Posts

android - Can't open database on 2nd user account, error EACCES (Permission denied) -

i have problems app of mine , galaxy nexus 10 multi user support. app has copy database, works fine when logged in first user of tablet, fails java.io.filenotfoundexception: /data/data/packagename/dbname.db: open failed: eacces (permission denied) when logged in second account. second account seems have no rights write /data/data... so, can done it? read of topics concerning problem, still no answer satisfies me. there folder can used share data between users?! the second account seems have no rights write /data/data... correct. so, can done it? i guessing hard-coded path. if so, not this. use getdatabasepath() find proper path database for current user . is there folder can used share data between users?! not aware of. external storage separate between users. in effect, separate user accounts on device if users on separate devices.

java - ThreadLocal and Memory usage -

threadlocal created have separate copy of objects operate on in threadsafe manner. this means number of objects in process increase number of threads. because, each thread create own copy of threadlocals. does not increase memory requirement of process ? you seem imply threadlocal s specific culprit increases memory usage, in fact question not particularly related threadlocal s per se . in situation describe, merely object have been allocated @ point , go unreacheable when thread dies @ latest.

angularjs - Initializing @attr in Angular directive -

i have directive this: can see equivalent plunker here http://plnkr.co/edit/0e2nmyatamd3m3qtctls app.directive('bptest', function() { return { restrict: 'a', templateurl: 'directivetemplate.html', scope: { bptype: '@' }, link: function($scope, $elem, $attrs) { console.log($scope, $elem, $attrs); $scope.bptype = $scope.bptype || 'text'; } // link function }; }); in directivetemplate.html: <div> {{ bptype }} </div> in index.html: <div bp-test bp-type="text"></div> <!-- results in <div>text</div> --> <div bp-test bp-type="number"></div> <!-- results in <div>number</div> --> <div bp-test></div> <!-- results in <div></div> ????? --> since initialize $scope.bptype = $scope.bptype || 'text' , expect third directive <div bp-test></div> display ...

linux - MySQL 'user'@'%' is not including 'user'@'localhost' -

i've seen other questions little different. i've created mysql user '%' , granted permissions. on mac , windows: i'm able login using this. mysql -u user -p<password> on linux fails invalid password 'user'@'localhost'. any idea why? hoping 'user'@'%' hosts including localhost behaving in mac , windows different on linux. i asked question myself while back. using % host when creating mysql user localhost special mysql, it's connection on named pipes or unix socket. using % host not include localhost.

sql - "database locked" error in ios while updating query -

i using below code to update query using sqlite . getting "database locked error" . tried searching link , suggested close database, did again getting same error. have mentioned getting error in code. const char *dbpath = [databasepath utf8string]; if (sqlite3_open(dbpath, &database) == sqlite_ok) { nsstring *locationno =null; nsstring *querysql = [nsstring stringwithformat:@"select count(*) code"]; const char *query_stmt = [querysql utf8string]; if (sqlite3_prepare_v2(database,query_stmt, -1, &statement, null) == sqlite_ok) { if (sqlite3_step(statement) == sqlite_row) { locationno = [[nsstring alloc] initwithutf8string:(const char *) sqlite3_column_text(statement, 0)]; int count= [locationno intvalue]; sqlite3_close(database); nslog(@"%@",locationno); if(0==count) { nsstring *insertsql = [nsstring stringwithformat:@...

hadoop - Pig Cross product reducer key -

when perform crossproduct operation (followed filtering) reducer sizes imbalanced, reducers writing 0 output , others taking several hours complete. basic example following code: crossproduct = cross tweets, clients; result = filter crossproduct text matches concat('.*', concat(keyword, '.*')); store result 'result' using pigstorage(' '); in case reducer key? this difficult question answer. cross implemented in pig join on synthetic keys. best resource understand cross programming pig - page 68 in example, cross like a = foreach tweets generate flatten(gfcross(0,2)), flatten(*); b = foreach clients generate flatten(gfcross(1,2)), flatten(*); c = cogroup ($0, $1), b ($0, $1); crossproduct = foreach c generate flatten(a), flatten(b); as explained in book, gfcross internal udf. first argument input number, , second argument total number of inputs. in example, udf generates records have schema of (int, int). field same first argument...

python - How to control test case run through an excel sheet? -

my question design problem. using python + selenium automation. pyunit unit framework used. have sheet in excel have 2 columns- testcaseid , run. testcaseid have testcase id in , run have either y or n signifying whether test case should runnable or not. trying read particular test case id sheet , see have it's run value, y or n. if y, test case executed unit framework else not run. here excerpt of test case have written: `class test_id_94017(unittest.testcase): ex = excel() def setup(self): self.ex.setupasheetinexcel('select_test_cases_to_run') if self.ex.gettestcaserunstatusfromexcel("94017") == "y": self.driver = browser().createbrowserdriver() self.driver.maximize_window() self.driver.implicitly_wait(15) self.ex.setupasheetinexcel('login') else: return def test_ccpd_regression001_per_custom_check(self): //do the definition gettestcaserunstatusfromexcel(testcaseid) method is...