<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>FangSoft</title>
	<atom:link href="http://www.fangsoft.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.fangsoft.net</link>
	<description>Programming with Style</description>
	<lastBuildDate>Fri, 22 Jan 2010 04:55:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>NextHub development ceased</title>
		<link>http://www.fangsoft.net/?p=214</link>
		<comments>http://www.fangsoft.net/?p=214#comments</comments>
		<pubDate>Fri, 22 Jan 2010 04:55:44 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[NextHub]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=214</guid>
		<description><![CDATA[<p>I&#8217;ve finally decided to make it official. If you view the NextHub SourceForge project page, you&#8217;ll find that it now states the following:</p> <p>As of 2010-01-21 18:00:00 CST, this project is no longer under active development.</p> <p>That&#8217;s right: NextHub development is indefinitely suspended. Neither Andy nor I have had time to work on it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally decided to make it official.  If you view the <a href="https://sourceforge.net/projects/nexthub/">NextHub SourceForge project page</a>, you&#8217;ll find that it now states the following:</p>
<blockquote><p>As of 2010-01-21 18:00:00 CST, this project is no longer under active development.</p></blockquote>
<p>That&#8217;s right: NextHub development is indefinitely suspended.  Neither Andy nor I have had time to work on it in over a year, and it&#8217;s time to stop kidding ourselves into thinking we&#8217;ll resume it.  My grad school work is occupying all my time, and I just can&#8217;t continue regular development on the project anymore.  I&#8217;m not opposed to handing the project over to excited developers that are interested in pursuing the project.  The basic functionality is there, but there is still quite a bit that Andy and I envisioned that we weren&#8217;t able to see through.</p>
<p>RIP NextHub.  You taught me a lot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=214</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pretty Things</title>
		<link>http://www.fangsoft.net/?p=201</link>
		<comments>http://www.fangsoft.net/?p=201#comments</comments>
		<pubDate>Wed, 21 Oct 2009 04:32:58 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=201</guid>
		<description><![CDATA[<p>Back in February, when I went to Vienna for the 2009 IMED conference, my biggest complaint about the trip was that I didn&#8217;t have a nice camera to capture the experience. Thanks to some friends, I was able to borrow a small Canon point and shoot, but it just didn&#8217;t have the horsepower and [...]]]></description>
			<content:encoded><![CDATA[<p>Back in February, when I went to Vienna for the <a href="http://imed.isid.org/">2009 IMED conference</a>, my biggest complaint about the trip was that I didn&#8217;t have a nice camera to capture the experience.  Thanks to some friends, I was able to borrow a small Canon point and shoot, but it just didn&#8217;t have the horsepower and options I really craved to get the job done.  My friend <a href="http://www.flickr.com/photos/proham/">Chris</a>, on the other hand, did have a nice camera and was able to capture some pretty nice images.  He had a <a href="http://en.wikipedia.org/wiki/Canon_EOS_450D">Canon Rebel XSi</a> at the time, and as soon as I got back, I began researching cameras.  Not too long after I got back home, I wound up buying an XSi myself.</p>
<p>Now, I&#8217;ve never had an ounce of artistic talent in my body.  I&#8217;ve always loved good photography, and since I&#8217;ve been in college, at least, I always wanted to get into photography myself.  I never had the funds, though, until I got to grad school.  Since getting into this hobby, I&#8217;ve discovered that I can express myself artistically after all!  It&#8217;s really exciting, and I&#8217;ve grown to really love this side of myself.</p>
<p>Even though I&#8217;ve only been into photography for about 7 months, I&#8217;ve already built up a pretty nice arsenal:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Canon_EOS_50D">Canon 50D</a></li>
<li><a href="http://en.wikipedia.org/wiki/Canon_EF_50mm_lens#EF_50mm_f.2F1.8_II">Canon 50mm f/1.8</a></li>
<li><a href="http://en.wikipedia.org/wiki/Canon_EF_100mm_lens">Canon 100mm f/2.8L macro</a></li>
<li><a href="http://en.wikipedia.org/wiki/Sigma_10%E2%80%9320mm_f/4%E2%80%935.6_EX_DC_HSM_lens">Sigma 10-20mm f/4-5.6</a></li>
<li><a href="http://en.wikipedia.org/wiki/Canon_EF-S_55-250mm_lens">Canon 55-250mm f/4-5.6 IS</a></li>
</ul>
<p>I have really versatile equipment.  The only thing currently missing is a general walk-around lens.  After much deliberation, I&#8217;ve decided to buy the <a href="http://www.tamron.com/lenses/prod/1750_vc_b005.asp">Tamron 17-50mm f/2.8 VC</a>.  This Tamron&#8217;s younger brother (the non-VC 17-50mm f/2.8) is an incredibly popular walk-around lens for crop bodies due to its speed and sharpness.  The new VC-enabled 17-50mm is set to debut sometime this next month, and I can&#8217;t wait.  It&#8217;s priced really well, too, at about half the price of <a href="http://en.wikipedia.org/wiki/Canon_EF-S_17-55mm_lens">Canon&#8217;s 17-55mm f/2.8 IS</a> whose only real advantage is a USM motor providing quieter and speedier auto-focusing.  For a grad student, choosing the Tamron over the Canon was a no-brainer.</p>
<p>Alright, the title of this post is &#8220;Pretty Things,&#8221; so I suppose I should get on with it.  Here are some of my favorite pictures.  Clicking each image will take you to my Flickr page where you can view the image at a larger resolution by clicking on the magnifying glass above the image that says &#8220;All Sizes.&#8221;</p>
<p><center><a href="http://www.flickr.com/photos/gcfairch/4004159772/" title="bolts on a bridge (by gcfairch)"><img src="http://farm3.static.flickr.com/2479/4004159772_82d4929545_m.jpg" title="bolts on a bridge (by gcfairch)" alt="bolts on a bridge (by gcfairch)" width="240" height="160" /></a> <a href="http://www.flickr.com/photos/gcfairch/3954129220/" title="sunset lake (by gcfairch)"><img src="http://farm3.static.flickr.com/2539/3954129220_83ceba4d5a_m.jpg" title="sunset lake (by gcfairch)" alt="sunset lake (by gcfairch)" width="240" height="121" /></a> <a href="http://www.flickr.com/photos/gcfairch/3677382202/" title="NBC building in Chicago (by gcfairch)"><img src="http://farm4.static.flickr.com/3657/3677382202_10c14181bd_m.jpg" title="NBC building in Chicago (by gcfairch)" alt="NBC building in Chicago (by gcfairch)" width="240" height="162" /></a> <a href="http://www.flickr.com/photos/gcfairch/3677608740/" title="IMG_2691 (by gcfairch)"><img src="http://farm4.static.flickr.com/3632/3677608740_d7c7fa1a20_m.jpg" title="IMG_2691 (by gcfairch)" alt="IMG_2691 (by gcfairch)" width="240" height="147" /></a></center></p>
<p><center><a href="http://www.flickr.com/photos/gcfairch/3605584504/" title="Federal LE Tactical .40 hollow point 1 (by gcfairch)"><img src="http://farm4.static.flickr.com/3355/3605584504_78ac6e8d86_m.jpg" title="Federal LE Tactical .40 hollow point 1 (by gcfairch)" alt="Federal LE Tactical .40 hollow point 1 (by gcfairch)" width="160" height="240" /></a> <a href="http://www.flickr.com/photos/gcfairch/3599118248/" title="Shadow's eye (by gcfairch)"><img src="http://farm4.static.flickr.com/3303/3599118248_b93d5c799e_m.jpg" title="Shadow's eye (by gcfairch)" alt="Shadow's eye (by gcfairch)" width="240" height="160" /></a> <a href="http://www.flickr.com/photos/gcfairch/3676566115/" title="IMG_2745 (by gcfairch)"><img src="http://farm3.static.flickr.com/2634/3676566115_4c78cf8f2e_m.jpg" title="IMG_2745 (by gcfairch)" alt="IMG_2745 (by gcfairch)" width="240" height="160" /></a> <a href="http://www.flickr.com/photos/gcfairch/3677399042/" title="IMG_2910 (by gcfairch)"><img src="http://farm3.static.flickr.com/2592/3677399042_2d149d3582_m.jpg" title="IMG_2910 (by gcfairch)" alt="IMG_2910 (by gcfairch)" width="170" height="240" /></a></center></p>
<p><center><a href="http://www.flickr.com/photos/gcfairch/3905235336/" title="bee on purple flower 2 (by gcfairch)"><img src="http://farm3.static.flickr.com/2599/3905235336_b536cf29ac_m.jpg" title="bee on purple flower 2 (by gcfairch)" alt="bee on purple flower 2 (by gcfairch)" width="240" height="160" /></a> <a href="http://www.flickr.com/photos/gcfairch/3763092801/" title="IMG_3861 (by gcfairch)"><img src="http://farm4.static.flickr.com/3453/3763092801_125625cac0_m.jpg" title="IMG_3861 (by gcfairch)" alt="IMG_3861 (by gcfairch)" width="240" height="160" /></a> <a href="http://www.flickr.com/photos/gcfairch/4003393229/" title="IMG_2948 (by gcfairch)"><img src="http://farm3.static.flickr.com/2638/4003393229_16dfbaf680_m.jpg" title="IMG_2948 (by gcfairch)" alt="IMG_2948 (by gcfairch)" width="240" height="160" /></a> <a href="http://www.flickr.com/photos/gcfairch/3905280994/" title="IMG_4496 (by gcfairch)"><img src="http://farm4.static.flickr.com/3470/3905280994_9ea46578a8_m.jpg" title="IMG_4496 (by gcfairch)" alt="IMG_4496 (by gcfairch)" width="240" height="141" /></a></center></p>
<p><center><a href="http://www.flickr.com/photos/gcfairch/3763878802/" title="IMG_3778 (by gcfairch)"><img src="http://farm3.static.flickr.com/2553/3763878802_64a8e1cb6e_m.jpg" title="IMG_3778 (by gcfairch)" alt="IMG_3778 (by gcfairch)" width="240" height="136" /></a> <a href="http://www.flickr.com/photos/gcfairch/3599442253/" title="my eye 2 (by gcfairch)"><img src="http://farm4.static.flickr.com/3612/3599442253_f95a1a44ce_m.jpg" title="my eye 2 (by gcfairch)" alt="my eye 2 (by gcfairch)" width="240" height="198" /></a> <a href="http://www.flickr.com/photos/gcfairch/3561277365/" title="bee 2 (by gcfairch)"><img src="http://farm4.static.flickr.com/3375/3561277365_ef9fb55879_m.jpg" title="bee 2 (by gcfairch)" alt="bee 2 (by gcfairch)" width="237" height="240" /></a> <a href="http://www.flickr.com/photos/gcfairch/3677413896/" title="IMG_3081 (by gcfairch)"><img src="http://farm4.static.flickr.com/3537/3677413896_3906547e36_m.jpg" title="IMG_3081 (by gcfairch)" alt="IMG_3081 (by gcfairch)" width="240" height="150" /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=201</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SA emoticons no longer being updated by me</title>
		<link>http://www.fangsoft.net/?p=199</link>
		<comments>http://www.fangsoft.net/?p=199#comments</comments>
		<pubDate>Wed, 21 Oct 2009 03:56:53 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=199</guid>
		<description><![CDATA[<p>I will no longer be maintaining the SA emoticon pack on digsbies. tweekmonster on SA has redone his auto-updating site that generates SA emoticon packs, and it now includes support for Digsby (along with many other platforms). So, if you want to get the SA emoticon pack, simply go to http://sae.tweek.us/ now instead of [...]]]></description>
			<content:encoded><![CDATA[<p>I will no longer be maintaining the <a href="http://digsbies.org/site/project/saemote">SA emoticon pack on digsbies</a>.  <a href="http://forums.somethingawful.com/member.php?action=getinfo&#038;userid=35329">tweekmonster</a> on SA has redone his <a href="http://sae.tweek.us/">auto-updating site that generates SA emoticon packs</a>, and it now includes support for Digsby (along with many other platforms).  So, if you want to get the SA emoticon pack, simply go to <a href="http://sae.tweek.us/">http://sae.tweek.us/</a> now instead of the digsbies site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=199</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More changes to my SA emoticon packager for Digsby/Pidgin</title>
		<link>http://www.fangsoft.net/?p=192</link>
		<comments>http://www.fangsoft.net/?p=192#comments</comments>
		<pubDate>Wed, 22 Jul 2009 11:23:55 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=192</guid>
		<description><![CDATA[<p>SA recently updated the layout of their smileys, and as a result, I had to update my automatic emoticon packager so that I can continue maintaining the Digsby SA emoticons. While trying to fix the regular expressions, a fellow goon pointed me to lxml, an XML/HTML library for Python. He suggested using XPath, something [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://forums.somethingawful.com/">SA</a> recently updated the layout of their <a href="http://forums.somethingawful.com/misc.php?s=&#038;action=showsmilies">smileys</a>, and as a result, I had to update my automatic emoticon packager so that I can continue maintaining the <a href="http://digsbies.org/site/project/saemote">Digsby SA emoticons</a>.  While trying to fix the regular expressions, a fellow goon pointed me to <a href="http://codespeak.net/lxml/">lxml</a>, an XML/HTML library for Python.  He suggested using XPath, something I had learned about in my database class <em>just this last semester</em>.  I had already forgotten about it, and it never crossed my mind to use it!  Boy, I&#8217;m glad he suggested that because the XPath code is <em>much</em> simpler than the equivalent regular expression.</p>
<p>Here an example of what I am parsing:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span>&gt;</span>:arghfist:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://i.somethingawful.com/forumsystem/emoticons/emot-arghfist.gif&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;SO ANGRY&quot;</span><span style="color: #66cc66;">/</span>&gt;</span></pre></td></tr></table></div>

<p>What I was originally doing was reading the website source code line by line and using regex to capture <code>:arghfist:</code> and <code>http://i.somethingawful.com/forumsystem/emoticons/emot-arghfist.gif</code>.  However, now I can simply use these two lines to capture <em>every single</em> emoticon:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">page = html.<span style="color: black;">parse</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;http://forums.somethingawful.com/misc.php?s=&amp;action=showsmilies&quot;</span><span style="color: black;">&#41;</span>
emoteDict = <span style="color: #008000;">dict</span><span style="color: black;">&#40;</span><span style="color: #008000;">zip</span><span style="color: black;">&#40;</span>page.<span style="color: black;">xpath</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;//li[@class='smilie']/div/text()&quot;</span><span style="color: black;">&#41;</span>, page.<span style="color: black;">xpath</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;//li[@class='smilie']/img/@src&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>That&#8217;s really all there is to it!  I&#8217;ve re-uploaded the source code if you&#8217;d like to take a look at it.  You can get it at <a href="http://www.fangsoft.net/public/SA-emotes-source.7z">http://www.fangsoft.net/public/SA-emotes-source.7z</a>.  Remember that you&#8217;ll need lxml in order to run this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=192</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hasher Update (and how to obtain the hash of a file in Java)</title>
		<link>http://www.fangsoft.net/?p=183</link>
		<comments>http://www.fangsoft.net/?p=183#comments</comments>
		<pubDate>Thu, 02 Apr 2009 22:58:13 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[Eclipse Plugins]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=183</guid>
		<description><![CDATA[<p>I updated Hasher today. The plugin still functions the same, but I fixed a bug in the hash generation algorithm (thanks to Vladimir Kozlov for pointing the bug out to me). I also greatly increased modularity which in turn reduced the code size rather significantly. Here is how I calculate the hash of a [...]]]></description>
			<content:encoded><![CDATA[<p>I updated <a href="http://www.fangsoft.net/?page_id=56">Hasher</a> today.  The plugin still functions the same, but I fixed a bug in the hash generation algorithm (thanks to Vladimir Kozlov for pointing the bug out to me).  I also greatly increased modularity which in turn reduced the code size rather significantly.  Here is how I calculate the hash of a file (the String parameter algorithm can be any algorithm listed at <a href="http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#MessageDigest">http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#MessageDigest</a>):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> HEX_CHARS <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;0123456789abcdef&quot;</span>.<span style="color: #006633;">toCharArray</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">String</span> generateHash<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> file, <span style="color: #003399;">String</span> algorithm<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">NoSuchAlgorithmException</span>, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> dataBytes <span style="color: #339933;">=</span> getFileContents<span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003399;">MessageDigest</span> messageDigest <span style="color: #339933;">=</span> <span style="color: #003399;">MessageDigest</span>.<span style="color: #006633;">getInstance</span><span style="color: #009900;">&#40;</span>algorithm<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	messageDigest.<span style="color: #006633;">update</span><span style="color: #009900;">&#40;</span>dataBytes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> digestBytes <span style="color: #339933;">=</span> messageDigest.<span style="color: #006633;">digest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// this chunk of code was taken from http://echochamber.me/viewtopic.php?f=11&amp;t=16666&amp;p=553936#p459685</span>
	<span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> hash <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">*</span> digestBytes.<span style="color: #006633;">length</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> digestBytes.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		hash<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">*</span> i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> HEX_CHARS<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#40;</span>digestBytes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;</span> 0xF0<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;&gt;&gt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		hash<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">*</span> i <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> HEX_CHARS<span style="color: #009900;">&#91;</span>digestBytes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;</span> 0x0F<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> getFileContents<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> file<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003399;">FileInputStream</span> fileInputStream <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
		fileInputStream <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileInputStream</span><span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">byte</span> fileBytes<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span>fileInputStream.<span style="color: #006633;">available</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		fileInputStream.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>fileBytes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> fileBytes<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">throw</span> e<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>fileInputStream <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
				fileInputStream.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span> <span style="color: #009900;">&#123;</span>
				fileInputStream <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=183</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SA Emoticon Packager Updates</title>
		<link>http://www.fangsoft.net/?p=157</link>
		<comments>http://www.fangsoft.net/?p=157#comments</comments>
		<pubDate>Sun, 15 Mar 2009 00:20:42 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=157</guid>
		<description><![CDATA[<p>I&#8217;ve updated the SA emoticon packager once again. I&#8217;ve added functionality to expand it beyond just Digsby. Currently, it generates packages for both Digsby and Pidgin. The way I&#8217;ve designed it, it&#8217;d be fairly trivial to add support for Adium or any other chat program. Maybe I&#8217;ll do that someday. If you&#8217;d like the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve updated the <a href="http://www.fangsoft.net/?p=93">SA emoticon packager</a> once again.  I&#8217;ve added functionality to expand it beyond just Digsby.  Currently, it generates packages for both <a href="http://www.digsby.com/">Digsby</a> and <a href="http://www.pidgin.im/">Pidgin</a>.  The way I&#8217;ve designed it, it&#8217;d be fairly trivial to add support for Adium or any other chat program.  Maybe I&#8217;ll do that someday.  If you&#8217;d like the source code, I&#8217;ve put it up on my website for download.  You&#8217;ll need an archive manager that can open <a href="http://www.7-zip.org/">7-Zip</a> archives to open this file.</p>
<p><strong>Download:</strong> <a href="http://www.fangsoft.net/public/SA-emotes-source.7z">http://www.fangsoft.net/public/SA-emotes-source.7z</a></p>
<p>Don&#8217;t forget that you can visit <a href="http://digsbies.org/site/project/saemote">http://digsbies.org/site/project/saemote</a> to download the most recent SA emoticon package for Digsby.</p>
<p>If you find this useful or have a question or comment, please leave me a comment.  <img src='http://www.fangsoft.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=157</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another KML ZCTA Population Map</title>
		<link>http://www.fangsoft.net/?p=128</link>
		<comments>http://www.fangsoft.net/?p=128#comments</comments>
		<pubDate>Tue, 24 Feb 2009 14:03:22 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=128</guid>
		<description><![CDATA[<p>I edited the KML ZCTA population map that I posted on 2/22/09. For my uses, it&#8217;s important that I be able to calculate distances between ZCTAs. To calculate these distances, I use the center of each ZCTA. To avoid complex centroid calculations, and since the Census Bureau&#8217;s ZCTA boundary data includes the centers so [...]]]></description>
			<content:encoded><![CDATA[<p>I edited the KML ZCTA population map that <a href="http://www.fangsoft.net/?p=113">I posted on 2/22/09</a>.  For my uses, it&#8217;s important that I be able to calculate distances between ZCTAs.  To calculate these distances, I use the center of each ZCTA.  To avoid complex centroid calculations, and since the <a href="http://www.census.gov/geo/www/cob/z52000.html">Census Bureau&#8217;s ZCTA boundary data</a> includes the centers so that this calculation isn&#8217;t necessary, I figured I&#8217;d include them.</p>
<p>I did this by changing the KML geometry from a single <a href="http://code.google.com/apis/kml/documentation/kmlreference.html#linearring">LinearRing</a> to a <a href="http://code.google.com/apis/kml/documentation/kmlreference.html#multigeometry">MultiGeometry</a> of LinearRings and <a href="http://code.google.com/apis/kml/documentation/kmlreference.html#point">Point</a>s.  Let me know if this is useful to you!</p>
<p>Also, if you&#8217;re curious, the distance formula for computing the distance (in miles) between two latitude/longitude points (in degrees) is fairly simple.  Courtesy, <a href="http://www.meridianworlddata.com/Distance-Calculation.asp">http://www.meridianworlddata.com/Distance-Calculation.asp</a>, here it is:</p>
<p>$$3963 \cdot \arccos[\sin(lat1) \cdot \sin(lat2) + \cos(lat1) \cdot \cos(lat2) \cdot \cos(long2 - long1)]$$</p>
<p><strong>Download</strong>: <a href="http://www.fangsoft.net/public/populationZCTA.kmz">http://www.fangsoft.net/public/populationZCTA.kmz</a> (20.8mb)</p>
<p>Here&#8217;s what this new file looks like in <a href="http://earth.google.com/">Google Earth</a>:</p>

<a href='http://www.fangsoft.net/?attachment_id=130' title='ZCTA map of IA with centers included'><img width="150" height="96" src="http://www.fangsoft.net/wordpress/wp-content/uploads/2009/02/centers-150x96.png" class="attachment-thumbnail" alt="ZCTA map of IA with centers included" title="ZCTA map of IA with centers included" /></a>
<a href='http://www.fangsoft.net/?attachment_id=149' title='52245 population count'><img width="150" height="88" src="http://www.fangsoft.net/wordpress/wp-content/uploads/2009/02/52245-150x88.png" class="attachment-thumbnail" alt="52245 population count" title="52245 population count" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=128</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KML Map with ZCTA Boundaries and Population Counts from the 2000 Census</title>
		<link>http://www.fangsoft.net/?p=113</link>
		<comments>http://www.fangsoft.net/?p=113#comments</comments>
		<pubDate>Sun, 22 Feb 2009 07:53:44 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=113</guid>
		<description><![CDATA[<p>My research thus far in grad school has been concentrated around using computer science and GIS tools/techniques to help solve medical problems.  For one of the problems I&#8217;m working on, I need access to ZCTA boundaries and population counts for each ZCTA.  For those of you that don&#8217;t know, ZCTA stands for ZIP-code tabulation [...]]]></description>
			<content:encoded><![CDATA[<p>My research thus far in grad school has been concentrated around using computer science and GIS tools/techniques to help solve medical problems.  For one of the problems I&#8217;m working on, I need access to ZCTA boundaries and population counts for each ZCTA.  For those of you that don&#8217;t know, ZCTA stands for ZIP-code tabulation area; basically, it&#8217;s what the Census Bureau uses to split the US population up geographically.  ZCTAs typically correspond to ZIP codes, but unfortunately, that&#8217;s doesn&#8217;t always happen (there is a ZCTA 506HH, for example).  Some ZCTAs have populations of 0.  However, as far as I can tell, ZCTAs are the best thing we have for geographically representing the US population.</p>
<p>Anyway, what I was doing was using the shapefiles publicly available at <a title="http://www.census.gov/geo/www/cob/z52000.html" href="http://www.census.gov/geo/www/cob/z52000.html" target="_blank">http://www.census.gov/geo/www/cob/z52000.html</a> to get the ZCTA boundary information.  I also used the 2000 census population data available from <a title="http://factfinder.census.gov/servlet/DownloadDatasetServlet?_lang=en" href="http://factfinder.census.gov/servlet/DownloadDatasetServlet?_lang=en" target="_blank">http://factfinder.census.gov/servlet/DownloadDatasetServlet?_lang=en</a>.<a title="http://factfinder.census.gov/servlet/DCGeoSelectServlet?ds_name=DEC_2000_SF1_U" href="http://factfinder.census.gov/servlet/DCGeoSelectServlet?ds_name=DEC_2000_SF1_U" target="_blank"></a> This is all fine and dandy, but reading shapefiles can be kind of a pain.  <a title="GeoTools" href="http://geotools.codehaus.org/" target="_blank">GeoTools</a> works quite well, but it&#8217;s Java-only.  I&#8217;m in the process of converting a Java-based application into a PHP web-based application for some of my research.  PHP&#8217;s shapefile readers, at least from what I&#8217;ve heard, can be kind of hit or miss.  Also, having to get this data from multiple sources starts to make code look kinda nasty.  Ideally, since population information goes with ZCTAs, there should be a 1-stop shop that gives me both the boundary information and population counts for each ZCTA in the US.  And if it&#8217;s not too much to ask for, I&#8217;d like a human-readable text format.  So what do I do?</p>
<p>A KML map seemed like the most obvious answer.  It&#8217;s XML, so it&#8217;s easily readable, and it&#8217;s highly extensible and powerful.  And since Google&#8217;s name is behind it, it&#8217;s very widely supported.  What&#8217;s not to like?  Surely, a KML file like this exists, right?  Well, after quite a bit of Googling, I came to the conclusion that one didn&#8217;t exist.  So, I decided to make my own.  I wrote a Java program to read in the population information and ASCII coordinates of each ZCTA listed at the bottom of the Census Bureau&#8217;s page I linked to in the above paragraph and spit out a KML map.</p>
<p>Because this is so useful to me (and really, anyone doing anything that requires ZCTA-level population counts), I figured I&#8217;d upload it here and let anyone that wants it grab it.  This took me a decent chunk of time to get done, so maybe I can save someone else some time by sharing this.  If you use this, please let me know by leaving a comment.  Also, if you&#8217;re interested in the Java code I used to create the KML file, feel free to ask.</p>
<p><strong>Download</strong>: <a title="http://www.fangsoft.net/public/populationZCTA.kmz" href="http://www.fangsoft.net/public/populationZCTA.kmz">http://www.fangsoft.net/public/populationZCTA.kmz</a> (size: 20.1mb)</p>
<p>Note: This file has a KMZ extension (not a KML extension).  A KMZ file is simply a zipped-up KML file.  If you wish to access the underlying KML markup, simply rename the file to populationZCTA.zip, and unzip it like you would a normal ZIP file.  Google Earth can read the KMZ file without unzipping.</p>
<p>Here&#8217;s what it looks like in <a title="Google Earth" href="http://earth.google.com/" target="_blank">Google Earth</a>:</p>

<a href='http://www.fangsoft.net/?attachment_id=143' title='places selector showing state-level population counts'><img width="88" height="150" src="http://www.fangsoft.net/wordpress/wp-content/uploads/2009/02/places-88x150.png" class="attachment-thumbnail" alt="places selector showing state-level population counts" title="places selector showing state-level population counts" /></a>
<a href='http://www.fangsoft.net/?attachment_id=133' title='places selector for IA showing ZCTA-level population counts'><img width="88" height="150" src="http://www.fangsoft.net/wordpress/wp-content/uploads/2009/02/iowapop-88x150.png" class="attachment-thumbnail" alt="places selector for IA showing ZCTA-level population counts" title="places selector for IA showing ZCTA-level population counts" /></a>
<a href='http://www.fangsoft.net/?attachment_id=135' title='ZCTA boundaries for the entire US'><img width="150" height="96" src="http://www.fangsoft.net/wordpress/wp-content/uploads/2009/02/usa-150x96.png" class="attachment-thumbnail" alt="ZCTA boundaries for the entire US" title="ZCTA boundaries for the entire US" /></a>
<a href='http://www.fangsoft.net/?attachment_id=131' title='ZCTA boundaries for CA, CO, IA, and TX'><img width="150" height="112" src="http://www.fangsoft.net/wordpress/wp-content/uploads/2009/02/calcoloiowatx-150x112.png" class="attachment-thumbnail" alt="ZCTA boundaries for CA, CO, IA, and TX" title="ZCTA boundaries for CA, CO, IA, and TX" /></a>
<a href='http://www.fangsoft.net/?attachment_id=132' title='ZCTA boundaries for IA'><img width="150" height="97" src="http://www.fangsoft.net/wordpress/wp-content/uploads/2009/02/iowa-150x97.png" class="attachment-thumbnail" alt="ZCTA boundaries for IA" title="ZCTA boundaries for IA" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=113</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>More changes to Digsby&#8217;s Python package manager and SA&#8217;s emoticons</title>
		<link>http://www.fangsoft.net/?p=107</link>
		<comments>http://www.fangsoft.net/?p=107#comments</comments>
		<pubDate>Sat, 20 Sep 2008 06:44:16 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=107</guid>
		<description><![CDATA[<p>I decided to alter my Python script that automates the process of the creation of the Digsby SA emoticons package.  I&#8217;m changing it so that it will automate the creation of the emoticon pack for other IM clients (namely, Adium, Miranda IM, and Pidgin).  tweekmonster of SA seems to have disappeared off the face [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to alter my Python script that automates the process of the creation of the Digsby SA emoticons package.  I&#8217;m changing it so that it will automate the creation of the emoticon pack for other IM clients (namely, <a title="Adium" href="http://www.adiumx.com/" target="_blank">Adium</a>, <a title="Miranda IM" href="http://www.miranda-im.org/" target="_blank">Miranda IM</a>, and <a title="Pidgin" href="http://www.pidgin.im/" target="_blank">Pidgin</a>).  <a title="tweekmonster of SA" href="http://forums.somethingawful.com/member.php?s=&amp;action=getinfo&amp;userid=35329" target="_blank">tweekmonster of SA</a> seems to have disappeared off the face of the Earth, and his <a title="SA emoticons page" href="http://sa.tweek.us/emots/" target="_blank">SA emoticons page</a> is doing wonky things (why does it contain 523 emoticons when <a title="SA's smilies page" href="http://forums.somethingawful.com/misc.php?s=&amp;action=showsmilies" target="_blank">SA&#8217;s smilies page</a> has only 376?).  I figured I&#8217;d rewrite it correctly and put it up on my website.  The changes to my Python script are almost complete, and then I just need to add the web frontend.  This will hopefully be done this weekend.  <img src='http://www.fangsoft.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em>Update:</em><br />
Well, for right now, I&#8217;ve decided not to do this.  I may change my mind sometime in the future.  Right now, I&#8217;m content with just maintaining the Digsby SA emotes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=107</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SA Emoticon Pack Package Manager</title>
		<link>http://www.fangsoft.net/?p=96</link>
		<comments>http://www.fangsoft.net/?p=96#comments</comments>
		<pubDate>Fri, 05 Sep 2008 00:23:07 +0000</pubDate>
		<dc:creator>Fangs404</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.fangsoft.net/?p=96</guid>
		<description><![CDATA[<p>In my previous post, I described the SA emoticon pack package manager that I wrote in Python.  I&#8217;ve had several interested people ask me for it, so I figured I&#8217;d go ahead and post the source code.  If you want to get the source, just download the following file.</p> <p>Download: http://www.fangsoft.net/public/SA-emotes-source.7z</p> <p>If you notice [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post, I described the SA emoticon pack package manager that I wrote in Python.  I&#8217;ve had several interested people ask me for it, so I figured I&#8217;d go ahead and post the source code.  If you want to get the source, just download the following file.</p>
<p><strong>Download:</strong> <a title="http://www.fangsoft.net/public/SA-emotes-source.7z" href="http://www.fangsoft.net/public/SA-emotes-source.7z">http://www.fangsoft.net/public/SA-emotes-source.7z</a></p>
<p>If you notice anything I&#8217;ve done wrong (like I said, I&#8217;m still a Python newbie), please tell me.  Or, if you know of a way to do something more efficiently than what I&#8217;ve done, please tell me.  Let me know what you think, either way.  <img src='http://www.fangsoft.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.fangsoft.net/?feed=rss2&amp;p=96</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
