Posts

java - How to use ArrayList while adding something to another Class's constructor ? -

i'm try create 1 simple reservation system, we'll read file, we'll add train, bus, etc., we'll writer output. import java.io.*; import java.util.*; public class company { private static arraylist<bus> bus = new arraylist<bus>(); static int buscount = 0, traincount = 0; public static void main (string[] args) throws ioexception { fileparser(); } public company() { } public static void fileparser() { try { file file = new file(); //i fill later file file2 = new file(); // fill later fileinputstream fis = new fileinputstream(file); fileoutputstream fos = new fileoutputstream(file2); bufferedreader br = new bufferedreader(new inputstreamreader(fis)); bufferedwriter bw = new bufferedwriter(new outputstreamwriter(fos)); string line; while ((line = br.readline()) != null) { string[] splitted = line.split(","); if(spli...

bash - ssh wait for script to finish -

i using following script start process on node. main node: for dir in n9 n18 n27 n40 node=compute-2-10 ssh $node "cd $dir ; nohup ./process.sh > watchdog-$dir &" done the thing when connect compute-2-10 see no jobs running. think problem process can not completed since bash doesn't wait finish. correct or need else? i have been using like ssh $node "nohup myprogram > prog.out 2> prog.err < /dev/null &" if redirect 3 i/o should not create issue.

ios - Data passed to prepareForSegue is nil -

i'm trying ingredientviewcontroller update array belongs controller called via segue ( fridgeviewcontroller ) in ingredientviewcontroller fridgemanager nil no matter try the code: fridgeviewcontroller: - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { // new view controller using [segue destinationviewcontroller]. // pass selected object new view controller. ingredientviewcontroller *controller = (ingredientviewcontroller *)segue.destinationviewcontroller; [controller setfridgemanager:fridgemanager]; } ingredientviewcontroller: @property (strong, nonatomic) fridgedatamanager *fridgemanager; and in viewdidload fridgemanager nil (and in other method of coarse) synthesize fridgemanager property in ingredientviewcontroller.m @synthesize fridgemanager;

Comparing Matlab and Apache statistics - kurtosis -

Image
hi comparing statistics between matlab , apache functions. here apache functions tested in java. same set of data, different results double array (double[] ) follow: --------------------------------------- matlab vs apache --------------------------------------- max = 0.5451 vs 0.5450980392156862 min = 0.4941 vs 0.49411764705882355 var = 5.4154e-05 vs 5.415357603461868e-5 std = 0.0074 vs 0.007358911334879547 mean = 0.5206 vs 0.5205525290240967 kurtosis = 3.3442 vs 0.35227427833465486 skewness = 0.2643 vs 0.26466432504210746 i checked , rechecked data, each value matlabs same used in java. here can see statistics identical, except kurtosis. is possible kurtosis computed differently matlab , apache library? if so, data should trust then? edit my data subset of image matrix (containing pixels values). each subset compute above statistics. everytime, statistics match except kurtosis. the matlab...

sql server - MySQL error code 1005 Can't create table (errno150) - (again) - in all the foreign keys -

background:- yesterday creating small database practice, , created 9 tables, , got error in create table statement of 1 of them. question located here . thankfully told alternative way creating table without foreign key , use alter table statement add foreign key constraint, , worked. today creating database, , getting error in tables contain foreign keys. have tried alternative way of creating table , adding foreign keys alter table statement. doesn't seem help. my research:- i know question has been been addressed before on website, have tried solutions on this , this page, except adding indexes because firstly, don't need them in such small database ( second point in first answer ), , secondly don't know them , want keep simple. none of answers helped. moreover, mentioned here , " if error message refers error 150, table creation failed because foreign key constraint not correctly formed. " please tell me what's wrong foreign key constr...

html - Hover over div breaks positioning jquery css -

jsfiddle: http://jsfiddle.net/y78a2/ i have element like <div id="hoverdiv"></div> <div style="margin:0 auto;"> <div class="hover" hovertext="this div 1">div 1</div> <div class="hover" hovertext="this div 2">div 2</div> <div class="hover" hovertext="this div 3">div 3</div> </div> css this #hoverdiv{ display:none; position:absolute; font-size:12px; background: rgba(0,0,0,.6); color: #ddd; border: 1px solid #999; padding:10px; z-index:10000; } jquery this $(document).on('mousemove','.hover',function(e){ var hovertext = $(this).attr('hovertext'); $('#hoverdiv').text(hovertext) .css('top',e.pagey-95) .css('left',e.pagex+10) .show(); }).on('mouseout','.hover',function(){ $('#hoverdiv...

javafx - JavaFX8 tree tabel view customize separate cells -

in tree-table-view there child items have in turn other child items. need customize, say, text of cells of pseudo-root items. is there way assign css class/style items? update: ok, got working following cellfactory: treetblcolumnname.setcellfactory(new callback<treetablecolumn<filemodel, string>, treetablecell<filemodel, string>>() { @override public treetablecell<filemodel, string> call(treetablecolumn<filemodel, string> param) { treetablecell<filemodel, string> cell = new treetablecell<filemodel, string>() { @override protected void updateitem(string t, boolean bln) { super.updateitem(t, bln); //to change body of generated methods, choose tools | templates. system.out.println(this.gettablecolumn().); label lbl = new label(t); lbl.setstyle("-fx-font-weight: bold; -...