Tim Manchester

Ranch Hand
+ Follow
since Nov 03, 2004
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 Tim Manchester

Yes but it's difficult to get the data so I was hoping it would be a jsp issue. It looks more like a data issue now. Thanks.

Regards,

Tim
14 years ago
JSP
Follow up question:

Is it a bug to say


should you say


?

Regards,

Tim
14 years ago
JSP
OK, thanks!

Regards,

Tim
14 years ago
JSP
Howdy,

I'm looking at a jsp that isn't working as I thought it should and I see several cases where a comparison is done that the '!' operator is used as opposed to 'not'. I haven't read that you can use '!' alone so I was wondering if that was a problem with the following lines...


I do know you can use '!=' which I imagine could lead to the confusion with '!'. Am I correct about this?

Regards,

Tim
14 years ago
JSP
Thanks for the explanation & link. I've got it now.

Best Regards,

Tim
14 years ago
Howdy,

I was perusing some code and I saw a for loop written in a way that I've never seen before. I was wondering if someone could explain this to me:

for (TransferLimit transferLimit : transferLimits)

This is not the typical for syntax that I'm used to. What is this?

Regards,

Tim
14 years ago
Rat's I've reread my post and I see a cut-and-paste error. Please pull the sleep() call out of the enclosing "if (iNdx >1)" and delete the if. It doesn't belong there. Sorry.

Regards,

Tim
15 years ago
Ah very good. I'll check out that link too. OK, let me back at this...

Regards,

Tim Manchester
15 years ago
Howdy,

For fun I wrote an app that launches a daemon process that just sits and listens to stdin and echoes what it gets out to stdout. The main app has the Process object after it calles Runtime.exec() to launch the new process. The Process object allows me to get it's stdin and stdout through calls to Process.getInputStream() and Process.getOutputStream(), hooray.

Now the problem is my app has an InputStream which is the daemon process' stdin, but how do I use it to send a message to the daemon? There is no InputStream.write() method. By the same token, how do I use the daemon process' OutputStream to get the messages it's sending back? Any suggestions?

I do know that I could use a database or some message queue system here but I'm trying to do this just with streams.

Regards,

Tim Manchester
[ September 12, 2006: Message edited by: Tim Manchester ]
15 years ago
Cool, that's the ticket. Gonna play with that right now.

Thanks,

Tim Manchester
15 years ago
Well there's more than one way to skin a cat (as I often think just after my cat pees on something), but here's what I'd do:

I'd create the main class where most of the application runs (let's call it MainClass just to be creative) and another class derived from the thread class to listen to the parallel port and report back to MainClass when it hears something. We'll call it ParallelListener just because I'm funny that way.

ParallelListener would look something like this:


The way you'd create a ParallelListener in your MainClass is straightforward:


Note that in the ParallelListener class, after getting some signal from the parallel port and decoding it's meaning, I'd call methods on the MainClass to take whatever action necessary to handle it (but that's just me).

Also, note that you shut down the ParallelListener thread by calling it's stopRunning() method like this:


*** Added the following to post ***
Note that programming robots can be tricky buisness, especially if you have to worry about real-time concern like collisions, time sensitive processes, etc (I used to program industrial robots awhile back). Polling for I/O needs to be done in it's own thread and that thread needs to share CPU time with everybody else or "Bad Things(tm)" will happen. Play with the timeing of the sleep command to get a balance between sharing the cpu and responsiveness to commands from the parallel port.

Java, while my favorite language is not the most effective choice for this sort of thing. May I ask why you chose it for programming a robot?
*** End of additional posting ***

I hope that helps.

Regards,

Tim Manchester

[ September 11, 2006: Message edited by: Tim Manchester ]
[ September 12, 2006: Message edited by: Tim Manchester ]
15 years ago
As a purely fun exercise, I want to write an app that launches a couple of daemon processes. I want the "controller" app to be able to send messages to the daemons and for them to pick them up and respond. Further I want this just in java, no http (so all processes will be on the same box running under the same JVM), no database.

I'd like to use stdin and stdout for communication but I'm not sure how to "link" the daemons and the connector so the there is two-way commuication using stdin and stdout. I have all of the other bits down (threading, etc) but this one piece puzzles me. Would someone have a good suggestion or two?

This is just for fun so we don't have to get completely collegiate in our responses (if I were going for a practical solution, I'd try to work out a different solution).

Regards,

Tim Manchester
15 years ago
Well I found the answer and thought I might as well post it here for folks. It seems that the window.opener variable remains contstant throughout the chain of execution, so in the window "grandkid" you can still call upon window.opener.testPopup(); and it calls all the way back into the "parent" window. Cool.

Regards,

Tim Manchester
Howdy,

I have a problem that's got me stumped. First off I'm using I.E. 6 and expect all users to be using the same browser. I start on one page (let's call it the "parent" page). This page has globally defined a method so that it can be called from another page.

I do this in the following way inside <SCRIPT> tags:


In additon, the "parent" page opens a child browser window (let's call it "kiddie") by clicking an html:button opens a child window. Now this child window can call the testPopup method in it's parent pretty easily:


But the problem I have here is that the child browser may navigate to one more page (let's call this page "grandkid"). Here on "grandkid" (the new page) I still need to call the testPopup method on the "parent" page. What I don't have on "grandkid" is a reference to "parent". How do I get one?

Regards,

Tim Manchester
I tried everything I could think of to alleviate this problem. Finally in frustration, I blew away my server (deleted the server and server configuration) and built a new one. Then it worked. I still don't know what went wrong, but that was the fix.
15 years ago