Posts

Java add a list to class and modification -

i have problem list. adds list class. in class list more items added. when want display list of class not have items. add people mysqlcategorydao -> modify in mysqlcategorydao -> return people in class model. public class model { public list<category> people = new vector<category>(); public list<category> getpeople() { (category person : people) { system.out.println(person.getname()); //no data } return new arraylist<category>(people); } public void load() throws exception { daofactory factory = daofactory.getfactory(daofactory.mysql); new mysqlcategorydao(job.select,people).execute(); } } class in modifies list public class mysqlcategorydao extends swingworker<void, category> implements categorydao{ private job job; public list<category> list; public mysqlcategorydao(job job, list<category> list){ this.job = job; thi...

java - XSD with import in Gradle resource folder can't be read by SAX -

i have generated xsd validation files schemagen. there both one-file validation xsd , two-file validation xsd imports. there no problem include one-file validation xsd file in java application validation gradle resource folder. if try load two-file validation xsd import gradle resource folder shown below, crash following error: org.xml.sax.saxparseexception; linenumber: 12; columnnumber: 98; src-resolve: name "ns1:stringarray" kann nicht als "type definition"-komponente aufgelöst werden. means in english: name can't resolved type definition component if two-file validation xsd located in gradle source folder, works properly, there can't error in file except resolving of import location. my xsd file looks following: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <xs:schema version="1.0" targetnamespace="" xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:tns="...

c - Calling main menu is displaying sub menu -

i doing airplain seat booking system. here have main menu of chooseflight() , submenu of printmenu(). whenever press 'f' printmenu's options should return mainmenu. cannot. please me! int main() { chooseflight(); fflush(stdin); return 0; } void chooseflight(void) { char selectflight; printf("a) flight 102 b) flight 311 c) flight 444 d) flight 519 e)quitprogram\n"); scanf("%c",&selectflight); switch(selectflight) { case 'a': puts("welcome flight 102 service"); while(1){ printmenu102(); } break; case 'b': puts("welcome flight 311 service"); printmenu311(); break; case 'c': puts("welcome flight 444 service"); printmenu444(); break; case 'd': ...

java - Mainapp does not start -

i need debug main app , can't find error. app doesn't start personoverviewcontroller . need fix issue, in fmxl= messages in control javafx.fxml.loadexception: /users/stefanhegetschweiler/documents/weiterbildung/fh/programmierung/projekt/17.08.2014/vokabulartrainer/bin/ch/makery/address/view/personoverview.fxml @ javafx.fxml.fxmlloader.constructloadexception(fxmlloader.java:2617) @ javafx.fxml.fxmlloader.loadimpl(fxmlloader.java:2587) @ javafx.fxml.fxmlloader.loadimpl(fxmlloader.java:2441) @ javafx.fxml.fxmlloader.load(fxmlloader.java:2409) @ ch.makery.address.mainapp.showpersonoverview(mainapp.java:162) @ ch.makery.address.mainapp.start(mainapp.java:120) @ com.sun.javafx.application.launcherimpl$8.run(launcherimpl.java:837) @ com.sun.javafx.application.platformimpl$7.run(platformimpl.java:335) @ com.sun.javafx.application.platformimpl$6$1.run(platformimpl.java:301) @ com.sun.javafx.application.platformimpl$6$1.run(platformimpl.java:298) @ java.security.accesscontrolle...

performance - Fortran strange behavior when timing subroutines -

the strangest behavior happens when i'm timing code shown below. it's long it's doing matrix multiplication different ways of passing arguments. matmul0 use explicit shape, matmul1 use assumed shape, , matmul2 use assumed shape plus use pointers inside subroutine point matrices (don't ask me why this, doesn't matter). thing is, when time 3 subroutines, like: time explicit shape: 3.712099 time assumed shape: 12.55620 time assumed shape + pointer: 3.821299 now, if comment third subroutine (the 1 pointers), time like: time explicit shape: 3.712099 time assumed shape: 3.824401 time assumed shape + pointer: 0.00000 why happening? , why doesn't happen first subroutine too? i'm running on intel core i3, intel compiler, no optimization flags, ifort test.f90 -fpp (the fpp preprocessing timer macro). full code below. #define timer(func, store) call system_clock(start_t, rate); call func; call system_clock(end_t); store = store + real(end_t - start_...

c# - File.ReadLine adds line breaks to CSV -

Image
i have been converting exported document outlook csv used interpreted c# further manipulations. problem arises when using: string path = @"contacts.csv"; program self = new program(); // open file read from. var readline = file.readlines(path); foreach (string line in readline) { console.writeline(line); console.readkey(true); } to display following data: which not expected output, , after hitting key pass readkey rest of data displayed following: (blanked out contact numbers) when csv it's self not contain line breaks (used replace function using ctrl+j mimic line break , replace nothing). csv looks like: there no line breaks present, problem persists throughout document on iterations not others. why there new line breaks being added , being pushed iteration, why occouring? i've exhausted possibilities within skillset i've tried forcefully removing new line breaks string toprint = line.replac...

floating point - atof() returns 3 digit number into 2 digits -

i trying parse string sent arduino uno using serial communication float. want use these floats set rgb led's color. issue is, read first 2 digits. sorta. entered 100. come out 10.00. if it's 231, come out 23.00. weird thing is, if put 32.43, come out 32.4300. have no idea why this. here code: float led1color[3]; ... (int = 0; < 3; i++) { int index = content.indexof(","); content = content.substring(index + 1); //removes additional text in front of numbers led1color[i] = atof(content.substring(0, index).c_str()); serial.println(led1color[i], 4); } now lets sent following: "rgbled,43.61,52,231". first, rgbled removed. then, 3 values console shows me followed: 43.6100 52.0000 23.0000 obviously issue here need value 231, not 23.0000. i've never programmed in c/c++ before, there i'm missing? why 3 digit number being converted 2 digit number? your error value of index. finds first comma correctly int ind...