<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss version="2.0"><channel><title>Day to day stuff</title><link>http://day-to-day-stuff.blogspot.com/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DayToDayStuff" /><description>Experiences from a hard core JVM programmer. Likes to keep things simple.</description><language>en</language><managingEditor>noreply@blogger.com (Erik van Oosten)</managingEditor><lastBuildDate>Sun, 13 May 2012 04:49:49 PDT</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">109</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="daytodaystuff" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Getting size of a file in shell script</title><link>http://day-to-day-stuff.blogspot.com/2012/04/getting-size-of-file-in-shell-script.html</link><category>open source</category><category>unix</category><category>mac</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Fri, 27 Apr 2012 06:44:17 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-5965783230229907519</guid><description>
This is really too silly. There seems to be no consistent way to get the size of a file (in bytes) on multiple platforms. Here is a solution that works in bash on Linux (tested under Debian and Ubuntu) and BSD (tested under OSX):


# Echo's size of a file (first argument).
# Tested under Linux (Debian) and BSD (OSX).
function filesize() {
  echo $(stat --format=%s "$1" 2&amp;gt;/dev/null || stat -f '%z</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>X forwarding as root</title><link>http://day-to-day-stuff.blogspot.com/2012/01/x-forwarding-as-root.html</link><category>unix</category><category>mac</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Mon, 16 Jan 2012 00:50:01 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-7557209537817749164</guid><description>Often is useful to run jconsole on a remote (production) machine. One basically has 2 options to do so. First, you can pierce your firewall and let your application listen to the appropriate JMX and RMI ports. This however always tricky (in particular the RMI). In addition, creating the connection string that jconsole accepts is not nice at all.

The other option, is to do X forwarding. I'll </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Breaking a Java HashSet</title><link>http://day-to-day-stuff.blogspot.com/2011/12/breaking-java-hashset.html</link><category>java</category><category>concurrency</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Tue, 13 Dec 2011 04:57:50 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-3383054662335388053</guid><description>Can it be?
Set set1 = new HashSet(5);
Set set2 = new HashSet(5);
// add of bunch of strings to both sets
assert set1.equals(set2) == false;


Yes it can!

We actually had this problem in an integration test. The cause was that the strings to one set were added concurrently. Interestingly, the sets seemed to be the same, when printed they contained the same strings, just in a different order (</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>DNS for Version 99 is off-line</title><link>http://day-to-day-stuff.blogspot.com/2011/08/version-99-dns-off-line.html</link><category>open source</category><category>java</category><category>version99</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Mon, 15 Aug 2011 11:54:39 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-6988679067923977176</guid><description>To alleviate some pain with using the commons-logging framework, I created version 99. It was hosted at the hostname no-commons-logging.zapto.org courtesy of no-ip.com. Unfortunately, due to lack of traffic I had to affirm usage of the  the hostname once per month. Though this was slightly annoying, a complete pain is that I missed the last deadline, and that recreation is out as dashes in </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total></item><item><title>Lock-less singleton pattern</title><link>http://day-to-day-stuff.blogspot.com/2011/06/lock-less-singleton-pattern.html</link><category>java</category><category>concurrency</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sat, 18 Jun 2011 11:31:22 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-2826013984759313459</guid><description>Although the singleton pattern is now know as an anti-pattern, I think it still is a valid choice when you only need one instance in a particular context. Anyway, in Java there are several ways to implement a singleton.

For example this one uses a synchronized block:private Singleton singleton = null;

protected Singleton createSingleton() {
  synchronized (this) {  // locking on 'this' for </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></item><item><title>Apache Wicket Cookbook — book review</title><link>http://day-to-day-stuff.blogspot.com/2011/05/apache-wicket-cookbook-book-review.html</link><category>opinion</category><category>book review</category><category>wicket</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Thu, 19 May 2011 12:46:49 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-7288074598967722200</guid><description>Some time ago I reviewed the drafts of the new book from Wicket rockstar programmer Igor Vaynberg: Apache Wicket Cookbook. If you are serious about using Wicket, this book is for you. It is fast, to the point, has very clear code samples and teaches you all the relevant (both clean and dirty) stuff you need and which Wicket in Action could not cover.

Conclusion: this is the book to read after '</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Virtualizing a PC</title><link>http://day-to-day-stuff.blogspot.com/2011/03/virtualizing-pc.html</link><category>open source</category><category>unix</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Thu, 31 Mar 2011 05:25:25 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-798289589743505068</guid><description>All hardware is eventually decommissioned. It may be broken, stolen, or just too old and slow. However, the software on it might still be needed. Not all software is easily transferable to a new PC with the latest OS on it. This quick guide helps you convert the old machine to a virtual machine, so that you can run it in VirtualBox. The process is called physical to virtual (P2V).

This article </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>On making a custom Ubuntu Bootable USB stick</title><link>http://day-to-day-stuff.blogspot.com/2011/03/on-making-custom-ubuntu-bootable-usb.html</link><category>open source</category><category>unix</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 27 Mar 2011 05:44:57 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-8678989278886714289</guid><description>In my upcoming Wicket course the students will use a rental laptop. How do we guarantee that they will be up and running in no time? Colleague Jason had the solution: burn a Ubuntu Live CD to a USB stick!

Though simple this may sound, in the end it took us almost 3 days to put it together. This article gives an overview of the steps I took to create the USB sticks and how I tested them with </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Why Functional Programming Matters - An exploration of functional Scala - Part 2</title><link>http://day-to-day-stuff.blogspot.com/2010/10/why-functional-programming-matters.html</link><category>scala</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Tue, 05 Oct 2010 12:24:40 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-7498033563175873770</guid><description>package nl.grons.whyfp
import scala.math.abs

/**
A translation of Miranda examples in chapter 4 of the paper
    Why Functional Programming Matters
    by John Hughes, 1984.

    This article is the continuation of
    part 1 - Chapter
    3 examples. I will show you lazy evaluation and how this can be useful.

@author Erik van Oosten
*/
object Chapter4_LazyList {
/*
Chapter 4’s examples make </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>Why Functional Programming Matters - An exploration of functional Scala.</title><link>http://day-to-day-stuff.blogspot.com/2010/09/why-functional-programming-matters.html</link><category>scala</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Thu, 23 Sep 2010 00:44:06 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-7894133147803399811</guid><description>package nl.grons.whyfp
/**
A translation of Miranda examples in the paper
    Why Functional Programming Matters
    by John Hughes, 1984.

@author Erik van Oosten
*/
object WhyFp_Abstract {
/*
Scala is in the focus of attention because it allows a smooth migration from one
    of the most popular programming languages ever to a language that supports
    (among other things) a functional style </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total></item><item><title>Open source - why bother with anything else?</title><link>http://day-to-day-stuff.blogspot.com/2010/08/open-source-why-bother-with-anything.html</link><category>open source</category><category>opinion</category><category>programming philosophy</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:25:24 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-4696658217318491088</guid><description>Since I work in a fine small company where we are breathing open source for at least a decade, it is sometimes weird to be confronted again by open source adversaries or agonists. For example, a colleague wrote a fine technical design based on Mule. All of a sudden we're asked to compare this to BEA AquaLogic and see whether we could implement the project with that. Now this is probably possible,</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Another Wicket course coming up</title><link>http://day-to-day-stuff.blogspot.com/2010/04/another-wicket-course-coming-up.html</link><category>java</category><category>wicket</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Thu, 01 Apr 2010 01:41:56 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-8711711376540029444</guid><description>I'll be doing the public Wicket introduction course from jweekend again on May 27 and 28. For more information see the link above or drop me a note.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Wicket root mounts</title><link>http://day-to-day-stuff.blogspot.com/2010/04/wicket-root-mounts.html</link><category>java</category><category>wicket</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Thu, 01 Apr 2010 01:28:09 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-8324888867249992692</guid><description>Just in case you missed it: I recently wrote an article that shows how to mount pages on the root in Wicket. As a lot of time went into creation the example application I posted the article on my employers blog.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Backup home directory to USB harddisk</title><link>http://day-to-day-stuff.blogspot.com/2009/10/backup-home-directory-to-usb-harddisk.html</link><category>unix</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:27:59 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-6517881008987010441</guid><description>As I am keen to install Ubuntu 9.10 on my work laptop, its time to do an extra backup of my home directory. My mp3 player has about 30 Gb free so I'll use that.

First attempt:cp -R /home/erik /media/H300/Backup/

You wont believe how slow this is! All those little pesky files, we'll need to aggregate them. 

Second attempt:tar -cjf /media/H300/Backup/erik.tar.bz2 /home/erik
Waiting ... waiting .</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Wicket do's and dont's</title><link>http://day-to-day-stuff.blogspot.com/2009/09/wicket-dos-and-donts.html</link><category>open source</category><category>java</category><category>wicket</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Wed, 16 Sep 2009 01:04:54 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-8605085292765205693</guid><description>Just published an article on my employer's blog: Wicket do's and dont's.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Extending my e-mail stack with Roundcube</title><link>http://day-to-day-stuff.blogspot.com/2009/06/extending-my-e-mail-stack-with.html</link><category>open source</category><category>unix</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:29:45 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-2401429074625835492</guid><description>I don't trust anyone with my most precious data: e-mail. That is why I run my own e-mail server. The server runs Ubuntu, Postfix, Dovecot and several tools for spam interception. I access my e-mail from several machines through the IMAP protocol (with TLS). Though any good IMAP client would do it is always Thunderbird (yes, even on my Mac).

It is however not always feasible to have Thunderbird </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>More Wicket filter options</title><link>http://day-to-day-stuff.blogspot.com/2009/05/more-wicket-filter-options.html</link><category>java</category><category>wicket</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:30:17 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-1548747502920430663</guid><description>Wicket has this very clever idea to serve requests from a servlet Filter instead of a Servlet. The brilliance of it is that you can serve pages on the root of your context, but still allow the servlet container to process requests that Wicket has nothing to do with.

By default this works correct automatically. Incoming requests that are not recognized by Wicket are just passed through.

However,</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Simon 2 in beta</title><link>http://day-to-day-stuff.blogspot.com/2009/04/simon-2-in-beta.html</link><category>java</category><category>monitoring</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Mon, 13 Apr 2009 03:49:06 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-3739768968965086096</guid><description>Java Simon, simple java monitoring, version 2 is in beta. I am quite proud of this because firstly the major change in the version was a result of my performance investigations, and secondly it contains my Spring integration code.

See the java simon pages for news, downloads, etc.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Wicket course preparations</title><link>http://day-to-day-stuff.blogspot.com/2009/04/wicket-course-preparations.html</link><category>wicket</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:31:10 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-4819030954188364547</guid><description>Soon I will start teaching Wicket courses in The Netherlands. To prepare I spend some days in London with jWeekend teacher Cemal Bayramoglu (also know for organizing the London Wicket meetups). Most of our time we were at jWeekend's nice classroom, right in the middle of London, with close access to a very nice Thai restaurant, several coffee corners, etc.

The first day we went through the </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Amsterdam Wicket meetup March 24 2009</title><link>http://day-to-day-stuff.blogspot.com/2009/03/amsterdam-wicket-meetup-march-24-2009.html</link><category>java</category><category>conference</category><category>wicket</category><category>scala</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:31:25 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-2870364728379846595</guid><description>The Wicket meetup has finally been given a date and time! March 24 2009, 19:00 - 22:00 in the Mövenpick hotel Amsterdam.

Presentations

Registration (do not register on the page above)</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Reliably sending email with Spring</title><link>http://day-to-day-stuff.blogspot.com/2009/01/reliably-sending-email-with-spring.html</link><category>open source</category><category>java</category><category>networking</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:33:30 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-6214354822319842397</guid><description>Update 2009-09-12: I no longer recommend this library. Please see the comments.

My colleague Allard just pointed me to an old but very useful library: HA-JavaMail.

The email sender that the JVM provides has some serious shortcomings. It does not automatically open a new connection when the connection was closed and you can forward your e-mail to 1 SMTP server only. Furthermore, it is not so </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>Runtime monitoring libraries for Java</title><link>http://day-to-day-stuff.blogspot.com/2009/01/runtime-monitoring-libraries-for-java.html</link><category>open source</category><category>java</category><category>monitoring</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:36:25 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-3731218577052692129</guid><description>Followers of this blog may have noticed an emphasis on monitoring lately. This is because my employer has decided to give me some time to investigate monitoring and create new components to ease the use of monitoring (in particular for Wicket applications). Blogging about the results is one of the requisites of this exercise.

This article lists all open source Java runtime monitoring tools I </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">8</thr:total></item><item><title>Improving Jamon’s performance</title><link>http://day-to-day-stuff.blogspot.com/2009/01/improving-jamons-performance.html</link><category>open source</category><category>java</category><category>monitoring</category><category>concurrency</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:39:41 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-2684790941784562755</guid><description>I was browsing through Jamon’s code to see why it is so much slower under high contention then Simon (see my previous article). In this article I will present these differences and show you a way to speed up Jamon right now.

Differences
Jamon has more features then Simon like listeners and data ranges. This obviously need some computing, if only to see if they are used. Another interesting </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>‘Effective Wicket’ presentation now on Vimeo</title><link>http://day-to-day-stuff.blogspot.com/2009/01/effective-wicket-presentation-now-on.html</link><category>java</category><category>conference</category><category>wicket</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Mon, 01 Nov 2010 11:19:09 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-3188476353738527901</guid><description>My Effective Wicket talk on NL-JUG’s J-Fall conference of 2008-11-12 is now online! Watch the presentation (Dutch spoken) on Vimeo: part 1 and part 2 (provided by bachelor-ict.nl).

Feel free to download the slides of Effective Wicket (mirror) (PDF 4.1 Mb). If you want to see the notes skip to page 55.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Evaluating Simon - Java monitoring</title><link>http://day-to-day-stuff.blogspot.com/2008/12/evaluating-simon.html</link><category>open source</category><category>java</category><category>monitoring</category><category>concurrency</category><author>noreply@blogger.com (Erik van Oosten)</author><pubDate>Sun, 22 Aug 2010 05:51:59 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-27876765.post-5654132183612571496</guid><description>Recently a new monitoring kid appeared on the block: Java Simon (not to be confused with Dejal's Simon or some other simons).

Simon claims to be the successor of JAMon. As I just started a project to improve the documentation of Jamon, and integrate this better with Wicket projects, I thought this would be a good time to evaluate Simon and also to compare it to Jamon. Here are the results.

</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item></channel></rss>

