March 5th, 2009 — Java, Stripes, TJUG
Last week at TJUG, our local Java User Group, I had a short presentation called “Stripes – Painless Java Web Development”, introducing (obviously) Stripes. Slides can be downloaded here.
We also had a chance to take a look at Eclipse RAP in another presentation by Gabriel Ciuloaica – “From Eclipse RCP to RAP”.
Many thanks to Gabi Pop who always takes care of planning and organizing the TJUG meetings.
January 28th, 2009 — GeekStyle, Tools
I’ve been looking for a decent tool to determine the byte code version for a Java .class file. You know, the one based on the numbers after the CAFEBABE magic (you can read more about this here or here).
There are some tools around for this, but most of them written in Java. I really don’t see the point in starting a JVM just to read 4 bytes from a file, so I wrote a short Perl script for this. Again, I am no Perl expert so this is probably not the best solution performance-wise and such.
Usage
1. Running the script with no arguments – will result in scanning the current directory recursively for .class files. The results are grouped by directory and a total number of files is also displayed. Directories that do not contain any .class files will be ignored, in order to keep a clean output. Below is a short sample.
cosmin@cosminaru:~/work/quizine$ bcversion.pl
* /home/cosmin/work/quizine/src/main/webroot/WEB-INF/classes/org/quizine (2 files)
QuizineException.class -> 1.6
ApplicationContext.class -> 1.6
* /home/cosmin/work/quizine/src/main/webroot/WEB-INF/classes/org/quizine/web (2 files)
ErrorHandlerFilter.class -> 1.6
SessionContext.class -> 1.6
* /home/cosmin/work/quizine/src/main/webroot/WEB-INF/classes/org/quizine/web/actions (1 files)
ActionBase.class -> 1.6
2. If you provide one or more arguments, the script will only scan the content of these arguments. If the argument is a file then the byte code version is displayed for that file. If it is a directory then it will be scanned recursively, just like above.
Note: The paths from the argument list should all be relative to the current directory in order for the script to work correctly.
cosmin@cosminaru:~.../model/quiz$ bcversion.pl AbstractQuestion.class result
* AbstractQuestion.class -> 1.6
* /home/cosmin/work/quizine/src/main/webroot/WEB-INF/classes/org/quizine/model/quiz/result (5 files)
QuestionnaireResult.class -> 1.6
BooleanAnswer.class -> 1.6
AbstractAnswer.class -> 1.6
SingleChoiceAnswer.class -> 1.6
MultipleChoiceAnswer.class -> 1.6
I’ll probably want to scan JAR files and directories containing JAR files. But the really poor Perl docs for reading ZIP buffers didn’t quite help me. If you think think you can give a hand with that, drop a note
.
Download:
You can get the script from here.
January 20th, 2009 — TestNG
TestNG-XSLT, a small project of mine, has finally made it to 1.0. It’s currently tested only with Firefox 3.x and Internet Explorer 7, but it will probably work on most modern browsers. For the moment I thought it is more important to target the popular browsers and leave the more exotic ones for later.
Some of noteworthy features that I’ve added since the project start:
- Maven plugin with access to all transformer features and settings.
- SVG pie chart with the overview of the pass/fail/skip status.
- Configurable CSS style sheet – you can build your own “skin” by overwriting the built-in styles and setting the
testNgXslt.cssFile parameter. More about this here.
- Ability to change the report title, to generate information about test durations and other settings configurable through XSL transformer parameters.
- Other smaller or bigger issues and feature requests reported by users.
I want to thank all the guys that used this and came up with bugs, feature requests and suggestions: Andreas Guther, Xuan Ngo, Francis Henninger, Csongor Gyuricza, Andreas Kuhtz and others.
Last, but not least, I would like to mention that Haw-Bin Chai has managed to successfully integrate TestNG-XSLT in Lightest, a lightweight testing framework based on TestNG and Groovy.
The download is available here. If you use Maven, make sure you update your pom.xml to get the 1.0.9 version of the plugin.
November 13th, 2008 — Java, Quizine
Last night I managed to publish the 0.3 version for Quizine. Below is a short overview of what’s been added/improved.
- First draft of questionnaire life-cycle management – The operations on a questionnaire will no be in strict correlation with it’s state: In Work, Published, Closed (more will probably be added later). The application will allow certain actions only while the questionnaire is in a certain status. At the moment is very rough, but hopefully I’ll have the time to elaborate it more in a 0.4 (also hoping to get a decent documentation for it).
- Complete new layout – The Administrator Console layout has been completely reworked (screenshots here). I am pretty ok with this and I don’t expect to allocate any more effort in this direction any time soon.
- New sample data – Both the MySQL and the HSQL demo script now contain enough data with all stages of the application so anyone can easily have a look at all the workflow.
- Demo movies – I wanted to start providing some demo movies that should be bundled in the (future) documentation. For the moment I only have two, but I plan to create more. It is not rocket science to make such movies with Ubuntu, but it’s pretty time consuming if you want to get it right.
There is still a lot of effort to be put in Quizine and mostly in overall testing and getting a feeling about usability and overall workflow. So, if you are interested in helping out with any part of the application/documentation/etc, or just have some suggestions, you are more than welcome to contact me at .
October 20th, 2008 — Java, Quizine
As of version 0.2, Quizine provides a set of reports detailing quiz results (screenshots here and here).
In addition, the application demo can now be downloaded with a bundled Tomcat. This package contains the demo .war file and can be downloaded as a .zip or as a .tar.gz (see Download section from the project page).
I hope I’ll find some time to write some decent documentation about it, including both setup and user guide.
October 16th, 2008 — Idiots
This Crap 2.0 thing is really getting out of hand. Seriously. I am not 100% sure, but I believe it all started with the Web 2.0 idiocy. I don’t think anyone needs to hear anymore about that shit with web as a platform, tagging as new mechanism to remember stuff for imbeciles-that-can’t-navigate-a-tree-structure, Ajax as the new Jesus, social networking as a new term for “Are you a horny teenager, bisexual voyeur, or child-molesting monster? Sign-up now for free!”, etc. We’ve been there too many times and we all know what a big pile of crap that is.
What is really dangerous about this Penis 2.0 is that there’s a huge number of autistic morons who claim to have something to do with reality, and believe that everything that comes out their ass should be labeled as “2.0″. “Wow, my crap smells different today – I’ll call it Shit 2.0″.
The Orifice 2.0
For example, I don’t understand (nor I am very interested in) what people could talk about at an “Office 2.0″ conference. I believe we can all admit that office tools are in an eternal pre-alpha and has a long way to come until we’ll have a stable 1.0. For Christ’s sake, am I the only one that has had it with word processors that always (and by default) know better than you what you meant by typing “-”, and not “–”? If only I was there to smack a keyboard in the head of the idiot that had for the first time the genius idea to “improve my productivity by auto-correcting my typing mistakes”.
The desktop tools for office are still retarded. Most of these suck an elephant’s cock. They’re all slow, unintuitive, rigid, and very temperamental about changing default settings (that, of course, if you can make it to the long expedition of getting to that unreachable check box).
Now these guys (and lots others), in the name of “online productivity & collaboration” are taking everything (or most things) on the web (see Google Docs and Zoho, etc.). Wow, that’s awesome. The desktop application that was almost completely integrated with my OS couldn’t satisfy half my needs, and now I am supposed to believe that a browser-based office suite will? Does anyone in the room is still listening to this? Doesn’t anyone feel abused?
I am big Wiki fan, if we must speak about “online collaboration”. However, we all know that the target of these tools hardly contains any individuals with non-technical education. And maybe this is the point that we are missing: why should every moron “collaborate and be productive online”? No matter what democracy tells you, we’re not fucking equal (and surely not with the same level of intellectual development).
So I can’t take things like Orifice 2.0 seriously until I see a 1.0 that has an at least 70%-to-30% rate of usefulness vs. annoyance. Right now we’re at about 10%-to-90% with most desktop tools, so good luck with the browser solution.
And another argument for this (for those of us who can edit a Wiki in plain-text mode): http://teddziuba.com/2008/09/a-web-os-are-you-dense.html.
The retarded playboy that thinks he is artistically inspired by the comments on his blog post where he wrote about the fact that he has grown pubic hair.
I’ve seen this commercial first on Romanian television, and I gotta say I was surprised to survive it. I was expecting some serious brain damage (although if it happened, I couldn’t confirm it, could I?) and probably muscular spasm after hearing one of the final lines: “I am …. The first 2.0 poet”.
Bitch, say what? Oh my fuckin’ God! Are you serious? Was this produced in a mental institution? It was enough for me to hear that the moron thinks that his downloads uptown and uploads downtown have anything to do with poetry. It was already abusing the fact that he is such an idiot to believe that he has a girlfriend “half the globe away” – dude, if she’s half the globe away you can call it whatever you want, but that doesn’t mean she won’t bang half of the neighborhood.
This guy is such an imbecile that it makes my brain hurt. Especially when he’s telling us that he sent a picture to his mom with a kid that looked just like his brother. Huh? Dude, maybe you should ask you’re mom what she’s been up lately, but he might just be your brother.
And still, he thinks he’s a god-damn poet. Now I know this is just a commercial. But am I supposed to take this shit seriously?
I don’t know that much about poetry, but I could never guessed that these guys need a versioning mechanism. What in the world should 2.0 mean for poetry? Will all poets have blogs and talk about their penises and occasionally brag about having crazy-ass-bitches girlfriends abroad? All poets should start learning about downloading (uptown) and uploading (downtown), do web casts and such? What exactly is it, ’cause I don’t get the point? Does any of these has anything, and I mean anything, to do with poetry?
I believe that these are two relevant examples related to STD 2.0 and the way it is spreading. Basically, wherever you turn your head, there’s a moron with the head up his ass trying to impress the crowd and that’s it – there’s no 2.0 about it. Is the same sales and marketing people, with the same autistic behavior, licking their own balls. Nothing new about it, so stop calling it 2.0.
We are not re-inventing everything (and we shouldn’t). We are not re-defining the world as we know it. This is just a lame show with fewer and fewer audience. So why don’t you guys just give us all a break and stop insulting our intelligence?
October 15th, 2008 — Java, Quizine
My new baby project, Quizine, has now a demo .war file that you can download to and deploy in any Java web application container.
Since this .war is for demo purposes only, it uses an HSQL database running in-process and memory-only. As a consequence, all changes that you make will only be consistent until you restart the container, at which point they will be reset.
You can also check the project’s main page (http://code.google.com/p/quizine) where you can find additional details about getting the application, building it, running, etc.
October 8th, 2008 — Java, Quizine
Quizine is a project I’ve been working for quite some time now. It is a questionnaire management solution built as a Java Web application.
Although it is in only a first draft, I am hoping to find some time to finalize it and create a comprehensive and robust quiz tool. For this, any suggestions or contributions are highly appreciated at this stage, as the concept is still in the process of being defined.
April 9th, 2008 — GeekStyle, Tools
There are many situations when I need to convert an amount of Euros to RON (Romanian Leu). There are a couple of sites that can do the conversion for you (even Google does this pretty well). However, none of them seem to be as accurate as the the National Bank of Romania, whose exchange rate is the only one that has any relevance for me. So most of the times I have to open the calculator, go the BNR website and use the exchange rate provided here, an issue that doesn’t work very well for a lazy ass like me.
Fortunately, BNR also provides an XML with the exchange rates for the most important currencies in a manner that is very easy to understand:
...
<Rate currency="DKK">0.4926</Rate>
<Rate currency="EGP">0.4291</Rate>
<Rate currency="EUR">3.6747</Rate>
<Rate currency="GBP">4.6020</Rate>
...
Luckily, Perl knows how to parse XMLs so we’re almost good to go. Now I am not Perl expert, nor want to become one very soon, but this sounded like something doable with a minimum amount effort.
What we need is to get the XML with an HTTP request, parse it and convert the given amount of money using the desired currency. So I created a tiny script convert2ron.pl that accepts two parameters: the currency identifier (EUR, USD, etc.) and the amount to be converted. I will not go into the details of how this script works as it’s pretty straight-forward (even for someone with a minimal understanding of Perl). So now I can convert all sorts of currencies to RON using calls like this:
$ ./convert2ron.pl EUR 245
and get results like these:
245 EUR = 900.30 RON
(rate is 3.6747)
Is this the geekiest way to do this, or what? And the geekness doesn’t stop here. Now I also have some scripts like eur2ron.sh and usd2ron.sh so I can do stuff like this all day:
$ eur2ron 456
So, if you want to convert international currencies to RON the geek way, here’s the download: http://cosminaru.ro/downloads/ron-convert.zip.
April 7th, 2008 — TestNG
I finally got the time to finalize the Maven plugin for TestNG XSLT. A detailed usage scenario is described here.
A few important notes:
- Integration with the Maven site (navigation link in the “Project Reports” section)
- CSS customization is performed by passing a
cssFile configuration parameter to the plugin