Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Dave Robbins

Ranch Hand
+ Follow
since Sep 16, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dave Robbins

Thanks David

I thought my terminology might not be quite right
I understand, Tomcat and the compiler are both apps running in the JVM

Dave
10 years ago
the ray tracer is multithreaded so it's hammering the cpu despite it being multi core
I can imagine it might wait till it finishes a frame to update
I'll play around with your suggestion on the type of stream, it's ok like it is but "better" is always good

Dave
Hey Folks,

I'm playing around with an app to schedule jobs for a ray tracer to run
so far I can create a list of jobs to be done and hit the go button and all is well for 1 machine
next I'd like to be able to schedule jobs on another machine, a render farm
so say I have 2 machines, the master and the slave
I want to render 500 frames of an animation
I want to tell the master to do 1-250, the slave 251-500
the slave machine has a version of my code running on it which I'm thinking will have a socket listening for instructions from the master, it may not have a GUI
I'd like to be able to control the slave from the master, specifically I'd like to be able to pop up a dialog on the master that lets me set the path of the raytracer executable and the location of the file to raytrace (this is using blender, blender.org) for the instance running on the slave
is their a way to do this?
connect apps running on 2 machines and have the master display a file select dialog from the slave?
my fallback is you simply have to know these paths and type them in, but a file select dialog would really be slick

TIA
Dave
11 years ago
not sure why you would want to use threads for this
if you want to run the code at a certain time use the windows scheduler

http://www.iopus.com/guides/winscheduler.htm

use google to find more details

Dave
Here's my class that extends SwingWorker



if I give it a task of rendering 25 frames out of an animation it will post the output of the ray tracer back to the GUI after each frame
if I run the same command on the command line it prints out about 20 lines of info for each frame and does it as the frame is being rendered
I'm thinking maybe this is as good as it gets, it is doing 25 updates of the GUI during the time this thread runs

the thing called "job" that I pass to the constructor of my class is an object that knows all about the command to be sent to the ray tracer

Dave
I think I'm starting to get it
the process() function runs in the Event Dispatch Thread so it can write to the textArea

Dave
Hi Folks,

I'm writing an app that schedules a list of jobs to be sent to a ray tracer
each job may take an hour or more
so, I have a list of jobs, I want to do them one at a time, not all together
the ray tracer gives info on what it's doing that I'd like to post to the GUI
so I loop through each job and create an instance of my class that extends SwingWorker
I'm using this code as an example

http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html#setProgress(int)

the second example, I'll post the code here for discussion



so far I can get it to post the messages from the ray tracer when it finishes the job but not as it goes along
so I'm here asking for an explanation of the example code and if I understand it correctly
first off, they pass textArea to task in it's constructor and task calls a function on it
I thought having the worker thread do this was a no no
second, what is the purpose of calling



it looks like that fires a PropertyChangeEvent causing the GUI thread to modify the progress bar
third, is the purpose of calling setProgress() to set the value that gets sent to the GUI in the PropertyChangeEvent?
and last, what's up with the overridden function process()?
isn't it writing to the GUI?
didn't we just do that with the publish() function?
sorry, I'm a bit confused here, are they showing me 2 different ways to do things?

Clarification Appreciated
Dave
I will ponder your revised code when it isn't dark:thirty and I don't have a beer in my hand
thanks for the tip, you got me over the hump

Dave
beautiful
one tweak

change this line



to this



in case somebody else comes along and uses your tip
works great!!
Thanks

Dave
thanks
I thought the answer was something to that affect
I'll let you know how it works out

Dave
Hello All

I have a servlet that needs to generate graphs of weather data
I'm using a HttpURLConnection to fetch what I need to generate the graph
I want to get the high temps for a particular zipcode for a whole year which means I get a file about 30K in size (it has other weather data included)
I do a little loop



to wait till all the data come back and then read it and start processing it
but I consistently get about 8080 bytes of data, a quarter of what I expect
I think the code is being broken into packets and I'm just getting the first one, does that make sense?
if so how can I get around this?
the guts of the code follow



TIA
Dave
the file I'm trying to open is normal_earth_2400.jpg
in the picture you can see I have it in the directory with my various panels
the code I use to open it is



that works properly both in the IDE and running the jar file from the command line
what I'd like to do is have that jpg in the images directory, I don't want graphics file mixed with my source code, I've been down that road, trust me, "madness lurks there" :roll:

interestingly, I just made an images directory under the resources dir which is under panels
I place the jpg there and I can open it with



I can live with that but I don't understand why the first way didn't work
it doesn't seem to want to let me use .. to go up a directory
Ideas welcome but I can live with what I have

Dave
12 years ago
here's a pic of the directory structure

http://www.drobbins.net/pics/toys.jpg

Dave
12 years ago
hmm, that's annoying
if I change my code to this



and dump the jpg into the directory with my panels it works both in the IDE and from the command line
apparently some sort of path issue
unfortunately, I want my images in their own folder

Dave
12 years ago
nope
changing to backslashes it still works in the IDE but not from the command line
continuing to investigate, ideas welcome

Dave
12 years ago