This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!

Alex Chun

Ranch Hand
+ Follow
since May 07, 2015
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
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alex Chun

I've decided the last problem by stackoverflow
Problem with title is not solved.
I tried to parse by "article" and got the same exception.
So title and article have emdbedded tags.
From dtd file:


<!ENTITY % titlecontents "#PCDATA|sub|sup|i|tt|ref">
<!ELEMENT title (%titlecontents;)*>
<!ATTLIST title


E.g. title contains subtags: |sub|sup|i|tt|

How it can be solved? Give me a hint please.

PS. My wife gave birth a boy yesterday

Liutauras Vilda wrote:
Have you tried to download any other text editor as Notepad++, it should be able to handle files up to 2GB. Search for a different editor, surely there is some on Windows too.



Only I tried Notepad, OpenOffice and embedded Intellij IDEA edutor


Upd. Just I've tried open it in Notepad++ and showed: "File is too big to be opened by NotePad++"

Tim Holloway wrote:Well, if you can bring up the offending XML in your viewer program...



It's one of problems. Editors can not open too large file.

Tim Holloway wrote:I suspect that you are running a 32-bit JVM.

In any event, I ALSO suspect that you're attempting to process a 1.7 GB file by loading the entire freaking thing into memory.

And that there's nothing necessarily wrong with the XML other than that there's simply too much of it.

That much data rarely needs to be (or should be!) processed in RAM directly. There are other ways to handle XML that allow you to process the XML as a stream instead of as one big indigestible lump. Consider using a SAX or STaX parser instead, and it you actually want to do complex things, you might store the received data into a database where it can be more efficiently accessed.



Tim, yes, you're right. I run 32-bit JVM.
But I use StAX parser

PS. Yes, before I tried to use DOM-parser and I've got "Out of memory".
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: JAXP00010001: The parser has encountered more than "64000" entity expansions in this document; this is the limit imposed by the JDK.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:601)
at Parser.SAXParser.parseTitle(SAXParser.java:62)
at Parser.SAXParser.main(SAXParser.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

Process finished with exit code 0


JDK 1.8
I've read this bug was in 1.7 and before.
What is problem?

Rob Spoor wrote:Without seeing line 268 we cannot see what's going wrong. All I can tell you is what the message says - you have an element that expects only text content but instead contains a nested element.



How I can print out this code in Java at [row,col]:[268,35]

Tim Cooke wrote:I'm not sure how you could view that on a Windows machine. Perhaps someone else will be able to help with that.

On a *NIX machine I would suggest using sed to print out a small range of lines from the whole file. I don't know if you have sed on Windows, or some equivalent even.



I have dmd file.
I 've just checked other attributes: "author", "year", "isbn", "booktitle". There are parsing without any problem. But "title" execute an exception.

Tim Cooke wrote:

Alex Chun wrote:Sorry, I paste picture here. It's only a part of xml file.


Please don't do that. I cannot read anything in that image.

Just paste the part of the xml relevant to the error. What's on and around line 268?



Tim, I 've tried open xml by notepad, readers. They do not open it because it's too big. I do know how I can do it.

Tim Cooke wrote:Please don't use images to show errors. Please copy and paste the error as text into your posts.

Also, show the xml that is being parsed.



title : Parallel Integer Sorting and Simulation Amongst CRCW Models.
title : Pattern Matching in Trees and Nets.
title : NP-complete Problems Simplified on Tree Schemas.
title : On the Power of Chain Rules in Context Free Grammars.
title : Schnelle Multiplikation von Polynomen nullber Knullrpern der Charakteristik 2.
title : A characterization of rational D0L power series.
title : The Derivation of Systolic Implementations of Programs.
title : Fifo Nets Without Order Deadlock.
title : On the Complementation Rule for Multivalued Dependencies in Database Relations.
title : Equational weighted tree transformations.
title : Merged processes: a new condensed representation of Petri net behaviour.
title : Verifying a simplification of mutual exclusion by Lycklama-Hadzilacos.
title : A Three-Stage Construction for Multiconnection Networks.
title : The Expressive Power of Delay Operators in SCCS.
title : Calculi for Interaction.
title : A Synthesis of Several Sorting Algorithms.
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[268,35]
Message: elementGetText() function expects text only elment but START_ELEMENT was encountered.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.getElementText(XMLStreamReaderImpl.java:857)
at Parser.SAXParser.main(SAXParser.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
title : A Workload Model Representative of Static and Dynamic Characteristics.
title : Gray visiting Motzkins.
title : Trace- and failure-based semantics for responsiveness.
title : Branching Processes in the Analysis of the Heights of Trees.
title : Least Upper Bound on the Cost of Optimum Binary Search Trees.
title : The Mathematical Analysis of the Computer System Modeled as a Two Stage Cyclic Queue.
title : Invariants, Composition, and Substitution.

Process finished with exit code 0



xml file is a big (~1.7GB). It does not open in textpad.

Sorry, I paste picture here. It's only a part of xml file.



Guys, what is exception? How I can fix it? Thanks in advance!

Hi everybody!
Two problems - I downloaded project in IDEA, but it does not stand up) classes marked red badges.
And I need implement method sort with two parameters.
About Function<Object, Comparable> ...Is it right?
Thank you.





PS. How I can measure select operation speed before and after this operation?
How can I draw two balls?
6 years ago
6 years ago
I'm afraid that I don't know why not. Just I started to learn Swing/AWT. I' m agree about class "Ball" creation.

PS. I updated the link and free access.
https://youtu.be/hvNAUUP_mS0
6 years ago
I have two classes. Here is the red ball is moving only. I do not know how to realize a blue ball.



6 years ago