Pavel Cherkashin

Ranch Hand
+ Follow
since Mar 04, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pavel Cherkashin

old good mxml
13 years ago
tried to send you the reference to one very usable site but got message:

Sorry, your post contained a reference to a company or website that publishes real test questions - a practice we do not approve of here at JavaRanch. We have banned all discussion of the websites which do this, because even the knowledge of the names of such websites seems to encourage others to use the website to cheat. If you were attempting to discuss this website for any other reason, we apologize for the inconvenience.

If you need it, give me email, I will send you. As for me, this resource is too nice and that is the reason it is banned.

13 years ago
one more fly in the ointment

did You forget about java.lang.StringBuffer

String buffers are used by the compiler to implement the binary string concatenation operator +. For example, the code:

x = "a" + 4 + "c"

is compiled to the equivalent of:

x = new StringBuffer().append("a").append(4).append("c")

Hi there.

Did anybody try Fiji in practice?

Pretty cool stuff as for me... charts, table data cache. But faces are embarasing and huge.
to say: show a table 3X3 whith headers one, two, three and values 123456789 you got to code halfscreen of xml.
That is why scripting languages are better.
13 years ago
I think it's a kind of psychological mania to get satisfied with code.
I experienced such a syndrome few years ago, achieved the result, i was satisfied with every line of code I wrote). But the real world usually brings you to the team. Not all team members code perfect. You perfect coding skill will rise into aggression against all team fellows who do not code well. So think twice what You want to achieve.

What perfect coding will give You: nothing but headache (imho) and feeling that You are better then other imperfect coders (they will not feel that though)

There are a lot of good aims to pursue: to create reliable programs, to be doc in real time programming, be on demand in market, rise IQ score, marry and grow up kids, do not be perfect coder!

Also i would say java is not a language to write perfect code. Programming on java You will usually repeat yourself, try python
13 years ago
As we can see java is not only the language anymore it put its hands and bridges on almost everything
that is why I would propose to introduce topics dedicated to such bridges.
Most of us heard about Jython so users can share experiences around Python to Java bridge. The same to Groovy, JRuby.

Second: there is no category about Java to hardware (scanners, printers, other USB devices)

Third: Java is community driven, correct me if i am wrong but I can not imagine java without the open source. Young developers, fresh heads
might share ideas, ask advices from old experienced open source guys. I would propose the category for discussion of open source projects existent and planned.
13 years ago
Hi there,

Did anybody write java parsers and tree generators? I tried java cc but got no success with it.

My purpose is somehow deeper though. I am trying to develop java to abc byte code compiller.

here is active script 3.0 compiler
source code. And I was thinking to myself it would be great to write code on java and produce SWF flash. Is not it cool idea?

Active script 3.0 and java are very alike. Their byte code formats are alike as well. So there are lot of of options:

one is to replace java specific constructions to those of AS 3.0

second is to transform class byte code to abc byte code

third is most optimal (from my point of view) generate evaluation tree for java source, trans form it to the tree Macromedia's asc compiler user to traverse and compile using old good flex compiler. That is what i am trying to do.

So the first step is easy: get evaluation tree for java source. Can anybody share some practices regarding parser generator using javacc or antlr?


13 years ago
XSLT 2.0 support regular expression.
Regard these links:
the good publication

the chapter from tutorial

the official xslt 2.0 specification (very long html document)-chapter 15 is about regexps

The can be usable as a xslt reference (elements, functions etc)
[ February 28, 2008: Message edited by: Pavel Cherkashin ]
Of course if there is a reason to use more abstract binding, then it depends from special needs. Sometimes it is needed to specify the structure of the xml data. Sometimes it is needed to handle the inheritance of data beans. The large byte arrays and multi part data content - is a special topic. The validation of values is also form time to time being the topic to discuss when selecting the tool.

You're the driver.
As far as raw nodes <-> fields bridge is considered, the Dom4j is very usable. It implements xpath and to access every node or attribute of the document is easy.

This tool works with raw xml and raw beans and abstract the developer from handling "nodeStarted" and "nodeEnded" etc.
Hi, Cristian. It seems that Dom4j does not handle new lines after every attribute. But it does handle formatted output.

for the more detailed information about formatting possibilities the Dom4j provide.
To reach the thing You need, it might be helpful to reload some methods in

Or the other way to solve the problem - is to output the XML content into string buffer and then add some format refinements using regular expressions.
[ February 28, 2008: Message edited by: Pavel Cherkashin ]
Have something to add.
If there is no requirement to xml structure and the main idea - convert bean to xml and back populate to bean, then the XStream is very usable. Refer this two minutes tutorial
May be that is the best choice in your situation.
divide your jsp on two independent parts, depending form parameter.

For example introduce parameter "showReport" = pass it by POST or GET. For instance if your one *.jsp page is report.jsp - to see form, use http://.../report.jsp?showReport=false, to see the result - use http://.../report.jsp?showReport=true.

Then this parameter can be considered to separate form rendering from results rendering. Use JSTL tags or easy scriplets to control the flow of jsp execution.

Use redirect or forward directive to output result from jasper.

The described solution does not imply any iframes. With frames - it is easier. Create two jsp pages first (one for form and one for result). show them in separate iframes of one html document. Use javascript to build url and point this url to access the result page, refresh it if there is a signal form form.
14 years ago
Consider piece of code with comments.

Read the point 4 (about wildcards) of the generics tutorial - there is a good and quite detailed explanation of this situation.
14 years ago