This year’s Dutch Java Nerd event called J-Fall was held in Nijkerk, in a beautiful location called “Hart van Holland” . With plenty of sessions by speakers from all over the world it promised to be a great day for Java enthusiasts, at a great location for meeting friends and colleagues. I took a day off from work and it was well worth it.
Want to save a single email from gmail to disk, in a readable format for Outlook, Thunderbird or Apple Mail? Here’s how:
- Open your browser and log into your gmail account.
- Open the email you want to save.
- On the top-right, there is a little triangle next to the “Reply” button. Click that, and select “Show Original”.
- The original, raw email opens in a new window or tab.
- Right-click on this new window, and select “Save as…”.
- When saving the file, make sure the extension of the filename is “eml“. So for example “MyEmail.eml”.
All done. Now you dan open the file in Thunderbird, Outlook or whatever email viewer you have out there and see the original mail, in all it’s marked-up glory.
The top feature of the eclipse IDE is the very impressive refactoring possibilities. It makes code feel like play-doh, allowing you to knead it in any shape way or form you think fits the current situation. A close second to that is the impressive templates and code assist. Yes, Java is verbose, but I think 80% of the characters which make up a Java program was never actually typed. All the readability without the labour, brought to you by eclipse’s powerful templates.
What many people don’t realize is that you can easily add to this magic by creating your own templates. One of the first templates I always add to the environment is the one which adds a private static final log4j logger. I thought it would be great example to share with you.
After lies about Dropbox Employees not being able to see your files, then proving that they do not do regression testing on their security, the latest change in terms of service really was the last drop. So I dropped dropbox.
I had become dependent on Dropbox to transfer files between my private and work machines, having my notes, configuration files and (encrypted thank god) password databases handy at all times. Searching around, there is really no other service like it. Although lots of products claim to have the same functionality, the “share this folder between all my machines” feature which dropbox proviced is really unsurpassed.
I had to find an alternative solution which would meet the following criterea:
- has to be a single, native folder, instantly syncing with all other machines
- has to be free or *really* cheap, minimum 2GB
- has to use an encryption technology where no one else can ever read my files, not even the hosting party, not even at gunpoint
- has to have client software for Windows, Mac and Linux
- accessing data on my iPhone would be a nice bonus.
For one additonal GB of storage for life, use my referal link to register at SpiderOak. Read the whole article to add another 5GB to that.
Jenkins, the brilliant Continuous Integration build server, has a bit of a problem with the Maven surefire jUnit test plugin. Last sunday, I discovered that our Jenkins build server suddenly started ignoring test failures. While the logfile clearly states that the Unittests contain failures, Jenkins marks the builds as “stable”.
After some digging around, I found that even though Jenkins explicitly tells you in the logfile that it will fail the build, it will not do so if the Surefire XML reports are not generated. In our case, somebody in the team decided that the generation of the XML Surefire reports was taking too long and had disabled them in the Maven pom.xml.
In order to solve this, I re-enabled the XML reports and voila, Jenkins happily started reporting errors again. Here is the correct Surefire plugin configuration for you to use in your maven pom.xml file:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.8</version> <configuration> <!-- Please note that Jenkins needs Surefire XML reports in order for detection to work. Keep this property set to false. --> <disableXmlReport>false</disableXmlReport> </configuration> </plugin>
File Search always requires mouseclicks. To open the Search window and select the correct tab. It was not until recently that I realized that I could actually reassign the ^H (Control – H) key combination to pop up the File Search tab. If you are an avid Eclipse user you’ve probably already done this, or know how to do this. If you are new to eclipse, or lazy like me, read on to see how you can re-map this key binding.
A few months ago we had a problem where Eclipse could not automatically run all jUnit unit tests in a package if that package references a class called “enum”, which is a reserved word in Java 1.6. I’ll spare you the details, but we were forced to create a TestSuite. Normally we avoid this construction because it’s easy to create a new unit test and forget to add it to the correct TestSuit. So as a workaround we wrote some code which could build and return a TestSuite dynamically. Right-click in eclipse, select “Run as Unittest”, sit back and enjoy.
Lately this piece of code came in handy while testing another application, which required the removal of data from a database. Yes I know, Unittests should maybe not depend on databases because it leans towards integration testing, but here we are, and I need to solve it. I used the old TestSuite code and changed it so that the TestCase I needed to run first was singled out, while still maintaining the functionality of auto-detecting testcases in the source folder.