Paul Clapham

Marshal
+ Follow
since Oct 14, 2005
Paul likes ...
Eclipse IDE Firefox Browser MySQL Database
Vancouver, Canada
Cows and Likes
Cows
Total received
81
In last 30 days
0
Total given
148
Likes
Total received
2988
Received in last 30 days
22
Total given
807
Given in last 30 days
6
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Clapham

Matthew Bendford wrote:So, although a 32bit VM should be able to max out at 4GiB it actually does so at around 1.5GiB - for whatever reason I'm not really sure of.



That corresponds to my experience from last year when I finally upgraded from Java 8. I was using a 32-bit version of Java 8 and it wouldn't accept even "-Xmx=2G" to specify the heap size. But when I upgraded to 64-bit versions of Java 11 and then onwards, I could specify much, much larger heap sizes with no problem -- until the heap size exceeded the maximum virtual memory swapping file's capacity.
1 minute ago

milind k das wrote:Why and how "every instance of a subclass is also an instance of its superclass"? and why/how on "not vice versa"?



String is a subclass of Object. So "Every instance of a String is also an instance of Object." But not vice-versa, because not every Object is a String.

If you want to learn these basic Java concepts I would recommend not starting with complicated and confusing examples. Find examples which clearly demonstrate the concept you're trying to learn first.

11 hours ago
Well look, Matthew Bendford pointed out earlier that Java actually supports a large amount of memory. So if you already have a plan about how to process the XML using the XML DOM, I'd suggest you try it out to see if you really have a problem. I agree that SAX and StAX don't understand XPath -- although it's possible that somebody has built some open-source code to fix that. But you've decided without evidence (I think) that your XML is too big. So like Matthew says, give DOM a chance first.
17 hours ago

Mdri Na wrote:I meant environment settings.  As I see many items related to SAX/STax via google. It shows as linux kind.



I don't know what that refers to; SAX and StAX are part of the standard Java API so if you already have Java running then you don't need to do anything else, your environment is already set up.

Are you able to point me to a code snippet /template to process this XML ?



The web is full of examples of how to process XML documents. But you aren't going to find a tutorial which deals with exactly that document, of course. What you have to do is to take one or more of those tutorials and get some understanding of how to process XML documents. Then use that understanding to write code to deal with your XML document.

If you have questions as you go along, then the forum is here for you. Or if you have specific questions now, go ahead and ask them.
1 day ago

Mdri Na wrote:What are the env set under windows for SAX/Stax?



Sorry, I don't know what an "env set" is.

Are there any IDEs to use with SAX/Stax?



They are simply Java code, as you will see if you examine the tutorials linked to. So any Java IDE would be just fine.
2 days ago
If you want to upload an example for discussion purposes, upload a much smaller example which shows what your XML looks like.

If you just want to show us that the XML document is very big, then there's no need to upload it. Just telling us that it's very big is sufficient information.
2 days ago

Mdri Na wrote:I am not expert of SAX and StAX. Are you able to point me to coding sample of SAX and StAX to process attached complex XML meseage file



I searched the web for tutorials about SAX and STAX. Here's some:

Parsing an XML File Using SAX Parser

Parsing an XML File Using StAX
3 days ago

Mdri Na wrote:I tried to upload a .xml file to my thread of 839kb size. It is not working.



This is a good thing. What on earth would be the point of attaching a huge XML file?
3 days ago
Too simple then. Okay, how about Calculus: Symbolic differentiation.

For example you give the code a string like "X - sin(X) + exp(X^2)" and you have to parse that String and output its derivative with respect to X. So the output would be "1 - cos(X) + 2 * X * exp(X^2)" (if I did that correctly in my head just now). I recall doing that as a CS project myself a number of years ago. You can adjust the number of differentiable functions you support depending on how much work is required.
3 days ago
Then, like the title of your post says, there's no solution to that problem. Those numbers can't be expressed exactly in floating point so you'll have to use BigDecimal to represent them, as the earlier posts said. If you can't change that API to use BigDecimal (or String) then you're out of luck.
4 days ago
It looks like the first step is for you to choose a topic in one of those four categories. If you're at a loss, let me choose Number Theory for you and suggest your project should find amicable numbers.
4 days ago
You need to import Sheet.
6 days ago

Quazi Irfan wrote:



In your original example you had an array of int. Here you have an array of Integer. I speculate that they are treated differently, and you could find out whether I'm right.
6 days ago

Nyeng Gyang wrote:I have no recollection that I actually made any error(s) while using the option/flag; this means that, unlike with debugging, I have no way of determining the existence of any such hypothetical error(s) I made and removing it/them.



If you made an error, exactly how and when would you recollect that you made that error? You wouldn't. At some later time you would notice that your use of the feature wasn't working the way you expected, and then you would conclude that you made an error.

And yes, when you make an error in typing something at the command line, it doesn't take long before there's no evidence of what you typed and therefore you do indeed have no way of examining what you typed. And likewise you can't remove the error. All you can do is to realize that what you typed included an error; but as you say it isn't possible to correct the error because you don't know what it was. All you can do is to try again to type a correct command.

James Strunk wrote:Another question is, am I really supposed to convert the Rectangle2D to a Rectangle, or am I supposed to rewrite the paint method to work with Rectangle2D directly?



"Supposed to" is up to you. It's your application.

If it were me... the application works fine with Rectangle in that location (I'm assuming) so I would continue to have it use Rectangle. That simply requires creating a Rectangle from the Rectangle2D object that you now have available.

Although I haven't seen your code, so maybe it's just as easy to switch over to using Rectangle2D. But I have no idea whether you just want the simplest possible change to keep the program running or whether you want to do "upgrades" like that.
6 days ago