Posted by theholyjava on August 31, 2010
I hope everybody is enjoying the holiday and not spending hours on tech blogs and sites. At least I do
and thus this month’s list is a short one:
- Working With Static Imports in Eclipse – how to make working with static imports (nearly) as easy as with the normal ones (especially useful for fluent interfaces and “DSLs”), mainly by adding types like JUnit’s Assert and Mockito to your favorite imports and setting Eclipse to always generate static imports in the form <type>.*
- 5 things you didn’t know about … Java Database Connectivity – it was interesting to learn that JDBC specifies some scalar functions that drivers may support and translate into the DB’s language such as “{CURRENT_DATE()}”; for common functions supported by most drivers this should make your implementation more portable
- Four Things to Remember about java.lang.String – a really good one thanks to information on how to compare correctly the same Unicode character/string that can be encoded in different ways with java.text.Normalizer.normalize and Locale-sensitive comparison ignoring optionally unimportant differences such as letter size and accents (using a Collator)
Posted in Java, Tools | Tagged: eclipse, java, jdbc, unicode | Leave a Comment »
Posted by theholyjava on August 10, 2010
You will learn how to customize Clonezilla Live (v. 1.2.5-24) for an easy backup of a partition (or a disk) to an encrypted file stored on a remote Samba server and how to test the backup by restoring it to a VMware virtual machine. We will create our own Clonezilla script to mount a TrueCrypt volume on a Samba share.
What is Clonezilla?
Clonezilla is a live Linux distribution containing tools for performing backup and restoration of disks and partitions. It is basically a collection of various open-source tools such as partimage and gzip and custom scripts that “glue” them together to create a single backup tool driven by a wizard-like user interface. You install it to a CD or USB flash disk, boot from that medium, answer few questions and a backup or a restoration may start.
Read the rest of this entry »
Posted in Tools | Tagged: backup, encryption, linux | Leave a Comment »
Posted by theholyjava on August 2, 2010
Posted in Java | Tagged: IO, java, jdbc, patterns, performance | Leave a Comment »
Posted by theholyjava on July 25, 2010

MiniPauker 1.1.05
MiniPauker 1.1.05, the final milestone before 1.1.1, has just been released. MiniPauker is a “flashcard learning” application for cell phones, which means that you can use it to learn or repeat any pairs of information, such as French vocabulary or terms and their definitions. The “cards” that you have troubles remembering are repeated often while the ones well remembered less and less frequently. It’s a mobile version of the desktop application Pauker.
The version 1.1.05, and thus also 1.1.1, brings many new features and enhancements, especially regarding usability, and some important fixes, such as:
- The “lesson” (previously known as “session”) last used is automatically re-opened when you start MiniPauker
- Possibility to save & quit with a single key (namely 5) press while learning/repeating, or via a new main menu item “Save & Quit”
- Possibility to edit or delete a card while learning/repeating
- When there are any cards to learn or repeat, the corresponding menu item is emphasized with a red font, and when there is nothing, invoking that menu item will inform you when the next cards expire and will thus require to be repeated
- Support for long cards: you can easily page up/down using the keys 2 and 5 and the typing limit for adding or editing a card was increased to 10,000
- When a call arrives, the application should be able to stop and later resume without any loss of data (unless you inadvertently close it)
See the release notes for the complete list.
The “general availability” release 1.1.1 will be published based on 1.1.05 after thirty days without any new bug report and we are therefore asking everybody to download MiniPauker 1.1.05 (either the normal or the -debug version) and try it out to discover and report as many problems, unexpected behavior etc. as possible. Don’t miss your chance to influence the look&feel and behavior of the application! Read more about how to help with testing. Thanks a lot!
Posted in Java | Tagged: java, open_source, j2me, midlet, learning | Leave a Comment »
Posted by theholyjava on July 21, 2010
I’d like to share with you my experience with the Sun Certified Enterprise Architect for the Java Platform, Enterprise Edition 5 (SCEA 5) [1] certification. There was a couple of unclear things regarding the assignment and its deliverables and I’ve learned some interesting things (mostly about hardware estimation and deployment environments such as the “clouds”), both of which may be of an interest to somebody aiming at this certification. I only know that I passed but not how well, so my way of doing things, though sufficient, may not be the best one.
Read the rest of this entry »
Posted in Java, j2ee | Tagged: java, javaEE, architecture, sun, certification | Leave a Comment »
Posted by theholyjava on July 9, 2010
The last month’s list of interesting articles is a bit shorter due to off-line holidays, which I enjoyed much more then reading articles
Posted in Java | Tagged: html5, java, refactoring | Leave a Comment »
Posted by theholyjava on June 25, 2010
If you need to modify the code in class files at the (post-)build time without adding any third-party dependencies, for example to inject cross-cutting concerns such as logging, and you don’t wan’t to deal with the low-level byte code details, Javassist is the right tool for you. I’ve already blogged about “Injecting better logging into a binary .class using Javassist” and today I shall elaborate on the instrumentation capabilities of Javassist and its integration into the build process using a custom Ant task.
Read the rest of this entry »
Posted in Java | Tagged: ant, AOP, java, Javassist | Leave a Comment »
Posted by theholyjava on June 10, 2010
It isn’t possible to boot from a USB stick under VMware player 3.0.0, because its BIOS is ignorant of USB, but fortunately there is an easy workaround:
- Download the PLoP boot manager (e.g. plpbt-5.0.10.zip), which supports usb booting
- Decide whether you want to install PLoP to the virtual hard disk (useful if you will boot from the USB stick more often) or not
- Using PLoP without installing it to the virtual disk:
- Extract the ISO image plpbt-5.0.10/plpbt.iso from the archive
- Attach the extraced ISO image to you VMware virtual machine as a CD/DVD
- Boot the vmware machine from this virtual CD. (VMware should automatically try it as a boot device, if not, press Esc at the virtual machine start to enter the boot device selection menu).
- PLoP will be started, ses below.
- Installing PLoP to the virtual disk (you may want to check the PLoP installation guide):
- Extract the ISO image plpbt-5.0.10/install/plpbtin.iso from the archive
- Attach the extraced ISO image to you VMware virtual machine as a CD/DVD
- Boot the vmware machine from this virtual CD. (VMware should automatically try it as a boot device, if not, press Esc at the virtual machine start to enter the boot device selection menu).
- PLoP installation menu will show up, press 1 to select the option “Full boot manager install” and answer “y” to the question whether you want to proceed
- When the installation finishes, power off the virtual machine
- Remove the CD/DVD device from the virtual machine, we won’t need it anymore
- Start the virtual machine, which will boot PLoP from the virtual hard disk.
- Once PLoP is started, it will give you a selection of devices to boot from including your USB stick. (Make sure that the USB stick is connected to the virtual machine, if not, connect it and restart the machine via the menu VM – Power – Reset).
PS: You can do the same for VirtualBox, which also doesn’t support booting from USB.
Posted in General | Tagged: boot, usb, vmware | Leave a Comment »
Posted by theholyjava on June 4, 2010
JMeter is great for functional and performance testing of many things, including web services (and to my surprise also LDAP). It also provides means for extracting data from a response and passing them to a subsequent request, which is exactly what I needed. There is already a good tutorial on testing a WS with JMeter, so I won’t repeat the basic setup here. The steps are:
- Create a webservice (WS) test plan, as described in the tutorial (in my case it contains two WS calls)
- Add the User Defined Variables config element to the test plan and define there a variable for transferring the response data
- Add an XPath Extractor Post Processor to the first WS call to extract the value of interest into the user defined variable (beware namespaces!)
- Add a BeanShell Post Processor to the second call, which will replace a placeholder in the WS call’s XML data with the value of that variable
Posted in Java, Testing | Tagged: Testing, java, webservice, jmeter | 2 Comments »
Posted by theholyjava on June 2, 2010
The most interesting stuff I’ve read in May, in no particular order. You can easily guess I’ve been working on performance troubleshooting this month
- NoSQL is About… – all the things NoSql databases are said to be about (and perhaps are not) and a good overview of the different goals and thus also features of the various implementations
- Bulletproof of Mind Mapping: Overview, Benefits, Tips and Tools – the article not only introduces mind maps (a structured way of recording ideas, much less limited than lists) but also describes over 30 desktop and web-based MM tools, both free and commercial (some of the descriptions come from the SW’s web, some from the author – the distinction isn’t clear)
- Java vs. C Performance….Again. (9/2009) – When C(++) is better than Java, when Java is more appropriate, and common flaws in comparions methodologies/false arguments.
- Why Learning Git is really, really hard part 1 and part 2 with actual reasons – because it doesn’t care enough for usability (unusual commands, cryptic error messages, impossibly to go to a “simpler use mode”). I’m intrigued by distributed SCM systems and tired of not-so-easy branching & merging in SVN and its lovely problems with corrupted metadata (when you delete a folder…) and thus I was considering switching to Git that everybody is so excited about. I still plan that but these articles warned me that it may be not so painless and easy. A good read.
- Java VisualVM Blogging Contest results – the best posts -
- VisualVM – tool for profiling Java applications – nice, short intro with many pictures
- Analyzing Memory Leak in Java Applications using VisualVM
- (and others … )
- How to compute running mean/standard deviation - this page explains and in C implements an algorithm for computing a running estimate of mean and standard deviation, which minimizes accumulation of precision errors. A running estimation has the advantage that you do not need to store all the numbers and is thus suitable e.g. for continuous performance monitoring with a low memory overhead (buth the performance overhead of a division and multiplication it introduces is perhaps also something to consider – though for most application it’s negligible)
- (Java) Web performance in seven steps – a great article about the “management of performance” of a Web/JEE application from the definition of performance requirements up to continual performance monitoring with interesting war stories and links to various useful tools. I can sign the author’s maxim “measure, don’t guess!”. The Java monitoring API Java Simon mentioned in the article is worth a look.
Posted in General, Java | Tagged: Git, java, monitoring, nosql, performance | Leave a Comment »