This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!

Rikko Verrijzer

Ranch Hand
+ Follow
since Jul 22, 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 Rikko Verrijzer

Hi,

I'm trying to modify a XML file with DOM. Basically what needs to be done is to translate all math inside a XML file from latex to mathML. Finding the math and translating it is to mathML no problem.

However the translation proces creates a new DOM XML tree. The problem I have is the integration of this new DOM tree into the old DOM tree.

I understood that the following lines of code should take care of this merging problem:



However this results in an error message like:
Exception in thread "main" org.apache.crimson.tree.DomEx: NOT_SUPPORTED_ERR: This DOM implementation does not support that node type.
at org.apache.crimson.tree.XmlDocument.importNode(XmlDocument.java:1259)
at translate.MathTransformation.process(MathTransformation.java:144)

Now apparently I'm not allowed to inserted complete documents into another document, but any child node I try add instead of the root node generates to following error:

Exception in thread "main" org.apache.crimson.tree.DomEx: WRONG_DOCUMENT_ERR: That node doesn't belong in this document.
at org.apache.crimson.tree.ParentNode.checkDocument(ParentNode.java:250)
at org.apache.crimson.tree.ParentNode.appendChild(ParentNode.java:333)
at translate.MathTransformation.process(MathTransformation.java:146)

I'm relatively new to DOM so this might be easy to solve.

Thanks,
Rikko
13 years ago

Timer tasks should complete quickly. If a timer task takes excessive time to complete, it "hogs" the timer's task execution thread. This can, in turn, delay the execution of subsequent tasks, which may "bunch up" and execute in rapid succession when (and if) the offending task finally completes.



That is also true when you are using your timer task to run a lot of small tasks over a long period of time. The timer will tend to slip some time eveytime it executes a task, resulting in inaccurate execution moments.
For example if you run every 10 mins a task, you might notice a delay of a minute or so over a month time.

Rikko
14 years ago
Hi,

another possibility, one that is only possible when you 'cleaned' the class before posting it here. Is that you have another variable declared with the same name inside your method putscore(int). By assigning the value to gamescore you actually asigns the value to a local variable (with a scope limited to the method putscore(int)), instead of the global (class member) variable. This results in keeping the global variable gamescore at 0.

Hope this helps?
Rikko
14 years ago
Hi,

I should implement the toString method in the Customer class, which simply appends all values into one string. (like "cIDIn "+ cIDIn +" cFirstNameIn "+cFirstNameIn etc...), and then itterate through the array, and call toString on each object in the array. Assuming you want to do this for some screendump or something like that.

Hope this helps?
Rikko
14 years ago
Stephan,
You seem to be right. My apologies for any misunderstanding!
Fanny, go with Stephans explanation!
Rikko
14 years ago
Hi,
An abstract class can not have an constructor, it's simply illegal. This is because it has methods without a body, and it wouldn't make sense if an object of this class existed in that way. Constructing is left to a non-abstract subclass, which has the abstract methods implemented.
Hope this helps?
Rikko
14 years ago
Hi Landon,
As you already said in your first method, the toArray() method returns an array of the type Object. If you want your elements from your list (Linkedlist or arraylist at this point are all the same), you have to assign the resulting array to an array of type Object[], or any super type of Object (but thats a little hard in this situation )
So you have to use Object myArray[] = myList.toArray();
Or use an iterator which iterates over the list and cast each element to a String before putting them into a String array
Hope this helps?
Rikko
14 years ago
Hi Rick,
If you define an inteface you should know that all variables defined in that interface are final. That means that you can use the values(!!!), but not change them.
note that a value is something different for an object than for a primitive. Primitives values of those like int, byte, boolean etc. are unchangable. However, a object value is the refference to an object, not its inner values. This means that an object can not be replaced with any other reference, but its methods like add(), get(), count() etc. can be called and used to change its inner values.
So its possible to add new elements into your arraylist even though your arraylist is final. However you can't replace the arraylist with a new instance (filled with whatever you like).

Hope this helps?
Rikko
14 years ago
Hi,
Perhaps the most simple, but not very subtle solution would be: multiply by 100, call Math.round(double), cast to double and divide by 100.
long story short, something like this:
roundeDoubleValue = (double)Math.round(someDoubleValue*100)/100;
But there might be a better solution though
Rikko
14 years ago
Hi,
I'm building an application which gets its requests from a JMS queue.
The problem I'm currently facing is that the JMS calls the onMessage() method faster than the application can handle the requests. Therefore I'm looking for a way to slow down the rate of the onMessage()calls. Preferably without slowing JMS in general, since this application is not the only application connecting to the JMS.
Hope that anyone has some usefull hint for this problem.
Thanks in advance
PS. slowing down the message supplier is not an option.
Rikko
Hi Wayne and Joel,
Thanks for you solutions, I think I can solve the problem now. Thanks alot!!
Rikko
15 years ago
Hi,
I'm busy with a project which is used while it is not yet finished. This results in stored serialized objects while the classes needs to be updated.
I don't see any proper solution to do this without deleting the current stored objects. The only possible solution I see right now, is loading the stored objects, use them to create other/newer objects with the same behaivoir and store the new ones. However This changes the used classes while I wanted them to remain the same.
Does anyone know a decent solution for this?
Rikko
15 years ago
Hi,
I ordered my book also from amazon.uk. If this is true, I'm certaintly going to cancel my order and replace it in the US. Does anyone have more information on this?
Rikko
Hi Sneha,
So you where afraid of nothing I guess
Your score is indeed very close to what you achieved on marcus exam.
Congratulations!
Rikko
15 years ago
So it wasn't just my testcenter then, I had a little hope that other test centers where better than mine. They let me watch a screen with a lousy refresh rate. I really had a hard time to stay focused with the headache it caused!
One should think that you pay enough for the voucher to get at least decent ergonomics at your test center.
Rikko