<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.9.2 (http://www.squarespace.com/) on Wed, 10 Mar 2010 07:00:34 GMT--><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>Blog</title><link>http://blog.locut.us/main/</link><description></description><lastBuildDate>Wed, 10 Feb 2010 20:19:46 +0000</lastBuildDate><copyright></copyright><language>en-US</language><generator>Squarespace Site Server v5.9.2 (http://www.squarespace.com/)</generator><item><title>Connected my blog to Google Buzz</title><dc:creator>Ian Clarke</dc:creator><pubDate>Wed, 10 Feb 2010 20:18:46 +0000</pubDate><link>http://blog.locut.us/main/2010/2/10/connected-my-blog-to-google-buzz.html</link><guid isPermaLink="false">282911:2872235:6641197</guid><description><![CDATA[<p>Thanks to Adam and Chris Lambert my blog should now be connected to Google Buzz. &nbsp;Its a somewhat involved process, you can find instructions <a href="http://www.google.com/buzz/bradfitz/PPjHXDhANAC/Want-to-connect-your-blog-or-some-other-feed-to">here</a>.</p>]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-6641197.xml</wfw:commentRss></item><item><title>The GOP's war on healthcare ignores facts, and history</title><category>Politics</category><dc:creator>Ian Clarke</dc:creator><pubDate>Sat, 05 Dec 2009 16:25:06 +0000</pubDate><link>http://blog.locut.us/main/2009/12/5/the-gops-war-on-healthcare-ignores-facts-and-history.html</link><guid isPermaLink="false">282911:2872235:5992771</guid><description><![CDATA[<p>Carly Fiorina gave the GOP address this week, claiming that the task force which recently came up with recommendations about breast cancer screenings is a sign of things to come if health care reform is passed. She complains that the task force didn't include an oncologist, a radiologist, or other cancer experts. What was Obama thinking?!</p>
<p>The only problem? This task force was set up last year under Bush, not by Obama! Of course she doesn't mention this minor detail, can't let the facts get in the way.</p>
<p>She goes on to peddle the whole scare tactic about government bureaucrats deciding who lives and who dies. Isn't she aware that health insurance company bureaucrats do exactly this every day?</p>
<p>Doesn't she realize that since breast cancer is a serious pre-existing condition, there is no way she'd be able to get individual coverage under today's system if she had to change insurance providers today?&nbsp;<br />Of course, she doesn't have to worry too much about health insurance because she is a multi-millionaire, but most people aren't.</p>
<p>The new reform bill is far from perfect, but the perfect should not be the enemy of the better. The fact that it will prevent insurance companies from denying coverage due to pre-existing conditions is reason enough to support it.</p>
<p>In 10 years when people look back on this, the GOP's war on healthcare reform will look just as&nbsp;ridiculous&nbsp;as their war on Medicare in the 60s when they used all the same rhetoric about "socialized medicine".</p>
<p>I'll end with a quote, let me know if it sounds familiar:</p>
<p><em>"If you don&rsquo;t stop Medicare and I don&rsquo;t do it, one of these days you and I are going to spend our sunset years telling our children and our children&rsquo;s children what it once was like in America when men were free" - Ronald Regan, 1961.</em></p>]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-5992771.xml</wfw:commentRss></item><item><title>A great tip for diagnosing Java memory issues</title><category>Java</category><category>Programming</category><dc:creator>Ian Clarke</dc:creator><pubDate>Thu, 03 Dec 2009 14:59:39 +0000</pubDate><link>http://blog.locut.us/main/2009/12/3/a-great-tip-for-diagnosing-java-memory-issues.html</link><guid isPermaLink="false">282911:2872235:5978129</guid><description><![CDATA[<p>My good friend (and creator of Apache Wicket)&nbsp;<a href="http://web.mac.com/jonathan.locke/JonathanLocke/Blog/Blog.html">Jonathan Locke</a>&nbsp;just gave me a great tip. &nbsp;I was aware of the <strong>jmap</strong> utility, but didn't know it could do this:</p>
<p>Just type:</p>
<blockquote>
<p>jmap -histo:live &lt;pid&gt;</p>
</blockquote>
<p>Where &lt;pid&gt; is the process id of a Java process, and it will dump out all objects, starting with whichever is taking up the most memory.</p>
<p>The handy thing is that the Java process doesn't need to have been started with any kind of special command line options, it will work with any running Java process.</p>
<p>I wish I knew this a few weeks ago while debugging a memory leak on a remote server...</p>]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-5978129.xml</wfw:commentRss></item><item><title>I've found a new URL shortener</title><category>Technology</category><dc:creator>Ian Clarke</dc:creator><pubDate>Thu, 03 Dec 2009 13:54:15 +0000</pubDate><link>http://blog.locut.us/main/2009/12/3/ive-found-a-new-url-shortener.html</link><guid isPermaLink="false">282911:2872235:5977812</guid><description><![CDATA[<p>I've found a new URL shortener. &nbsp;It is nowhere near as powerful as <a href="http://budurl.com/">BudUrl</a>, but it has one overriding advantage. &nbsp;Take a look at <a href="http://to/">http://to/</a></p>]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-5977812.xml</wfw:commentRss></item><item><title>The Guardian writes about Freenet</title><category>Freenet</category><category>Programming</category><dc:creator>Ian Clarke</dc:creator><pubDate>Thu, 26 Nov 2009 00:28:40 +0000</pubDate><link>http://blog.locut.us/main/2009/11/25/the-guardian-writes-about-freenet.html</link><guid isPermaLink="false">282911:2872235:5919010</guid><description><![CDATA[<p>A few weeks ago I spoke to Andy Beckett of The Guardian in the UK, he was writing an article about "the darknet", and wanted to talk to me about Freenet. &nbsp;I was quite pleased about this because when I'm in the UK the Guardian is by far my favorite newspaper.</p>
<p>We had a good conversation, I talked about the original motivation behind Freenet (read about it <a href="http://freenetproject.org/philosophy.html" target="_blank">here</a>), our challenges, like balancing the very theoretical issues we face with the need to write software that non-techies can use, and other things.</p>
<p>At one point he mentioned the dangers of "bad"&nbsp;uses of Freenet, but he did so in a very coy almost apologetic way. &nbsp;I immediately assumed he was thinking of child pornography, and made it pretty clear that I was more than happy to discuss that, indeed of the hundreds of conversations I've had with journalists about Freenet over the past 10 years, I can't think of one where I didn't discuss the CP issue!</p>
<p>I told him what I tell everyone, which is that like most people I wish CP didn't exist, but there are many ways to get it other than Freenet, and I don't think people should be denied the freedom to communicate just because a small minority might use it for something we don't agree with.</p>
<p>My impression at the time was that he really wanted to get off the subject, which I thought was a bit surprising since journalists love&nbsp;controversy, and there are few things as&nbsp;controversial&nbsp;as child porn.</p>
<p>Anyway, Google Alerts just told me that the article has appeared on the Guardian's website (skip to the bottom for the link).</p>
<p>Overall I think it was quite a good article, I was particularly excited to read:</p>
<blockquote>
<p>Installing the software takes barely a couple of minutes and requires minimal computer skills</p>
</blockquote>
<p>I think Andy may be the first mainstream journalist in the history of Freenet to actually install and use the software before writing about it!</p>
<p>I was a little surprised that it did focus almost exclusively on the negatives implications of an absolutist "free communication" philosophy. &nbsp;For example the subtitle is:</p>
<blockquote>
<p>In the 'deep web', Freenet software allows users complete anonymity as they share viruses, criminal contacts and child pornography</p>
</blockquote>
<p>I was neither surprised nor annoyed that a journalist would want to talk about computer viruses, criminals, and child porn, after all -&nbsp;controversy&nbsp;attracts clicks and lets face it, our newspapers need all the help they can get attracting revenue these days. &nbsp;Further, it is perfectly legitimate to talk about the fact that freedom of communication implies freedom for people to communicate data and ideas we don't like.</p>
<p>I was a little surprised, however, that Andy didn't seem terribly interested in discussing these issues when we spoke by phone - even though I made it very clear that I was happy to and I even tried to steer the conversation in that direction.</p>
<p>Regardless of this slight surprise, I haven't yet noticed any major&nbsp;errors in it, at least no errors on Andy's part (although the [sic] after the American spelling of "pedophile" is not exactly in the spirit of cross-Atlantic harmony). &nbsp;I am curious about how he knew I was a pasty teenager (although he was quite right)! &nbsp;Not so much now that I've been living in Texas for a few years.</p>
<p>I did find this interesting though:</p>
<blockquote>
<p>According to the police, for criminal users of services such as Freenet, the end is coming anyway. The PCeU spokesman says, "The anonymity things, there are ways to get round them, and we do get round them.</p>
</blockquote>
<p>If, by "the anonymity things" they are referring to stuff like simple referrers, or even just using your browser in "incognito" mode, then they are correct. &nbsp;But if they are referring to technologies like Freenet and Tor - then either they are mistaken, lying, or they know something about Freenet and Tor that neither I, nor anyone I've ever met or heard from, has discovered. &nbsp;This is extremely unlikely, I know many of the best security people in the world, and none of them work for the British police.</p>
<p>This isn't to say that identifying a user of software like Freenet or Tor is impossible, but it would require either an impractical expenditure of resources (bugging computers, etc), or for the user to do something like accidentally disclosing their identity on Freenet. &nbsp;We can guard against many things, but we can't guard against stupidity :-)</p>
<p>Anyway, as I said its a pretty good article, and despite its focus on the negative - it will hopefully bring some new users to Freenet. &nbsp;Read it here: <a href="http://www.guardian.co.uk/technology/2009/nov/26/dark-side-internet-freenet" target="_blank">The dark side of the internet</a></p>]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-5919010.xml</wfw:commentRss></item><item><title>Polynomial regression on a large dataset in Java</title><category>Java</category><category>Programming</category><category>SenseArray</category><dc:creator>Ian Clarke</dc:creator><pubDate>Sat, 14 Nov 2009 21:13:10 +0000</pubDate><link>http://blog.locut.us/main/2009/11/14/polynomial-regression-on-a-large-dataset-in-java.html</link><guid isPermaLink="false">282911:2872235:5804559</guid><description><![CDATA[<p>For an internal project <a href="http://sensearray.com/">at my day job</a>&nbsp;I needed to find the <strong>n</strong> degree polynomial that best fits a (potentially very large) dataset, something like this:</p>
<p style="text-align: center;"><span class="full-image-block ssNonEditable"><span><img style="width: 400px;" src="http://blog.locut.us/storage/post-images/orthofit1.png?__SQUARESPACE_CACHEVERSION=1258237910217" alt="" /></span></span></p>
<p><em>Note: Yes I know the function illustrated above isn't a polynomial, this was the best illustration I could find of curve fitting on short notice. &nbsp;I hope you'll forgive me.</em></p>
<p>I asked a question on Reddit about this, and <a href="http://vps.arachnoid.com/index.html">Paul Lutus</a>&nbsp;was kind enough to&nbsp;respond&nbsp;with a link to some code that did something close to what I needed, however Paul's code was not well suited to very large amounts of data.</p>
<p>So with his help, I modified his code to decouple it from the original application it was a part of, make it follow good Java coding practices a bit more closely, and in doing so make it more flexible and well suited to handling very large datasets.</p>
<p>The code is under the GNU Public License, which is unfortunate since its a library and the GPL is viral and Paul is unwilling to relicense under the LGPL, meaning that I or someone else will need to&nbsp;re-implement&nbsp;under a different license if the library is to be used within non-GPL'd code :-(</p>
<p>Here is the source, collaborative free software at work, and please comment if you find it useful!: <a href="http://gist.github.com/234253">PolynomialFitter.java</a></p>]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-5804559.xml</wfw:commentRss></item><item><title>Infinite complexity from simplicity</title><category>Programming</category><dc:creator>Ian Clarke</dc:creator><pubDate>Sat, 31 Oct 2009 16:02:12 +0000</pubDate><link>http://blog.locut.us/main/2009/10/31/infinite-complexity-from-simplicity.html</link><guid isPermaLink="false">282911:2872235:5664668</guid><description><![CDATA[It never ceases to amaze me that the simple equation <i>z</i><sub><i>n</i>+1</sub> = <i>z</i><sub><i>n</i></sub><sup>2</sup>+<i>c</i> can generate the infinite complexity of the Mandelbrot set:
<p/>
<p/>
<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6035941&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6035941&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><p><a href="http://vimeo.com/6035941">Fractice Mandelbrot deep zoom to 2^316 (bigger than the universe!)</a> from <a href="http://vimeo.com/whorld">Chris Korda</a> on <a href="http://vimeo.com">Vimeo</a>.</p>]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-5664668.xml</wfw:commentRss></item><item><title>Simple bash script to name a tab in iTerm</title><category>Programming</category><category>Technology</category><dc:creator>Ian Clarke</dc:creator><pubDate>Fri, 30 Oct 2009 18:26:33 +0000</pubDate><link>http://blog.locut.us/main/2009/10/30/simple-bash-script-to-name-a-tab-in-iterm.html</link><guid isPermaLink="false">282911:2872235:5658361</guid><description><![CDATA[I like to open a lot of tabs in <a href="http://iterm.sourceforge.net/">iTerm</a>, the open source replacement for Apple's Terminal.app on the Mac.  Unfortunately, its easy to forget which is which, as typically they don't get very descriptive names.
<p/>
In particular, I have a few scripts I run which will automatically ssh into a remote server, and run screen.  When I wanted to find one of these, I'd often have to click several tabs to see which one I wanted (since they would all, rather unhelpfully, be called "ssh").
<p/>
So I wrote a simple script, which I call "nametab", which allows you to name the tab you are in from the command line.  You just type something like:
<pre>
$ nametab New tab name
</pre>
If you'd like to use this yourself, here is the code:
<script src="http://gist.github.com/222607.js"></script>
Just put it in a file in your PATH, and ensure that it is executable (ie. do a <code>chmod u+x nametab</code>).]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-5658361.xml</wfw:commentRss></item><item><title>A good pretty-printer for Google Gson</title><category>Java</category><category>Programming</category><dc:creator>Ian Clarke</dc:creator><pubDate>Sun, 18 Oct 2009 15:42:24 +0000</pubDate><link>http://blog.locut.us/main/2009/10/18/a-good-pretty-printer-for-google-gson.html</link><guid isPermaLink="false">282911:2872235:5526202</guid><description><![CDATA[<p>I decided to do something about the one thing I wasn't happy about in Google Gson, the lack of good pretty-printing.</p>
<p>I created a class called GsonPrettyPrinter which outputs nice readable JSON in a reasonably intelligent way, you can grab the source code <a href="http://gist.github.com/216173">here</a>.</p>
<p>Here is what the output looks like: <script src="http://gist.github.com/211231.js"></script></p>
<p>Note, in particular:</p>
<ul>
<li>Requires at least Gson 1.4 (the current version at the time of writing)</li>
<li>It will try to represent JSON objects on arrays on a single line if it can</li>
<li>It sorts JSON objects by their keys</li>
<li>The code is in the public domain, with a request for attribution</li>
</ul>
<p>&nbsp;</p>]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-5526202.xml</wfw:commentRss></item><item><title>Which is the best Java JSON library?</title><category>Java</category><category>Programming</category><dc:creator>Ian Clarke</dc:creator><pubDate>Wed, 14 Oct 2009 13:42:32 +0000</pubDate><link>http://blog.locut.us/main/2009/10/14/which-is-the-best-java-json-library.html</link><guid isPermaLink="false">282911:2872235:5483642</guid><description><![CDATA[<p>I may not have tried them all, but I've tried quite a few including:</p>
<ul>
<li>The default libraries from json.org</li>
<li>Jackson</li>
<li>XStream</li>
<li>Google Gson</li>
<li>JsonMarshaller</li>
<li><span class="caps">JSON</span>.simple</li>
</ul>
<p>I ended up going with <a href="http://code.google.com/p/google-gson/">Google Gson</a>, the library is simple, efficient, intuitive and flexible. &nbsp;It allows you to convert JSON objects directly into&nbsp;equivalent&nbsp;Java POJOs<span style="font-size: x-small;">[1]</span> and back again, which makes for clean and simple code. &nbsp;</p>
<p>One annoyance with Gson is that its JSON pretty-printer isn't verbose enough for my tastes, but at the time of writing (Oct 09) this is on their todo list.</p>
<p>[1] "Plain Old Java Object"</p>]]></description><wfw:commentRss>http://blog.locut.us/main/rss-comments-entry-5483642.xml</wfw:commentRss></item></channel></rss>