<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>And now here's something…</title>
	
	<link>http://christiansons.net/mike/blog</link>
	<description>Java, Ant, SVN, Jetty, cygwin and other stuff…</description>
	<lastBuildDate>Fri, 02 Dec 2011 16:53:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/wilt-blog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="wilt-blog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Software Engineering reading group: Working Effectively with Legacy Code</title>
		<link>http://christiansons.net/mike/blog/2011/12/software-engineering-reading-group-working-effectively-with-legacy-code/</link>
		<comments>http://christiansons.net/mike/blog/2011/12/software-engineering-reading-group-working-effectively-with-legacy-code/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 08:18:56 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[gangplank]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=777</guid>
		<description><![CDATA[The software engineering reading group, hosted out of Gangplank Phoenix, has finished Clean Code and is moving on to another book: Working Effectively with Legacy Code by Michael Feathers. This book was my personal choice, kindly agreed to by the other members of the group. Everyone seems to enjoy the book thus far, even when I <a href='http://christiansons.net/mike/blog/2011/12/software-engineering-reading-group-working-effectively-with-legacy-code/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/0131177052/ref=as_li_ss_tl?ie=UTF8&amp;tag=wiltblog-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0131177052"><img class="alignleft" title="Working Effectively with Legacy Code" src="http://vig-fp.prenhall.com/coverimage/0131177052.jpg" alt="" width="109" height="144" /></a>The software engineering reading group, hosted out of Gangplank Phoenix, has finished Clean Code and is moving on to another book: <a href="http://www.amazon.com/gp/product/0131177052/ref=as_li_ss_tl?ie=UTF8&amp;tag=wiltblog-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0131177052">Working Effectively with Legacy Code</a> by Michael Feathers.</p>
<p>This book was my personal choice, kindly agreed to by the other members of the group. Everyone seems to enjoy the book thus far, even when I presented chapters four and five this week!</p>
<p>If you&#8217;re in the Phoenix area, come join us! Drop by <a href="http://gangplankhq.com/">Gangplank</a> at 8:00pm on any Wednesday.</p>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/ReIqAtYBBAM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2011/12/software-engineering-reading-group-working-effectively-with-legacy-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Global unique identifiers in Java, the easy way</title>
		<link>http://christiansons.net/mike/blog/2011/11/global-unique-identifiers-in-java-the-easy-way/</link>
		<comments>http://christiansons.net/mike/blog/2011/11/global-unique-identifiers-in-java-the-easy-way/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 22:50:03 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=759</guid>
		<description><![CDATA[A recent attempt at creating a unique identifier at work was shot down in flames by Findbugs. My naïve attempt wasn&#8217;t very thoughtful but seemed to work. Integer.toString&#40;Math.abs&#40;random.nextInt&#40;&#41;&#41;&#41; Findbugs indicated there was a possibility that I might end up with a negative value even though I &#8220;cleverly&#8221; used Math.abs(). RV: Bad attempt to compute absolute <a href='http://christiansons.net/mike/blog/2011/11/global-unique-identifiers-in-java-the-easy-way/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>A recent attempt at creating a unique identifier at work was shot down in flames by Findbugs. My naïve attempt wasn&#8217;t very thoughtful but seemed to work.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">Integer</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">abs</span><span style="color: #009900;">&#40;</span>random.<span style="color: #006633;">nextInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Findbugs indicated there was a possibility that I might end up with a negative value even though I &#8220;cleverly&#8221; used <tt>Math.abs()</tt>.</p>
<blockquote><p>RV: Bad attempt to compute absolute value of signed random integer <a href="http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT">(RV_ABSOLUTE_VALUE_OF_RANDOM_INT)</a></p>
<p>If the number returned by the random number generator is Integer.MIN_VALUE, then the result will be negative as well</p></blockquote>
<p>Even though I didn&#8217;t need this random id to be perfect &#8212; the unintended side-effect wasn&#8217;t a technical problem since I used it as a String &#8212; I still wanted to fix it. Stackoverflow to the rescue.</p>
<p>A <a href="http://stackoverflow.com/questions/7567350/findbugs-rv-absolute-value-of-random-int-warning">question-and-answer from Stackoverflow</a> pointed the way to the solution: <tt><a href="http://download.oracle.com/javase/6/docs/api/java/util/UUID.html">java.util.UUID</a></tt>. Somehow, I missed that Sun had added Java&#8217;s own universally unique identifier (UUID) generator in Java 1.5.</p>
<p>In the end, I happily replaced my homemade id generator with Java&#8217;s.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">UUID.<span style="color: #006633;">randomUUID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>The output of which is something like <tt>1c312843-8903-411f-88b2-ff1b92ca80ba</tt>.</p>
<p><em>Cross-posted at <a href="http://java.dzone.com/articles/global-unique-identifiers-java">http://java.dzone.com/articles/global-unique-identifiers-java</a>.</em></p>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/JrOiisgTUx4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2011/11/global-unique-identifiers-in-java-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java 7 : Fork and Join</title>
		<link>http://christiansons.net/mike/blog/2011/08/java-7-fork-and-join/</link>
		<comments>http://christiansons.net/mike/blog/2011/08/java-7-fork-and-join/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 17:38:22 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[forkjoin]]></category>
		<category><![CDATA[java7]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=747</guid>
		<description><![CDATA[Check out Julien Ponge&#8217;s article on Fork and Join in Java 7.]]></description>
			<content:encoded><![CDATA[<p>Check out Julien Ponge&#8217;s article on <a href="http://www.oracle.com/technetwork/articles/java/fork-join-422606.html">Fork and Join in Java 7</a>.</p>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/IjpE36YFnPI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2011/08/java-7-fork-and-join/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change cygwin home directory</title>
		<link>http://christiansons.net/mike/blog/2011/07/change-cygwin-home-directory/</link>
		<comments>http://christiansons.net/mike/blog/2011/07/change-cygwin-home-directory/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 18:13:44 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[cygwin]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=732</guid>
		<description><![CDATA[Perhaps most people using Cygwin don&#8217;t realize this, but they actually have two home directories. One is their Windows home directory (%USERPROFILE%) and the other is their Cygwin home directory (~). Several months ago I became frustrated with repeated navigation from one to the other, so I began using a symbolic link. In ~ I <a href='http://christiansons.net/mike/blog/2011/07/change-cygwin-home-directory/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://photos.smugmug.com/photos/i-r5gnHJ8/0/O/i-r5gnHJ8.png" alt="" width="64" height="64" />Perhaps most people using Cygwin don&#8217;t realize this, but they actually have two home directories. One is their Windows home directory (<tt>%USERPROFILE%</tt>) and the other is their Cygwin home directory (<tt>~</tt>).</p>
<p>Several months ago I became frustrated with repeated navigation from one to the other, so I began using a symbolic link. In <tt>~</tt> I created a link to <tt>%USERPROFILE%</tt> with&nbsp;<code>ln -s "$USERPROFILE" home</code>. Thus, any time I wanted to change to my Windows home directory I would simply <tt>cd ~/home</tt>.</p>
<p>It worked, but that&nbsp;dichotomy remained… Then, it&nbsp;occurred&nbsp;to me: why couldn&#8217;t <tt>~</tt> and <tt>%USERPROFILE%</tt> be the same?</p>
<p>Luckily, they can! &nbsp;In fact, the <a href="http://cygwin.com/cygwin-ug-net/using-utils.html#utils-althome-ex">Cygwin documentation on alternate home roots</a> shows exactly how. Using <tt><a href="http://cygwin.com/cygwin-ug-net/using-utils.html#mkpasswd">mkpasswd</a></tt>, one or all home directories may be set to any arbitrary path; to change all home directories to the Windows home directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mkpasswd <span style="color: #660033;">-l</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(cygpath -H)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span></pre></div></div>

<p>Pretty neat. See&nbsp;the <a href="http://cygwin.com/cygwin-ug-net/using-utils.html#utils-althome-ex">Cygwin documentation on alternate home roots</a> for more information.</p>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/durztNmB3XI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2011/07/change-cygwin-home-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Engineering reading group: Clean Code</title>
		<link>http://christiansons.net/mike/blog/2011/07/software-engineering-reading-group-clean-code/</link>
		<comments>http://christiansons.net/mike/blog/2011/07/software-engineering-reading-group-clean-code/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 06:20:37 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[gangplank]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=718</guid>
		<description><![CDATA[I joined a software engineering reading group, last week, hosted out of Gangplank.  The group is reading Clean Code by Bob C. Martin.  If you&#8217;re in the Phoenix metro area and interested in joining, check for details on the Gangplank blog.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/0132350882/ref=as_li_ss_il?ie=UTF8&amp;tag=wiltblog-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0132350882"><img class="alignright" src="http://photos.smugmug.com/photos/i-QB9t5HC/0/O/i-QB9t5HC.jpg" alt="" width="120" height="160" /></a>I joined a software engineering reading group, last week, hosted out of Gangplank.  The group is reading <a href="http://www.amazon.com/gp/product/0132350882/ref=as_li_ss_tl?ie=UTF8&amp;tag=wiltblog-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0132350882"><em>Clean Code</em> by Bob C. Martin</a>.  If you&#8217;re in the Phoenix metro area and interested in joining, check for details on the <a href="http://gangplankhq.com/2011/06/software-engineering-reading-group/">Gangplank blog</a>.</p>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/AQtEgfoTW-Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2011/07/software-engineering-reading-group-clean-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse syntax highlighting with color themes</title>
		<link>http://christiansons.net/mike/blog/2011/06/eclipse-syntax-highlighting-with-color-themes/</link>
		<comments>http://christiansons.net/mike/blog/2011/06/eclipse-syntax-highlighting-with-color-themes/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 06:29:16 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=706</guid>
		<description><![CDATA[I don&#8217;t mind working with code or structured text files in a plain-text editor like Textpad, but my ability to read and comprehend increases with an editor that performs syntax highlighting. By default, Eclipse does a pretty good job of syntax highlighting Java files without going overboard. But, if you want a fresh look &#8212; <a href='http://christiansons.net/mike/blog/2011/06/eclipse-syntax-highlighting-with-color-themes/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.eclipsecolorthemes.org/"><img alt="" src="http://photos.smugmug.com/photos/i-qjJ6xdx/0/O/i-qjJ6xdx.png" class="alignleft" width="100" height="100" /></a>I don&#8217;t mind working with code or structured text files in a plain-text editor like Textpad, but my ability to read and comprehend increases with an editor that performs syntax highlighting.</p>
<p>By default, Eclipse does a pretty good job of syntax highlighting Java files without going overboard. But, if you want a fresh look &#8212; maybe you want to try a dark background &#8212; the Eclipse Color Theme plugin lets you change whole editor themes with the click of your mouse.</p>
<p>The <a href="http://www.eclipsecolorthemes.org/">Eclipse Color Theme</a> plugin is free and so are the themes. So far I&#8217;m liking the <a href="http://www.eclipsecolorthemes.org/?view=theme&#038;id=1">dark Oblivion theme</a>, shown below.</p>
<p><a href="http://www.eclipsecolorthemes.org/?view=theme&#038;id=1"><img alt="" src="http://photos.smugmug.com/photos/i-7JsRh3L/0/O/i-7JsRh3L.png" class="aligncenter" width="420" height="324" /></a></p>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/sk_UV3fr008" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2011/06/eclipse-syntax-highlighting-with-color-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running wview on PowerBook G4</title>
		<link>http://christiansons.net/mike/blog/2011/01/running-wview-on-powerbook-g4/</link>
		<comments>http://christiansons.net/mike/blog/2011/01/running-wview-on-powerbook-g4/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 08:01:40 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[weather]]></category>
		<category><![CDATA[powerpc]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=615</guid>
		<description><![CDATA[Ever since I set up my Davis Vantage Vue weather station, I&#8217;ve used my Dell Inspiron Mini 1012 to get weather data from my console, into the computer, and out to the Internet. This weekend I decided to see if I could dust off my old 12&#8243; PowerBook G4 and use it for the same <a href='http://christiansons.net/mike/blog/2011/01/running-wview-on-powerbook-g4/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://www.smugmug.com/photos/1159232851_Y3P2N-Ti.jpg" title="Davis Vantage Vue" class="alignright" width="100" height="100" />Ever since I set up my <a href="http://vantagevue.com/">Davis Vantage Vue</a> weather station, I&#8217;ve used my Dell Inspiron <a href="http://www.dell.com/us/p/inspiron-mini1012/fs">Mini 1012</a> to get weather data from my console, into the computer, and out to the Internet.  This weekend I decided to see if I could dust off my old <a href="http://en.wikipedia.org/wiki/PowerBook_G4#Aluminum_PowerBook_G4">12&#8243; PowerBook G4</a> and use it for the same purpose.</p>
<p><img alt="" src="http://www.smugmug.com/photos/1159226867_QA37y-Ti.jpg" title="12&quot; PowerBook G4" class="alignleft" width="100" height="91" />To complicate matters, I had recently removed OS X 10.4 and installed Ubuntu 10.10 on the PowerBook in an ill-fated attempt to give it new life.  The PowerBook was a great computer in its time but, these days, PowerPC is a dying, if not already dead, architecture.  <span id="more-615"></span>Flash 10?  Not on PowerPC.  Google Chrome?  Nope.  </p>
<p>On the Mini, which ran Windows 7 Starter, I used <a href="http://home.comcast.net/~wuhu_software/">WUHU</a> for data acquisition and upload.  That program worked well, but obviously an x86 PC app just would not do the trick on Linux or a PowerPC.  Some searching led me to <a href="http://www.wviewweather.com">wview</a> which worked on Linux and was capable of running on something like a NSLU2 or plug computer.  It would either be perfect or a perfect mirage.</p>
<p>And then there was the issue of my USB-to-Serial adapter, for connecting the computer to the weather station console.  Who knew if that would work?  </p>
<p>So, there I was with a dead architecture, the wrong OS, a questionable USB adapter and&#8230; well, let&#8217;s just say I wasn&#8217;t very hopeful.  </p>
<p><img alt="" src="http://www.wviewweather.com/wview.png" title="wview" class="alignright" width="100" height="100" />But&#8230; it worked!  Much to my surprise, I was able to get data from my weather station, using wview, through the USB adapter, into the PowerBook, and out to the world.  Here&#8217;s how I did it:</p>
<ol>
<li>Installed <a href="https://wiki.ubuntu.com/PowerPC">Ubuntu 10.10 for PowerPC</a>.</li>
<li>Tested the <a href="http://www.amazon.com/gp/product/B000067VB7?ie=UTF8&#038;tag=wiltblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B000067VB7">IOgear GUC232A USB-to-Serial Adapter</a> and it worked right out of the box.
<pre>
USB Serial support registered for pl2303
usb 3-1: pl2303 converter now attached to ttyUSB0
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
</pre>
<li>Followed <a href="http://www.wviewweather.com/release-notes/wview-Debian-Quick-Start.html">wview Debian Quick Start Guide</a>.  Downloaded and executed <code>wview-install-debian</code></a>, encountered first problem:
<pre>In file included from ../htmlgenerator/htmlStates.c:36:
./glchart.h:28: fatal error: gd.h: No such file or directory</pre>
</li>
<li>Installed <code>libgd2</code>.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libgd2-noxpm-dev</pre></div></div>

</li>
<li>Executed <code>wview-install-debian</code> again, encountered second problem:
<pre>
http.h: error: curl/curl.h: No such file or directory
</pre>
</li>
<li>Installed <code>libcurl4</code>.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libcurl4-openssl-dev</pre></div></div>

</li>
<li>Executed wview-install-debian again; encountered problem; re-ran as

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wview-install-debian <span style="color: #660033;">-f</span></pre></div></div>

</li>
<li>From here out, I followed the <a href="http://www.wviewweather.com/release-notes/wview-User-Manual.html#Configuration">wview user manual for configuration</a>.</li>
</ol>
<div class="wp-caption alignleft" style="width: 310px"><a href="http://christiansons.net/mike/weather/"><img alt="" src="http://christiansons.net/mike/weather/tempdaycomp.png" title="live, daily temperature graph" width="300" height="180" /></a><p class="wp-caption-text">Check it out, it's a live, daily temperature graph.  For reals.</p></div>
<p>Anyway, here&#8217;s my weather page:<br />
<blockquote><a href="http://christiansons.net/mike/weather/"><strong>http://christiansons.net/mike/weather/</strong></a></p></blockquote>
<p>It&#8217;s nice to have brought life back to disused computer; it&#8217;s nice to have my Mini back!</p>
<p>P.S. Not having tried <a href="http://www.wviewweather.com/release-notes/wview-Quick-Start-MacOSX.html">wview on OS X</a>, I can&#8217;t compare the experience or difficulty.</p>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/CvthV6En_U8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2011/01/running-wview-on-powerbook-g4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generic socket server for testing</title>
		<link>http://christiansons.net/mike/blog/2010/10/generic-socket-server-for-testing/</link>
		<comments>http://christiansons.net/mike/blog/2010/10/generic-socket-server-for-testing/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 17:34:49 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[commandline]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[socat]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=593</guid>
		<description><![CDATA[Here&#8217;s a useful one-liner for running a generic socket server. I came up with this socat-based alternative to writing my own for testing client output. It listens on port 4096, accepts TCP/IP connections, and prints input received to stdout. socat TCP-L:4096,fork - Socat is quite powerful, be sure to read more about what it can <a href='http://christiansons.net/mike/blog/2010/10/generic-socket-server-for-testing/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a useful one-liner for running a generic socket server. I came up with this <a href="http://www.dest-unreach.org/socat/">socat</a>-based alternative to writing my own for testing client output. It listens on port <tt>4096</tt>, accepts TCP/IP connections, and prints input received to <tt>stdout</tt>.</p>
<pre>socat TCP-L:4096,fork -</pre>
<p><tt><a href="http://www.dest-unreach.org/socat/">Socat</a></tt> is quite powerful, be sure to read more about what it can do.</p>
<p><strong>2011-July-08</strong>: My coworker has a great post showing how <tt>socat</tt> can <a href="http://dollopofdesi.blogspot.com/2011/07/routing-serial-data-to-socket.html">pipe data from a serial port to a socket</a>!</p>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/PH0BYJipuF4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2010/10/generic-socket-server-for-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes on Java’s Date class</title>
		<link>http://christiansons.net/mike/blog/2010/09/notes-on-javas-date-class/</link>
		<comments>http://christiansons.net/mike/blog/2010/09/notes-on-javas-date-class/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 21:55:07 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[timezone]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=560</guid>
		<description><![CDATA[Every so often I get myself confused about Java&#8217;s often-obtuse handling of dates and timezones. So, for my future self&#8217;s benefit, here are some reminder notes&#8230; Please leave a comment if you have corrections or additional tips! (And, preemptively, yes, some day I&#8217;ll give Joda Time a try.) Dates do not have timezones; they reflect <a href='http://christiansons.net/mike/blog/2010/09/notes-on-javas-date-class/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Every so often I get myself confused about Java&#8217;s often-obtuse handling of dates and timezones.  So, for my future self&#8217;s benefit, here are some reminder notes&#8230;  <span id="more-560"></span></p>
<p>Please leave a comment if you have corrections or additional tips!  (And, preemptively, yes, some day I&#8217;ll give <a href="http://joda-time.sourceforge.net/">Joda Time</a> a try.)</p>
<ul>
<li><tt>Date</tt>s do not have timezones; <a href="http://download.oracle.com/javase/6/docs/api/java/util/Date.html"> they reflect UTC</a>.</li>
<li><a href="http://download.oracle.com/javase/6/docs/api/java/util/Date.html#toString()"><tt>Date.toString()</tt></a> returns a <tt>String</tt> representation based on the local machine&#8217;s default timezone.  This makes people think that <tt>Date</tt>s have timezones.</li>
<li>You cannot convert a <tt>Date</tt> from one timezone to another.</li>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">Calendar</span> c = <span style="color: #003399; font-weight: bold;">Calendar</span>.<span style="color: #006633;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
c.<span style="color: #006633;">setTime</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
c.<span style="color: #006633;">setTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">TimeZone</span>.<span style="color: #006633;">getTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UTC&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399; font-weight: bold;">Date</span> utc = c.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
c.<span style="color: #006633;">setTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">TimeZone</span>.<span style="color: #006633;">getTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;America/Phoenix&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399; font-weight: bold;">Date</span> mst = c.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">assert</span> <span style="color: #339933;">!</span>utc.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>mst<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">//throws AssertionError</span></pre></div></div>

<li>However, you <em>can</em> use <tt>DateFormat</tt> to affect the <tt>String</tt> representation of a <tt>Date</tt>, including the timezone.</li>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">Date</span> date <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">SimpleDateFormat</span> utcFormat <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">SimpleDateFormat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ddHHmm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">SimpleDateFormat</span> mstFormat <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">SimpleDateFormat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ddHHmm&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
utcFormat.<span style="color: #006633;">setTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">TimeZone</span>.<span style="color: #006633;">getTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UTC&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
mstFormat.<span style="color: #006633;">setTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">TimeZone</span>.<span style="color: #006633;">getTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;America/Phoenix&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> utc <span style="color: #339933;">=</span> utcFormat.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span>date<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> mst <span style="color: #339933;">=</span> mstFormat.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span>date<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">assert</span> <span style="color: #339933;">!</span>utc.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>mst<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">//should not throw AssertionError</span></pre></div></div>

</ul>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/bBBhNgRVVbQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2010/09/notes-on-javas-date-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pin Eclipse to taskbar in Windows 7</title>
		<link>http://christiansons.net/mike/blog/2010/08/pin-eclipse-to-taskbar-in-windows-7/</link>
		<comments>http://christiansons.net/mike/blog/2010/08/pin-eclipse-to-taskbar-in-windows-7/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 18:02:55 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[windows7]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=554</guid>
		<description><![CDATA[There&#8217;s an issue with pinning Eclipse to the Windows 7 taskbar on 64-bit systems. Fortunately one of the suggested workarounds does the trick for me.]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s an <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=314805">issue with pinning Eclipse</a> to the Windows 7 taskbar on 64-bit systems.  Fortunately one of the <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=314805#c21">suggested workarounds</a> does the trick for me.<br />
<a href="http://www.smugmug.com/photos/958450986_d3i5D-L.png"><img alt="" src="http://www.smugmug.com/photos/958450986_d3i5D-Th.png" title="screenshot" class="aligncenter" width="150" height="144" /></a></p>
<img src="http://feeds.feedburner.com/~r/wilt-blog/~4/jzzhGWDpcqY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2010/08/pin-eclipse-to-taskbar-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

