Posts

android - unable to call onclick event only at first page in phonegap -

i'm using cordova phonegap make android app. in first page i'm trying use input elements button: $(document).ready(init()); and: document.addeventlistener("deviceready", ondeviceready, false); input element: <input type="button" id="task_btn" value="button" /> click event: $("#download_btn").click(function() { console.log("index.html >> task button clicked"); } but doesn't work; however, in second page works well. element ids defined correctlly. how solve problem? full code on html page : <!doctype html> <html> <head> <title>home page</title> <meta charset="utf-8"> <link rel="stylesheet" href="js/jquery.mobile-1.3.1.min.css"> <script src="js/jquery-1.9.1.min.js"></script> <script src="js/jquery.mobile-1.3.1.min.js"...

Puppet master policy-based autosign script STDOUT/STDERR not copied to master's log output -

according puppet master documentation here , both stderr , stdout emitted executable referred autosign=[path executable] setting copied puppet master's main log output. however, cannot find output anywere. the relevant bit of puppet.conf: [main] logdir = /var/log/puppet log_level = debug [master] autosign=/usr/lib/ruby/site_ruby/1.8/autosign.rb the source of /usr/lib/ruby/site_ruby/1.8/autosign.rb: #!/usr/bin/env ruby require 'etc' env['home'] = etc.getpwuid(process.uid).dir stderr.puts "inside autosign.rb" stderr.puts "=====================================" stderr.puts "=== env['home'} =====================" stderr.puts "#{env['home']}" stderr.puts "=== stdin ===========================" argf.each |line| stderr.puts line if line =~ /login/ end stderr.puts "=== argv[] ==========================" argv.each |b| stderr.puts b end #require 'puppet' #require ...

subset - R: Subsetting column 1 based on vector of values potentially present in column 2 -

i have dataframe kegglist , pertinent section of show below: > kegglist[131:145,] v1 v2 131 a0avt1 hsa04120 132 a0pjz3 hsa00514 133 a1a4s6 hsa05100 134 a1a4y4 hsa05145 135 a1l167 hsa04120 136 a2rtx5 hsa00970 137 a3kft3 hsa04740 138 a4d0s4 hsa05146 139 a4d0s4 hsa04512 140 a4d0s4 hsa04510 141 a4d0s4 hsa05200 142 a4d0s4 hsa05222 143 a4d0s4 hsa05145 144 a4d2g3 hsa04740 145 a5d8v6 hsa04144 i have vector listx contains some, not all, of ids in v1 of kegglist : > listx [1] a1l167 a2rtx5 a3kft3 a4d0s4 what want subset kegglist$v2 based on ids in kegglist$v1 present in listx . so, in example, result should this: > result [1] hsa04120 hsa00970 hsa04740 hsa05146 hsa04512 hsa04510 hsa05200 hsa05222 hsa05145 please note in real data, not ids in listx found consecutively in kegglist$v1 . thank help. i tried result <- kegglist$v1[kegglist$v2 %in% listx] to no avail. try: kegglist$v2[kegglist$v1 %in% listx] or: kegglist$v2[which(...

matlab - How to convert nifti file to AFNI file? -

i want know how convert nifti file afni file (.head/brik). you can use 3dcopy : 3dcopy myfile.nii myfile will create myfile+tlrc.head , myfile+tlrc.brik (afni can handle nifti files file, though, without them needing in head/brik format).

java - Modifying value in Hashtable -

hello come problem modifying value in hashtable when 2 keys equal. i define hashtable, hashtable<string, integer> hash = new hashtable<string, integer>(); and program fills data .put() method. note: first column represents hex values 08 86 aa 10 ff 330 2a 54 e1 60 i can check string duplicates if(hash.containskey(string x)){} . if want insert data in hashtable, same string hash.put("aa", 77); dont know how add value in hashtable new value , have hashtable no duplikate strings. means have final hastable looking likewise 08 86 aa 87 ff 330 2a 54 e1 60 any suggestions? string yourkey = "aa"; int val = 77; if (hashtable.containskey(yourkey)) val += hashtable.get(yourkey)); hashtable.put(yourkey, val); this checks duplicates , if there is, add original value table

java - Properly handling empty Observable in RxJava -

i have situation creating observable containing results database. applying series of filters them. have subscriber logging results. may case no elements make way though filters. business logic states not error. however, when happens onerror called , contains following exception: java.util.nosuchelementexception: sequence contains no elements is accepted practice detect type of exception , ignore it? or there better way handle this? the version 1.0.0. here simple test case exposes i'm seeing. appears related having events filtered before reaching map , reduce. @test public void test() { integer values[] = new integer[]{1, 2, 3, 4, 5}; observable.from(values).filter(new func1<integer, boolean>() { @override public boolean call(integer integer) { if (integer < 0) return true; else return false; } }).map(new func1<integer, string>() { @overr...

mysql - the path for the folder in my server (PHP) -

i have problem in php code. have form let user upload files server, did not know how write correct path folder in server![enter image description here][1] want files store in, how path specific file download later. the path in server : /public_html/upload_files but keeps tell me : warning: move_uploaded_file(upload_files/project_guidelines.pdf): failed open stream: no such file or directory in d:\sites\dwts.com\public_html\website\creat.php on line 50 warning: move_uploaded_file(): unable move 'c:\windows\temp\php14ac.tmp' 'upload_files/project_guidelines.pdf' in d:\sites\dwts.com\public_html\website\creat.php on line 50 error uploading file code: $len = count($_files['attachment']['name']); for($i = 0; $i < $len; $i++) { $uploaddir = 'upload_files/'; $filename = $_files['attachment']['name'][$i]; $tmpname = $_files['attachment']['tmp_name'][$i]; $filesize = $_files['attach...