Posts

java - I am trying to build a sample App from a Third Party SDK. I am getting a class not found exception and I am not able to figure out why? -

below logcat : 06-26 21:31:41.352: d/androidruntime(9911): shutting down vm 06-26 21:31:41.352: w/dalvikvm(9911): threadid=1: thread exiting uncaught exception (group=0x4114b930) 06-26 21:31:41.372: e/androidruntime(9911): fatal exception: main 06-26 21:31:41.372: e/androidruntime(9911): java.lang.runtimeexception: unable instantiate application com.counterpath.sdkdemo.audiocall.phoneapp: java.lang.classnotfoundexception: didn't find class "com.counterpath.sdkdemo.audiocall.phoneapp" on path: /data/app/com.counterpath.sdkdemo.audiocall-1.apk 06-26 21:31:41.372: e/androidruntime(9911): @ android.app.loadedapk.makeapplication(loadedapk.java:504) 06-26 21:31:41.372: e/androidruntime(9911): @ android.app.activitythread.handlebindapplication(activitythread.java:4364) 06-26 21:31:41.372: e/androidruntime(9911): @ android.app.activitythread.access$1300(activitythread.java:141) 06-26 21:31:41.372: e/androidruntime(9911): @ android.app.activitythread$h.handle...

javascript - using setTimeout to execute function excatly at specified time -

here code below.. settimeout(executequery, 5000); iam aware executequery run after 5 second... want run @ e.gethours()+':'+e.getminutes() console.log(e.gethours()+':'+e.getminutes()); display 1:30 ,iam trying run a function today @ 1:30 anyways fix this??? set date , time when want run function using new date(year, month, day, hours, minutes, seconds, milliseconds); . current new date() , , substract difference in milliseconds count, assign settimeout function. see following snippet:- window.onload=function(){ var date1=new date(); var date2=new date(2014,05,27,11,45,00); var diff=date2.gettime()-date1.gettime(); settimeout(executequery, diff); } function executequery(){ alert("hello"); } fiddle

Why I cannot prompt for a variable that will be shared by multiple plays (ansible 1.6.5) -

i have distilled playbook has 3 plays. goal collect database password prompt in 1 play , use same password in other 2 plays. --- - name: database password hosts: - webservers - dbservers vars_prompt: - name: "db_password" prompt: "enter database password databse user root" default: "root" - hosts: dbservers tasks: - command: echo {{db_password | mandatory }} - hosts: webservers tasks: - command: echo {{db_password | mandatory }} it fails shown below. enter database password databse user root [root]: play [database password] ****************************************************** gathering facts *************************************************************** ok: [vc-dev-1] play [dbservers] ************************************************************** gathering facts *************************************************************** ok: [vc-dev-1] task: [command echo {{db_password | mandatory}}] **...

perl - Net::OpenSSH::Gateway->find_gateway fails when ControlPersist option is set -

Image
i trying create persistent gateway connection using net::openssh::gateway. below code snippet using same. my %proxy_opts = ( host => $host, port=>$port, password=>$password, user=>$user , scheme=>"ssh", ssh_cmd => '/usr/bin/ssh', master_opts => [ -o=>"stricthostkeychecking=no", -o=>"tcpkeepalive=no", -o=>"serveraliveinterval=30", -o=>"serveralivecountmax=90", -o=>"controlpath=/tmp/ssh-master-%h_%p_%r", -o=>"controlpersist=yes" ] ); %gateway_settings = ( proxies=>[ {%proxy_opts} ]); $gateway = net::openssh::gateway->find_gateway(%gateway_settings, errors=>$errors); i error below. if remove option controlpath , controlpersist entire thing works fine. [error ] unable establish master ssh connection: bad ssh master @ /root/.libne...

Python enum implementation -

this question has answer here: how can represent 'enum' in python? 43 answers i have declared enum follows in python.i don't know how use them.when create instance of class gives error 2 arguments required 1 given. class cbarreference(enum): thisbar = 0, nextbar = 1, undefined=2 a=cbarreference() i know error don't know give second argument other self. you should never have create instance of enum; they're accessed directly class, , can assign them variables like: a = cbarreference.thisbar b = cbarreference.nextbar c = cbarreference.undefined d = cbarreference.thisbar assert(a == d) assert(b != a) assert(b != c)

python - Why do I only get the last value of a for loop in view in django? -

lets say: y = [go, cat, jump, see] if did: view: x in y: x template: {{x}} i x=see , no other result, 1. why that? 2. how can make work? know doing in template works need values each item in array or dicitonary (unless, done in template too). thoughts? edit. have this: session = {4,5,6,7,} saved in session, comes form full of check box choices, primary keys. views: form = inlinefactory_formset(model1, model 2,extra = len(sesssion) formset = form(instance=none ) in views have {% x in session%} {{x}} {{formset}} {%endfor%} so prints number , form number. want, x pk mentioned above, want use pk name x instance , print form people know form editing. inside loop x updated. after has run value of x last value in list. what want loop through in template: {% x in y %} {{ x }} {% endfor %}

multithreading - Process is a thread or thread is a process? -

i asked interview question. replied thread process after thinking process superset of thread interviewer didn't agree it. confusing , i'm not able find clear answer this. a process executing instance of application. a thread path of execution within process. also, a process can contain multiple threads . 1. it’s important note thread can process can do. since process can consist of multiple threads, thread considered ‘lightweight’ process. thus, essential difference between thread , process work each 1 used accomplish. threads used small tasks, whereas processes used more ‘heavyweight’ tasks – execution of applications. 2. another difference between thread , process threads within same process share same address space, whereas different processes not. allows threads read , write same data structures , variables, , facilitates communication between threads. communication between processes – known ipc, or inter-process commun...