<?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>bitplane.net</title>
	<atom:link href="http://bitplane.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://bitplane.net</link>
	<description>Rants, ramblings, free software</description>
	<lastBuildDate>Mon, 16 Jan 2012 16:58:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>TEMPer1 temperature sensor in Linux</title>
		<link>http://bitplane.net/2012/01/temper1-ubuntu/</link>
		<comments>http://bitplane.net/2012/01/temper1-ubuntu/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 23:36:12 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[temper1]]></category>
		<category><![CDATA[thermometer]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=825</guid>
		<description><![CDATA[Yey! Just got my PCSensor TEMPer1 USB thermometer logging in Linux. It automatically detects and does expose USB HID profiles, but there&#8217;s no way to access the data by holding down the CAPS key like it says in the docs. Thankfully, a search for the device ID (0c45:7401 Microdia) finds ruby bindings for Temper.c by Michitaka Ohno, [...]]]></description>
			<content:encoded><![CDATA[<p>Yey! Just got my <a href="http://pcsensor.com/index.php?_a=viewProd&amp;productId=7">PCSensor TEMPer1 USB thermometer</a> logging in Linux. It automatically detects and does expose USB HID profiles, but there&#8217;s no way to access the data by holding down the CAPS key like it says in the docs.</p>
<p>Thankfully, a search for the device ID (0c45:7401 Microdia) finds ruby bindings for Temper.c by <a href="https://github.com/elpeo">Michitaka Ohno</a>, which conveniently includes the reverse-engineered USB protocol. So I&#8217;ve <a href="https://github.com/bitplane/temper">forked this on GitHub</a>, removed the Ruby bits, edited the unit test wrapped it up in a little script that logs the time and temperature to a CSV file. It currently only supports one device, which will change if I ever get another one of these devices (spoiler: I probably will) </p>
<p><span id="more-825"></span></p>
<p>To start logging your TEMPer1&#8242;s data in Ubuntu just</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;"># install dependencies</span>
 $ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">git</span> build-essential libusb-0.1.4 libusb-0.1.4-dev
 <span style="color: #666666; font-style: italic;"># clone the logger</span>
 $ <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>bitplane<span style="color: #000000; font-weight: bold;">/</span>temper.git
 <span style="color: #666666; font-style: italic;"># build it</span>
 $ <span style="color: #7a0874; font-weight: bold;">cd</span> temper
 $ <span style="color: #c20cb9; font-weight: bold;">make</span> clean
 $ <span style="color: #c20cb9; font-weight: bold;">make</span>
 <span style="color: #666666; font-style: italic;"># start logging!</span>
 $ <span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>log.sh <span style="color: #000000; font-weight: bold;">&gt;</span> temperature.log</pre></div></div>

<p>Now I&#8217;m just waiting for my USB clip-on-mic to arrive. Once it does I can log the bubbles from the airlock on my beverages along with the temperature, and make some pretty graphs.</p>
<p>Watch this space!</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2012/01/temper1-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu printing and scanning</title>
		<link>http://bitplane.net/2012/01/hp-officejet-4500-ubuntu/</link>
		<comments>http://bitplane.net/2012/01/hp-officejet-4500-ubuntu/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 17:18:56 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HP]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=812</guid>
		<description><![CDATA[I haven&#8217;t owned a printer since I had an Amiga all those years ago, but since I&#8217;ve started my homebrew mission I&#8217;ve decided I need something to print some labels. Kath got me a HP OfficeJet 4500 G510g printer/scanner/copier for my birthday, and I have to say it works wonderfully. My last experience with a printer [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t owned a printer since I had an Amiga all those years ago, but since I&#8217;ve started my homebrew mission I&#8217;ve decided I need something to print some labels. Kath got me a HP OfficeJet 4500 G510g printer/scanner/copier for my birthday, and I have to say it works wonderfully.</p>
<p><span id="more-812"></span></p>
<p>My last experience with a printer in Ubuntu was when I attempted to use an old Lexmark Z-something, there were no Linux drivers and after much struggling I had to reboot into Windows to use it. The Windows drivers were close to a hundred megabytes, sluggish, always running and came complete with an intrusive systray app to further sap system resources. The app had a non-standard and ugly UI plus annoying American voice that begged me to &#8220;please insert paper in the auto sheet-feeder&#8221; each time I tried to print something. I remember Canon doing a similar thing with their Windows software too which is one reason why I&#8217;ve avoided printers for all these years. That sort of blatant disregard for system resources and desktop space makes the overhead of attaching a printer weigh in heavier than the reward it offers.</p>
<p>I don&#8217;t know whether it&#8217;s HP&#8217;s, Canonical&#8217;s or Debian&#8217;s idea but the experience with my OfficeJet 4500 in Ubuntu has been great. Rather than having to download drivers I just plugged it in. I installed gLabels from the Software Center and printed out some labels within minutes. Pressing meta and typing &#8220;print&#8221; takes me to Gnome&#8217;s Printing app which lists my printer and its fax machine counterpart (remember those?!), and I can right click and set quality settings and so on in a standard UI:</p>
<p><a href="http://bitplane.net/2012/01/hp-officejet-4500-ubuntu/printer/" rel="attachment wp-att-813"><img class="aligncenter size-medium wp-image-813" title="printer" src="http://bitplane.net/wp-content/uploads/2012/01/printer-300x206.png" alt="" width="300" height="206" /></a></p>
<p>Keying &#8220;scan&#8221; into Unity&#8217;s search bar takes me to Canonical&#8217;s &#8220;Simple Scan&#8221; which really is as easy as π, it just scans. Before I could scan through Gimp I had to install XSane, which a bit of a mess. It opens four windows and somehow transfers to Gimp as JPEG by default, leaving 16&#215;16 JPEG compression artefacts in my scanned images. These look bad even if I choose 100% quality in the menu, so it looks like the quality settings are ignored:</p>
<p><a href="http://bitplane.net/wp-content/uploads/2012/01/Jaggies.png"><img class="aligncenter size-medium wp-image-814" title="Jaggies" src="http://bitplane.net/wp-content/uploads/2012/01/Jaggies-300x208.png" alt="" width="300" height="208" /></a></p>
<p>edit: A bit of investigation showed that this is due to Sane&#8217;s XP driver using 10% JPEG compression by default. This can be disabled via the <em>Window -&gt; Show advanced options</em> dialog.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2012/01/hp-officejet-4500-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Irrlicht website update</title>
		<link>http://bitplane.net/2012/01/irrlicht-website-update/</link>
		<comments>http://bitplane.net/2012/01/irrlicht-website-update/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 07:39:39 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Irrlicht]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=804</guid>
		<description><![CDATA[The WordPress version of the Irrlicht website is now live, which means we can edit pages and post news articles using an online editor, users can post comments and we can even appoint community editors to post stuff without giving them rights to the filesystem. Expect lots more activity there in the future]]></description>
			<content:encoded><![CDATA[<p>The WordPress version of the <a href="http://irrlicht.sourceforge.net">Irrlicht website</a> is now live, which means we can edit pages and post news articles using an online editor, users can post comments and we can even appoint community editors to post stuff without giving them rights to the filesystem.</p>
<p>Expect lots more activity there in the future <img src='http://bitplane.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2012/01/irrlicht-website-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2011 in review</title>
		<link>http://bitplane.net/2012/01/mmi/</link>
		<comments>http://bitplane.net/2012/01/mmi/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 10:21:09 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[bitcoin]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[mead]]></category>
		<category><![CDATA[metawatch]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=786</guid>
		<description><![CDATA[Dear diary Sorry for not writing to you of late, but this year has been a busy one.  I&#8217;ll make up for my lack of output with this mammoth post reviewing a small selection of interesting things I got up to this year&#8230; Did far too much work Feels like I&#8217;ve been busting my balls [...]]]></description>
			<content:encoded><![CDATA[<p>Dear diary</p>
<p>Sorry for not writing to you of late, but this year has been a busy one.  I&#8217;ll make up for my lack of output with this mammoth post reviewing a small selection of interesting things I got up to this year&#8230;</p>
<p><span id="more-786"></span></p>
<h2>Did far too much work</h2>
<p>Feels like I&#8217;ve been busting my balls for the last two years, so I decided to stick all my invoices into Google Docs and graph the output. The answer is yes, I&#8217;ve been working like a full-time employee.</p>
<div id="attachment_790" class="wp-caption aligncenter" style="width: 310px"><a href="http://bitplane.net/2012/01/mmi/days-worked/" rel="attachment wp-att-790"><img class="size-medium wp-image-790" title="days worked" src="http://bitplane.net/wp-content/uploads/2012/01/days-worked-300x192.png" alt="" width="300" height="192" /></a><p class="wp-caption-text">2009 was a good year!</p></div>
<p>I love consulting and Microsoft have a great working environment, but a rolling contract at a huge corporation means living out of a hotel for months at a time, which gets old rather fast. I learned a lot about BizTalk, Visual Studio Load Test and T-SQL, I&#8217;ll miss the new friends I&#8217;ve made, but I certainly won&#8217;t miss the travel. So I&#8217;m taking a couple of months off to doss around, learn some new technologies and work on some free software before looking for another contract.</p>
<h2>Rediscovered Bitcoin during the bubble</h2>
<p>I initially flirted with Bitcoin in late 2010 and was completely fascinated by the idea of a P2P currency, specially the proof-of-work method and the anonymity. There was no GPU mining software available and doing work units on the CPU had pretty low returns, but in December I decided to get a decent PC for experimenting with this new currency. After a bunch of cooling problems and losing my wallet.dat (containing a mere 5 BTC, worth about 30 US cents each; £1 total at the time) I fell out of love with Bitcoin and forgot all about it&#8230;</p>
<p>Fast forward 6 months and everyone is talking about this amazing new currency, demand outstrips supply, prices soar and the bubble finally bursts at $28 a piece. Why, oh why did I spend £2,000 on a top of the range computer then not even bother mining any BTC, rather than £1000 on BTC in December and sell out at £95,0000 in June?</p>
<div id="attachment_798" class="wp-caption aligncenter" style="width: 310px"><a href="http://bitplane.net/2012/01/mmi/bitcoin/" rel="attachment wp-att-798"><img class="size-medium wp-image-798" title="bitcoin" src="http://bitplane.net/wp-content/uploads/2012/01/bitcoin-300x111.png" alt="" width="300" height="111" /></a><p class="wp-caption-text">What could have been</p></div>
<p>On top of the new PC the Bitcoin thing ended up costing me about £50 in electricity, and my ATI 5970 hasn&#8217;t been feeling well since. I did play online poker with Americans after they closed all the poker sites, and made about $200 trading on <a title="Magic The Gathering Online Exchange, believe it or not" href="http://mtgox.com" target="_blank">Mt Gox</a>. Not enough BTC to have someone assassinated but the option to buy 5 wraps of heroin from Silk Road is always open (INSTANT ADDICTION, TORE FAMILY APART. A++++ WOULD BUY AGAIN)</p>
<h2>Read Gödel, Escher, Bach</h2>
<p>With all the travel I&#8217;ve had a fair bit of time for reading, which is nice. Along with The Design of Everyday Things and Zen and the art of Motorcycle Maintenance, <a title="GEB" href="http://www.amazon.co.uk/gp/product/0140289208/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=bitplanenet-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=0140289208">Godel, Escher, Bach</a> (that&#8217;s Girdle, Esher, Bark to us infidels) changed the way that I think about a lot of things.</p>
<p>This year I&#8217;m going to try to set more time aside for reading.</p>
<h2>Got into home brewing</h2>
<p>A few months back I decided to start brewing mead, yeah, <strong>before</strong> Skyrim came out. I&#8217;m now seven batches in and I think I&#8217;m getting the hang of it, my latest batches taste a bit less like sweaty feet and a bit more like something you might want to drink. I started out using a 5L bottle of water with 3 jars of honey, some raisins and bread yeast added to it and a balloon stuck over the top, and now I&#8217;ve progressed to demijohns with real air-locks and exotic ingredients like.. uh.. orange flesh, cloves and vanilla pods. I even made some labels:</p>
<div id="attachment_791" class="wp-caption aligncenter" style="width: 238px"><a href="http://bitplane.net/2012/01/mmi/mead/" rel="attachment wp-att-791"><img class="size-medium wp-image-791" title="Mead" src="http://bitplane.net/wp-content/uploads/2012/01/Mead-228x300.png" alt="" width="228" height="300" /></a><p class="wp-caption-text">How&#39;s the abdomen?</p></div>
<p>I figure that this whole home brewing thing is a long game, it&#8217;s worth starting while I&#8217;m in my 30s if I&#8217;m going to actually master it before I&#8217;m old and grey. That is if the state of the kitchen doesn&#8217;t cause me to die of death by angry woman first.</p>
<h2>Replaced my MBW-150</h2>
<p>After the LEDs burned out on my Sony Ericsson MBW-150 I replaced it with a shiny new <a href="http://www.metawatch.org/">Metawatch</a>. Apparently it looks like a cheap, tacky Casio (so some random guy in a bar tells me anyway), but it&#8217;s not really supposed to be bling; the firmware and Android software is open source, making the device infinitely programmable.</p>
<p><a href="http://bitplane.net/2012/01/mmi/metawatch/" rel="attachment wp-att-793"><img class="aligncenter size-medium wp-image-793" title="Metawatch" src="http://bitplane.net/wp-content/uploads/2012/01/Metawatch-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>The down-side is that the firmware is too large to be compiled using gcc for MSP430, so there&#8217;s currently no free development environment. I sketched out an analogue face for it in C, but if I wanted to spend £2000 on an analogue watch face then I would have got a Rolex instead!</p>
<h2>Neglected Free Software</h2>
<p>I&#8217;ve been lazy when it comes to developing this year. I&#8217;ve done no work on my Android apps, pushed a single commit to Irrlicht and wrote about 100 lines of my <a href="http://canvnc.sf.net/">web-based VNC client</a>. I feel like I&#8217;ve cheated on the world by spending most of the year writing T-SQL and C# for Microsoft, so my new year&#8217;s resolution is to get off my backside and write some code.</p>
<p>And blog more. Yeah, I&#8217;ll do that too.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2012/01/mmi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anonypic and Microphone source drop</title>
		<link>http://bitplane.net/2011/01/anonypic-mic-source-release/</link>
		<comments>http://bitplane.net/2011/01/anonypic-mic-source-release/#comments</comments>
		<pubDate>Mon, 03 Jan 2011 16:34:01 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android-microphone]]></category>
		<category><![CDATA[anonypic]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=761</guid>
		<description><![CDATA[Since I&#8217;ve not updated these two Android projects in a while, at risk of total future embarrassment (I&#8217;m still a Java newbie) I&#8217;ve decided to dump the source code on GitHub so others can make use of it. Details are on the Anonypic and Microphone project pages. If you fix any bugs, please send a [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;ve not updated these two Android projects in a while, at risk of total future embarrassment (I&#8217;m still a Java newbie) I&#8217;ve decided to dump the source code on GitHub so others can make use of it. Details are on the <a href="http://bitplane.net/projects/android/anonypic">Anonypic</a> and <a href="http://bitplane.net/projects/android/microphone">Microphone</a> project pages.</p>
<p>If you fix any bugs, please send a pull request and I&#8217;ll do my best to merge them in, but keep in mind this is also my first attempt at using git; expect schoolboy errors there too!</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2011/01/anonypic-mic-source-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import vmstat logs into LoadRunner</title>
		<link>http://bitplane.net/2010/11/vmstat-to-csv/</link>
		<comments>http://bitplane.net/2010/11/vmstat-to-csv/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 19:40:45 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[loadrunner]]></category>
		<category><![CDATA[performance testing]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=731</guid>
		<description><![CDATA[Here&#8217;s a little script to format vmstat&#8217;s output into something you can import into LoadRunner&#8217;s analysis tool: import sys, time &#160; sys.stdout.write&#40;&#34;Date,Time,&#34; &#34;Proc Run,Proc sleep,&#34; &#34;Mem swap use,Mem free,Mem buffered,Mem Cache,&#34; &#34;Swap in,Swap out,Blocks in,Blocks out,&#34; &#34;Interrupts,Context switches,&#34; &#34;CPU %User,CPU %System,CPU %Idle,CPU %Wait,CPU %Stolen\n&#34;&#41; &#160; for line in iter&#40;sys.stdin.readline, &#34;&#34;&#41;: if line&#91;0&#93; != 'p' and [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little script to format vmstat&#8217;s output into something you can import into LoadRunner&#8217;s analysis tool:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>, <span style="color: #dc143c;">time</span>
&nbsp;
<span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Date,Time,&quot;</span>
                 <span style="color: #483d8b;">&quot;Proc Run,Proc sleep,&quot;</span>
                 <span style="color: #483d8b;">&quot;Mem swap use,Mem free,Mem buffered,Mem Cache,&quot;</span>
                 <span style="color: #483d8b;">&quot;Swap in,Swap out,Blocks in,Blocks out,&quot;</span>
                 <span style="color: #483d8b;">&quot;Interrupts,Context switches,&quot;</span>
                 <span style="color: #483d8b;">&quot;CPU %User,CPU %System,CPU %Idle,CPU %Wait,CPU %Stolen<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">iter</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span>.<span style="color: #dc143c;">readline</span>, <span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> line<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!</span>= <span style="color: #483d8b;">'p'</span> <span style="color: #ff7700;font-weight:bold;">and</span> line<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span>:<span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!</span>= <span style="color: #483d8b;">' r'</span>:
        t = <span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%d/%m/%Y,%H:%M:%S&quot;</span>, <span style="color: #dc143c;">time</span>.<span style="color: black;">localtime</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        line = <span style="color: #483d8b;">' '</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>line.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        line = line.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot; &quot;</span>, <span style="color: #483d8b;">&quot;,&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%s,%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>t, line<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>.<span style="color: black;">flush</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>(Thanks to <a href="http://stackoverflow.com/q/4187785/146642">fabrizoM</a> for the help!)</p>
<p>Run it from a shell script like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #c20cb9; font-weight: bold;">vmstat</span> <span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">|</span> python vmstat2csv.py <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; servername-vmstat.log</pre></div></div>

<p>Then start the job from the shell, press CTRL+Z and nohup it (so it doesn&#8217;t die if you disconnect) and tail it (so you can keep an eye on it) like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>+  Stopped                 .<span style="color: #000000; font-weight: bold;">/</span>log.sh
<span style="color: #7a0874; font-weight: bold;">&#91;</span>gaz<span style="color: #000000; font-weight: bold;">@</span>box ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">bg</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>+ .<span style="color: #000000; font-weight: bold;">/</span>log.sh <span style="color: #000000; font-weight: bold;">&amp;</span>amp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>gaz<span style="color: #000000; font-weight: bold;">@</span>box ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">disown</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>gaz<span style="color: #000000; font-weight: bold;">@</span>box ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-f</span> servername-vmstat.log
Date,Time,Proc Run,Proc <span style="color: #c20cb9; font-weight: bold;">sleep</span>,Mem swap use,Mem <span style="color: #c20cb9; font-weight: bold;">free</span>,Mem buffered,Mem Cache,Swap <span style="color: #000000; font-weight: bold;">in</span>,Swap out,Blocks <span style="color: #000000; font-weight: bold;">in</span>,Blocks out,Interrupts,Context switches,CPU <span style="color: #000000; font-weight: bold;">%</span>User,CPU <span style="color: #000000; font-weight: bold;">%</span>System,CPU <span style="color: #000000; font-weight: bold;">%</span>Idle,CPU <span style="color: #000000; font-weight: bold;">%</span>Wait,CPU <span style="color: #000000; font-weight: bold;">%</span>Stolen
<span style="color: #000000;">23</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>,<span style="color: #000000;">12</span>:<span style="color: #000000;">59</span>:<span style="color: #000000;">47</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">1266452</span>,<span style="color: #000000;">465576</span>,<span style="color: #000000;">2074012</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">15</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">36</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">99</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>
<span style="color: #000000;">23</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2010</span>,<span style="color: #000000;">13</span>:00:<span style="color: #000000;">11</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">1264460</span>,<span style="color: #000000;">465584</span>,<span style="color: #000000;">2074024</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">168</span>,<span style="color: #000000;">581</span>,<span style="color: #000000;">577</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">94</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">0</span></pre></div></div>

<p>When you&#8217;re done, import it into the Analysis tool via the Tools -&gt; External Monitors menu. Make sure you set the correct date for the custom format and remember to keep a close eye on the timezones. If you make a mistake while importing there&#8217;s no going back, so save a backup of your analysis files before you attempt this.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2010/11/vmstat-to-csv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rainwatch featured on Android Market</title>
		<link>http://bitplane.net/2010/09/rainwatch-top-free-app/</link>
		<comments>http://bitplane.net/2010/09/rainwatch-top-free-app/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 16:34:02 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Market]]></category>
		<category><![CDATA[rainwatch]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=722</guid>
		<description><![CDATA[Sometime yesterday my app Rainwatch was added to the &#8220;top free&#8221; list on the Android Marketplace, showing in 5th position in the News and Weather section. This is strange because it&#8217;s only 32nd in the &#8220;top free&#8221; list on the market on Android devices, but hey, I&#8217;m not complaining! I guess I&#8217;d better make a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Sometime yesterday my app <a href="http://bitplane.net/projects/android/rainwatch">Rainwatch</a> was added to the &#8220;top free&#8221; list on the Android Marketplace, showing in 5th position in the News and Weather section. This is strange because it&#8217;s only 32nd in the &#8220;top free&#8221; list on the market on Android devices, but hey, I&#8217;m not complaining!<span style="font-size: 13.3333px;"> </span></p>
<p style="text-align: left;"><a href="http://bitplane.net/wp-content/uploads/2010/09/top-free.png"><img class="aligncenter size-medium wp-image-723" title="Rainwatch on Android Market" src="http://bitplane.net/wp-content/uploads/2010/09/top-free-300x264.png" alt="" width="300" height="264" /></a></p>
<p style="text-align: left;">I guess I&#8217;d better make a promotional image for Market and update the screenshots so they actually look like recent versions of the app!</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2010/09/rainwatch-top-free-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Float.parseFloat is slow</title>
		<link>http://bitplane.net/2010/08/java-float-fast-parser/</link>
		<comments>http://bitplane.net/2010/08/java-float-fast-parser/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 22:17:54 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[performance testing]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=710</guid>
		<description><![CDATA[While profiling some loader code and expecting to see performance issues with my regular expressions, I found that ~60% of my time was actually spent converting String variables to floats. It turns out that the slow bit lives inside Float.parseFloat, where it calls String.toLowerCase every single time just in case this string is a hex [...]]]></description>
			<content:encoded><![CDATA[<p><span>While profiling some loader code and expecting to see performance issues with my regular expressions, I found that ~60% of my time was actually spent converting <em>String</em> variables to <em>float</em>s. It turns out that the slow bit lives inside <a href="http://www.java2s.com/Open-Source/Java-Document/Apache-Harmony-Java-SE/org-package/org/apache/harmony/luni/util/FloatingPointParser.java.htm">Float.parseFloat</a>, where it calls String.toLowerCase every single time just in case this string is a <em>hex float</em>, a very rare type of float which I had never seen before. I <a href="https://issues.apache.org/jira/browse/HARMONY-6635">logged this with Apache</a>, but as I can&#8217;t ship a custom ROM with my SVG parser I decided to replace it.</span><br />
<span>Here&#8217;s the results from some tests of 3896 calls to parseFloat on my Nexus One:</span></p>
<ul>
<li>a) Using Float.parseFloat(String): 1516.449ms</li>
<li>b) My own parseFloat(String): 654.882ms</li>
<li>c) &#8230;and my own isDigit(char): 449.622</li>
<li>d) &#8230;and isDigit written inline: 295.865ms</li>
<li>e) &#8230;copying the string into a char buffer and avoiding all string access and method calls: 254.527ms (112ms spent copying the characters!)</li>
</ul>
<p><span>So in theory, if the method took a character buffer and length it could be as short as 135ms, over ten times faster than Float.parseFloat. I&#8217;m currently using option d as gives a nice performance gain without breaking my design, but when performance tuning the entire API later this may see some huge changes. Here&#8217;s the function I cooked up:</span></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">float</span> parseFloat<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> f<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> len   <span style="color: #339933;">=</span> f.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">float</span>     ret   <span style="color: #339933;">=</span> 0f<span style="color: #339933;">;</span>         <span style="color: #666666; font-style: italic;">// return value</span>
	<span style="color: #000066; font-weight: bold;">int</span>       pos   <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>          <span style="color: #666666; font-style: italic;">// read pointer position</span>
	<span style="color: #000066; font-weight: bold;">int</span>       part  <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>          <span style="color: #666666; font-style: italic;">// the current part (int, float and sci parts of the number)</span>
	<span style="color: #000066; font-weight: bold;">boolean</span>   neg   <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>      <span style="color: #666666; font-style: italic;">// true if part is a negative number</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// find start</span>
	<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>pos <span style="color: #339933;">&lt;</span> len <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000ff;">'0'</span> <span style="color: #339933;">||</span> f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #0000ff;">'9'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'-'</span> <span style="color: #339933;">&amp;&amp;</span> f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'.'</span><span style="color: #009900;">&#41;</span>
		pos<span style="color: #339933;">++;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// sign</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'-'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
		neg <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span> 
		pos<span style="color: #339933;">++;</span> 
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// integer part</span>
	<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>pos <span style="color: #339933;">&lt;</span> len <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #0000ff;">'9'</span> <span style="color: #339933;">||</span> f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		part <span style="color: #339933;">=</span> part<span style="color: #339933;">*</span><span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	ret <span style="color: #339933;">=</span> neg <span style="color: #339933;">?</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>part<span style="color: #339933;">*-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#41;</span>part<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// float part</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>pos <span style="color: #339933;">&lt;</span> len <span style="color: #339933;">&amp;&amp;</span> f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'.'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		pos<span style="color: #339933;">++;</span>
		<span style="color: #000066; font-weight: bold;">int</span> mul <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		part <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>pos <span style="color: #339933;">&lt;</span> len <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #0000ff;">'9'</span> <span style="color: #339933;">||</span> f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			part <span style="color: #339933;">=</span> part<span style="color: #339933;">*</span><span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
			mul<span style="color: #339933;">*=</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span> pos<span style="color: #339933;">++;</span>
		<span style="color: #009900;">&#125;</span>
		ret <span style="color: #339933;">=</span> neg <span style="color: #339933;">?</span> ret <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#41;</span>part <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#41;</span>mul <span style="color: #339933;">:</span> ret <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#41;</span>part <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#41;</span>mul<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// scientific part</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>pos <span style="color: #339933;">&lt;</span> len <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'e'</span> <span style="color: #339933;">||</span> f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'E'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		pos<span style="color: #339933;">++;</span>
		neg <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'-'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> pos<span style="color: #339933;">++;</span>
		part <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>pos <span style="color: #339933;">&lt;</span> len <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #0000ff;">'9'</span> <span style="color: #339933;">||</span> f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			part <span style="color: #339933;">=</span> part<span style="color: #339933;">*</span><span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>f.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>pos<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">'0'</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;">if</span> <span style="color: #009900;">&#40;</span>neg<span style="color: #009900;">&#41;</span>
			ret <span style="color: #339933;">=</span> ret <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#41;</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">pow</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span>, part<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">else</span>
			ret <span style="color: #339933;">=</span> ret <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span><span style="color: #009900;">&#41;</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">pow</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span>, part<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>	
	<span style="color: #000000; font-weight: bold;">return</span> ret<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><span>This is of course a very crude method, it requires a well-formed number and will return 0 or partial numbers instead of raising exceptions, it doesn&#8217;t work with hex floats or parse NaNs or Infinity and it doesn&#8217;t use doubles internally so the accuracy is not perfect. It does however work for my purposes, so I thought I&#8217;d share it with the Internet.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2010/08/java-float-fast-parser/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Microphone for Android</title>
		<link>http://bitplane.net/2010/08/android-mic/</link>
		<comments>http://bitplane.net/2010/08/android-mic/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 16:48:46 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android-microphone]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=688</guid>
		<description><![CDATA[So, my 4th Android app is out, a simple mic which you can plug into your computer. It&#8217;s got quite a slating on the Android Market because of its latency, the problem is that there&#8217;s quite large minimum values on the buffer size for accessing input and output buffers, there&#8217;s no way to reduce this [...]]]></description>
			<content:encoded><![CDATA[<p>So, <a href="http://bitplane.net/projects/android/microphone">my 4th Android app</a> is out, a simple mic which you can plug into your computer. It&#8217;s got quite a slating on the Android Market because of its latency, the problem is that there&#8217;s quite large minimum values on the buffer size for accessing input and output buffers, there&#8217;s no way to reduce this latency below the ~300ms which it currently has. Hopefully AOSP will address <a href="http://code.google.com/p/android/issues/detail?id=3434">this</a> eventually, paving way for realtime audio applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2010/08/android-mic/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adventures in Android</title>
		<link>http://bitplane.net/2010/08/android-adventures/</link>
		<comments>http://bitplane.net/2010/08/android-adventures/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 05:55:24 +0000</pubDate>
		<dc:creator>Gaz Davidson</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[anonypic]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mc-mail]]></category>
		<category><![CDATA[rainwatch]]></category>

		<guid isPermaLink="false">http://bitplane.net/?p=680</guid>
		<description><![CDATA[Since getting myself a Google Nexus One I&#8217;ve decided to do a bit of Android development. My first impressions with the platform weren&#8217;t really that good, but I&#8217;m beginning to get the hang of it now. My main problem is that Java is a horribly verbose and restrictive language. To do the simplest things you [...]]]></description>
			<content:encoded><![CDATA[<p>Since getting myself a Google Nexus One I&#8217;ve decided to do a bit of Android development. My first impressions with the platform weren&#8217;t really that good, but I&#8217;m beginning to get the hang of it now.</p>
<p>My main problem is that Java is a horribly verbose and restrictive language. To do the simplest things you need to implement at least three interfaces and extend a couple of abstract classes (after reading the documentation for each of them and their alternatives of course). Something which could be written in Python in three lines of code and two minutes takes fifty lines and twenty minutes in Java. Perhaps that&#8217;s just me, maybe I&#8217;ve been spoiled by dynamic languages and expect to be able to do things a hundred different ways by just typing whatever comes to mind, rather than carefully considering the available options and planning every step of my app. In my short journey through Java development I&#8217;ve suffered a lot of pain because I make assumptions and choose a design pattern which is incompatible some point later down the line, so I end up refactoring everything ten times before I even get a working prototype. I&#8217;m slowly learning not to fly by the seat of my pants (even if it is the most fun way to fly) and perhaps that&#8217;s a good thing.</p>
<p>My other gripe is the UI editor and XML format, their steep learning curve makes the design stage a huge time sink. I&#8217;ve now spent a fair bit of time banging my head off my keyboard while attempting to make the simplest of interface, which still don&#8217;t look like they do on paper, but I think I&#8217;m getting the hang of it.</p>
<p>Anyhow, so far I&#8217;ve managed to knock out 3 applications which are available in the Android marketplace:</p>
<h2><a title="Anonypic" href="http://bitplane.net/projects/android/anonypic">Anonypic</a></h2>
<p>This little app just adds an extra option to your share menu, and will upload an image to <a href="http://bayimg.com">bayimg.com</a>, the anonymous image sharing service by the creators of The Pirate Bay. Images have their EXIF data removed, so you can share images without leaving a trail of metadata leading back to your phone.</p>
<h2><a href="http://bitplane.net/projects/android/rainwatch">Rainwatch</a></h2>
<p>Rainwatch is an alternative viewer for the BBC&#8217;s Maps Presenter, the Flash application available on their <a href="http://news.bbc.co.uk/weather">weather site</a>. It&#8217;s far from complete but is good enough to predict the weather, so I&#8217;m quite happy with it (as are my 1500 active users)</p>
<h2><a href="http://bitplane.net/projects/android/mc-mail">MC Mail</a></h2>
<p>MC Mail, or Missed Call Mailer is a little app which sends you an email when you get a missed call. The back-end is written in PHP and MySQL, the front-end is mostly just a service which monitors your call log. Useful if you&#8217;re a hospital or call centre worker who has access to email but can&#8217;t use a phone in work, or if you always forget your phone. It usually only works while the phone is in silent mode.</p>
<h2>Next steps?</h2>
<p>I&#8217;ll make a couple more apps and maybe a game, then learn the Native Development Kit and port Irrlicht using Christian&#8217;s OpenGL ES driver. I haven&#8217;t done any Irrlicht code in ages, so that&#8217;s certainly on the agenda.</p>
]]></content:encoded>
			<wfw:commentRss>http://bitplane.net/2010/08/android-adventures/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

