<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>grepmonster</title>
	<atom:link href="http://grepmonster.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://grepmonster.wordpress.com</link>
	<description>He hides under your bed</description>
	<lastBuildDate>Tue, 17 Jan 2012 11:24:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='grepmonster.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>grepmonster</title>
		<link>http://grepmonster.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://grepmonster.wordpress.com/osd.xml" title="grepmonster" />
	<atom:link rel='hub' href='http://grepmonster.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Changing the Privacy Settings on Google+ Games</title>
		<link>http://grepmonster.wordpress.com/2011/12/27/changing-the-privacy-settings-on-google-games/</link>
		<comments>http://grepmonster.wordpress.com/2011/12/27/changing-the-privacy-settings-on-google-games/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 16:44:13 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Google Plus]]></category>
		<category><![CDATA[Interweb]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=235</guid>
		<description><![CDATA[For a while now I&#8217;ve been struggling to remove games I&#8217;ve played on Google+. Typically I grant a Third Party game access to all of my private data, play it for a few days and then I&#8217;m done with it. This is true of all the games I&#8217;ve played on Google+ with the exception of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=235&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For a while now I&#8217;ve been struggling to remove games I&#8217;ve played on Google+. Typically I grant a Third Party game access to all of my private data, play it for a few days and then I&#8217;m done with it. This is true of all the games I&#8217;ve played on Google+ with the exception of <a title="Triple Town Game" href="https://plus.google.com/u/0/games/209089085730">Triple Town</a>, which is simply awesome!</p>
<p>Anyway, once I&#8217;ve finished with a game, I want to block it from accessing my private data. Annoyingly Google doesn&#8217;t seem to provide an obvious way to do this in their settings. That was until I came across<a title="Google App Privacy" href="https://www.google.com/accounts/IssuedAuthSubTokens?hl=en"> this link</a>. This page allows you to revoke permissions from any Third Party application that is connected to your Google account. Google take heed &#8211; please provide a link somewhere on Plus to this page!</p>
<br />Filed under: <a href='http://grepmonster.wordpress.com/category/games/'>Games</a>, <a href='http://grepmonster.wordpress.com/category/google-plus/'>Google Plus</a>, <a href='http://grepmonster.wordpress.com/category/interweb/'>Interweb</a>, <a href='http://grepmonster.wordpress.com/category/privacy/'>Privacy</a> Tagged: <a href='http://grepmonster.wordpress.com/tag/games/'>Games</a>, <a href='http://grepmonster.wordpress.com/tag/google/'>Google</a>, <a href='http://grepmonster.wordpress.com/tag/google-plus/'>Google Plus</a>, <a href='http://grepmonster.wordpress.com/tag/privacy/'>Privacy</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/235/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/235/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/235/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=235&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2011/12/27/changing-the-privacy-settings-on-google-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>
	</item>
		<item>
		<title>A Kindle for reading PDFs</title>
		<link>http://grepmonster.wordpress.com/2011/10/05/a-kindle-for-reading-pdfs/</link>
		<comments>http://grepmonster.wordpress.com/2011/10/05/a-kindle-for-reading-pdfs/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 20:57:52 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Kindle]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[free stuff]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=228</guid>
		<description><![CDATA[I have been reading quite a lot of PDF eBooks of late at work, such as Implementing CIFS. As I don&#8217;t like reading on a bright computer monitor for long periods, purchasing a Kindle seemed like a good idea due to the high contrast, non-backlit E-Ink display. Having loads of free classics books available to download [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=228&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been reading quite a lot of PDF eBooks of late at work, such as <a href="http://ubiqx.org/cifs/Book.html">Implementing CIFS</a>. As I don&#8217;t like reading on a bright computer monitor for long periods, purchasing a Kindle seemed like a good idea due to the high contrast, non-backlit E-Ink display. Having loads of free classics books available to download was an added bonus.</p>
<p>&nbsp;</p>
<h3>&#8220;&#8230;displayed like an image, and not text&#8221;</h3>
<p><span class="Apple-style-span" style="font-size:13px;font-weight:normal;">PDFs on Kindle almost work, but are a bit of a pain. Unlike regular Kindle formatted books, they are displayed like an image, and not text. The major difference is that you cannot resize the text of a PDF, instead you have to &#8220;zoom in&#8221;, as if the PDF was an image. This is a bit annoying, because you cannot make the text to a big enough size to read on one page without rotating it &#8211; so you end up using the Kindle in landscape, rather than portrait mode. This is not as comfortable as the page turning buttons are now on the top and bottom of the device. Still, the PDF formatting is perfect, <em>e.g. </em>images and tables look fine.*</span></p>
<p>&nbsp;</p>
<h3></h3>
<h3>On the plus side</h3>
<ul>
<li>The online store is better than I imagined for finding books, even free ones. They literally download in seconds, which is very satisfying, but a little disconcerting as you could easily flutter away all of your money very quickly.</li>
<li>Minesweeper can be played by pressing ALT+SHIFT+M from the Home screen. Press G to play GoMoKu (4 in a row).</li>
<li>I&#8217;m currently experimenting with <a href="http://www.instapaper.com/">Instapaper</a>, which sends long articles from the internet to your Kindle, so they&#8217;re easier to read.</li>
</ul>
<h3></h3>
<h3></h3>
<h3>What&#8217;s Missing?</h3>
<div>More games! Some text-adventures would be nice (<a href="http://www.theregister.co.uk/2010/10/11/native_infocom/">lots of hacking in this area!)</a>.</div>
<div>I would love to hear from you if you have any similar Kindle experiences of reading PDFs.</div>
<p>* As an experiment, I e-mailed the CIFS book to my amazon kindle email which automatically converts it to Kindle formatting. The theory being that I can then resize the text and read it the normal way around. Unfortunately it loses the formatting of the columns and images, so it seems the &#8220;rotation method&#8221; is the best solution at the time of writing.</p>
<br />Filed under: <a href='http://grepmonster.wordpress.com/category/books/'>Books</a>, <a href='http://grepmonster.wordpress.com/category/kindle/'>Kindle</a> Tagged: <a href='http://grepmonster.wordpress.com/tag/amazon/'>Amazon</a>, <a href='http://grepmonster.wordpress.com/tag/books/'>Books</a>, <a href='http://grepmonster.wordpress.com/tag/free-stuff/'>free stuff</a>, <a href='http://grepmonster.wordpress.com/tag/kindle/'>Kindle</a>, <a href='http://grepmonster.wordpress.com/tag/pdf/'>PDF</a>, <a href='http://grepmonster.wordpress.com/tag/review/'>Review</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=228&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2011/10/05/a-kindle-for-reading-pdfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu 11.10 &#8211; Middle Mouse Button Emulation</title>
		<link>http://grepmonster.wordpress.com/2011/05/31/ubuntu-11-10-middle-mouse-button-emulation/</link>
		<comments>http://grepmonster.wordpress.com/2011/05/31/ubuntu-11-10-middle-mouse-button-emulation/#comments</comments>
		<pubDate>Tue, 31 May 2011 09:50:01 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[middle mouse emulation]]></category>
		<category><![CDATA[mouse settings]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=223</guid>
		<description><![CDATA[Hardcore Linux users will tell you that copy and paste is as simple as selecting a piece of text and middle clicking. And if you&#8217;re stuck with a two-button mouse or trackball, the usual trick is to click both left and right buttons simultaneously. This used to work out of the box on Ubuntu, but recent [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=223&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hardcore Linux users will tell you that copy and paste is as simple as selecting a piece of text and middle clicking. And if you&#8217;re stuck with a two-button mouse or trackball, the usual trick is to click both left and right buttons simultaneously. This used to work out of the box on Ubuntu, but recent versions (since at least 11.04) do not have the middle button emulation.</p>
<p>What to do? &#8211; Install this cool little program:</p>
<pre>sudo aptitude install gpointing-device-settings</pre>
<p>Then run it and check the middle button emulation box. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://grepmonster.wordpress.com/category/linux/'>Linux</a>, <a href='http://grepmonster.wordpress.com/category/ubuntu/'>Ubuntu</a> Tagged: <a href='http://grepmonster.wordpress.com/tag/linux/'>Linux</a>, <a href='http://grepmonster.wordpress.com/tag/middle-mouse-emulation/'>middle mouse emulation</a>, <a href='http://grepmonster.wordpress.com/tag/mouse-settings/'>mouse settings</a>, <a href='http://grepmonster.wordpress.com/tag/ubuntu/'>Ubuntu</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/223/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=223&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2011/05/31/ubuntu-11-10-middle-mouse-button-emulation/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>
	</item>
		<item>
		<title>Problems with O2 Broadband and Steam</title>
		<link>http://grepmonster.wordpress.com/2011/02/02/problems-with-o2-broadband-and-steam/</link>
		<comments>http://grepmonster.wordpress.com/2011/02/02/problems-with-o2-broadband-and-steam/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 20:11:42 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Interweb]]></category>
		<category><![CDATA[Counter Strike]]></category>
		<category><![CDATA[Steam]]></category>
		<category><![CDATA[Thomson]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=216</guid>
		<description><![CDATA[Having problems playing Counter Strike on 02 Broadband? Symptoms include not being able to connect to a game, VAC security errors or getting disconnected shortly after joining. The problem isn&#8217;t related to your internet connection, but rather the free Thomson modem that comes with it: The Fix Click on the start button and run cmd.exe. If you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=216&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Having problems playing Counter Strike on 02 Broadband?</h2>
<p>Symptoms include not being able to connect to a game, VAC security errors or getting disconnected shortly after joining. <span style="font-size:11.6667px;">The problem isn&#8217;t related to your internet connection, but rather the free Thomson modem that comes with it:</span></p>
<div id="attachment_217" class="wp-caption aligncenter" style="width: 410px"><a href="http://grepmonster.files.wordpress.com/2011/02/thomson_0.png"><img class="size-full wp-image-217  " title="thomson_0" src="http://grepmonster.files.wordpress.com/2011/02/thomson_0.png?w=500" alt="Thomson Modem"   /></a><p class="wp-caption-text">Got one of these?</p></div>
<h2>The Fix</h2>
<ol>
<li>Click on the start button and run <strong>cmd.exe</strong>. If you are on Windows XP you may need to click on <strong>Start-&gt;Programs&gt;Accessories-&gt;Command Prompt</strong>.</li>
<li>This should bring up a black box. Type <strong>telnet 192.168.1.254</strong> and hit return.
<ol>
<li>If you are on Windows 7 and you get an error about <strong>telnet is not recognized as an internal or external command</strong>, then you need to enable telnet first.</li>
<li>Go to <strong>Start -&gt; Control Panel -&gt; Program -&gt; Turn Windows Features on or off</strong>, and check <strong>Telnet Client</strong>.</li>
<li>Press <strong>OK</strong>.</li>
<li>Repeat step 2.</li>
</ol>
</li>
<li>You have now logged into the router. Type<strong> :connection bindlist</strong> and hit enter. You should see something like this:
<pre>Application  Proto Portrange   Flags
LOOSE(UDP)   udp   69
LOOSE(UDP)   udp   67
GAME(UDP)    udp   27010-27011
JABBER       tcp   15222
JABBER       tcp   5222
FTP          tcp   21
IRC          tcp   6660-6669
H323         tcp   1720
ILS          tcp   1002
ILS          tcp   389
RTSP         tcp   554
RAUDIO(PNA)  tcp   7070
CU/SeeMe     udp   7648
SIP          udp   5060        SIP_ALG:E RTP_predict_for_term_SIP_ALG:E
IKE          udp   500
ESP          esp   0
IP6TO4       6to4  0</pre>
</li>
<li>Type <strong>:connection unbind application=GAME(UDP) port=27010-27011</strong> and hit enter.
<ol>
<li>If the <strong>Portrange</strong> shown above is different, then edit the <strong>unbind</strong> command to have the same value.</li>
</ol>
</li>
<li>Type<strong> :connection bindlist</strong> and hit enter again. The <strong>GAME(UDP)</strong> line should have gone, which means you have fixed the problem.</li>
<li>Type <strong>exit</strong> and hit enter.</li>
<li>Restart Steam.</li>
</ol>
<p>Happy gaming <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://grepmonster.wordpress.com/category/games/'>Games</a>, <a href='http://grepmonster.wordpress.com/category/hacking/'>Hacking</a>, <a href='http://grepmonster.wordpress.com/category/interweb/'>Interweb</a> Tagged: <a href='http://grepmonster.wordpress.com/tag/counter-strike/'>Counter Strike</a>, <a href='http://grepmonster.wordpress.com/tag/games/'>Games</a>, <a href='http://grepmonster.wordpress.com/tag/steam/'>Steam</a>, <a href='http://grepmonster.wordpress.com/tag/thomson/'>Thomson</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/216/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=216&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2011/02/02/problems-with-o2-broadband-and-steam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>

		<media:content url="http://grepmonster.files.wordpress.com/2011/02/thomson_0.png" medium="image">
			<media:title type="html">thomson_0</media:title>
		</media:content>
	</item>
		<item>
		<title>Things every Java Programmer should know (Part I)</title>
		<link>http://grepmonster.wordpress.com/2011/01/22/things-every-java-programmer-should-know-part-i/</link>
		<comments>http://grepmonster.wordpress.com/2011/01/22/things-every-java-programmer-should-know-part-i/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 19:55:32 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SCJP]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=137</guid>
		<description><![CDATA[Studying Java at University should give you enough grounding to get by in your day job, but can you really call yourself a Java programmer unless you know the language inside and out? In this series we will outline the lesser known features of how the language works, taken from the SCJP objectives. Mastering these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=137&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Studying Java at University should give you enough grounding to get by in your day job, but can you really call yourself a Java programmer unless you know the language inside and out? In this series we will outline the lesser known features of how the language works, taken from the <a title="SCJP objectives" href="http://in.sun.com/training/catalog/courses/CX-310-065.xml">SCJP objectives</a>. Mastering these will increase your understanding of the language, and possibly (no guarantees) elevate you to demi-god status in the workplace. If you are studying for the SCJP examination you may also find these examples to be useful revision.</p>
<h3>Variable Names</h3>
<p>Identifiers in Java can begin with a letter, underscore or $. The characters after the first one can include digits too. These are all valid variable declarations:</p>
<pre>int myVar;
int $var;
int _var;
int _var2;
int $$$;</pre>
<p>Normally you would stick to using the alphabet, with following words capitalised:</p>
<pre>int myLongVariableName;</pre>
<p>Beginning local variables with an underscore (_) is a common convention as well.</p>
<pre>int _aLocalVariable;</pre>
<h3>Interface Constants</h3>
<p>Given the following interface:</p>
<pre>public interface ConstantInterface {
    int x = 2;
}</pre>
<p>and an implementation of it</p>
<pre>ConstantInterface impl = new ConstantInterface() {
   void test() {
      x = 2;
   }
};</pre>
<p>This will not compile! The variable <strong>x</strong> is implicitly <strong>public static </strong>and <strong>final </strong>because it is declared in an interface. The code could be made more readable by capitalising the variable name, to show the intent that it is a constant. Alternatively, move the constant out of the interface as constant interfaces are rarely a good idea [1]</p>
<h3>What do protected methods really mean?</h3>
<p>Everyone knows that <strong>public </strong>methods can be called anywhere and that <strong>private </strong>methods can only be called within it&#8217;s own class. So what about <strong>protected</strong> methods? First, lets explain what <strong>no access modifier</strong> means:</p>
<pre>package com.example.epiccode;
public class Ping {
   void myMethod() {
      System.out.println("fuzzy wuzzy was a bear");
   }
}</pre>
<p><strong>myMethod</strong> can be called from any class <span style="text-decoration:underline;">within the same package</span>. <em>i.e.</em> any class that belongs to the package <strong>com.example.epiccode</strong>. This is because it has no (default) access modifier. If a class belonged to the package <strong>com.example.epiccode.winner</strong> it cannot call this method because it is in a different package (no exception made to sub-packages).</p>
<p><strong>Protected</strong> methods follow exactly the same rules as default methods, except they also allow access to subclasses <span style="text-decoration:underline;">by inheritance only</span>. This is a very subtle point as shown below.</p>
<pre>package com.example.epiccode;
public class Ping {
   protected void myMethod() {
      System.out.println("I'm default yeh");
   }
}</pre>
<p>We have changed <strong>myMethod </strong>to be <strong>protected</strong>. Now let&#8217;s subclass <strong>Ping</strong>.</p>
<pre>package com.example.anotherpackage;
import com.example.epiccode.Ping;
public class Submarine extends Ping {
   void dive() {
     myMethod();
  }
}</pre>
<p>This code is perfectly fine &#8211; <strong>dive</strong> can call <strong>myMethod</strong> because <strong>Submarine </strong>extends <strong>Ping </strong>(even though they are in different packages).</p>
<p>The following code will not compile:</p>
<pre>package com.example.anotherpackage
import com.example.epiccode.Ping
public class Submarine2 extends Ping {
   void dive() {
     Ping p = new Ping();
     p.myMethod();
  }
}</pre>
<p>We are not accessing <strong>myMethod </strong>through inheritance, instead we are creating a new instance of <strong>Ping </strong>and trying to call <strong>myMethod </strong>on it. This will not compile since Submarine is not in the same package as <strong>Ping</strong>. Funnily enough this subtlety is too much for Eclipse to handle:</p>
<p><a href="http://grepmonster.files.wordpress.com/2011/01/eclipse.png"><img class="size-full wp-image-209" title="eclipse" src="http://grepmonster.files.wordpress.com/2011/01/eclipse.png?w=500" alt="eclipse error"   /></a></p>
<p>The method is already protected, so the quick fix will not work.</p>
<h3>References</h3>
<p>[1] Effective Java 2nd Edition by Joshua Bloch &#8211; Item 19: Use interfaces only to define types.</p>
<br />Filed under: <a href='http://grepmonster.wordpress.com/category/programming/'>Programming</a> Tagged: <a href='http://grepmonster.wordpress.com/tag/java/'>Java</a>, <a href='http://grepmonster.wordpress.com/tag/programming/'>Programming</a>, <a href='http://grepmonster.wordpress.com/tag/scjp/'>SCJP</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/137/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=137&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2011/01/22/things-every-java-programmer-should-know-part-i/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>

		<media:content url="http://grepmonster.files.wordpress.com/2011/01/eclipse.png" medium="image">
			<media:title type="html">eclipse</media:title>
		</media:content>
	</item>
		<item>
		<title>Command Line Dictionary in 50 Lines of Perl</title>
		<link>http://grepmonster.wordpress.com/2010/06/16/command-line-dictionary-in-50-lines-of-perl/</link>
		<comments>http://grepmonster.wordpress.com/2010/06/16/command-line-dictionary-in-50-lines-of-perl/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 18:02:01 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Dictionary]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=167</guid>
		<description><![CDATA[Here&#8217;s a little script I wrote to look up words whilst reading a book or browsing the web. It uses the Aonaware web-service to get the definitions and prints them out to the console. And if you misspell a word it will offer some suggestions. You will need to install the LWP::Simple and XML::XPath modules [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=167&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://pastebin.com/KZ94KKTE">Here&#8217;s a little script I wrote</a> to look up words whilst reading a book or browsing the web. It uses the <a href="http://services.aonaware.com/DictService/DictService.asmx">Aonaware</a> web-service to get the definitions and prints them out to the console. And if you misspell a word it will offer some suggestions.</p>
<p>You will need to install the <a href="http://search.cpan.org/~gaas/libwww-perl-5.836/lib/LWP/Simple.pm">LWP::Simple</a> and <a href="http://search.cpan.org/dist/XML-XPath/">XML::XPath</a> modules from CPAN to get it to work, but other than that it should be clean sailing.</p>
<p>If you have comments, bugs to moan about or feature requests then let me know <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />Filed under: <a href='http://grepmonster.wordpress.com/category/programming/'>Programming</a> Tagged: <a href='http://grepmonster.wordpress.com/tag/command-line/'>Command Line</a>, <a href='http://grepmonster.wordpress.com/tag/dictionary/'>Dictionary</a>, <a href='http://grepmonster.wordpress.com/tag/perl/'>Perl</a>, <a href='http://grepmonster.wordpress.com/tag/programming/'>Programming</a>, <a href='http://grepmonster.wordpress.com/tag/terminal/'>Terminal</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=167&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2010/06/16/command-line-dictionary-in-50-lines-of-perl/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>
	</item>
		<item>
		<title>Enums are Brittle</title>
		<link>http://grepmonster.wordpress.com/2010/03/07/enums-are-brittle/</link>
		<comments>http://grepmonster.wordpress.com/2010/03/07/enums-are-brittle/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 17:32:52 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Enums]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=140</guid>
		<description><![CDATA[We all know Integer constants are brittle Consider this example from StackOverflow today:- Calendar date = Calendar.getInstance(); date.set(2010, 03, 7); if(date.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY)         System.out.println("OK"); The questioner mistakenly thought that the java.util.Calendar set(int year, int month, int date) method followed a sensible human format for representing dates, but in fact the API [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=140&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<blockquote>
<h2><em>We all know Integer constants are brittle </em></h2>
</blockquote>
<p>Consider this example from <a href="http://stackoverflow.com/questions/2396290/how-check-if-today-is-sunday-with-java-calendar">StackOverflow</a> today:-</p>
<pre>Calendar date = Calendar.getInstance();
date.set(2010, 03, 7);
if(date.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY)
        System.out.println("OK");
</pre>
<p>The questioner mistakenly thought that the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html#set%28int,%20int,%20int%29">java.util.Calendar</a> <strong>set</strong>(<strong>int</strong> year, <strong>int</strong> month, <strong>int</strong> date) method followed a sensible human format for representing dates, but in fact the API makes use of zero based int constants to represent the month. The questioner was encouraged to avoid this pitfall by changing his code to date.<strong>set</strong>(2010, Calendar.<strong>MARCH</strong>, 7). This of course is better, but the root of the problem lies with the poorly designed Calendar API.</p>
<p>If java.util.Calendar class has been written post Java 5 then the set method could have been defined as <strong>set</strong>(<strong>int</strong> year, <strong>Month</strong> month, <strong>int</strong> date) where Month is an enum type:-</p>
<pre>public eum Month {
JANUARY,
FEBRUARY,
MARCH,
...
}
</pre>
<p>This would prevent any ambiguity over whether the month parameter is zero or one based.</p>
<blockquote>
<h2><em>To change and to change for the better are two different things.</em></h2>
</blockquote>
<p>Enums may be preferable to int constants, but they are not as flexible as regular Java classes. You may well find that when you come to modify an enum which was written months ago, you need to refactor the whole thing into a regular class. This of course is time-consuming and you would have been better off designing a class from the start.</p>
<p>Below is an example enum representing a 2D direction on a grid. Direction takes two parameters, <strong>deltaX</strong> and <strong>deltaY</strong> which represent the offset of moving in that direction. Given that co-ordinate (0, 0) on the grid is located in the top left hand corner, moving <strong>NORTH</strong> will result in a negative change in <strong>deltaY</strong>, <strong>EAST</strong> will result in a positive change in <strong>deltaX</strong> and so forth.</p>
<pre>enum Direction {
	NORTH(0, -1), NORTH_EAST(1, -1), EAST(1, 0),
        SOUTH_EAST(1, 1), SOUTH(0, 1), SOUTH_WEST(-1, 1),
        WEST(-1, 0), NORTH_WEST(-1, -1);
	private int deltaX;
	private int deltaY;
	Direction(int deltaX, int deltaY) {
		this.deltaX = deltaX;
		this.deltaY = deltaY;
	}
	public int deltaX() {
		return deltaX;
	}
	public int deltaY() {
		return deltaY;
	}
}
</pre>
<p>Direction feels like it should be an enum, as we only have eight possible directions to move in, allowing for diagonal moves. Furthermore this example demonstrates another advantage enums have over int constants &#8211; <span style="text-decoration:underline;">enums support methods</span>. In fact, this enum almost appears to be a regular class, besides the enum declarations at the top.</p>
<p>We encounter a problem with enums when we want to add a method that returns the opposite direction. <em>i.e</em>. the opposite of <strong>NORTH</strong> is <strong>SOUTH</strong>, <strong>NORTH_WEST</strong> is <strong>SOUTH_EAST</strong> and so on. Here is the first technique.</p>
<pre>enum Direction {
	NORTH(0, -1), NORTH_EAST(1, -1), EAST(1, 0),
        SOUTH_EAST(1, 1), SOUTH(0, 1), SOUTH_WEST(-1, 1),
	WEST(-1, 0), NORTH_WEST(-1, -1);
	private int deltaX;
	private int deltaY;
	Direction(int deltaX, int deltaY) {
		this.deltaX = deltaX;
		this.deltaY = deltaY;
	}
	public int deltaX() {
		return deltaX;
	}
	public int deltaY() {
		return deltaY;
	}
	public Direction getOpposite() {
		return new Direction(-deltaX, -deltaY);
	}
}
</pre>
<p>By simply negating the <strong>deltaX</strong> and <strong>deltaY</strong> values we get the opposite direction right? <span style="text-decoration:underline;">It doesn&#8217;t compile because we can&#8217;t invoke enum constructors directly, even from within the enum itself!</span> Let&#8217;s try it another way: -</p>
<pre>enum Direction {
	NORTH(0, -1, SOUTH), NORTH_EAST(1, -1, SOUTH_WEST),
        EAST(1, 0, WEST), SOUTH_EAST(1, 1, NORTH_WEST),
	SOUTH(0, 1, NORTH), SOUTH_WEST(-1, 1, NORTH_EAST),
        WEST(-1, 0, EAST), NORTH_WEST(-1, -1, SOUTH_EAST);
	private int deltaX;
	private int deltaY;
	private Direction opposite;
	Direction(int deltaX, int deltaY, Direction opposite) {
		this.deltaX = deltaX;
		this.deltaY = deltaY;
		this.opposite = opposite;
	}
	public int deltaX() {
		return deltaX;
	}
	public int deltaY() {
		return deltaY;
	}
	public Direction getOpposite() {
		return opposite;
	}
}
</pre>
<p>In the second technique we have hard-coded the opposite directions, passing them into the constructor. <span style="text-decoration:underline;">This doesn&#8217;t compiler either because you cannot refer to types before they are defined</span>. <em>e.g.</em> <strong>SOUTH</strong> cannot be referenced in <strong>NORTH</strong>&#8216;s constructor.</p>
<p>Finally we give up trying to find a work around with an enum and change the whole thing to be a regular class.</p>
<pre>public class Direction {
	public static final Direction NORTH =
        new Direction(0, -1);
	public static final Direction NORTH_EAST =
        new Direction(1, -1);
	public static final Direction EAST =
        new Direction(1, 0);
	public static final Direction SOUTH_EAST =
        new Direction(1, 11);
	public static final Direction SOUTH =
        new Direction(0, 1);
	public static final Direction SOUTH_WEST =
        new Direction(-1, 1);
	public static final Direction WEST =
        new Direction(-1, 0);
	public static final Direction NORTH_NORTH =
        new Direction(-1, -1);
	private int deltaX;
	private int deltaY;
	private Direction(int deltaX, int deltaY) {
		this.deltaX = deltaX;
		this.deltaY = deltaY;
	}
	public int deltaX() {
		return deltaX;
	}
	public int deltaY() {
		return deltaY;
	}
	public Direction getOpposite() {
		return new Direction(-deltaX, -deltaY);
	}
}
</pre>
<p>The private constructor ensures that we cannot create any instances outside of the class. The eight public instances and the <strong>getOpposite()</strong> method provide the only means of access. Note that in this class we can write the <strong>getOpposite()</strong> method using the first technique.</p>
<p>In conclusion, enums may be an improvement over int constants, but are definitely less flexible than a regular class. If you do decide to create an enum, consider that it may outgrow itself, like Direction did.  Creating a regular class from the start may be the better option. In some cases a class may be more verbose than an enum, but then Java is pretty verbose language anyway!</p>
<br />Filed under: <a href='http://grepmonster.wordpress.com/category/programming/'>Programming</a> Tagged: <a href='http://grepmonster.wordpress.com/tag/enums/'>Enums</a>, <a href='http://grepmonster.wordpress.com/tag/java/'>Java</a>, <a href='http://grepmonster.wordpress.com/tag/programming/'>Programming</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=140&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2010/03/07/enums-are-brittle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>
	</item>
		<item>
		<title>Most Complicated Java Method Signature</title>
		<link>http://grepmonster.wordpress.com/2009/09/05/complicated-java-method/</link>
		<comments>http://grepmonster.wordpress.com/2009/09/05/complicated-java-method/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 19:38:39 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Generics]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=117</guid>
		<description><![CDATA[Since I started my new job as a Java Software Engineer, I’ve been doing some training in the form of reading Effective Java by Joshua Bloch. Today I came across the rather baffling method signature below: - Public static &#60;T extends Comparable&#60;? Super T&#62;&#62; T max(List&#60;? Extends T&#62; list) “OMG… What is that all about?” [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=117&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Since I started my new job as a Java Software Engineer, I’ve been doing some training in the form of reading<a href="http://java.sun.com/docs/books/effective/"> Effective Java by Joshua Bloch</a>. Today I came across the rather baffling method signature below: -</p>
<p><strong>Public static &lt;T extends Comparable&lt;? Super T&gt;&gt; T <em>max</em>(List&lt;? Extends T&gt; list)</strong></p>
<p>“OMG… What is that all about?” I thought at first glance. The description informs me that the method <strong><em>max</em></strong> takes a list of any comparable type and returns the object with the maximum value as defined by the implementation of the <a href="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html">Comparable </a>interface’s <strong>compareTo</strong> method.</p>
<p>So what’s with all the bloat? The answer is that generics are <a href="http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)#Java">invariant rather than covariant</a> in Java. For example List&lt;String&gt; is not a subclass of List&lt;Object&gt;. In order to make your generic methods as flexible as possible it is necessary to support the inheritance of parameter types, which can cause quite a headache. I think I’ve just about got my head round this example so I will do my best to explain it.</p>
<p><strong>max</strong> is a method with modifiers <strong>public</strong> and <strong>static</strong>. Its return type is the generic type <strong>T</strong>.</p>
<p>Generic methods declare a type parameter list which goes in between the modifiers (public static) and the return type (T). The type parameter for <strong><em>max</em></strong> is  <strong>T extends Comparable&lt;? Super T&gt;&gt;</strong>. This means that <strong>T</strong> is type that is comparable with itself or its super class.</p>
<p>To break this down, let’s consider the simpler parameter type <strong>T extends Comparable&lt;T&gt;&gt;</strong>. In this example, <strong>T</strong> is the type that is comparable with itself only. Adding the bounded wildcard type <strong>&lt;? Super T&gt;</strong> allows <strong>T</strong> to be comparable with its super types as well. This is necessary if we apply <strong>T</strong> as a class that subclasses a class <strong>E</strong> that implements <strong>Comparable&lt;E&gt;</strong>. One example of this that the book gives is the <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ScheduledFuture.html">java.util.concurrent.ScheduledFuture</a> interface which is a sub-interface of <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Delayed.html">java.util.concurrentDelayed</a>. Delayed extends Comparable&lt;Delayed&gt; whereas ScheduledFuture does not extend the Comparable interface directly.</p>
<p>The final brain teaser is the sole parameter <strong>list</strong> of type <strong>List&lt;? Extends T&gt;</strong>. This means that list can be a List of any type that is a subclass of T (remember everything is a subclass of itself).</p>
<p>Phew, I hope this made some sense. Please appreciate I’m hardly an expert in this field, so if you spot an error in my description then let me know!</p>
<br />Posted in Programming Tagged: Generics, Java, Programming <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=117&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2009/09/05/complicated-java-method/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>
	</item>
		<item>
		<title>Aptitude Woes</title>
		<link>http://grepmonster.wordpress.com/2009/08/16/aptitude-woes/</link>
		<comments>http://grepmonster.wordpress.com/2009/08/16/aptitude-woes/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 11:59:52 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Aptitude]]></category>
		<category><![CDATA[Installing]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=115</guid>
		<description><![CDATA[I&#8217;ve just spent the last hour battling with Ubuntu to get it to upgrade. My problem stems from installing the World of Goo demo and then removing it (it never had a hope in hell of working on my ATI graphics card). Now every time I try to install a new package through aptitude, or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=115&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just spent the last hour battling with Ubuntu to get it to upgrade. My problem stems from installing the <a href="http://2dboy.com/games.php">World of Goo</a> demo and then removing it (it never had a hope in hell of working on my ATI graphics card). Now every time I try to install a new package through aptitude, or try to perform an upgrade I receive</p>
<pre>files list file for package `worldofgoodemo' contains empty filename</pre>
<p>I had to remove</p>
<pre>/var/lib/dpkg/worldofgoodemo.list</pre>
<p>to fix it. Not the most elegant solution, but at least I can install things again.</p>
<br />Posted in Linux Tagged: Aptitude, Installing, Linux, Ubuntu <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=115&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2009/08/16/aptitude-woes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>
	</item>
		<item>
		<title>Marketing Free Software Pt. II &#8211; The Name is Wrong!</title>
		<link>http://grepmonster.wordpress.com/2009/07/21/marketing-free-software-pt-ii-the-name-is-wrong/</link>
		<comments>http://grepmonster.wordpress.com/2009/07/21/marketing-free-software-pt-ii-the-name-is-wrong/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 13:43:28 +0000</pubDate>
		<dc:creator>ed1337</dc:creator>
				<category><![CDATA[Free Software]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[marketing]]></category>

		<guid isPermaLink="false">http://grepmonster.wordpress.com/?p=112</guid>
		<description><![CDATA[Last year I attended a talk by Richard Stallman in Manchester, UK where he explained the motivations behind Free Software as well as its history and what we could do to support the cause. Whilst I enjoyed the talk and agreed with most of his views, I found myself hooked on obvious marketing anomalies. First [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=112&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p style="margin-bottom:0;">Last year I attended a talk by Richard Stallman <a href="http://manchester.fsuk.org/blog/2008/04/13/richard-stallman-1st-may/">in Manchester, UK</a> where he explained the motivations behind Free Software as well as its history and what <em>we</em> could do to support the cause. Whilst I enjoyed the talk and agreed with most of his views, I found myself hooked on obvious marketing anomalies.</p>
<p style="margin-bottom:0;">First of all, there is the name – FREE SOFTWARE. Most people in the audience assumed (even after Stallman reiterated the point on several occasions) that it&#8217;s all about not paying a penny, when of course the name refers to the FREEDOMS to <a href="http://www.gnu.org/philosophy/free-sw.html">run, modify, redistribute and improve the program</a>.  Surly, calling the movement something like FREEDOM SOFTWARE or LIBRE SOFTWARE (<a href="http://en.wikipedia.org/wiki/Gratis_versus_Libre">See Gratis versus Libre</a>) would cause less confusion?</p>
<p style="margin-bottom:0;">A further negative consequence of the confusion caused by the name FREE SOFTWARE  comes about as a result of the psychological weakness of human beings to perceive quality in terms of price. When I&#8217;ve tried to explain Free Software to the casual computer users/business people (not programmers), their immediate impressions of the name is that the software is free (gratis) AND THEREFORE there must be something wrong with it. Like the GNU OS is some cheap knock-off of MS Windows! My point is that the name FREE SOFTWARE creates unnecessary hurdles to climb when we are trying to pitch the benefits of Free Software to a wider audience.</p>
<p style="margin-bottom:0;">Now I&#8217;m done ranting, I will balance the karma by advertising a Manchester Free Software event this evening &#8211; <a href="http://manchester.fsuk.org/blog/2009/07/12/manchester-free-software-talk-dan-lynch-audio-production-with-free-software-21st-july/">Dan Lynch, Audio Production with Free Software – 21st July</a>. I hope to see you there!</p>
<br />Posted in Free Software Tagged: Free Software, GNU, marketing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grepmonster.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grepmonster.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grepmonster.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grepmonster.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grepmonster.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grepmonster.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grepmonster.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grepmonster.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grepmonster.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grepmonster.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grepmonster.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grepmonster.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grepmonster.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grepmonster.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grepmonster.wordpress.com&amp;blog=5134161&amp;post=112&amp;subd=grepmonster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grepmonster.wordpress.com/2009/07/21/marketing-free-software-pt-ii-the-name-is-wrong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/97a126bf218ad32e6e00def5a0eed46a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ed1337</media:title>
		</media:content>
	</item>
	</channel>
</rss>
