Posts

Featured post

How to set a border for android Imageview in Longpress? -

in android application want set border imageview when long pressed. want remove same(border) when user releases view. please anyone, me in this? @override public boolean ontouchevent(motionevent event) { switch (event.getaction()) { case motionevent.action_down: { mtouchdownx = (int) event.getx(); mtouchdowny = (int) event.gety(); break; } case motionevent.action_move: { int x = (int) event.getx(); int y = (int) event.gety(); if (mdraggeditem >= 0) { setdraggeditemposition(x, y); int index = getindexfromcoordinates(x, y); if (index == mdraggeditem || index < 0) break; if (index < mdraggeditem) { (int = index; < mdraggeditem; i++) { moveviewtoposition(i, i+1); } (int = mdraggeditem-1; >= index; i--) { ...

java - Cast from Object to List<String>: CastClassException -

i'm using touchdb ektorp in android app access couchdb the json document i'm accessing has array of categories: categories: ['cat1', 'cat2'] in view query i'm trying access array classcastexception when trying convert result object list: public void map(map<string, object> document, tdviewmapemitblock emitter) { object dateadded = document.get("dateadded"); object expirydate = document.get("expirydate"); boolean expired = false; if(expirydate!=null){ expired = comparedate.isitemexpired(expirydate); } list<string> test = (list<string>)document.get("categories"); the .get() method works fine single json fields. ideas? document declared map<string, object> so when .get() - return object. there's no direct mapping (list<string>) exception saying need cast object rather list. you ch...

c++ - Linux and Windows millisecond time -

i want milliseconds time of system (i don't care if it's real time, want accurate possible). method it? #ifdef win32 unsigned long long freq; unsigned long long get_ms_time() { large_integer t; queryperformancecounter(&t); return t.quadpart / freq; } #else unsigned long long get_ms_time() { struct timespec t; clock_gettime(clock_monotonic, &t); return t.tv_sec * 1000 + t.tv_nsec / 1000000; } #endif how can wrap value signed int? tried doing , negative values (on linux, don't know on windows): ~ start -2083002438 ~ 15 seconds after.. -2082987440 ~ 15 seconds after.. -2082972441 i this. ~ start x ~ 15 seconds after.. x + 14998 ~ 15 seconds after.. x + 29997 where x positive number. (i want output positive , increasing) i in code... timespec specstart, specstop; // start time ( unix timestamp ) in seconds... clock_gettime( clock_monotonic_raw, &starttime ); int starttimeint = starttime.tv_se...

what is actual difference between NSString and NSMutable String in objective C with the help of example? -

this question has answer here: what purpose of having both nsmutablestring , nsstring? 4 answers what difference between nsstring , nsmutablestring? [duplicate] 4 answers what actual difference between nsstring , nsmutable string in objective c? have searched lot not getting answer..i understand nsstring immutable object , nsmutablestring mutable object want understand difference between them of example..please me.. now question has solved.. immutable string..... nsstring *str1 = @"hello testing"; nsstring *str2 = str1; replace second string str2 = @"hello hehehe"; and list current values nslog(@"str1 = %@, str2 = %@", str1, str2); //logs below //str1 = hello testing, str2 = hello hehehe mutable strings setup 2 var...

android - Proguard: Blank screen after exiting webview or browser -

i enabled proguard using following info tried both popular answers enabling proguard in eclipse android . when hit button webviewactivity or browser (started intent in application), app shows blank screen, if disable proguard behaviour normal. note: happens when hit button, webview or content shown properly. if project uses webview js, uncomment following , specify qualified class name javascript interface class: -keepclassmembers class fqcn.of.javascript.interface.for.webview { public *; } from auto generated proguard-project.txt file.

ios - Change camera and device orientation -

i have application view , when user click button, camera visualization starts. i want allow orientations when camera isn't showed, when camera showed, need force application portrait mode because if isn't on portrait, video rotated. when camera closed, app may rotate again. do know if can solve problem video orientation? or how can force app portrait mode? know on earlier ios version, can use [uidevice setorientation:] , it's deprecated lastest ios. how can ios 5 , ios 6? i've tried with: [self presentviewcontroller:[uiviewcontroller new] animated:no completion:^{ [self dismissviewcontrolleranimated:no completion:nil]; }]; and in shouldautorotatetointerfaceorientation method: if (state == camera) { return (interfaceorientation == uiinterfaceorientationportrait); }else{ return yes; } it works ok , force app portrait. when camera closed, doesn't work properly, doesn't rotate well. i mean, when camera closed happens: ...

jquery - Perform action in series -

i trying perform action in series here in code alert message printed firat though have written after action. this fiddle have tried . http://jsfiddle.net/wggua/635/ $(document).ready(function() { var a=1; settimeout(function() { $('#dvdata').fadeout(); }, 2000); if(a==1) { alert("value s 1"); } else { alert("value 0"); } }); please help, your code says: "run fade out function in 2 seconds. alert something." if want alert appear after fade out function runs, need put code inside function runs in 2 seconds too.