C. Nimo

Ranch Hand
+ Follow
since Mar 23, 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 C. Nimo

hi.

when you're using JMS, you have to make sure that all your clients have a JMS client installed as well, so they communicate with your JMS server. I don't find it that difficult, but sometimes you just can't have that on remote machines.
still, using JMS, i think your implementation will be a lot easier. I mean - your clients query the server for information. so, let's say you have a method called queryMyServer() on each of the clients.
using JMS, your EJBs just don't care about the clients - what you do is use a topic, that all clients listen to. then, when you update your data, just put a message on this topic, telling all clients you got some new info for them.
the clients will have a listener on this topic, and in its onMessage() method - just call queryMyServer() and you're good as gold, since the clients will query the server when they can, and you still have the control (inside your server) of load and distribution of data. additionally, a client may decide it doesn't need your data, so that's good as well - less hussle and expensive RMI on your side.
you might also want to just send the changed data on your JMS message straight away to the client, and let the JMS provider worry about it gettting safely to the destination.
hi.

a QueueRequestor is a wrapper class provided by the JMS provider. using a QueueRequestor, you simplify the following scenario:

send a message on a queue,
wait for a reply-message to arrive (that is only for you)
process that reply.

suppose, for example, that your application talks to a remote
book store. you ask that remote book store for a quote on a certain book.
Now - where would this book store put your reply for you? i mean - if you
listen to a topic - this is not secured. if you listen to a queue, you risk
missing the reply message, since others may listen to this queue as well.

what you would do is something like that:

1. create a QueueSender on the store's incoming-messages-queue
2. create a temporary queue, for the store's reply
3. create a request message asking for a quote, stating the temporary
queue in your JMSReplyTo field of the message.
4. create a QueueReceiver on the TemporaryQueue from step 2.
5. send the message using your QueueSender.send() method.
6. waiting for the reply using your QueueReceiver.receive() method.
7. process the message that the store sent you.

now, using a QueueRequestor:

1. create a QueueRequestor on the store's incoming-message-queue
2. create a request message asking for a quote.
3. use your QueueRequestor.request() method to receive the reply.
4. process the message that the store sent you.

see what i mean?
unhook-hook means - unhook this post here and re-post there, but never mind any more.. i see you gave a good answer yourself
16 years ago
yeah.. but what is it that you need to do?
basically, you probably need to access one or more instances of
Unit class in side Conversion.
You keep all those instances in an array called units[].
so - units[0] is the first Unit instance in the array, units[1] is
the second, and so on.
So, if you have a method named getWhatever() in your Unit class, and you
need to call it, you need to do something like this:



?
16 years ago
Not good.
This was supposed to go as a reply to

"Enhanced for loop array assignment? "

mmm... can anyone unhook-hook for me?
please?
16 years ago
I can think of several reasons why this wouldn't work... What did you experience?
16 years ago
I think you should look at aging algorithms. In short - what you do is you give each job a grade, made up from the time it needs, and the cycles it was 'skipped' (i.e. - other jobs where scheduled, while it was in the system).
using this grade, you order your waiting-jobs-queue, and whenever a truck comes in - you need to give it the first elligible waiting job from that queue.

Nimo.
16 years ago
looks like you're trying to use a method which takes an Object (the addElement method) and give it a primitive (a double).

Nimo.
16 years ago
ola.
the answer depends on how you defined the ArrayList in your SMS class.
if the Message class may access it directly - (i.e. - it is public, or you have your classes in the same package and declared it with package access) -you could just use it straight away. something like:

(This is inside the Message class)


however - this is not a good solution in terms of software engineering.
what you probably want to do is have methods in your SMS class for retrieving / deleting messages -

was that any help?
17 years ago
As far as I can tell, this benchmark isn't really relevant to answer the question 'Is Java slower..'.
The reasons are:

1 - The only valid comparison here is to C - all the other languages are like Java in the way the code is run - so you can practically call them Java-like. It is interesting to compare Java to the pre-linked program in C. That's all (Interpreted Python is, of course, no match).

2 - Java was executed with the optimization just-in-time on. Since the benchmark tested predictable mathematical testing - the code that was executed was not interpreted after the first cycle.

Apart from that, the drop in trig-performance is a bit suspicious. There might be some problem there..
17 years ago
The array class doesn't have a length() method, only a length member variable.
My guess is - since the array is not mutable (I mean - once you declared it, the length doesn't change until you re-new it) - It is safe to just assign the size to the variable in the constructor and have the variable public.
Further guessing, I'd say this is either a mis-design that just can't be changed now (backward compatability?) or efficiency-oriented, as getting the variable's value is supposed to be faster then calling a method.
17 years ago
hi.
back in the old days, using assembly, the implementation of a switch statement used multiple jumps (or breaks in asm/370) that branched on the return codes. This is why return codes where multiples of 4 - the length of a branch statements in bytes.
the jvms will actually convert switch statements to a few if statements. this is why the type of the checked value must be known beforehand. I am not so sure why it is specifically an int
17 years ago
it is a windows issue.
but anyway - when u save it - the save dialog-box has on the bottom a drop-down list with the caption "Save as type".
change the value there to read 'all files *.*' (it's in the drop down, don't type it in) and you're good as gold.

cheers.
17 years ago
Just use '/'.
It works on windows as well.
17 years ago
Sometimes it has to do with the resolution of your graphics on the windows end. this is why i asked about Blip.blip().
Try setting the resolution to as high as you can.
17 years ago