i'm learning java , have question regarding reading file want read numbers file contains strings well. here example of file: 66.56 "3 java 3-43 5-42 2.1 1 and here coding: public class test { public static void main (string [] args){ if (0 < args.length) { file x = new file(args[0]); try{ scanner in = new scanner( new fileinputstream(x)); arraylist<double> test = new arraylist<>(); while(in.hasnext()){ if(in.hasnextdouble()){ double f=in.nextdouble(); test.add(f);} else {in.next();} } catch(ioexception e) { system.err.println("exception during reading: " + e); } } my problem add 66.56,2.1 , 1 doesn't add 3 after "3 or ignores 3-43 , 5-42 can tell me how skip strings , add doubles here? thanks all said 3 ie; "3, 3-43 , 4-42 strings either u read string , split , check number @ " , - or put in space between characters , integers. jvm after compilation tre...
i know commonly refactor code back-end improve it's speed, security or make more readable next person takes on project, refactor html , css? since markup languages doesn't seem trivial, besides wiping off few bytes of code vs time input looking alternatives doesn't seem worth effort, if working on tight deadline. there innumerable things can increase or decrease page performance. optimisation though, should start people seeing problems or slowdown. on broader level, reducing payloads smallest possible size makes big difference. involves gzip, caching, , minification. can rewrite code thousand times won't end smaller if @ if use gzip , minify css — don't minify html it's prone rendering issues. on finer level, specific css features such resizing large images , implementing lots of browser-generated gradients , shadows can bring performance down significantly. if you're noticing sluggishness when scrolling things need focus on. 1 image that...
i'm seeing memory leak in code below. i'm creating , processing data in separate modules, isn't causing leak can see. believe it's because calling new instance of drawing class each time change scale, although i'm not sure how correct issue. i've read this thread , when try , implement self.canvas.destroy() method on code receive error. wondering method applied code below solve issue? code snippet: from tkinter import * class interface_on: def interface_elements(self, master): self.master=master self.master.title( "my canvas") self.c=canvas(self.master, width=1000, height=1000, bg='black') self.c.grid(row=0, column=0) menubar = menu(master) filemenu = menu(menubar, tearoff=0) filemenu.add_command(label="new", command=self.edit_new) menubar.add_cascade(label="file", menu=filemenu) master.config(menu=menubar) drawing_utility_run=draw...
Comments
Post a Comment