<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>juretta.com</title>
    <link>http://www.juretta.com/</link>
    <description>juretta.com: Recent entries</description>
    <language>en-us</language>
    <ttl>40</ttl>
    <creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/juretta" type="application/rss+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><item>
      <title>URI-Template gem released</title>
      <description>&lt;p&gt;
URITemplate is a parser for URI Templates as defined in the URI Template specification (http://bitworking.org/projects/URI-Templates).
&lt;/p&gt;

&lt;blockquote cite="http://bitworking.org/projects/URI-Templates/"&gt;
URI Templates are strings that contain embedded variables that are transformed into URIs after embedded variables are substituted. This specification defines the structure and syntax of URI Templates.
&lt;/blockquote&gt;

&lt;p&gt;
A simple example shows the usage:
&lt;code&gt;http://example.com/search?q={searchTerms}&amp;num={count}&lt;/code&gt; can be expanded to
&lt;/p&gt;

&lt;pre&gt;http://example.com/search?q=hello%20world&amp;num=5
http://example.com/search?q=ruby&amp;num=100
&lt;/pre&gt;

&lt;p&gt;
by supplying different variables for &lt;code&gt;searchTerms&lt;/code&gt; and &lt;code&gt;count&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://bitworking.org/projects/URI-Templates/"&gt;http://bitworking.org/projects/URI-Templates/&lt;/a&gt; is the homepage of the current draft.
&lt;a href="http://code.google.com/p/uri-templates/"&gt;http://code.google.com/p/uri-templates/&lt;/a&gt; hosts the current reference implementation in Python.
&lt;p&gt;


Install the Ruby gem:
&lt;pre class="shell"&gt;
macbook-pro:~ stefan$ sudo gem install uri-templates
&lt;/pre&gt;


&lt;strong&gt;Treetop - go look at it&lt;/strong&gt;
&lt;p&gt;
After playing around with &lt;a href="http://www.cs.queensu.ca/~thurston/ragel/"&gt;Ragel&lt;/a&gt; and &lt;a href="http://www.antlr.org/"&gt;ANTLR&lt;/a&gt; I decided to use the excellent &lt;a href="http://treetop.rubyforge.org/"&gt;Treetop (Parsing expression grammar implementation)&lt;/a&gt; to implement the URI template specification. Although the draft explicitly states that you do not need a full full-fledged parser, Treetop made it really easy to implement just that.
&lt;/p&gt;

&lt;p&gt;
Get the source:
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-pro:~ stefan$ git clone git://scm.juretta.com/uri-templates.git
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=iNNgrNF"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=iNNgrNF" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=q4NbZuF"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=q4NbZuF" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=JUsvLKF"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=JUsvLKF" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/254899473" height="1" width="1"/&gt;</description>
      <pubDate>Sat, 15 Mar 2008 08:20:00 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2008/03/15/uri-template_gem_released/#180</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/254899473/</link>
    <feedburner:origLink>http://www.juretta.com/log/2008/03/15/uri-template_gem_released/#180</feedburner:origLink></item>
    <item>
      <title>New Zealand Daylight Saving Time Change: Mac OS X and Java</title>
      <description>It appears that Apple missed the new rules for Daylight Saving Time (DST) in New Zealand in even the most recent versions of Mac OS X 10.4 Tiger. 

&lt;blockquote cite="http://www.dia.govt.nz/diawebsite.nsf/wpg_URL/Services-Daylight-Saving-Index"&gt;
&lt;strong&gt;From this year [2007]&lt;/strong&gt;, Daylight Saving will run for a period of 27 weeks. It now commences from the last Sunday in September, when 2.00am becomes 3.00am, and ends on the first Sunday in April the following year, when 3.00am becomes 2.00am. 
&lt;/blockquote&gt;

&lt;p&gt;
Mac OS X still thinks that the Daylight Saving time starts on Oct. 7th.
&lt;/p&gt;

&lt;p&gt;
The &lt;a href="http://docs.info.apple.com/article.html?artnum=306486"&gt;knowledgebase entry&lt;/a&gt; is rather disappointing
&lt;/p&gt;

&lt;blockquote cite="http://docs.info.apple.com/article.html?artnum=306486"&gt;
Deselect (uncheck) 'Set Date &amp; Time automatically' if it's enabled.
&lt;br /&gt;
Manually set the correct time.
&lt;/blockquote&gt;

&lt;p&gt;
A better approach is to update the timezone database that is used to compute the correct time for your timezone in relation to UTC (Read &lt;a href="http://en.wikipedia.org/wiki/Time_zone"&gt;more&lt;/a&gt;):
&lt;br /&gt;
&lt;code&gt;GMT_TIME + LOCAL_TIME_ZONE_OFFSET + DST_OFFSET.&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
First check if you have to update the timezone information (assuming you have selected NZST/NZDT as your local timezone):
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-pro:~ stefan$ zdump -v /etc/localtime | grep 2007
/etc/localtime Sat Mar 17 13:59:59 2007 UTC = Sun Mar 18 02:59:59 2007 NZDT isdst=1 
/etc/localtime Sat Mar 17 14:00:00 2007 UTC = Sun Mar 18 02:00:00 2007 NZST isdst=0 
/etc/localtime Sat Oct 6 13:59:59 2007 UTC = Sun Oct 7 01:59:59 2007 NZST isdst=0 
/etc/localtime Sat Oct 6 14:00:00 2007 UTC = Sun Oct 7 03:00:00 2007 NZDT isdst=1
&lt;/pre&gt;

&lt;p&gt;
This shows that the Mac thinks that the daylight saving time (NZDT) will start on Sun Oct 7. &lt;strong&gt;That's wrong&lt;/strong&gt;.
&lt;/p&gt;

&lt;p&gt;
To update the Mac OS X timezone database download the latest tzdata2007_.tar.gz from ftp://elsie.nci.nih.gov/pub/. As of Oct 1 it's ftp://elsie.nci.nih.gov/pub/tzdata2007h.tar.gz
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-pro:~ stefan$ curl -O ftp://elsie.nci.nih.gov/pub/tzdata2007h.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  158k  100  158k    0     0   4851      0  0:00:33  0:00:33 --:--:--  7928
&lt;/pre&gt;

Extract the archive and run the &lt;code&gt;zic&lt;/code&gt; timezone compiler

&lt;pre class="shell"&gt;
macbook-pro:~ stefan$ mkdir tzdata; tar -xvzf tzdata2007h.tar.gz -C tzdata
macbook-pro:~ stefan$ cd tzdata; sudo zic australasia
&lt;/pre&gt;

&lt;p&gt;
You might want to reboot the system to enable the new timezone information.
&lt;/p&gt;


Check again:
&lt;pre class="shell"&gt;
macbook-pro:~ stefan$ zdump -v /etc/localtime | grep 2007
/etc/localtime  Sat Mar 17 13:59:59 2007 UTC = Sun Mar 18 02:59:59 2007 NZDT isdst=1
/etc/localtime  Sat Mar 17 14:00:00 2007 UTC = Sun Mar 18 02:00:00 2007 NZST isdst=0
/etc/localtime  Sat Sep 29 13:59:59 2007 UTC = Sun Sep 30 01:59:59 2007 NZST isdst=0
/etc/localtime  Sat Sep 29 14:00:00 2007 UTC = Sun Sep 30 03:00:00 2007 NZDT isdst=1
&lt;/pre&gt;

&lt;strong&gt;Java Update&lt;/strong&gt;&lt;br /&gt;
&lt;p&gt;
The JRE uses it's one timezone database (unfortunately). We need to update this information as well.
&lt;/p&gt;

&lt;p&gt;
Got to &lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;http://java.sun.com/javase/downloads/index.jsp&lt;/a&gt; and get the &lt;strong&gt;JDK DST Timezone Update Tool - 1.2.2&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Expand the archive and run the tzupdater.jar: &lt;code&gt;sudo java -Djava.vendor="Sun Microsystems Inc." -jar tzupdater.jar -v -u &lt;/code&gt;
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-pro:~ stefan$ sudo java -Djava.vendor="Sun Microsystems Inc." -jar tzupdater.jar -v -u 
Password:
java.home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
java.vendor: Sun Microsystems Inc.
java.version: 1.6.0-dp
JRE time zone data version: tzdata2006a
Embedded time zone data version: tzdata2007g
Extracting files... done.
Renaming directories... done.
Validating the new time zone data... done.
Time zone data update is complete.
&lt;/pre&gt;

Quick check:
&lt;pre class="code"&gt;
Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("Pacific/Auckland"));
cal.setTimeInMillis(new Date().getTime());	
System.out.format("%1$tT (%1$tB %1$td %1$tY)", cal, new Locale("de", "DE"));
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=LB54LmC"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=LB54LmC" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=UDcOF4C"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=UDcOF4C" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=xY3aFbC"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=xY3aFbC" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/194165635" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 5 Oct 2007 02:18:00 +0200</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/10/05/new_zealand_daylight_saving_time_change_mac_os_x_and_java/#179</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/194165635/</link>
    <feedburner:origLink>http://www.juretta.com/log/2007/10/05/new_zealand_daylight_saving_time_change_mac_os_x_and_java/#179</feedburner:origLink></item>
    <item>
      <title>javap</title>
      <description>&lt;blockquote&gt;
The  javap  command  disassembles  a  Java(tm) class file.  The options
       determine the output.  If no options are used,  javap  prints  out  the
       package, protected, and public fields and methods of the classes passed
       to it.  The javap command displays its output to stdout. 
&lt;/blockquote&gt;

Usage: 
&lt;pre class="shell"&gt;
macbook-pro:~ stefan$ javap -private java.util.Calendar
Compiled from "Calendar.java"
public abstract class java.util.Calendar extends java.lang.Object implements java.io.Serializable,java.lang.Cloneable,java.lang.Comparable{
    public static final int ERA;
    public static final int YEAR;
    public static final int MONTH;
    public static final int WEEK_OF_YEAR;
    public static final int WEEK_OF_MONTH;
    public static final int DATE;
    public static final int DAY_OF_MONTH;
    public static final int DAY_OF_YEAR;
    public static final int DAY_OF_WEEK;
    public static final int DAY_OF_WEEK_IN_MONTH;
    public static final int AM_PM;
    public static final int HOUR;
    public static final int HOUR_OF_DAY;
    public static final int MINUTE;
    public static final int SECOND;
    public static final int MILLISECOND;
    public static final int ZONE_OFFSET;
    public static final int DST_OFFSET;
    public static final int FIELD_COUNT;
    public static final int SUNDAY;
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=Z68pIKC"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=Z68pIKC" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=UmIoTrC"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=UmIoTrC" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=qvC9OKC"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=qvC9OKC" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/194165636" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 4 Oct 2007 20:03:00 +0200</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/10/04/javap/#178</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/194165636/</link>
    <feedburner:origLink>http://www.juretta.com/log/2007/10/04/javap/#178</feedburner:origLink></item>
    <item>
      <title>List open ports on your machine (Mac OS X)</title>
      <description>&lt;p&gt;
netstat on Mac OS X is not what you might be used to on a linux machine (there you can use &lt;code&gt;netstat -atp | grep -i "listen"&lt;/code&gt;). To show all open ports applications on your machine are listening to you can use this workaround:
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook:~ sudo lsof -i -P | grep -i "listen"
netinfod    33    root    7u  IPv4 0x3f76e08      0t0    TCP localhost:1033 (LISTEN)
AppleFile  142    root   29u  IPv6 0x3973c50      0t0    TCP *:548 (LISTEN)
AppleFile  142    root   30u  IPv4 0x3f76018      0t0    TCP *:548 (LISTEN)
mysqld     175   mysql   11u  IPv4 0x415c018      0t0    TCP *:3306 (LISTEN)
slpd       214    root    2u  IPv4 0x415c710      0t0    TCP *:427 (LISTEN)
eclipse    277 stefans   23u  IPv6 0x39733a0      0t0    TCP *:8118 (LISTEN)
eclipse    277 stefans   25u  IPv6 0x3973a24      0t0    TCP *:49372 (LISTEN)
eclipse    277 stefans   27u  IPv6 0x51d20e0      0t0    TCP *:6836 (LISTEN)
eclipse    277 stefans   29u  IPv6 0x51d2764      0t0    TCP *:14685 (LISTEN)
cupsd      279    root    0u  IPv4 0x3f75c9c      0t0    TCP localhost:631 (LISTEN)
java      1037 stefans    7u  IPv6 0x3972d1c      0t0    TCP *:1527 (LISTEN)
java      1052 stefans    9u  IPv6 0x3971538      0t0    TCP *:49979 (LISTEN)
java      1052 stefans   15u  IPv6 0x3972f48      0t0    TCP *:44441 (LISTEN)
java      1052 stefans   23u  IPv6 0x51d4174      0t0    TCP *:49987 (LISTEN)
java      1118 stefans   12u  IPv6 0x51d3240      0t0    TCP *:50055 (LISTEN)
java      1118 stefans   38u  IPv6 0x568f3a0      0t0    TCP *:50061 (LISTEN)
java      1118 stefans   48u  IPv4 0x3f76394      0t0    TCP *:8000 (LISTEN)
java      3422 stefans   11u  IPv6 0x5a28de8      0t0    TCP *:51669 (LISTEN)
java      3422 stefans   13u  IPv6 0x6111990      0t0    TCP *:8080 (LISTEN)
java      3422 stefans   14u  IPv6 0x56af764      0t0    TCP *:8443 (LISTEN)
java      3422 stefans   37u  IPv6 0x5f69764      0t0    TCP *:51672 (LISTEN)
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=YDMjiWyl"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=YDMjiWyl" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=A7Sb0x2u"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=A7Sb0x2u" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=XI97fLLy"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=XI97fLLy" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/142294235" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 8 Aug 2007 10:28:00 +0200</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/08/08/list_open_ports_on_your_machine_mac_os_x_/#177</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/142294235/</link>
    <feedburner:origLink>http://www.juretta.com/log/2007/08/08/list_open_ports_on_your_machine_mac_os_x_/#177</feedburner:origLink></item>
    <item>
      <title>Monitoring network traffic with ngrep</title>
      <description>&lt;p&gt;

There are many tools to monitor network traffic.
Wading through lines and lines of tcpdump output can be cumbersome sometimes.
ngrep to the rescue. From their website:
&lt;/p&gt;

&lt;blockquote cite="http://ngrep.sourceforge.net/"&gt;
ngrep strives to provide most of GNU grep's common features, applying them to the network layer.
&lt;/blockquote&gt;

&lt;p&gt;
To install ngrep on a Mac OS X machine you can use the &lt;code&gt;port&lt;/code&gt; command if you have &lt;a href="http://darwinports.com/"&gt;darwinports&lt;/a&gt; installed.
&lt;/p&gt;

&lt;div class="shell"&gt;macbook:~ sudo port install ngrep
&lt;/div&gt;

To monitor network traffic using the htt protocol use the following command:

&lt;div class="shell"&gt;macbook:~ sudo ngrep -d en0 -W byline port 80

##
T 66.35.250.209:80 -&gt; 10.200.1.40:50710 [AP]
HTTP/1.1 200 OK.
Date: Fri, 27 Jul 2007 13:45:05 GMT.
Server: Apache/1.3.33 (Unix) PHP/4.3.10.
Last-Modified: Tue, 28 Nov 2006 13:54:21 GMT.
ETag: "219bab-160c-456c3f8d".
Accept-Ranges: bytes.
Content-Length: 5644.
Connection: close.
Content-Type: text/html.
[...]
&lt;/div&gt;

&lt;p&gt;
To monitor the traffic to a certain host include the host information:
&lt;/p&gt;

&lt;div class="shell"&gt;macbook:~ sudo ngrep -d en0 -W byline host google.com
&lt;/div&gt;

&lt;p&gt;
&lt;em&gt;Hint use &lt;code&gt;ifconfig&lt;/em&gt; to figure out which device to use (in my case it is en0, it might be eth0 for example on your machine).
&lt;/p&gt;

&lt;p&gt;
Ngrep homepage: &lt;a href="http://ngrep.sourceforge.net/"&gt;http://ngrep.sourceforge.net/&lt;/a&gt;
&lt;br /&gt;
For usage information you can find more information here: &lt;a href="http://ngrep.sourceforge.net/usage.html"&gt;http://ngrep.sourceforge.net/usage.html&lt;/a&gt;.
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=ADBU7c6A"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=ADBU7c6A" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=hyNJuJx9"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=hyNJuJx9" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=vp8gXVhK"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=vp8gXVhK" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/138098310" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 27 Jul 2007 06:30:00 +0200</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/07/27/monitoring_network_traffic_with_ngrep/#175</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/138098310/</link>
    <feedburner:origLink>http://www.juretta.com/log/2007/07/27/monitoring_network_traffic_with_ngrep/#175</feedburner:origLink></item>
    <item>
      <title>Google Developer Day 2007 Hamburg</title>
      <description>Today is &lt;a href="http://code.google.com/events/developerday/"&gt;Google Developer Day&lt;/a&gt; in 10 cities around the world. 
I have the pleasure to attend the Hamburg, Germany conference. 
During the keynote in Australia the following new features were announced:
&lt;ul&gt;
&lt;li&gt;Google releases Google Gears: &lt;a href="http://gearsblog.blogspot.com/2007/05/posted-by-aaron-boodman-and-erik.html"&gt;Today&lt;/a&gt; google released a new offline webapplication engine called &lt;a href="http://gears.google.com/"&gt;Google Gears&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;New Maps feature: Mapplets - Developer Preview: &lt;a href="http://maps.google.com/preview"&gt;http://maps.google.com/preview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Google Maps now supports &lt;a href="http://googlemapsapi.blogspot.com/2007/05/driving-directions-support-added-to.html"&gt;DrivingDirections&lt;/a&gt;!&lt;/li&gt;
&lt;/ul&gt;                                                                     
                     
Google Developer Day 2007 links:
&lt;ul&gt;
	&lt;li&gt;Developer Day &lt;a href="http://code.google.com/events/developerday/webcast-schedule.html"&gt;Webcast Schedule&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Photos: &lt;a href="http://picasaweb.google.com/developerday"&gt;Picasa&lt;/a&gt;, &lt;a href="http://flickr.com/search/?q=gdd07"&gt;Flickr&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Maps API &lt;a href="http://gdd2007.mapsapi.googlepages.com/"&gt;Workshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://googledeveloperday2007-de.blogspot.com/2007/05/willkommen-auf-der-offiziellen-homepage.html"&gt;Blog  Session Hamburg&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

to be updated soon...&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=Wir9nMUg"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=Wir9nMUg" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=psUEgrUe"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=psUEgrUe" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=sQ2TDUhm"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=sQ2TDUhm" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/121184264" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 31 May 2007 10:08:00 +0200</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/05/31/google_developer_day_2007_hamburg/#173</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/121184264/</link>
    <feedburner:origLink>http://www.juretta.com/log/2007/05/31/google_developer_day_2007_hamburg/#173</feedburner:origLink></item>
    <item>
      <title>svn: Can't convert string from 'UTF-8' to native encoding:</title>
      <description>Filenames containing "special characters" can cause an annoying Subversion error message:
&lt;pre class="shell"&gt;
svn: Can't convert string from 'UTF-8' to native encoding:
&lt;/pre&gt;

From the subversion book:
&lt;blockquote cite="http://svnbook.red-bean.com/en/1.2/svn.advanced.l10n.html"&gt;
Errors like this typically occur when the Subversion client has received a UTF-8 string from the repository, but not all of the characters in that string can be represented using the encoding of the current locale. For example, if your locale is en_US but a collaborator has committed a Japanese filename, you're likely to see this error when you receive the file during an svn update.
&lt;/blockquote&gt;

To fix this error message you have to set your current locale appropriately:
&lt;pre class="shell"&gt;
macbook:~ stefan$ export LC_CTYPE=en_US.UTF-8
macbook:~ stefan$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL="C/en_US.UTF-8/C/C/C/C"
macbook:~ stefan$ svn update
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=hRTuQhUT"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=hRTuQhUT" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=t4ztDt6h"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=t4ztDt6h" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=EmbDQjYz"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=EmbDQjYz" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/115398119" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 9 May 2007 09:09:00 +0200</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/05/09/svn_can_t_convert_string_from_utf-8_to_native_encoding_/#172</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/115398119/</link>
    <feedburner:origLink>http://www.juretta.com/log/2007/05/09/svn_can_t_convert_string_from_utf-8_to_native_encoding_/#172</feedburner:origLink></item>
    <item>
      <title>Loading the Netflix Dataset into MySQL</title>
      <description>&lt;p&gt;
I just couldn't resist. The by now well known &lt;a href="http://netflixprize.com/"&gt;Netflix Prize&lt;/a&gt; is a great opportunity to do a little bit research about &lt;a href="http://en.wikipedia.org/wiki/Recommendation_system"&gt;recommendation engines (recommender)&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
I decided to use a plain MySQL 5 database to store the Netflix dataset even though the common wisdom seems to believe that a database isn't the best solution for this problem.
&lt;/p&gt;

&lt;p&gt;
But first things first. I needed to import the data into the database and i'm going to describe a really fast way to import the Netflix data set.
&lt;/p&gt;

&lt;p&gt;
The training_set directory contains 17770 files with movie ratings. 
Each filename contains the movie id (mv_0009569.txt is the ratings file for the movie with the id 9569). I did a quick check to ensure that the movie ids contained in the file are matching the movie ids contained in the filename. They do match - so when can skip the first line of each ratings file.
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the necessary tables to hold the training data (ratings) and movie titles.&lt;/li&gt;
&lt;li&gt;Insert the movie titles using simple INSERT statements (Fast enough for 17770 titles)&lt;/li&gt;
&lt;li&gt;Insert the movie ratings by using the &lt;code&gt;LOAD DATA INFILE&lt;/code&gt; statements for each of the 17770 rating files in the training_set directory.&lt;/li&gt;
&lt;li&gt;Optional: Create one or more indices (may take a while to create!)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
&lt;a href="http://attachr.com/private/04695bc398a1a9af7172d2001d68965f/download"&gt;Download the script here&lt;/a&gt;
&lt;/p&gt;

&lt;pre class="ruby"&gt;
#!/usr/bin/env ruby
#
#  Created by Stefan Saasen on 2007-04-24.
#  Copyright (c) 2007. All rights reserved.
require 'dbi'           
# Configuration
DB_DATABASE   = 'netflix'
DB_USER       = 'YOUR DB USERNAME'
DB_PASSWORD   = 'YOUR DB PASSWORD'
               
# Directory with netflix dataset
NETFLIX_DOWNLOAD_DIR = File.join(File.dirname(__FILE__), "..", "..", "download")

NETFLIX_MOVIE_TITLES = File.join(NETFLIX_DOWNLOAD_DIR, "movie_titles.txt")
NETFLIX_TRAINING_SET = File.join(NETFLIX_DOWNLOAD_DIR, "training_set")

# Profile...
start = Time.now

# Connect to the MySQL database
DBI.connect("DBI:Mysql:#{DB_DATABASE}", DB_USER, DB_PASSWORD) do |dbh|
  # create the necessary tables
  stmts = DATA.read.split(";").delete_if{|stmt| stmt.strip.empty?}
  stmts.each do |stmt|
    # Execute the current SQL statement
    dbh.do(stmt)
  end
  
  # 1. Insert movie titles into movie_titles table using simple INSERT STATEMENTS
  sql = "INSERT INTO movie_titles (id, year_of_release, title) VALUES(?,?,?)"
  # It would be even more efficient to use INSERT statements that 
  # use VALUES syntax which can insert multiple rows. 
  # e.g. INSERT INTO movie_titles (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
  dbh.prepare(sql) do |sth|
    File.open(NETFLIX_MOVIE_TITLES) do |f|
       f.each do |line|
         # Execute the prepared INSERT Statement
         id, year_of_release, title = line.split(",")
         sth.execute id.to_i, year_of_release.strip, title.strip
       end
    end
  end
  
  # 2. Insert rating data from training_set using the fast LOAD DATA INFILE syntax
  # The filename contains the movie id! Skip the first line (IGNORE 1 LINES)
  sql = "LOAD DATA INFILE ? INTO TABLE ratings FIELDS TERMINATED BY ',' "+
        "IGNORE 1 LINES (customer_id, rating, date) SET movie_id = ?;"
  dbh.prepare(sql) do |sth|
    Dir[NETFLIX_TRAINING_SET + "/*.txt"].each do |trs_file|
      puts "Importing #{trs_file}..."
      if trs_file =~ /([0-9]+)\.txt$/
        movie_id = $1.dup.to_i 
      else
        raise "Missing movie_id (file: #{trs_file})"
      end
      # Execute the prepared statement using the .txt file and the movie_id
      sth.execute File.expand_path(trs_file), movie_id
    end
  end
  
  # Add index for certain columns
  #puts "Creating index on the ratings table - may take a while"
  #["CREATE INDEX mid_idx ON ratings (...)", "CREATE INDEX cid_idx ON ..."].each{|stmt| dbh.do(stmt)}             
end
puts "Import successfully finished!\n"
puts "The netflix data import took #{sprintf("%0.2f", (Time.now - start)/60.0)} minutes"

__END__
DROP DATABASE IF EXISTS netflix;
CREATE DATABASE netflix /*!40100 DEFAULT CHARACTER SET latin1 */;
USE netflix;

DROP TABLE IF EXISTS `movie_titles`;
CREATE TABLE `movie_titles` (
  `id` int(11) NOT NULL,
  `year_of_release` YEAR(4) default NULL,
  `title` VARCHAR(250),
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `ratings`;
CREATE TABLE `ratings` (
  `id` int(11) NOT NULL auto_increment,
  `movie_id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `date` date default NULL,
  `rating` int(1),
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=giiksMXN"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=giiksMXN" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=dDEaSea2"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=dDEaSea2" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=U2NgZEEI"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=U2NgZEEI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/113400617" height="1" width="1"/&gt;</description>
      <pubDate>Tue, 24 Apr 2007 17:59:00 +0200</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/04/24/loading_the_netflix_dataset_into_mysql/#171</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/113400617/</link>
    <feedburner:origLink>http://www.juretta.com/log/2007/04/24/loading_the_netflix_dataset_into_mysql/#171</feedburner:origLink></item>
    <item>
      <title>Attachr.com: OpenID support added</title>
      <description>Attachr.com now supports OpenID. You can add an OpenID to your existing account. New users can signup using an OpenID.


Read more about &lt;a href="http://openid.net/"&gt;OpenID&lt;/a&gt;. Create an &lt;a href="http://attachr.com/signup/openid"&gt;account at attachr.com&lt;/a&gt;.&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=ENGtQ0sa"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=ENGtQ0sa" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=2PILzMr4"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=2PILzMr4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=O0u1WbEI"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=O0u1WbEI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/113400618" height="1" width="1"/&gt;</description>
      <pubDate>Sun, 22 Apr 2007 08:47:00 +0200</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/04/22/attachr_com_openid_support_added/#170</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/113400618/</link>
    <feedburner:origLink>http://www.juretta.com/log/2007/04/22/attachr_com_openid_support_added/#170</feedburner:origLink></item>
    <item>
      <title>undefined method `refresh' for #&lt;Hash</title>
      <description>Are you getting the following error while trying to use the "gem" command?

&lt;pre&gt;
undefined method `refresh' for #&amp;lt;Hash...
&lt;/pre&gt;

&lt;strong&gt;Solution: Delete your source_cache files!&lt;/strong&gt; 
&lt;p&gt;
These files are located in your local ~/.gem and in your system gem directory. 
&lt;/p&gt;

&lt;p&gt;
You can print your system gem directory using the "gem env g" command.
&lt;/p&gt;
&lt;pre class="shell"&gt;
powermac:~ sts$ gem env g
/usr/local/lib/ruby/gems/1.8
&lt;/pre&gt;


&lt;div class="notice"&gt;
You might want to run: &lt;code&gt;[sudo] gem update --system&lt;/code&gt; in order to get the latest rubygems release.
&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=SfcfA5Gg"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=SfcfA5Gg" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=WVeUYfyQ"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=WVeUYfyQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=hXXX1bMc"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=hXXX1bMc" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/113400620" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 13 Apr 2007 13:35:00 +0200</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/04/13/undefined_method_refresh_for_hash/#169</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/113400620/</link>
    <feedburner:origLink>http://www.juretta.com/log/2007/04/13/undefined_method_refresh_for_hash/#169</feedburner:origLink></item>
    <item>
      <title>Attachr.com: New languages added</title>
      <description>As of today attachr.com now supports the following additional languages:

&lt;ol&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Clipper_programming_language"&gt;Clipper&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.rexxla.org/About_Rexx/"&gt;Rexx&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Oberon_programming_language"&gt;Oberon&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.fortran.com/"&gt;FORTRAN 77/Fortran 90/95&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.lispworks.com/documentation/HyperSpec/Front/Contents.htm"&gt;Lisp&lt;/a&gt; and&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://pike.ida.liu.se/"&gt;Pike&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
Examples: &lt;a href="http://attachr.com/7477"&gt;Rexx&lt;/a&gt;, &lt;a href="http://attachr.com/7478"&gt;Oberon&lt;/a&gt; and &lt;a href="http://attachr.com/7479"&gt;Clipper&lt;/a&gt;.
&lt;/p&gt;


&lt;p&gt;
A comprehensive list of languages that are supported can be found here: &lt;a href="http://attachr.com/attachr/supported_languages"&gt;http://attachr.com/attachr/supported_languages&lt;/a&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=LTLRMT0E"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=LTLRMT0E" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=c2AWCG8y"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=c2AWCG8y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=8lWtAciM"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=8lWtAciM" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/102636361"/&gt;</description>
      <pubDate>Sun, 18 Mar 2007 19:14:10 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/03/18/attachr_com_new_languages_added/#167</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/102636361/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/03/18/attachr_com_new_languages_added/#167</feedburner:origLink></item>
    <item>
      <title>nl -- line numbering filter</title>
      <description>&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ nl `which attachr`
     1  #!/usr/bin/env ruby
     2  #
     3  # This file was generated by RubyGems.
     4  #
     5  # The application 'attachr' is installed as part of a gem, and
     6  # this file is here to facilitate running it. 
     7  #
      
     8  require 'rubygems'
     9  version = "&amp;gt; 0"
    10  if ARGV.size &amp;gt; 0 &amp;&amp; ARGV[0][0]==95 &amp;&amp; ARGV[0][-1]==95
    11    if Gem::Version.correct?(ARGV[0][1..-2])
    12      version = ARGV[0][1..-2] 
    13      ARGV.shift
    14    end
    15  end
    16  require_gem 'attachr', version
    17  load 'attachr'
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=xPUoWl1V"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=xPUoWl1V" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=dNEfyI61"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=dNEfyI61" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=tyQh6Hiz"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=tyQh6Hiz" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/113400621" height="1" width="1"/&gt;</description>
      <pubDate>Wed, 21 Feb 2007 20:32:07 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/02/21/nl_line_numbering_filter/#165</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/113400621/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/02/21/nl_line_numbering_filter/#165</feedburner:origLink></item>
    <item>
      <title>List image dimensions</title>
      <description>Install &lt;a href="http://www.imagemagick.org/"&gt;Imagemagick&lt;/a&gt; (you might want to use &lt;code&gt;sudo port install imagemagick&lt;/code&gt; on a Mac).

&lt;pre class="shell"&gt;
Welcome to Darwin!
macbook-sts:~ stefan$ cd ~/images/
macbook-sts:~ stefan$ for i in $(ls); do identify $i | \
    awk '{print $1 " -&gt; " $3}'; done
next_plus.gif -&gt; 40x40
nextlabel.gif -&gt; 63x32
prev.gif -&gt; 45x45
prev_chevron.png -&gt; 40x40
prev_img.gif -&gt; 16x16
prev_minus.gif -&gt; 40x40
prevlabel.gif -&gt; 63x32
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=uNREQGdD"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=uNREQGdD" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=roNO6Sop"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=roNO6Sop" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=XImgFbaj"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=XImgFbaj" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/113400622" height="1" width="1"/&gt;</description>
      <pubDate>Tue, 20 Feb 2007 11:05:16 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/02/20/list_image_dimensions/#164</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/113400622/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/02/20/list_image_dimensions/#164</feedburner:origLink></item>
    <item>
      <title>Using Ant-style properties in Spring Bean configuration files</title>
      <description>&lt;p&gt;
Being a long time ant user i always wanted to use Ant-style properties in my Spring bean definitions. And no surprise here - this is quite easy to accomplish.
&lt;/p&gt;

&lt;p&gt;
Spring has the &lt;code&gt;PropertyPlaceholderConfigurer&lt;/code&gt; class which takes a Java properties file and replaces ${} placeholders in your XML based bean definition files.
&lt;/p&gt;

&lt;p&gt;
A very simple examples shows how to use the property placeholders.
&lt;/p&gt;

&lt;p&gt;
This is the directory layout in my java source folder:
&lt;/p&gt;
&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ dP src 
src
  \-com
    \-juretta
      \-spring
        \-example:
          MyBean.java
src
  \-example:
    Runner.java
.
  beans.xml
  configuration.properties 
lib:
  commons-logging.jar
  spring.jar
&lt;/pre&gt;

&lt;p&gt;
You will need the spring.jar and at least commons-logging.jar to successfully compile and run this very simple example. You are advised to download the spring-framework-with-dependencies zip file as it contains every library you might need. You can get the Spring framework &lt;a href="http://www.springframework.org/download"&gt;here&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
The simple example has only one Spring bean. The Spring bean has one String property that will be set through spring dependency injection. For this property a property placeholder will be used.
&lt;/p&gt;

&lt;p&gt;
Files used in this example: a Pojo Bean "com.juretta.spring.example.MyBean", a Runner class (example.Runner), the xml bean definition file (beans.xml) and a simple property file "configuration.properties"
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ cat src/configuration.properties 
# An example path
conf.path=/usr/local/tomcat/conf
&lt;/pre&gt;


&lt;p&gt;
&lt;strong&gt;src/beans.xml&lt;/strong&gt;
&lt;/p&gt;
&lt;div class="xml code"&gt;&lt;pre&gt;
&lt;span class="punct"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="tag"&gt;xml&lt;/span&gt; &lt;span class="attribute"&gt;version&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;1.0&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;encoding&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;UTF-8&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;?&amp;gt;&lt;/span&gt;

&lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;beans&lt;/span&gt; &lt;span class="attribute"&gt;xmlns&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;http://www.springframework.org/schema/beans&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;
	&lt;span class="namespace"&gt;xmlns&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt;&lt;span class="attribute"&gt;xsi&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;
	&lt;span class="namespace"&gt;xsi&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt;&lt;span class="attribute"&gt;schemaLocation&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-2.0.xsd&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&lt;/span&gt;

	&lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;bean&lt;/span&gt; &lt;span class="attribute"&gt;id&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;propertyPlaceholder&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;
		&lt;span class="attribute"&gt;class&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;org.springframework.beans.factory.\
                  config.PropertyPlaceholderConfigurer&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&lt;/span&gt;
		&lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;property&lt;/span&gt; &lt;span class="attribute"&gt;name&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;location&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; 
                 &lt;span class="attribute"&gt;value&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;classpath:configuration.properties&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="punct"&gt;/&amp;gt;&lt;/span&gt;

	&lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;bean&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;

	&lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;bean&lt;/span&gt; &lt;span class="attribute"&gt;id&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;myBean&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;class&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;com.juretta.spring.example.MyBean&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&lt;/span&gt;
		&lt;span class="punct"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag"&gt;property&lt;/span&gt; &lt;span class="attribute"&gt;name&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;configurationPath&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="attribute"&gt;value&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;${conf.path}&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="punct"&gt;/&amp;gt;&lt;/span&gt;

	&lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;bean&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="punct"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag"&gt;beans&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;
The single bean has just a setter and getter for one string property.
&lt;strong&gt;src/com/juretta/spring/example/MyBean.java&lt;/strong&gt;
&lt;/p&gt;
&lt;pre class="java code"&gt;
&lt;span class="kwa"&gt;package&lt;/span&gt; com&lt;span class="sym"&gt;.&lt;/span&gt;juretta&lt;span class="sym"&gt;.&lt;/span&gt;spring&lt;span class="sym"&gt;.&lt;/span&gt;example&lt;span class="sym"&gt;;&lt;/span&gt;

&lt;span class="com"&gt;/**&lt;/span&gt;
&lt;span class="com"&gt; * &amp;#64;author Stefan Saasen &amp;lt;s&amp;#64;juretta.com&amp;gt;&lt;/span&gt;

&lt;span class="com"&gt; */&lt;/span&gt;
&lt;span class="kwa"&gt;public class&lt;/span&gt; MyBean &lt;span class="sym"&gt;{&lt;/span&gt;
	&lt;span class="kwa"&gt;private&lt;/span&gt; &lt;span class="kwc"&gt;String&lt;/span&gt; configurationPath&lt;span class="sym"&gt;;&lt;/span&gt;

	&lt;span class="kwa"&gt;public&lt;/span&gt; &lt;span class="kwc"&gt;String&lt;/span&gt; &lt;span class="kwd"&gt;getConfigurationPath&lt;/span&gt;&lt;span class="sym"&gt;() {&lt;/span&gt;
		&lt;span class="kwa"&gt;return&lt;/span&gt; configurationPath&lt;span class="sym"&gt;;&lt;/span&gt;
	&lt;span class="sym"&gt;}&lt;/span&gt;

	&lt;span class="kwa"&gt;public&lt;/span&gt; &lt;span class="kwb"&gt;void&lt;/span&gt; &lt;span class="kwd"&gt;setConfigurationPath&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="kwc"&gt;String&lt;/span&gt; configurationPath&lt;span class="sym"&gt;) {&lt;/span&gt;
		&lt;span class="kwa"&gt;this&lt;/span&gt;&lt;span class="sym"&gt;.&lt;/span&gt;configurationPath &lt;span class="sym"&gt;=&lt;/span&gt; configurationPath&lt;span class="sym"&gt;;&lt;/span&gt;

	&lt;span class="sym"&gt;}&lt;/span&gt;

	&amp;#64;Override
	&lt;span class="kwa"&gt;public&lt;/span&gt; &lt;span class="kwc"&gt;String&lt;/span&gt; &lt;span class="kwd"&gt;toString&lt;/span&gt;&lt;span class="sym"&gt;() {&lt;/span&gt;
		&lt;span class="kwa"&gt;return new&lt;/span&gt; &lt;span class="kwc"&gt;StringBuilder&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;MyBean:&lt;/span&gt;&lt;span class="esc"&gt;\n&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;

		&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;append&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;&lt;/span&gt;&lt;span class="esc"&gt;\t&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;
		&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;append&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;configurationPath=&amp;quot;&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;
		&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;append&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="kwa"&gt;this&lt;/span&gt;&lt;span class="sym"&gt;.&lt;/span&gt;configurationPath&lt;span class="sym"&gt;)&lt;/span&gt;

		&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;append&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;&lt;/span&gt;&lt;span class="esc"&gt;\n\t&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;
		&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;append&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;super.toString: &amp;quot;&lt;/span&gt;&lt;span class="sym"&gt;)&lt;/span&gt;
		&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;append&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="kwa"&gt;super&lt;/span&gt;&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;toString&lt;/span&gt;&lt;span class="sym"&gt;()).&lt;/span&gt;&lt;span class="kwd"&gt;toString&lt;/span&gt;&lt;span class="sym"&gt;();&lt;/span&gt;
	&lt;span class="sym"&gt;}&lt;/span&gt;
&lt;span class="sym"&gt;}&lt;/span&gt;
&lt;/pre&gt;

&lt;div class="hr"&gt;&lt;!-- --&gt;&lt;/div&gt;

&lt;p&gt;

&lt;/p&gt;

&lt;pre class="java code"&gt;
&lt;div  class="java syntax"&gt;&lt;span class="kwa"&gt;package&lt;/span&gt; example&lt;span class="sym"&gt;;&lt;/span&gt;

&lt;span class="kwa"&gt;import&lt;/span&gt; org&lt;span class="sym"&gt;.&lt;/span&gt;springframework&lt;span class="sym"&gt;.&lt;/span&gt;context&lt;span class="sym"&gt;.&lt;/span&gt;support&lt;span class="sym"&gt;.&lt;/span&gt;ClassPathXmlApplicationContext&lt;span class="sym"&gt;;&lt;/span&gt;

&lt;span class="kwa"&gt;import&lt;/span&gt; com&lt;span class="sym"&gt;.&lt;/span&gt;juretta&lt;span class="sym"&gt;.&lt;/span&gt;spring&lt;span class="sym"&gt;.&lt;/span&gt;example&lt;span class="sym"&gt;.&lt;/span&gt;MyBean&lt;span class="sym"&gt;;&lt;/span&gt;
&lt;span class="kwa"&gt;import static&lt;/span&gt; java&lt;span class="sym"&gt;.&lt;/span&gt;lang&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwc"&gt;System&lt;/span&gt;&lt;span class="sym"&gt;.&lt;/span&gt;out&lt;span class="sym"&gt;;&lt;/span&gt;

&lt;span class="kwa"&gt;public class&lt;/span&gt; Runner &lt;span class="sym"&gt;{&lt;/span&gt;

	&lt;span class="com"&gt;/**&lt;/span&gt;
&lt;span class="com"&gt;	 * &amp;#64;param args&lt;/span&gt;
&lt;span class="com"&gt;	 */&lt;/span&gt;

	&lt;span class="kwa"&gt;public static&lt;/span&gt; &lt;span class="kwb"&gt;void&lt;/span&gt; &lt;span class="kwd"&gt;main&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="kwc"&gt;String&lt;/span&gt;&lt;span class="sym"&gt;[]&lt;/span&gt; args&lt;span class="sym"&gt;) {&lt;/span&gt;
		&lt;span class="slc"&gt;// create a Spring application context&lt;/span&gt;
		ClassPathXmlApplicationContext context &lt;span class="sym"&gt;=&lt;/span&gt;

			&lt;span class="kwa"&gt;new&lt;/span&gt; &lt;span class="kwd"&gt;ClassPathXmlApplicationContext&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;beans.xml&amp;quot;&lt;/span&gt;&lt;span class="sym"&gt;);&lt;/span&gt;

		&lt;span class="slc"&gt;// get the Spring Bean with id &amp;quot;myBean&amp;quot;&lt;/span&gt;
		&lt;span class="kwc"&gt;Object&lt;/span&gt; bean &lt;span class="sym"&gt;=&lt;/span&gt; context&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;getBean&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;&lt;span class="str"&gt;&amp;quot;myBean&amp;quot;&lt;/span&gt;&lt;span class="sym"&gt;);&lt;/span&gt;

		out&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;println&lt;/span&gt;&lt;span class="sym"&gt;(((&lt;/span&gt;MyBean&lt;span class="sym"&gt;)&lt;/span&gt;bean&lt;span class="sym"&gt;).&lt;/span&gt;&lt;span class="kwd"&gt;getConfigurationPath&lt;/span&gt;&lt;span class="sym"&gt;());&lt;/span&gt;
		out&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;println&lt;/span&gt;&lt;span class="sym"&gt;(&lt;/span&gt;bean&lt;span class="sym"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;toString&lt;/span&gt;&lt;span class="sym"&gt;());&lt;/span&gt;

	&lt;span class="sym"&gt;}&lt;/span&gt; &lt;span class="slc"&gt;// main&lt;/span&gt;
&lt;span class="sym"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/pre&gt;



&lt;p&gt;
To compile and run the program one would usually use ant or the Eclipse IDE. The following commands are compiling and running the simple example project:
&lt;/p&gt;

&lt;p&gt;
Running the simple example shows that the property placeholder ${conf.path} is now 
the value for conf.path as defined in &lt;code&gt;configuration.properties&lt;/code&gt;.
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ cd simple-example
# this direcotry has the following subdirectories: src, bin and lib

macbook-sts:~ stefan$ cp src/beans.xml bin; cp src/configuration.* bin

# compile 
macbook-sts:~ stefan$ javac -cp .:lib/spring.jar:lib/commons-logging.jar \
    -d bin src/example/Runner.java \
    src/com/juretta/spring/example/MyBean.java

# and run
macbook-sts:~ stefan$ java -cp \
.:lib/spring.jar:lib/commons-logging.jar:bin \
example/Runner

10.02.2007 15:16:45 org.springframework.core.CollectionFactory &lt;clinit&gt;
INFO: JDK 1.4+ collections available
10.02.2007 15:16:45 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
[... more log information ...]
MyBean:
        configurationPath=/usr/local/tomcat/conf
        super.toString: com.juretta.spring.example.MyBean@5cc942
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=vCa406wx"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=vCa406wx" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=L4dVb9RT"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=L4dVb9RT" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=PBSBVNUi"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=PBSBVNUi" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/88941945"/&gt;</description>
      <pubDate>Sat, 10 Feb 2007 15:30:40 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/02/10/using_ant-style_properties_in_spring_bean_configuration_files/#163</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/88941945/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/02/10/using_ant-style_properties_in_spring_bean_configuration_files/#163</feedburner:origLink></item>
    <item>
      <title>Mac OS X command line goodies</title>
      <description>&lt;p&gt;
Mac OS X has several command line programs you maybe unaware of. Here are a few that are worth knowing of.
&lt;/p&gt;

&lt;p&gt;
Command+Shif+4 or Command+Shift+3 are the built in commands to capture the current screen (3) or parts of the screen (4). With &lt;code&gt;screencapture&lt;/code&gt; you can use this facility using the command line. 
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ screencapture -C ~/Desktop/screen.png
&lt;/pre&gt;

&lt;p&gt;
The command &lt;code&gt;open&lt;/code&gt; opens files and directories.
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ open ~/Desktop/screen.png
# opens the file screen.png using the default program
# which would be used if you double clicked the file
macbook-sts:~ stefan$ open -a textmate /etc/hosts
# opens the file /etc/hosts using the application "Textmate"
&lt;/pre&gt;


&lt;p&gt;
The command &lt;code&gt;pbcopy&lt;/code&gt; and it's sibling &lt;code&gt;pbpaste&lt;/code&gt; open up the Mac OSX clipboard for your command line programs. Select some text in your browser, press Command+C and you can print the content of the clipboard with &lt;code&gt;pbpaste&lt;/code&gt;.
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ pbpaste | sed s/e/E/g
command linE programs. SElEct somE tExt in your browsEr, prEss Command+C and you can print thE contEnt of thE clipboard with
&lt;/pre&gt;

&lt;p&gt;
To put some text into your clipboard you can use &lt;code&gt;pbcopy&lt;/code&gt;. The following command reads the /etc/motd file (motd stands for message of the day, this is what you can see when opening a terminal - on Mac OS X its usually "Welcome to Darwin") and puts it's content into the clipboard.
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ cat /etc/motd | pbcopy
&lt;/pre&gt;

&lt;p&gt;
Are you using Ruby? Do you have RubyGems installed? You might want to consider installing the attachr gem (sudo gem install attachr). You can save text snippets to attachr.com from your commandline.
&lt;/p&gt;
&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ sudo gem install attachr
Successfully installed attachr-0.1.5
Installing ri documentation for attachr-0.1.5...
Installing RDoc documentation for attachr-0.1.5...

macbook-sts:~ stefan$ cat /etc/motd | attachr
Your text was posted to http://attachr.com/6948
&lt;/pre&gt;

&lt;p&gt;
With lsbom you can examine the contents of a Mac OS X installer (.pkg).
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ lsbom -f /Library/Receipts/Java.pkg/Contents/Archive.bom
&lt;/pre&gt;

&lt;p&gt;
&lt;code&gt;lipo&lt;/code&gt; is a tool to operate on universal binary files. You can get detailed info on a universal file by using &lt;code&gt;lipo -detailed_info /path/to/binary
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ lipo -detailed_info /Applications/DVD\ Player.app/Contents/MacOS/DVD\ Player 
Fat header in: /Applications/DVD Player.app/Contents/MacOS/DVD Player
fat_magic 0xcafebabe
nfat_arch 2
architecture i386
    cputype CPU_TYPE_I386
    cpusubtype CPU_SUBTYPE_I386_ALL
    offset 4096
    size 2291764
    align 2^12 (4096)
architecture ppc
    cputype CPU_TYPE_POWERPC
    cpusubtype CPU_SUBTYPE_POWERPC_ALL
    offset 2297856
    size 2525088
    align 2^12 (4096)
&lt;/pre&gt;


&lt;p&gt;
The &lt;code&gt;system_profiler&lt;/code&gt; command reports system hardware and software configuration. The following example prints the hardware configuration.
&lt;/p&gt;
&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ /usr/sbin/system_profiler SPHardwareDataType
Hardware:

    Hardware Overview:

      Machine Name: MacBook Pro 15"
      Machine Model: MacBookPro1,1
      Processor Name: Intel Core Duo
      Processor Speed: 2 GHz
      Number Of Processors: 1
      Total Number Of Cores: 2
      L2 Cache (per processor): 2 MB
      Memory: 2 GB
      Bus Speed: 667 MHz
      Boot ROM Version: MBP11.0055.B08
      SMC Version: 1.2f10
      Serial Number: XXXXXXXXXX
      Sudden Motion Sensor:
          State: Enabled

macbook-sts:~ stefan$ /usr/sbin/system_profiler SPHardwareDataType | grep Memory
      Memory: 2 GB
&lt;/pre&gt;

&lt;p&gt;
&lt;code&gt;softwareupdate&lt;/code&gt; installs system software updates from apple.
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ sudo softwareupdate -i -r
Software Update Tool
Copyright 2002-2005 Apple
[...]
&lt;/pre&gt;


&lt;p&gt;
You might know how to use the &lt;code&gt;find&lt;/code&gt; command to search for files. It's mac specific sibling &lt;code&gt;mdfind&lt;/code&gt; is using the Spotlight metadata repository to find files. To list the metadata for a specific file you can use the &lt;code&gt;mdls&lt;/code&gt; command.
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ mdfind -onlyin /usr/local stomp 
/usr/local/lib/ruby/gems/1.8/specifications/stomp-1.0.5.gemspec
/usr/local/lib/ruby/gems/1.8/gems/stomp-1.0.5
/usr/local/lib/ruby/gems/1.8/gems/stomp-1.0.5/lib/stomp.rb
/usr/local/lib/ruby/gems/1.8/doc/stomp-1.0.5
/usr/local/lib/ruby/gems/1.8/cache/stomp-1.0.5.gem
&lt;/pre&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ mdls ~/Desktop/spring-reference.pdf 
/Users/stefan/Desktop/spring-reference.pdf -------------
kMDItemAttributeChangeDate = 1970-01-01 01:00:00 +0100
kMDItemFSContentChangeDate = 2006-10-03 15:17:50 +0200
kMDItemFSCreationDate      = 2006-10-03 15:17:50 +0200
kMDItemFSCreatorCode       = 0
kMDItemFSFinderFlags       = 0
kMDItemFSInvisible         = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSLabel             = 0
kMDItemFSName              = "spring-reference.pdf"
kMDItemFSNodeCount         = 0
kMDItemFSOwnerGroupID      = 501
kMDItemFSOwnerUserID       = 501
kMDItemFSSize              = 3684682
kMDItemFSTypeCode          = 0
kMDItemID                  = 1949239
&lt;/pre&gt;

&lt;p&gt;
The last command &lt;cite&gt;convert[s] text to audible speech&lt;/cite&gt;. See &lt;code&gt;man say&lt;/code&gt; for more information to use &lt;code&gt;say&lt;/code&gt;. 
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ say -v Albert "Hello world"
# converts your clipboard content to speech
macbook-sts:~ stefan$ pbpaste | say
# You can get a list of the available voices:
macbook-sts:~ stefan$ ls /System/Library/Speech/Voices/ | sed s/.SpeechVoice//g
Agnes
Albert
BadNews
Bahh
Bells
Boing
Bruce
Bubbles
Cellos
Deranged
Fred
GoodNews
Hysterical
Junior
Kathy
Organ
Princess
Ralph
Trinoids
Vicki
Victoria
Whisper
Zarvox
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=qfoyicPL"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=qfoyicPL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=znXr3olb"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=znXr3olb" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=hTCx1OTV"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=hTCx1OTV" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/113400623" height="1" width="1"/&gt;</description>
      <pubDate>Sun, 4 Feb 2007 19:58:15 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/02/04/mac_os_x_command_line_goodies/#162</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/113400623/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/02/04/mac_os_x_command_line_goodies/#162</feedburner:origLink></item>
    <item>
      <title>Rails WDDX request</title>
      <description>&lt;!--
http://attachr.com/6887
http://attachr.com/6888
--&gt;
&lt;p&gt;
I was asked how to get the body of an HTTP post request in a Rails controller. And with the most things in Rails it's very easy.
&lt;/p&gt;

&lt;p&gt;
In Java you can get a ServletInputStream from the request object, in PHP there is  $_SERVER['RAW_POST_DATA']. Pretty much like in the java version you can just ask the request object for &lt;code&gt;raw_post&lt;/code&gt; in Rails.
&lt;/p&gt;

&lt;pre class="ruby"&gt;
# Simple RPC-Controller in Rails
# request.raw_post contains the raw post data, that is
# the data that is submitted in the http request body.

# The example uses the wddx gem to return a simple WDDX response message

# To us WDDX install the wddx gem ([sudo] gem install wddx)
# and a require "wddx" statement
# to config/environment.rb

# app/controllers/rpc_controller.rb

# This controller has a simple method "endpoint"
# The body of the post request is written to the 
# log/#{environment}.log file.
# The controller returns a WDDX XML message.
class RpcController &lt; ApplicationController             
  # simple endpoint
  def endpoint
     if request.post?
       logger.debug request.raw_post
       render :xml =&gt; "Ok".to_wddx
     else
       render :xml =&gt; "Failure".to_wddx
     end
  end
end
&lt;/pre&gt;

&lt;p&gt;
To test this controller you can use the following code to issue a post request.
&lt;/p&gt;

&lt;pre class="ruby"&gt;
#!/usr/bin/env ruby
#
#  Created by Stefan Saasen on 2007-01-31.
#  Copyright (c) 2007. All rights reserved.
require 'rubygems'  
require 'net/http'
require 'wddx'

begin      
  http = Net::HTTP.new("localhost", 3000) 
  response = http.post('/Rpc/endpoint', {"key" =&gt; "value", 
      "another" =&gt; "value"}.to_wddx) 
  puts response.body
rescue SocketError =&gt; e
  # error handling
end
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=Smd09FVX"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=Smd09FVX" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=89eUhoEc"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=89eUhoEc" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=1DPG8jYr"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=1DPG8jYr" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/85933792"/&gt;</description>
      <pubDate>Wed, 31 Jan 2007 10:20:17 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/01/31/rails_wddx_request/#161</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/85933792/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/01/31/rails_wddx_request/#161</feedburner:origLink></item>
    <item>
      <title>Job control</title>
      <description>&lt;blockquote&gt;
The nohup utility invokes command with its arguments and at this time
sets the signal SIGHUP to be ignored.  If the standard output is a terminal, the standard output is appended to the file nohup.out in the current
directory.  If standard error is a terminal, it is directed to the same
place as the standard output.
&lt;/blockquote&gt;

&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ nohup ant coremediaServerExport &amp;
macbook-sts:~ stefan$ tail -f nohup.out
macbook-sts:~ stefan$ exit
&lt;/pre&gt;

&lt;blockquote&gt;
script makes a typescript of everything printed on your terminal.
&lt;/blockquote&gt;


&lt;pre class="shell"&gt;
macbook-sts:~ stefan$ script
Script started, file is typescript
macbook-sts:~ stefan$ 
macbook-sts:~ stefan$ 
macbook-sts:~ stefan$ [commands...]
macbook-sts:~ stefan$ 
macbook-sts:~ stefan$ 
macbook-sts:~ stefan$ exit
exit
Script done, file is typescript
macbook-sts:~ stefan$
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=hwHxPFs9"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=hwHxPFs9" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=YlRCcVju"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=YlRCcVju" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=Psy5OllU"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=Psy5OllU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/113400624" height="1" width="1"/&gt;</description>
      <pubDate>Sun, 14 Jan 2007 01:29:21 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/01/14/job_control/#160</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/113400624/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/01/14/job_control/#160</feedburner:origLink></item>
    <item>
      <title>Debugging Ruby -RubyOSA continued</title>
      <description>&lt;p&gt;
The day before yesterday i wrote a short post about &lt;a href="http://rubyosa.rubyforge.org/"&gt;RubyOSA&lt;/a&gt;. RubyOSA is &lt;q cite="http://rubyosa.rubyforge.org/"&gt;a Ruby/AppleEvent Bridge&lt;/q&gt; which in the end  means that you can use Ruby to script Mac OS X applications like iTunes, iChat, Address Book and many more. 
&lt;/p&gt;

&lt;p&gt;
As a small introductory example i wrote (read: quick, dirty hack) a small script to print all contacts in a Mac OS X Address Book.
&lt;/p&gt;

&lt;p&gt;
    Running this script with Ruby 1.8.4 worked just fine. Running it with Ruby 1.8.5 resulted in a &lt;code&gt;(eval):2: [BUG] Segmentation fault
ruby 1.8.5 (2006-12-25) [i686-darwin8.8.1]&lt;/code&gt;. Without further investigation i just wrote &lt;q cite="http://www.juretta.com/log/2007/01/06/rubyosa/"&gt;RubyOsa seems to work better with Ruby 1.8.4 than with Ruby 1.8.5.&lt;/q&gt;. What i should have done is what i like to explain in this post.
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://chopine.be/lrz"&gt;Laurent Sansonetti&lt;/a&gt; the maintainer and main developer of RubyOSA left a comment and asked about the problems with Ruby 1.8.5. 
The sensible thing to do in the first place would have been to investigate if Ruby 1.8.5 really caused the aforementionend segmentation fault and if that was the case - to file a bug report with as much information as needed. 
&lt;/p&gt;

&lt;p&gt;
  Laurent asked me if Ruby had been build as a shared library. A quick and easy way to determine this is to check rbconfig.rb.
&lt;/p&gt;
&lt;p&gt;
When building Ruby &lt;code&gt;rbconfig.rb&lt;/code&gt; is being created with all relevant informations about the specific build. The following script prints all configuration options and shows if Ruby was built as a shared lib (mine actually was).
&lt;/p&gt;

&lt;pre class="ruby"&gt;
require 'rbconfig'

# Print all available configuration options
Config::CONFIG.each do |k,v|
  puts "#{k}: #{v}"
end                                        

# Ruby built as shared library?
puts Config::CONFIG['ENABLE_SHARED']  
&lt;/pre&gt;

&lt;p&gt;
To debug the Ruby interpreter or any low level library (like in this case) &lt;code&gt;gdb&lt;/code&gt; the &lt;a href="http://www.gnu.org/software/gdb/"&gt;GNU Project debugger&lt;/a&gt; yields valuable informations. 
&lt;/p&gt;
&lt;p&gt;
GDB just recently gained a new momentum in the Rails community after &lt;a href="http://weblog.jamisbuck.org/2006/9/22/inspecting-a-live-ruby-process"&gt;Jamis Buck&lt;/a&gt; and &lt;a href="http://eigenclass.org/hiki.rb?ruby+live+process+introspection"&gt;Mauricio Fernandez&lt;/a&gt; described how to easily attach the gnu debugger to a running ruby process.
&lt;/p&gt;

&lt;p&gt;
To debug a short running ruby script (without attaching the debugger to a process id) the following steps are neccessary: 
&lt;/p&gt;

&lt;p&gt;
Start gdb with the ruby interpreter as the first argument. You will get an interacive gdb session with a gdb prompt. There are more than 130 GDB commands but few will be sufficent to get the information that is needed.
&lt;/p&gt;

&lt;pre class="shell"&gt;
macbook-sts:~/Desktop stefan$ gdb `which ruby`
GNU gdb 6.3.50-20050815 (Apple version gdb-573) (Fri Oct 20 15:50:43 GMT 2006)
[... output stripped...]
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries .... done
&lt;/pre&gt;

&lt;p&gt;
Run the script that causes the bug. In this case it is &lt;code&gt;rubyosa_ad.rb&lt;/code&gt;. 
&lt;/p&gt;

&lt;pre class="shell"&gt;
(gdb) run rubyosa_ad.rb
Starting program: /usr/local/bin/ruby rubyosa_ad.rb
Reading symbols for shared libraries .+... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries ... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries ............................................................... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
[... output stripped...]

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x6552534e
0x9000c5f8 in __vfprintf ()
&lt;/pre&gt;

&lt;p&gt;
The output now shows what is really happening: &lt;em&gt;Program received signal EXC_BAD_ACCESS, Could not access memory.&lt;/em&gt;. To get even more information type &lt;code&gt;backtrace&lt;/code&gt; (or &lt;code&gt;bt&lt;/code&gt;) to get a backtrace.
&lt;/p&gt;

&lt;pre class="shell"&gt;
(gdb) bt
#0  0x9000c5f8 in __vfprintf ()
#1  0x90022818 in snprintf ()
#2  0x000b4562 in rbosa_app_send_event (self=6878720, event_class=6826060, event_id=6826040, params=6826020, need_retval=2) at src/rbosa.c:231
#3  0x00217f54 in call_cfunc (func=0, recv=980578162, len=-1, argc=0, argv=0x0) at eval.c:5672
&lt;/pre&gt;

&lt;p&gt;
GDB allows you to set breakpoints, step interactively through program execution and   as shown in this really short example: Examine what has happened, when your program has stopped. This is what makes a bug report valuable and what really helps the developer who has to or wants to fix the bug you are reporting.
&lt;/p&gt;

&lt;p id="fixed"&gt;
Laurent already fixed the bug in the RubyOSA trunk and even improved the address book example. The &lt;a href="http://rubyforge.org/viewvc/trunk/sample/AddressBook/inspect.rb?root=rubyosa&amp;view=markup"&gt;improved version&lt;/a&gt; is now in the &lt;a href="http://rubyforge.org/viewvc/trunk/sample/?root=rubyosa"&gt;RubyOSA sample directory&lt;/a&gt; which contains some interesting usage examples. Go and check them out!
&lt;/p&gt;


&lt;p&gt;
For more information about GDB check out the &lt;a href="http://sourceware.org/gdb/current/onlinedocs/gdb_toc.html"&gt;GDB manual&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Have a look at &lt;a href="http://rubyosa.rubyforge.org/"&gt;RubyOSA&lt;/a&gt; or &lt;a href="http://rubycocoa.sourceforge.net/doc/"&gt;RubyCocoa - a Ruby/Objective-C Bridge for Mac OS X Cocoa&lt;/a&gt;. Great and interesting librarys for Ruby development on Mac OS X.
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=D1eqDFDV"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=D1eqDFDV" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=YTcy5Kh0"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=YTcy5Kh0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=tZKs1Q3r"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=tZKs1Q3r" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/72611525"/&gt;</description>
      <pubDate>Mon, 8 Jan 2007 19:20:00 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/01/08/rubyosa_debugging_ruby/#158</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/72611525/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/01/08/rubyosa_debugging_ruby/#158</feedburner:origLink></item>
    <item>
      <title>"free" on Mac OS X</title>
      <description>&lt;p&gt;
&lt;code&gt;free&lt;/code&gt; is a command to show memory usage on variuos linux distributions. As "free" is not available on Mac OS X you have to use something different.
&lt;/p&gt;
&lt;p&gt;
To determine the size of memory on Mac OS X you can use:
&lt;/p&gt;
&lt;pre class="shell"&gt;
/usr/sbin/system_profiler SPHardwareDataType | grep Memory
&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=6VrSwzG"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=6VrSwzG" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=C6oym3G"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=C6oym3G" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=5EPCxPG"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=5EPCxPG" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/270630571" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 5 Jan 2007 23:09:00 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/01/05/free_on_mac_os_x/#157</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/270630571/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/01/05/free_on_mac_os_x/#157</feedburner:origLink></item>
    <item>
      <title>Ruby 1.9 with YARV - Ruby is getting faster</title>
      <description>&lt;p&gt;
As mentioned &lt;a href="http://redhanded.hobix.com/cult/yarvIsRubyItIsItReallyIs.html"&gt;here&lt;/a&gt; Ruby trunk now contains &lt;a href="http://www.atdot.net/yarv/#i-2"&gt;YARV&lt;/a&gt;. YARV is a Virtual Machin for Ruby and Ruby trunk is what will become Ruby 1.9.1 (it is 1.9.0 as of now).
&lt;/p&gt;

&lt;p&gt;
The &lt;a href="http://www.rubychan.de/share/yarv_speedups.html"&gt;benchmark&lt;/a&gt; looks really promising.
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/juretta?a=AEaJVhYT"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=AEaJVhYT" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=4mjqaI7E"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=4mjqaI7E" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/juretta?a=VGloTgyw"&gt;&lt;img src="http://feeds.feedburner.com/~f/juretta?i=VGloTgyw" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/juretta/~4/70342241"/&gt;</description>
      <pubDate>Wed, 3 Jan 2007 19:59:06 +0100</pubDate>
      <guid isPermaLink="false">http://www.juretta.com/log/2007/01/03/ruby_1_9_with_yarv_-_ruby_is_getting_faster/#156</guid>
      <link>http://feeds.feedburner.com/~r/juretta/~3/70342241/</link>
      <dc:creator>Stefan Saasen</dc:creator>
    <feedburner:origLink>http://www.juretta.com/log/2007/01/03/ruby_1_9_with_yarv_-_ruby_is_getting_faster/#156</feedburner:origLink></item>
  </channel>
</rss>
