<?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>Ciaran&#039;s Random Writings &#187; Software</title>
	<atom:link href="http://ciarang.com/posts/category/software/feed" rel="self" type="application/rss+xml" />
	<link>http://ciarang.com</link>
	<description>Random things I&#039;ve written about stuff</description>
	<lastBuildDate>Thu, 02 Feb 2012 17:46:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Converting EMF to SVG</title>
		<link>http://ciarang.com/posts/converting-emf-to-svg</link>
		<comments>http://ciarang.com/posts/converting-emf-to-svg#comments</comments>
		<pubDate>Thu, 02 Feb 2012 17:46:20 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=1219</guid>
		<description><![CDATA[This is one of those &#8220;in case I ever need to do it again&#8221; posts. Converting EMF files to SVG files &#8211; sounds like it should be a simple task, translating from one vector format to another. It turned out not to be. However, in the end: find . -name '*.emf' -exec unoconv -f svg [...]]]></description>
			<content:encoded><![CDATA[<p>This is one of those &#8220;in case I ever need to do it again&#8221; posts. Converting EMF files to SVG files &#8211; sounds like it should be a simple task, translating from one vector format to another. It turned out not to be.</p>
<p>However, in the end:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*.emf'</span> <span style="color: #660033;">-exec</span> unoconv <span style="color: #660033;">-f</span> svg <span style="color: #ff0000;">&quot;{}&quot;</span> \;</pre></div></div>

<p>successfully converted a nested directory structure full of .emf files to have their .svg equivalents alongside. Oh, and for some reason (I don&#8217;t care why) you have to run this first:</p>
<pre>
unoconv --listener &#038;
</pre>
<p>The key ingredient was <a href="http://dag.wieers.com/home-made/unoconv/">unoconv</a> (thankfully, Debian-packaged as unoconv), which also requires a load of openoffice and/or libreoffice stuff to make it work. There were a load of other possible ways of doing this that didn&#8217;t work, which I won&#8217;t even go into. Also, don&#8217;t even ask why I needed to do this in the first place.</p>
<p><b>Update:</b> After I&#8217;d finished, I realised I also needed EPS. Easy conversion, not so easy command due to various shell-related complications:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*.svg'</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'inkscape &quot;{}&quot; --export-eps=&quot;`dirname &quot;{}&quot;`/`basename &quot;{}&quot; .svg`.eps&quot;'</span> \;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/converting-emf-to-svg/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evolution</title>
		<link>http://ciarang.com/posts/evolution</link>
		<comments>http://ciarang.com/posts/evolution#comments</comments>
		<pubDate>Mon, 19 Dec 2011 11:11:00 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=1205</guid>
		<description><![CDATA[After many years as a dedicated user of Thunderbird as a mail and news client, along with the Lightning add-on for calendar and tasks, my list of gripes suddenly reached breaking point this week. I won&#8217;t go through them all, but here&#8217;s a small selection: Resource hoggery &#8211; this seems to be woven into the [...]]]></description>
			<content:encoded><![CDATA[<p>After many years as a dedicated user of Thunderbird as a mail and news client, along with the Lightning add-on for calendar and tasks, my list of gripes suddenly reached breaking point this week. I won&#8217;t go through them all, but here&#8217;s a small selection:</p>
<p><span id="more-1205"></span></p>
<ul>
<li>Resource hoggery &#8211; this seems to be woven into the fabric of all things Mozilla, and was responsible for me ditching Firefox for Chromium earlier this year. I know the response to this because I&#8217;ve heard it a million times &#8211; computers are getting faster, RAM is cheap. Well maybe, but I want to use my resources, they&#8217;re not yours to waste.</li>
<li>Thunderbird is a second class citizen. That&#8217;s my perception anyway. Mozilla is about web browsers and Thunderbird is dragged along and supported grudgingly. &#8220;But why would anyone want to use native clients for anything when they could access everything via a browser?&#8221; is what I keep hearing. I think that&#8217;s ridiculous and will always be wrong, but there you go.</li>
<li>Lightning is a third class citizen. It&#8217;s just another Thunderbird add-on, who cares? Again, just my perception, and no offence meant to the tiny and under-appreciated team who do excellent work on it.</li>
<li>I receive a meeting invitation, I accept it into a calendar, the response is sent via a different email address to the one that was invited.</li>
<li>The address book doesn&#8217;t sync with anything, e.g. CardDAV, WebDAV. That&#8217;s just insane, it&#8217;s nearly 2012. Oh, there are various third party add-ons, which I have used in the past, but due to version inflation or something, they are only occasionally compatible.</li>
</ul>
<p>Anyway, that list could go on forever. I didn&#8217;t set out to disparage Thunderbird or Mozilla. Thunderbird is good, just not for me any more. So let&#8217;s move on to the replacement.</p>
<p><a href="http://projects.gnome.org/evolution/">Evolution</a> is what&#8217;s taken the place of Thunderbird for me. I had a number of reservations about this, but so far it&#8217;s turned out to be excellent. All the problems I had with Thunderbird have gone away, right down to it using A FIFTH of the memory to do the same job faster than its bloated predecessor.</p>
<p>The migration wasn&#8217;t entirely trouble-free though. One of the biggest problems was that I tried to set it up to use real Trash and Junk folders for IMAP accounts. This is wrong, and not how IMAP is supposed to work, but everyone does it anyway. However, that functionality in Evolution just doesn&#8217;t work properly and you end up with messages you delete or move reappearing, and all kinds of other strange goings on. The answer is simply to just not do that, and let Evolution work with its own &#8216;virtual&#8217; versions of these folders, while using IMAP properly in the background.</p>
<p>Only time will tell if this was really a good move, but so far I&#8217;m very happy with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/evolution/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android Market Gripes</title>
		<link>http://ciarang.com/posts/android-market-gripes</link>
		<comments>http://ciarang.com/posts/android-market-gripes#comments</comments>
		<pubDate>Tue, 28 Sep 2010 20:13:43 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=1111</guid>
		<description><![CDATA[I&#8217;ve never come across any fans of Google&#8217;s Android Market. Personally I despise almost everything about it. To some extent this is understandable and was always going to be the case because Google&#8217;s goals in building and running it aren&#8217;t even similar to mine as a user. That&#8217;s fair enough &#8211; my requirements aren&#8217;t typical. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve never come across any fans of Google&#8217;s Android Market. Personally I despise almost everything about it. To some extent this is understandable and was always going to be the case because Google&#8217;s goals in building and running it aren&#8217;t even similar to mine as a user. That&#8217;s fair enough &#8211; my requirements aren&#8217;t typical. The other side of it though, is that it&#8217;s just crap, however you look at it.</p>
<p>What follows is a non-comprehensive list of what I think is crap. Some of these things everybody must agree with, while others most people probably don&#8217;t care about.</p>
<p><span id="more-1111"></span></p>
<p>One other thing before I start moaning, just to be clear &#8211; I am a big fan of Android in general, both from a user perspective (it&#8217;s great) and a techy one (there&#8217;s a lot of clever stuff hiding in there). Anyway, on with the moaning&#8230;</p>
<h3>Finding Things</h3>
<p>You&#8217;d think, what with Google being the long reigning undisputed champions of search, that they&#8217;d have this covered. Nothing could be further from the truth &#8211; it&#8217;s a disaster. Unless you know the name of the app you want, or the developer has managed to sneak the exact keyword you choose into the stingy allocation of description they&#8217;re allowed, you&#8217;re up shit creek. Take a simple example &#8211; find me all the apps that let you play chess online via FICS. Sounds simple, but I bet you don&#8217;t get them all in the first ten searches, if at all.</p>
<p>Some folk like to say that this is just because <i>it&#8217;s just like such a hard problem, man</i>. I disagree. Web search &#8211; that&#8217;s hard. You have no control over the quality or semantics of what you&#8217;re searching. This isn&#8217;t the same at all. Or at least, you shouldn&#8217;t have let it be.</p>
<h3>Choosing Things</h3>
<p>Assume you&#8217;ve climbed the search mountain and found a bunch of apps that look like they might do what you want &#8211; what now? Apps have very little metadata attached to them. You&#8217;re basically stuck with a couple of screenshots, a description, a price, a rating, and some user comments. The screenshots are not usually particularly useful and the description, as I already mentioned, is extremely limited but usually the best you have to go on. The other items deserve sections all of their own, which follow, but first a section about the elephant that isn&#8217;t in the room:</p>
<h3>License</h3>
<p>For me, there are two kinds of software &#8211; one kind is the one where the developer has deliberately kept the source code secret, preventing me from seeing what&#8217;s going on inside, customising it, or fixing bugs when they can&#8217;t be bothered any more. The other kind is the kind where they haven&#8217;t done that. There ARE legitimate reasons for concealing your source code, but most of the time, and especially for my personal use, I will avoid the practice like the plague.</p>
<p>Just to clarify, for the uninitiated, the latter kind of software is what&#8217;s referred to as Free Software. Free referring to freedom, not price (see below). If the developer has decided to suddenly make everything bright green, and I liked it when it was black, I am free to paint it black. If the developer can&#8217;t or won&#8217;t fix a bug, I&#8217;m free to fix it myself, or get someone else to do it for me. The former kind is sometimes referred to as proprietary software. I prefer the term Secret Software. The usual way of differentiating between these kinds of software is the license &#8211; it may consist of either &#8220;you can do this, feel free to do that&#8221; or &#8220;you mustn&#8217;t do this and don&#8217;t even think about that&#8221;. You don&#8217;t need me to tell you which is which.</p>
<p>Anyway, Google didn&#8217;t need that last paragraph &#8211; they understand all this very well and have built and run their business on Free Software, as well as making huge contributions to the world of Free Software at large. Indeed, most of Android itself (let&#8217;s not talk about the exceptions) is Free Software. The point of all this diversion into licensing being that when I manage to get to my list of possible apps that might fit the bill, although some are Free Software and some are not, I frequently have no idea at all which are which, because Google completely neglected to have any kind of licensing information attached to the apps. But not neglected, of course, because that implies an unintentional omission &#8211; it just didn&#8217;t occur to them? Of course it did. So why did they leave it out? You decide.</p>
<h3>Price</h3>
<p>So, based on the previous section, you&#8217;ve probably decided I&#8217;m looking for things that are free, as in free of charge. No. I don&#8217;t want to pay someone to keep the source code secret from me, but I&#8217;ll happily pay them to give me it. Anyway, free of charge would be easy, because the one thing you can easily see is the cost, FREE or&#8230; hang on a minute, did I say easily? FREE, or the cost in one of numerous different currencies. Are you familiar with the current exchange rates between US dollars, Euros, Pounds Sterling, Japanese Yen, and more? You&#8217;d better be. <i>Update: not any more &#8211; it now displays approximate prices in your local currency instead.</i></p>
<p>You&#8217;d also better hope, if your final choice isn&#8217;t free of charge, that you&#8217;re in the right country, because in many countries you simply can&#8217;t buy them. Strange &#8211; surely everywhere at least has PayPal? Yes, but Google doesn&#8217;t own PayPal.</p>
<p>The same situation arises, but to an even greater extent, if you&#8217;re on the other end of the deal. Live in Australia and want to sell your app? You can&#8217;t. <i>Update: Some new countries have now been added.</i></p>
<h3>Adware</h3>
<p>Some people, I assume, are happy to see adverts. I never see them, and I never want to see them. I especially don&#8217;t want to carry them around in my pocket, so I&#8217;m not interested in any app that is going to put them there. Google doesn&#8217;t want me to be able to filter this crap out, of course, because it makes a whole lot of money out of adverts, but still, I&#8217;m not going to look at them for longer than it takes me to quit and uninstall, and I&#8217;m definitely not going to click one, so why not save us both the trouble and just tell me up front.</p>
<p>Mind you, you can normally stop this kind of stuff before you get as far as actually installing it, because it wants all kinds of unnecessary permissions on your phone. But you don&#8217;t get to see this information until you actually tell it to install. Why not, when I&#8217;m looking at a list of 20 potential vuvuzela apps, let me see which ones mysteriously need to know my current location and shoe size, and have the ability to send that information to god knows where? I wonder.</p>
<h3>Ratings and Comments</h3>
<p>These two go together. This is where Google try to &#8216;crowdsource&#8217; away the twin problems of unsearchability and unchoosability. Everyone can rate an app, from 1-5 stars, and everyone can comment on it. Wonderful &#8211; now you can see an app&#8217;s average rating, and you can read the comments. Or at least, it would be wonderful if the crowd wasn&#8217;t a crowd of idiots.</p>
<p>Looking at some apps, ones you know are superb, you&#8217;ll find a whole bunch of 1* ratings accompanied by comments like &#8220;wut iz this it sux&#8221;. Conversely, if you&#8217;ve ever accidentally downloaded a complete dog of an app, you won&#8217;t have been saved by the string of 5* comments. I mentioned the chess apps earlier &#8211; have a look at some of those again if you like, with particular reference to the comments. Common themes include 1* it makes illegal moves (i.e. I don&#8217;t understand the rules), 1* it&#8217;s too hard (I am crap) and 1* it won&#8217;t let me move my prawns diagonally (Even in a crowd of clowns, my long shoes and big red nose stick out like a sore thumb).</p>
<p>In many cases, these comments are the only line of communication between user and developer (because the Market provides nothing else) and it&#8217;s particularly sad to sometimes see a developer attempting to provide support amidst this sea of bozosity.</p>
<p>Additionally, pretty much every time you look at an app&#8217;s comments, almost the first thing you&#8217;ll see is spam, most frequently offering you all the paid apps you want, for free. These comments always virtually the same, and contain easily recognised URLs, but for some reason Google doesn&#8217;t seem to be able to recognise them, or stop them at source, despite the Market being essentially a closed (you&#8217;re tied to a Google account, and a mobile device) platform. Very odd.</p>
<h3>Sorting and Filtering</h3>
<p>This ties in with the almost complete lack of metadata, and with some of the areas discussed above. I have a list of potential things as a result of a search &#8211; the next logical thing to do, if you want to find something in it, is filter the list or sort it by something. Everyone knows this.</p>
<p>There&#8217;s a place where you don&#8217;t do that &#8211; where the list is sorted and filtered for you, and you get what you&#8217;re given. It begins with Goo and it ends with gle.com. I wonder if the mindset of Google Search, which is a complete different kettle of fish to the app Market, where ultimately Google has the ability to shape the quality and quantity of the incoming data (and metadata), has influenced this lack of functionality at all.</p>
<h3>Versions</h3>
<p>Maybe a developer releases a version of an app that breaks a feature you use. Maybe you don&#8217;t realise this until you upgrade &#8211; why would you? Maybe you want to go back to the previous version that worked, and wait to upgrade until the next release when things are back to normal. Maybe they didn&#8217;t break anything, but you just liked an earlier version better, before they cluttered it up with stuff you never wanted in the first place. Well whatever the reason, it&#8217;s tough, because you&#8217;re stuck. There&#8217;s a current version, and that&#8217;s that.</p>
<h3>The End (For Now)</h3>
<p>I&#8217;ve missed quite a few things out, but that&#8217;s more than enough so I&#8217;ll stop now. There are quite a few alternative marketplaces available, needless to say given the above sorry state of affairs, but as far as I can tell they&#8217;re all even worse in various ways, so maybe there is more to me spending the time writing this than just one of my usual rants &#8211; only time will tell&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/android-market-gripes/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Map Control in C#</title>
		<link>http://ciarang.com/posts/csharp-map-control</link>
		<comments>http://ciarang.com/posts/csharp-map-control#comments</comments>
		<pubDate>Sun, 14 Mar 2010 08:55:59 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=937</guid>
		<description><![CDATA[I found myself in need of a C# (.NET/Mono) control for displaying and interacting with maps. I&#8217;d already implemented the same functionality in my application using an embedded browser, but that&#8217;s a horrible hack, so I decided to implement something nicer. I ended up with this: I can hear the whining sirens of the don&#8217;t-reinvent-the-wheel [...]]]></description>
			<content:encoded><![CDATA[<p>I found myself in need of a C# (.NET/Mono) control for displaying and interacting with maps. I&#8217;d already implemented the same functionality in my application using an embedded browser, but that&#8217;s a horrible hack, so I decided to implement something nicer. I ended up with this:</p>
<p><a href="http://ciarang.com/wp-content/uploads/2010/03/mapdemo.png"><img src="http://ciarang.com/wp-content/uploads/2010/03/mapdemo.png" alt="" title="mapdemo" width="430" height="340" class="aligncenter size-full wp-image-938" /></a></p>
<p>I can hear the whining sirens of the don&#8217;t-reinvent-the-wheel police approaching already, so a couple of points about that. Yes, there are a couple of projects around already that I could have used almost off the shelf. They&#8217;re too complicated for my liking. What I&#8217;ve implemented does the basics of what I needed straight away in two small classes, contained in one file. I find this much more pleasant that having to wrangle with someone else&#8217;s 25-class monster implementation. Sometimes you can spend more time figuring out how to integrate an external module than you would just writing it yourself, and having spent all that time you still don&#8217;t understand the underlying implementation. This becomes more important when you start to extend things further down the line, which I will need to do. I&#8217;ve even done all this before, about 7 years ago, using tile data sneakily grabbed from various online proprietary mapping services of the day &#8211; I could have used that code, but I even rejected my own wheel.</a></p>
<p>Furthermore, if all you ever do is piece together other people&#8217;s &#8216;wheels&#8217;, you miss out on a lot of understanding, and more importantly fun. I don&#8217;t advocate reinventing wheels when someone else is paying for your time or you just need to get something done, but aside from that it&#8217;s frequently a good idea. So hopefully the don&#8217;t-reinvent-the-wheel police have now gone away to annoy someone else, and I can get back on topic&#8230;</p>
<p><span id="more-937"></span></p>
<p>In this first incarnation, the control does the following:</p>
<ul>
<li>Presents a scrollable (by dragging) and zoomable map, using <a href="http://openstreetmap.org">OpenStreetMap</a> data from their tileserver.</li>
<li>Selects an appropriate set of tiles for the current zoom level.
<li>Asynchronously loads and caches (in memory only, for now) tiles, updating the display as new ones are retrieved.</li>
<li>Allows markers to be overlaid at specified lat/lon positions.</li>
<li>Raises events to notify the client of map movements made by the user, and clicks at lat/lon positions</li>
</ul>
<p>I&#8217;ve released the whole this under the GPL &#8211; get the source code for the control, and the demo app shown in the screenshot, <a href="http://projects.ciarang.com/p/csmapcontrol/">from here</a>. If you use this a lot, or in a widely distributed application, you should probably consider running your own tileserver (easy enough to do) rather than expecting the OpenStreetMap server to take the strain.</p>
<p>Comments and contributions are welcome, as are feature requests which I may well implement if they look easy and/or fun. In fact, I have a big list of things I intend to implement already &#8211; the thing you want is probably already on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/csharp-map-control/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SlideType Keyboard and Yak Shaving</title>
		<link>http://ciarang.com/posts/slidetype-keyboard-and-yak-shaving</link>
		<comments>http://ciarang.com/posts/slidetype-keyboard-and-yak-shaving#comments</comments>
		<pubDate>Tue, 09 Mar 2010 22:59:15 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=921</guid>
		<description><![CDATA[Something that was bugging me about Android was the touch screen keyboard. I found it impossible to type anything with acceptable speed or accuracy. Unless you have child-sized fingertips, you&#8217;re relying on the dictionary guessing to figure out what word you mean, which is crap at the best of times, and useless if you&#8217;re not [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ciarang.com/wp-content/uploads/2010/03/slidetype.png" alt="Slidetype Keyboard" title="Slidetype Keyboard" width="200" class="alignright size-full wp-image-922" /></p>
<p>Something that was bugging me about Android was the touch screen keyboard. I found it impossible to type anything with acceptable speed or accuracy. Unless you have child-sized fingertips, you&#8217;re relying on the dictionary guessing to figure out what word you mean, which is crap at the best of times, and useless if you&#8217;re not typing dictionary words. A side issue &#8211; I&#8217;ve noticed that if you *do* have child-sized fingers, it&#8217;s hard to get the touch screen to register at all, when you want it to. I don&#8217;t have child-sized fingers, of course, but my children do. When they want to press things, they have to hold their finger on the screen for a while, and sometimes it registers, sometimes it doesn&#8217;t. On the other hand, if they approach from behind and stab at the screen while you&#8217;re in the middle of doing something, it invariably registers straight away.</p>
<p>Anyway, before I got side-tracked by children&#8217;s fingers, I was going to say: But then I discovered the <a href="http://slidetype.blogspot.com/">SlideType Keyboard</a>!</p>
<p><span id="more-921"></span></p>
<p>The way this works (see the screenshot) is that pressing the buttons gives you the numbers, while pressing and sliding a short distance in the appropriate direction gives you the letters. Pressing Alt switches you to and from a second layout with symbols instead of letters. Additionally, you can &#8216;long-press&#8217; a letter key to get a pop-up menu of accented versions of those letters. This is a really good idea, and I found I could type reasonably quickly with it straight away, and with perfect accuracy. The one thing lacking is the ability to customise the layout. In particular, I didn&#8217;t want to have to switch to the symbol layout and back just to get an apostrophe. This is simple requirement was where the <a href="http://www.catb.org/~esr/jargon/html/Y/yak-shaving.html">yak shaving</a> started&#8230;</p>
<p>Getting the <a href="http://code.google.com/p/slidetypekeyboard/source/checkout">source code</a> was easy enough. Setting up Eclipse and the Android SDK was painful, but no big deal. Unfortunately though, I don&#8217;t get on with IDEs in general, and particularly not Eclipse. Although I got the minor changes I wanted done in 5 minutes, I spent the next 55 wrestling with bugs in Eclipse before I realised the error of my ways.</p>
<p>At this point, I ditched Eclipse and used <a href="http://ant.apache.org/">Ant</a> to build it instead. This was much better, and now I could easily build my modified keyboard application and run it in the emulator. To run it on a real device though, the package needs signing. After more messing about (generate key, sign package, &#8216;zipalign&#8217; package), I had that side of things sorted out and had something I could, in theory, install on my phone.</p>
<p>The sensible way to do this is using &#8216;adb&#8217;, the Android Debug Bridge. In theory, you plug the phone into the USB port, type &#8216;adb install mypackage.apk&#8217; and you&#8217;re done. In practice, it didn&#8217;t work due to various bugs and incompatibilities. For reference, using Karmic and a Samsung device, you have to do the following:</a></p>
<ol>
<li>Create <i>/etc/udev/rules.d/99-android.rules</i>, with a+rx permissions, with the following line in it: <i>SUBSYSTEM==&quot;usb&quot;, ATTRS{idVendor}==&quot;04e8&quot;, SYMLINK+=&quot;android_adb&quot;, MODE=&#8221;0666&#8243;</i>.</li>
<li>Restart udev &#8211; <i>sudo service restart udev</i></li>
<li>Build a non-broken version of adb &#8211; see <a href="http://code.google.com/p/android/issues/detail?id=5027">the bug</a></li>
</ol>
<p>Note that if the device is not a Samsung, you need to change the 04e8 to the appropriate vendor ID, which you can see as the first 4 digits of the device ID if you run <i>lsusb</i> with the device plugged in. You probably also don&#8217;t need the adb bug fix in that case.</p>
<p>Finally, two hours later, I have quote and an apostrophe on the &#8217;1&#8242; button on the keyboard. I don&#8217;t know many year&#8217;s worth of typing I&#8217;ll have to do on it for the time saved to come close to those two hours, but at least I now have a decent Android development environment set up.</p>
]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/slidetype-keyboard-and-yak-shaving/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Android FTP Server</title>
		<link>http://ciarang.com/posts/android-ftp-server</link>
		<comments>http://ciarang.com/posts/android-ftp-server#comments</comments>
		<pubDate>Thu, 04 Mar 2010 09:34:29 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=914</guid>
		<description><![CDATA[Stuart Langridge passed on a great idea that hadn&#8217;t occurred to me &#8211; running an FTP server on an Android phone. Although my i7500 is pretty much permanently connected via USB when I&#8217;m in the house, on account of needing to be sure the battery will be charged when I leave the house, I don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kryogenix.org/days/2010/03/03/browsing-my-android-phone-over-wifi-at-home">Stuart Langridge</a> passed on a great idea that hadn&#8217;t occurred to me &#8211; running an FTP server on an Android phone. Although my i7500 is pretty much permanently connected via USB when I&#8217;m in the house, on account of needing to be sure the battery will be charged when I leave the house, I don&#8217;t particularly want to have to mount the USB drive and manually transfer things. Apart from requiring ME to do the work, which defeats the whole object of machines, the computer I connect it to isn&#8217;t necessarily the one I want to transfer files to/from. Also, a card can only be mounted to one device at once, so by mounting it to the remote computer, you snatch it away from the Android device, which isn&#8217;t always ideal.</p>
<p>Stuart tracked down an Android application called <a href="http://www.cyrket.com/p/android/com.bw.onair/">On Air</a>, which he seems mostly happy with. I gave it a quick whirl, and didn&#8217;t like it at all. Clearly we&#8217;re all different. What didn&#8217;t I like?</p>
<p><span id="more-914"></span></p>
<ul>
<li>It generates a random &#8216;password&#8217; (actually a 4-digit number) every time you run it. This makes automating anything impossible.</li>
<li>The user interface. It&#8217;s horrible. To me, that is. I guess some people like a great big arty fart drawing of a button the size of the screen, with the actually user interface relegated to a tiny dot in the corner. Usable software trumps software that (to some) looks nice. Especially when the giant button picture is taking up storage space, which is not infinite.</li>
<li>You can only get to /sdcard, not the rest of the filesystem.</li>
<li>It&#8217;s closed source. All my gripes, and Stuart&#8217;s minor ones, are simple five minute fixes. But not if the developer deliberately makes it impossible. Very annoying.</li>
</ul>
<p>A bit of a washout then? No &#8211; the gem was the idea, not the software, and I found something much better. <a href="http://code.google.com/p/swiftp/">SwiFTP</a> is GPL licensed, already includes all the required functionality that On Air was lacking, and has a sane user interface. Clearly the developer spent his &#8216;drawing a great big stupid button&#8217; time on useful things instead.</p>
<p>A few things I will be using this for:</p>
<ul>
<li>Automatically transferring data to the phone from a queue &#8211; e.g. the latest <a href="http://ratholeradio.org/">Rathole Radio</a>, for listening to in the car.</li>
<li>Automatically backing up data from the phone.</li>
<li>Automatically retrieving specific things, e.g. GPS tracks, photos, and putting them in the appropriate database.</li>
<li>All kinds of other geeky and anal things beginning with the word &#8216;automatically&#8217; that I haven&#8217;t thought of yet.
</ul>
<p>So, thanks to Stuart for sharing the idea, and thanks to Dave Revell for sharing the software.</p>
]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/android-ftp-server/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Facebook, XMPP and a privacy leak</title>
		<link>http://ciarang.com/posts/facebook-xmpp-and-a-privacy-leak</link>
		<comments>http://ciarang.com/posts/facebook-xmpp-and-a-privacy-leak#comments</comments>
		<pubDate>Thu, 11 Feb 2010 21:35:10 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[XMPP]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=873</guid>
		<description><![CDATA[It&#8217;s been in the works a long time, but Facebook have finally switched on their XMPP functionality. Suddenly something like 400m users inside the Facebook walled garden are contactable from the outside world. I don&#8217;t know if this makes it the largest single deployment of XMPP &#8211; Google may be in a position to argue [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been in the works a long time, but Facebook have finally switched on their XMPP functionality. Suddenly something like 400m users inside the Facebook walled garden are contactable from the outside world. I don&#8217;t know if this makes it the largest single deployment of XMPP &#8211; Google may be in a position to argue there, although I&#8217;ve sometimes been inclined to call their implementation almost-but-not-quite-XMPP.
<p><span id="more-873"></span></p>
<p>Connecting to Facebook&#8217;s server is as simple as adding a new account in your favourite client, with chat.facebook.com as the server and your Facebook username as the user. Obviously then, they&#8217;re only contactable from the outside world by people who have an account within the walled garden already, but it&#8217;s a start. Anyway, it&#8217;s handy for people like me who have an account there but, for reasons of taste, common sense, downright dislike of having adverts stuck in their face, etc., don&#8217;t ever log in to it.</p>
<p>My first impressions are that their implementation is solid and well thought out. This is to be expected &#8211; despite any other criticisms I might have, Facebook have always struck me as a very technically capable organisation. Only one small problem is apparent to me so far, and it&#8217;s this: Say Bob is on the Facebook web site and Alice is using her XMPP client. Bob is browsing through the messages on the &#8216;I Dress Up As A Goat and Eat My Wife&#8217;s Underwear&#8217; page, something he does regularly but (uncharacteristically, for a Facebook user) doesn&#8217;t want to tell the world about. At this point, Alice uses XMPP to send Bob a link to something on her web site. Bob clicks the link, and blam &#8211; his goat/underwear fetish is revealed in Alice&#8217;s server logs as the HTTP Referrer.</p>
<p>While I&#8217;m thinking of Facebook, something I&#8217;ve mentioned elsewhere but is worth repeating, is in relation to <a href="http://www.dailymail.co.uk/news/article-1244351/Police-probe-baby-cigarette-photo-posted-Facebook.html">this story</a>. Read the story, then look at the two images &#8211; in particular the copyright notice on those images. Do Facebook really claim copyright on those images, or have the Daily Mail got it wrong? Either way, it&#8217;s definitely something that should be making you go hmmmmm.</p>
]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/facebook-xmpp-and-a-privacy-leak/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Samsung i7500 Galaxy Re-boxing</title>
		<link>http://ciarang.com/posts/galaxy-re-boxing</link>
		<comments>http://ciarang.com/posts/galaxy-re-boxing#comments</comments>
		<pubDate>Tue, 02 Feb 2010 07:58:50 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=842</guid>
		<description><![CDATA[If you&#8217;re unlucky you&#8217;ll have heard of unboxing videos, where someone laboriously unpacks their latest gadget purchase, appreciatively describing each piece of cardboard and polystyrene in excruciating detail, and videoing the whole thing for the &#8216;benefit&#8217; of the world. Frequently the gadget in question seems to be made by Apple, because who else but a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ciarang.com/gallery/general/technical/i7500rebox.jpg"><img class="ZenphotoPress_thumb ZenphotoPress_right " alt="Samsung i7500 Reboxing" title="Samsung i7500 Reboxing" src="http://ciarang.com/gallery/zp-core/i.php?a=general/technical&amp;i=i7500rebox.jpg&amp;w=200&amp;h=" style="float:right; " /></a></p>
<p>If you&#8217;re unlucky you&#8217;ll have heard of unboxing videos, where someone laboriously unpacks their latest gadget purchase, appreciatively describing each piece of cardboard and polystyrene in excruciating detail, and videoing the whole thing for the &#8216;benefit&#8217; of the world. Frequently the gadget in question seems to be made by Apple, because who else but a purchaser of Apple products would do such a thing? Anyway, not to be outdone, here is my re-boxing post and photograph.</p>
<p><span id="more-842"></span></p>
<p>The star of the show is a Samsung i7500 Galaxy, which I suppose you would describe as an Android-based smartphone. In other words it&#8217;s like an iPhone but better, not least because you can run any software you want on it without having to ask Steve Jobs for permission. Unfortunately, this particular specimen is under the impression that a ghostly hand is pressing the buttons down the right-hand side of the phone at random intervals, especially when it&#8217;s making a noise. This has many annoying side effects, not least that every incoming call gets cut off and sent to voicemail &#8211; fair enough, since that&#8217;s my most common response to an incoming call. I&#8217;d rather have the choice though, so it&#8217;s gone back in the box and O2 are (hopefully) bringing a replacement today.</p>
<p>Apart from this irritating behaviour, first impressions are good. I&#8217;ve had it about a week and the only real complaint I have is the battery life. Poor battery life is a common feature of all these new-fangled phones though, and turning things off when you&#8217;re not using them (especially GPS and background sync) makes things a lot better.</p>
<p>The only other issue is that it ships with Android 1.5, and Samsung are currently saying they won&#8217;t be shipping a 2.0 upgrade for this model. Right now I&#8217;m not that bothered, but I know I will be later. If they stick to that, then like many others I won&#8217;t touch another Samsung product as long as I live. The option is always there to re-flash the whole thing with an unofficial Android 2 build anyway.</p>
<h2>Applications</h2>
<p>All the data I have on the phone is synced online to various places, so replacing it is no great hassle. The only thing I&#8217;ll have to do is reinstall the various applications I&#8217;ve installed so far, a job that will take less than five minutes, especially as I&#8217;ve made this list:</p>
<ul>
<li><b>ConnectBot</b> &#8211; SSH client. Using this with a touchscreen keyboard is sheer hell &#8211; it took me over 5 minutes to type &#8216;tail /var/log/rabbitmq/rabbit.log&#8217;, for example. Handy for emergencies only.</li>
<li><b>GPS Speedometer</b> &#8211; it&#8217;s a speedometer. Not all that useful in itself, but it&#8217;s the only application I&#8217;ve found so far that holds the GPS open permanently. Without it, if you&#8217;re using Google Maps and switch away to another application, you can end up losing the GPS lock and have to wait for it to get it again when you switch back.</li>
<li><b>Compass (Snaptic)</b> &#8211; does what it says on the tin.</li>
<li><b>GPSTest</b> &#8211; good for figuring out what&#8217;s going on with the GPS, what satellites it&#8217;s using, what accuracy you&#8217;re getting, etc. Probably unnecessary, but my 2001-vintage handheld GPS shows all this by default when it&#8217;s powering up, so I feel lost without it.</li>
<li><b>Google Sky Map</b> &#8211; brilliant &#8211; point it at the sky and it tells you what you&#8217;re looking at. I normally use <a href="http://www.stellarium.org/">Stellarium</a> for this, but a PC doesn&#8217;t know which direction you&#8217;re looking, and you have to tell it where you are. Plus, you rarely have one in the pocket of your jeans.</li>
<li><b>Ultimate Stopwatch and Timer</b> &#8211; everyone needs a stop watch, don&#8217;t they?</li>
<li><b><a href="http://macno.org/mustard">Mustard</a></b> &#8211; StatusNet-compatible microblogging client.</li>
<li><b>Bubble</b> &#8211; not so many people need a spirit level, but it comes in handy.</li>
<li><b>Barcode Scanner</b> &#8211; I haven&#8217;t (yet) found a genuine use for this, but maybe I will one day.
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/galaxy-re-boxing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python &#8211; Over to the dark side</title>
		<link>http://ciarang.com/posts/python-over-to-the-dark-side</link>
		<comments>http://ciarang.com/posts/python-over-to-the-dark-side#comments</comments>
		<pubDate>Tue, 22 Dec 2009 21:49:40 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=821</guid>
		<description><![CDATA[There are two things I think are just plain wrong. Actually there are millions, but there are two I have in mind right now. The first is spaces instead of tab characters for indenting code. The second also involves spaces &#8211; excessive use of them like 1 + 1 = 2 when 1+1=2 is, to [...]]]></description>
			<content:encoded><![CDATA[<p>There are two things I think are just plain wrong. Actually there are millions, but there are two I have in mind right now. The first is spaces instead of tab characters for indenting code. The second also involves spaces &#8211; excessive use of them like 1 + 1 = 2 when 1+1=2 is, to me, far more sensible. I don&#8217;t want to argue about either of these things, because a) this is a religious matter, i.e. I&#8217;m right and you&#8217;re wrong, and b) there&#8217;s no point, because you win anyway.</p>
<p>Why? Because in the interests of global harmony, code sharing, encouraging of contributions, etc, all my Python projects will now follow the <a href="http://www.python.org/dev/peps/pep-0008/">PEP 8</a> guidelines. This doesn&#8217;t affect my contributions to other projects, since they&#8217;re always in the style required by that project (consistency always trumps religion), but it does mean that others can use and contribute to my stuff more easily, and hopefully in time I&#8217;ll get so used to seeing 1 + 1 = 2 that it won&#8217;t look stupid any more.</p>
<p>So, on the subject of PEP 8, a couple of tips I figured out along the way:</p>
<p><span id="more-821"></span></p>
<h2>Fixing Indentation</h2>
<p>There are a few ways to handle this, but the simplest and most reliable seems to be an example that&#8217;s part of the Python distribution itself. On Debian-based systems, this script is packaged separately in python-examples. Re-indenting a file to PEP 8 standards in that environment can be done like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">python <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>python2.6<span style="color: #000000; font-weight: bold;">/</span>examples<span style="color: #000000; font-weight: bold;">/</span>Tools<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>reindent.py yourfile.py</pre></div></div>

<h2>Checking Code</h2>
<p>There&#8217;s a handy utility, aptly named pep8, for checking code against the PEP 8 guidelines. The simplest way to install it is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">easy_install pep8</pre></div></div>

<p>After that, you can just run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pep8 <span style="color: #000000; font-weight: bold;">*</span>.py</pre></div></div>

<p>to get a list of your crimes against style and readability. Note that, in the current release at least, it doesn&#8217;t seem to do a perfect job. For example, this is flagged as an error:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">    value = func<span style="color: black;">&#40;</span>-x, -y<span style="color: black;">&#41;</span></pre></div></div>

<p>It doesn&#8217;t like that fact that there are no spaces around the unary minus, which I think is wrong. Moreover, it seems to be impossible to write that code in a way that it does like &#8211; if you put spaces, it complains about that instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/python-over-to-the-dark-side/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MWZenphoto &#8211; simple MediaWiki/Zenphoto integration</title>
		<link>http://ciarang.com/posts/mwzenphoto</link>
		<comments>http://ciarang.com/posts/mwzenphoto#comments</comments>
		<pubDate>Wed, 07 Oct 2009 20:48:30 +0000</pubDate>
		<dc:creator>CiaranG</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://ciarang.com/?p=787</guid>
		<description><![CDATA[I wanted an easy way of using images from a Zenphoto gallery in MediaWiki pages, and it turned out there wasn&#8217;t one. In fact, I had trouble finding a hard way of doing it with satisfactory results. It&#8217;s easy enough to embed external images in a MediaWiki page, if you have your MediaWiki config set [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted an easy way of using images from a Zenphoto gallery in MediaWiki pages, and it turned out there wasn&#8217;t one. In fact, I had trouble finding a hard way of doing it with satisfactory results. It&#8217;s easy enough to embed external images in a MediaWiki page, if you have your MediaWiki config set to allow it, but I wanted thumbnails that clicked through to the real image. Not so easy. Hence MWZenphoto &#8211; a very basic MediaWiki extension that lets you do just that by including a simple &lt;zenphoto&gt; tag in the wiki markup.</p>
<p><span id="more-787"></span></p>
<p>Installing is straightforward &#8211; get the MWZenphoto.php file from the <a href="http://projects.ciarang.com/p/mwzenphoto/source/tree/master/">project repository</a> and put it in MediaWiki&#8217;s &#8216;extensions&#8217; directory. Then add the following to LocalSettings.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'extensions/MWZenphoto.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Finally, in MWZenphoto.php, edit the following line so it points to the Zenphoto gallery you want to use:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$ZP_baseURL</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'/gallery'</span><span style="color: #339933;">;</span></pre></div></div>

<p>You can give it a relative path, like I&#8217;ve done there, if Zenphoto and MediaWiki are on the same server. Alternatively, you can give a full URL, such as &#8216;http://somewhere.else.example.com/path/to/gallery&#8217;.</p>
<p>Once it&#8217;s installed, you can use the &lt;zenphoto&gt; tag directly in the wiki markup. In its simplest form, you just need to specify the album and image name, like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;zenphoto&gt;album|image.jpg&lt;/zenphoto&gt;</pre></div></div>

<p>You can also specify the thumbnail size, the image alignment, and the alt text, and the image can be more than one album deep in the Zenphoto heirarchy. A more complex example:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;zenphoto&gt;album/subalbum|image.jpg|350px|right|alt=A picture&lt;/zenphoto&gt;</pre></div></div>

<p>In all cases, clicking the image takes you to the Zenphoto page for that image. Finally, see <a href="http://ciarang.com/wiki/page/Beetroot_and_Chocolate_Cake">here</a> for a working example. This is very much a first draft &#8211; maybe it needs some tweaking to fit in with your Zenphoto configuration, maybe it&#8217;s got a bug, or maybe it needs a feature. Let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://ciarang.com/posts/mwzenphoto/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

