Posts

Java Iterators. How to inspect the Iterator? -

i want know if there way inspect iterator object. kind of map? also, there a better way take contents of iterator object , put them in mapc? here code: import java.util.hashmap; import java.util.treemap; import java.util.map; import java.util.iterator; public class maps { public static void main(string[] args) { map mapa = new hashmap(); map mapb = new treemap(); mapa.put("key1", "element 1"); mapa.put("key2", "element 2"); mapa.put("key3", "element 3"); // 3 put() calls maps string value string key. can // obtain value using key. use get() method this: string element1 = (string) mapa.get("key1"); // why need type cast on right? system.out.println(element1); // lets iterate through keys of map: iterator iterator = mapa.keyset().iterator(); system.out.println(iterator); // how inspect this? kind of map? map mapc = new hashmap(); while(iter...

java - Failing to run ZK Spreadsheet on App Engine Managed VM -

i wrote simple application based on example here . when try run standalone jetty 9.2.10.v20150310 (which same version used gae managed vm) works fine (loading , saving). when try run google cloud sdk maven plugin or when deploy app engine, spreadsheet content loads, css fails download exception on server: [info] severe: failed load media, /view/z_obs/lgaq1/f14/0/ss_lgaq1_t0_sheet_0.css [info] java.lang.nullpointerexception [info] @ org.zkoss.zss.ui.spreadsheet.getmergematrixhelper(spreadsheet.java:2755) [info] @ org.zkoss.zss.ui.spreadsheet.preparebasicstylesheet(spreadsheet.java:4144) [info] @ org.zkoss.zss.ui.spreadsheet.getsheetdefaultrules0(spreadsheet.java:4603) [info] @ org.zkoss.zss.ui.spreadsheet.getsheetdefaultrules(spreadsheet.java:4597) [info] @ org.zkoss.zss.ui.spreadsheet.access$6200(spreadsheet.java:219) [info] @ org.zkoss.zss.ui.spreadsheet$extractrl.getmedia(spreadsheet.java:3041) [info] @ org.zkoss.zk.au.http.audynamediar.service(audynamediar.java:128) ...

scheduled tasks - Implement repeat interval of more than a day for parse.com background job -

i have created background job this: parse.cloud.job("resetleaderboard", function(request, response) { parse.cloud.usemasterkey(); var query = new parse.query("leaderboard"); query.find( { success: function(results) { response.success("success!"); }, error: function(error) { response.error(error); } }) .then( function(results) { return parse.object.destroyall(results); }); }); i want run job every 15 days. there no option available @ www.parse.com set time interval more day. i think need use time stamp , compare value current time. can show me standard way this? you're right job scheduling ui constrained single day. way solve problem have job run daily, have n...

openmodelica - Modelica vector parameters from a file -

is possible read vector of parameters file? i'm trying create vector of objects, such shown here: enter link description here starting on page 49. however, pull specific resistance , capacitance values text file. (i'm using example how read in). so, example fills in data this: a.basic.resistor r[n + 1](r = vector([re/2; fill(re,n-1); re/2]) ); a.basic.capacitor c[n](each c = c*l/n); but, instead have text file contains like, first column index, second r values , third c values: #1 double test1(4,3) #first set of data (row col) 1.0 1.0 10.0 2.0 2.0 30.0 3.0 5.0 50.0 4.0 7.0 100.0 i know can read data in using combitable1d or combitable2d. but, there way convert each column of data vector can analogous to: readintablefromdisk a.basic.resistor r[n + 1](r = firstdatacolumnofdataondisk ); a.basic.capacitor c[n](each c = seconddatacolumnofdataondisk); i recommend externdata library if want load external data files modelica tool. modelica library ...

android - Pulling values from an CSV file in java -

i having trouble pulling values csv file android app working on. csv file takes following format: acton town (district),acton town (piccadilly),2.00 aldgate (circle),aldgate (metropolitan),4.00 aldgate east (district),aldgate east (hammersmith , city),2.00 i trying import java class using following method: public arraylist<connection> importconnections(){ try { //gets lines.txt file assets in = this.getassets().open("connections.csv"); scanner scan = new scanner(in); textview linedata = (textview)findviewbyid(r.id.displayline); string connection = null; string startingstation = null; string endingstation = null; float duration = 0; { connection = scan.nextline(); string delimiter = ",\n"; stringtokenizer tokens = new stringtokenizer(connection, delimiter); ...

operating system - Explanation of state replication of barrelfish -

can tell how barrelfish os implementing state replication of kernel on each each core or closely-coupled "shared" on cores in case e have multi or many cores chip. trying understand point, tried check source code, no more documentation explain process of spawning kernel on whole cores. and if can offer me way understand source code of part great try trace source code, looks swim lone in ocean. thanks lot. abdo~ one example state replication in barrelfish capability system [1, section 5]. every core (in fact, every dispatcher) has own storage capabilities. many operations can done locally, without synchronizing other cores. if synchronization needed, capability system helps find replicas, since copy operations other cores explicit , can tracked. the barrelfish source code not place further this, since our capability system quite complex. if have further questions, please refer our mailing list [2] suggested deepthought [1] http://www.barrelfish.org/tn-01...

html - Fatal Error with PhP on submit -

i'm making form can add records database through browser. when press submit, comes error fatal error: call member function execute() on boolean in /srv/http/career.php on line 56 line 56 based of php line: $result->execute($_post); it's not related connection of database, works because able view made records. full code html <form method="post"> <label for="jobtitle">job title</label> <input type="text" name="jobtitle" /> <br> <label for="reference">reference</label> <input type="text" name="reference" /> <br> <label for="salary">salary</label> <input type="text" name="salary"/> <br> <label for="location">location</label> <input type="text" name="location"/> <br> <br> <label for="description...