<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Forbidden Projects</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/" />
    <link rel="self" type="application/atom+xml" href="http://www.bitwiz.org.uk/s/atom.xml" />
    <id>tag:www.bitwiz.org.uk,2013-01-14:/s//1</id>
    <updated>2013-03-03T22:40:40Z</updated>
    <subtitle>Free and Open Source Software in Reciprocal Space</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 5.2.2</generator>

<entry>
    <title>Flame Challenge</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2013/03/flame-challenge.html" />
    <id>tag:www.bitwiz.org.uk,2013:/s//1.88</id>

    <published>2013-03-03T22:17:25Z</published>
    <updated>2013-03-03T22:40:40Z</updated>

    <summary>I&apos;ve entered the Flame Challenge.  The challenge, specifically, is to answer the following question, scientifically (i.e. not poetically), for an 11 year old, in 300 words or less or as a graphic or video entry.  The entries will be judged...</summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Science" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="flamechallenge" label="Flame Challenge" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[<p>I've entered the <a href="http://www.centerforcommunicatingscience.org/the-flame-challenge-2/">Flame Challenge</a>.  The challenge, specifically, is to answer the following question, scientifically (i.e. not poetically), for an 11 year old, in 300 words or less or as a graphic or video entry.  The entries will be judged by 4th-6th graders in schools in the USA.  It was too much of a challenge for me to resist, and now that the deadline has passed I can reveal my answer:</p>
<h3 style="text-align: center;">What is time?</h3>
<blockquote>
<p>Imagine looking at every slice of a loaf of bread, one by one, starting with the crust at one end and progressing towards the other. First you'd see the crust, then you'd see all the slices from the middle of the bread. If the loaf had an air bubble inside, then you'd see a hole in some of the slices. The slice from right at the edge of the bubble would have a small hole, and the ones which were cut right through the middle of the bubble would have bigger holes. On your way through the slices, you'd see a small hole first, then a bigger one, then another smaller one, then no hole at all.<br /><br />The passing of time from moment to moment is like moving from one slice to another. Many things stay the same, just like every slice of a loaf of bread looks roughly the same, but some things change --- like the sizes of the holes in the bread slices. Things that change quickly, like an explosion, look very different from one "slice" to the next. Things that aren't changing at all look exactly the same in every slice. Something that's moving, like a car, changes its position from one slice to another.<br /><br />When you think of time this way, you see that the passage of time is quite similar to moving along in distance. This is actually how scientists often think about it, too. Have you heard of Einstein's Theory of Relativity? That's based on treating space and time as very similar things. The main difference is that we have no choice but to move forwards in time. You can choose to stop moving through the slices of bread and spend longer looking at a particular slice, but you can't stand still in time!</p>
</blockquote>
<p>My approach was to make the link between the dimension of time and the dimensions of space by using a familiar household object.  There's so much more that I could've added with a longer word limit, like how things can be measured in time and space by creating an object that changes its appearance regularly along the dimension of interest.  A ruler is just a stick which looks slightly different as you move along its length (the numbers go up), and a clock is just an object which looks slightly different as you move through time (the hands go round).  You can even extend the concept of a crystal to dimensions of time as well, making a <a href="https://en.wikipedia.org/wiki/Space-time_crystal">space-time crystal</a>.  What I find most interesting of all is how our <em>perception</em> of time is linked to its physical reality: exactly <em>why</em> are we compelled to advance through time, while having apparent free will concerning our movements in other dimensions?  Is it <a href="https://en.wikipedia.org/wiki/Eternalism_%28philosophy_of_time%29">all in our heads</a>?  Perhaps somehow related to the second law of thermodynamics applied to the physical and chemical processes in our brains?</p>
<p>The winners will be announced at the World Science Festival in June this year.  In the unlikely event that I win a trip to NYC at that time, I'll be flying in a highly sleep-deprived state from an experiment at the <a href="http://lcls.slac.stanford.edu/">Linac Coherent Light Source</a>.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Ten years of Sylpheed</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2012/11/ten-years.html" />
    <id>tag:www.bitwiz.org.uk,2012:/s//1.87</id>

    <published>2012-11-27T22:40:58Z</published>
    <updated>2012-11-27T23:13:34Z</updated>

    <summary><![CDATA[This came up on one of my mailing lists recently, and I realised that I've also been using Sylpheed as my email client for ten years.&nbsp; Since shortly after I started using Linux, in fact.&nbsp; It was the very first...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
    <category term="gkrellm" label="GKrellM" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sylpheed" label="Sylpheed" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[<a href="http://www.sraoss.jp/pipermail/sylpheed/2012-October/005420.html">This</a> came up on one of my mailing lists recently, and I realised that I've also been using <a href="http://sylpheed.sraoss.jp/en/">Sylpheed</a> as my email client for ten years.&nbsp; Since shortly after I started using Linux, in fact.&nbsp; It was the very first program I compiled and installed from source, and I remember being taken through the process of learning the difference between "libgtk+" and "libgtk+-dev" by a kind helper on IRC.<br /><br />A whole decade later, I'm still using Sylpheed almost every single day.&nbsp; In all that time, text editors, web browsers, version control systems, desktop environments, IRC clients, IM clients, window managers and even types of input device have all come and gone from my computing environment.&nbsp; Sylpheed simply never gave me any reason to replace it.&nbsp; In ten years, I think I can remember it crashing a single digit number of times.&nbsp; It's always one of the first things I install on a new machine - and my current laptop is my third such new machine since then.&nbsp; That's not including two work machines, where it was also the first thing I installed.<br /><br />Discounting things like the kernel, SSH, the X server and so on, the only other program that's achieved this is <a href="http://www.muhri.net/gkrellm/">GKrellM</a>, and that's only because the Sylpheed email prompted me to think about and remember it.&nbsp; In fact, not even the X server has survived these ten years: in 2002, it was XFree86.<br /><br />An impressive feat, and a mark of true software quality.&nbsp; If anything I produce lasts ten years on even one person's screen, I'll be very happy indeed!<br /><br />Which programs, if any, survived the last ten years on your desktop?<br />]]>
        
    </content>
</entry>

<entry>
    <title>Reproducible random ordering from &quot;sort -R&quot;</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2012/08/sortr.html" />
    <id>tag:www.bitwiz.org.uk,2012:/s//1.86</id>

    <published>2012-08-09T18:12:53Z</published>
    <updated>2012-08-09T19:03:52Z</updated>

    <summary><![CDATA[Random discovery for the day (actually yesterday, but never mind): "sort -R", which randomises the order of lines in its input, uses a crytographic random number generator seeded using numbers which include its PID and the time.&nbsp; It's the same...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Computer" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[Random discovery for the day (actually yesterday, but never mind): "sort -R", which randomises the order of lines in its input, uses a crytographic random number generator seeded using numbers which include its PID and the time.&nbsp; It's the same random number generator as used by "shred": <a href="https://en.wikipedia.org/wiki/ISAAC_%28cipher%29">ISAAC</a>.<br /><br />So, if you need to get the same random order of lines each time, as I did for a test script, you need to provide your own source of "random" numbers.&nbsp; Any old binary file will do, for example:<br /><br />$ sort -R --random-source=/bin/ls<br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Remote control repair</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2012/03/remote-control-repair.html" />
    <id>tag:www.bitwiz.org.uk,2012:/s//1.85</id>

    <published>2012-03-02T20:40:49Z</published>
    <updated>2012-03-02T21:15:48Z</updated>

    <summary><![CDATA[I repaired my DVD player by replacing the IR receiver for the remote control.&nbsp; It hadn't worked since about 2005, but I'd been hesitating about actually sorting it out.&nbsp; Admittedly, for a lot of that time I was convinced it...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Hardware" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="hardware" label="hardware" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="infrared" label="infrared" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="repair" label="repair" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[I repaired my DVD player by replacing the IR receiver for the remote control.&nbsp; It hadn't worked since about 2005, but I'd been hesitating about actually sorting it out.&nbsp; Admittedly, for a lot of that time I was convinced it was the remote control itself that was defective, and didn't want to give my credit card details to one of the many dodgy-looking replacement remote control websites.<br /><br />Anyway, in case anyone's interested, the model was a Panasonic SC-HT520 and the replacement part I used was a Vishay TSOP 1838 (<a href="http://www.conrad.de/ce/de/product/171115/IR-EMPFAeNGER-MODUL-TSOP1838-4838">example</a> , but the photo shows the wrong thing) which uses a 950 nm wavelength and a 38 kHz carrier.&nbsp; The pin assignments are exactly the same as the original one from the player, so you just have do undo some screws (hint: take the grey panel off the front of the DVD tray before disconnecting the power), desolder the old one and solder the replacement. The tracks on the PCB are nice and large, so it's dead easy.&nbsp; Total cost: €1.55, and about half an hour (plus many hours of research and figuring out what would be suitable, but that doesn't count).<br /><br />I remember reading somewhere that the receivers on certain Panasonic units often seem to go bad, so if anyone is interested and needs more guidance than the above, post a comment here and I'll put some photos up.<br /><br />]]>
        
    </content>
</entry>

<entry>
    <title>Project X</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2011/10/project-x.html" />
    <id>tag:www.bitwiz.org.uk,2011:/s//1.83</id>

    <published>2011-10-04T18:31:02Z</published>
    <updated>2011-10-04T18:55:13Z</updated>

    <summary><![CDATA[I'm still here, and programming.&nbsp; Work has been taking up most of my "programming brain" recently, but the results will hopefully be released as free and open source software very soon.For the last few months I've been working on a...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Computer" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Science" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="projectx" label="Project X" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[I'm still here, and programming.&nbsp; <a href="http://www.nature.com/nature/journal/v470/n7332/full/nature09750.html">Work</a> has been taking up most of my "programming brain" recently, but the results will hopefully be released as free and open source software very soon.<br /><br />For the last few months I've been working on a new non-work project as well, which I'm not going to say too much about just yet - let's call it <b>Project X</b> for now.&nbsp; It's a piece of major "itch scratching" for me, but I have a feeling that many other scientists who use Linux will love it.&nbsp; Perhaps many other people besides.&nbsp; Watch this space...<br />]]>
        
    </content>
</entry>

<entry>
    <title>Command line weight loss</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2011/07/command-line-weight-loss.html" />
    <id>tag:www.bitwiz.org.uk,2011:/s//1.82</id>

    <published>2011-07-06T20:25:06Z</published>
    <updated>2011-07-13T20:01:20Z</updated>

    <summary><![CDATA[$ sudo setweight --bmi=21It'd be nice if it were that simple.&nbsp; But it almost is!Scales of Truth is a command line implementation of The Hacker's Diet.&nbsp; The basic principle is to lose (or gain, I guess, theoretically at least) weight...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Computer" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="appliedthermodynamics" label="applied thermodynamics" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="programming" label="programming" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="script" label="script" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[<code>$ sudo setweight --bmi=21</code><br /><br />It'd be nice if it were that simple.&nbsp; But it almost is!<br /><b><br /><i>Scales of Truth</i></b> is a command line implementation of <a href="http://www.fourmilab.ch/hackdiet/e4/">The Hacker's Diet</a>.&nbsp; The basic principle is to lose (or gain, I guess, theoretically at least) weight by taking an engineering approach to your body's energy requirements. There are quite a few implementations of this or similar things (e.g. <a href="http://www.fourmilab.ch/hackdiet/online/hdo.html">The Hacker's Diet Online</a> and <a href="http://physicsdiet.com/">Physics Diet</a>), and an important feature is that the required day-to-day administration, i.e. typing in your weight, is not very time-consuming.&nbsp; Less than five minutes a day?&nbsp; Well opening a website, logging in, typing a value in and so on seems like a lot of work to me.&nbsp; With Scales of Truth, you simply click over to one of the many terminals you no doubt have open, and type:<br /><br /><code>$ sot XXX</code><br /><br />Where "XXX" is your current scale reading (in your choice of unit).&nbsp; Scales of Truth does all the necessary calculations, backs up your readings using Git (because losing months of figures would really suck), and displays some interesting statistics:<br /><br /><code>Current mass estimate: XXX kg (instantaneous BMI XX.X kg/m^2)<br />7-day change: -.42 kg (-1757.2 kJ or -419.9 kcal per day)<br />30-day change: -2.77 kg (-2704.2 kJ or -646.3 kcal per day)</code><br /><br />If you happen to miss a few readings, it interpolates the missing values automatically so your running average stays up to date.&nbsp; For the average reader of this site, the whole procedure probably takes <i>slightly less than two seconds</i>.&nbsp; That is, assuming you can resist taking a look at your progress using "sot --graph":<br /><div><br /></div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.bitwiz.org.uk/s/assets_c/2011/07/sot-20.html" onclick="window.open('http://www.bitwiz.org.uk/s/assets_c/2011/07/sot-20.html','popup','width=636,height=382,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.bitwiz.org.uk/s/assets_c/2011/07/sot-thumb-480x288-20.png" alt="sot.png" class="mt-image-center" style="text-align: center; display: block; margin: 0pt auto 20px;" width="480" height="288" /></a></span>That's my own graph for the last few months, so I've taken the liberty of removing the actual numbers.&nbsp; Suffice to say that each tick on the mass axis corresponds to two kilograms, and I'm rather pleased with progress so far...<br /><br />You can download Scales of Truth <a href="http://www.bitwiz.org.uk/stuff/sot">right here</a>.&nbsp; Simply download the file, open it in a text editor, satisfy yourself that it's not going to do anything evil to your computer, then follow the instructions.<br />]]>
        
    </content>
</entry>

<entry>
    <title>The T Word</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2010/10/the-t-word.html" />
    <id>tag:www.bitwiz.org.uk,2010:/s//1.81</id>

    <published>2010-10-31T13:11:50Z</published>
    <updated>2010-10-31T13:45:56Z</updated>

    <summary><![CDATA[Refuse to be terrorised. A criminal does not become a terrorist because of which country they came from, because they choose to attack aeroplanes, because they are religiously or politically motivated or because they use bombs.&nbsp; They become a terrorist...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Everything Else" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[<a href="http://www.schneier.com/essay-124.html">Refuse to be terrorised</a>.<br /> <div><br />A criminal does not become a terrorist because of which country they came from, because they choose to attack aeroplanes, because they are religiously or politically motivated or because they use bombs.&nbsp; They become a terrorist because we respond with fear and define them as such.&nbsp; Well, we can choose not to do that.<br /><br />Everyone should remember that the perpetrators of the recent cargo plane bombing, the Times Square bombing, the underpants bombing, the liquid bomb plots, the 2007 London and Glasgow attacks and countless others (at least in the "Western world") <i>did not succeed</i>.<br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Trackball Configuration</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2010/09/trackball-configuration.html" />
    <id>tag:www.bitwiz.org.uk,2010:/s//1.79</id>

    <published>2010-09-13T22:01:05Z</published>
    <updated>2010-09-13T22:28:13Z</updated>

    <summary><![CDATA[I have a slightly strange configuration for my trackball.&nbsp; I have it set up left-handed, so the main button on the right is "left click", and vice-versa.&nbsp; There are two smaller buttons, one on each side, and I have the...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Computer" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="gnome" label="Gnome" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="Linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="trackball" label="trackball" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="trackpad" label="trackpad" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xorg" label="X.org" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[I have a slightly strange configuration for my <a href="http://www.logitech.com/en-us/mice-pointers/trackballs/devices/4680">trackball</a>.&nbsp; I have it set up left-handed, so the main button on the right is "left click", and vice-versa.&nbsp; There are two smaller buttons, one on each side, and I have the left-hand one as "middle click" and the right-hand one turning the ball into a "scroll wheel" when it's held ("wheel emulation" in X speak).&nbsp; To complicate matters, I have the trackpad on my laptop right-handed.&nbsp; In previous times, I'd configure this with some lines like these in the relevant section of xorg.conf to set up the buttons properly just for the trackball:<br /><br />   Option         "Buttons" "9"<br />
  Option         "EmulateWheel" "on"<br />
  Option         "EmulateWheelButton" "9"<br />
  Option         "ButtonMapping" "3 8 1 4 5 6 7 2 9"<br />
<br />That worked until the business of HAL for X input configuration came along.&nbsp; Then I put something like this in /etc/hal/fdi/policy/trackball.fdi:<br /><br />
&lt;deviceinfo version="0.2"&gt;<br />&nbsp;&lt;device&gt;<br />&nbsp; &lt;match key="info.product" string="Logitech USB Trackball"&gt;<br />&nbsp;&nbsp; &lt;merge key="input.x11_driver" type="string"&gt;mouse&lt;/merge&gt;<br />&nbsp;&nbsp; &lt;merge key="input.x11_options.Buttons" type="string"&gt;5&lt;/merge&gt;<br />&nbsp;&nbsp; &lt;merge key="input.x11_options.EmulateWheel" type="string"&gt;true&lt;/merge&gt;<br />&nbsp;&nbsp; &lt;merge key="input.x11_options.EmulateWheelButton" type="string"&gt;9&lt;/merge&gt;<br />&nbsp;&nbsp; &lt;merge key="input.x11_options.ZaxisMapping" type="string"&gt;4 5&lt;/merge&gt;<br />&nbsp;&nbsp; &lt;merge key="input.x11_options.ButtonMapping" type="string"&gt;3 2 1 4 5 6 7 8 9&lt;/merge&gt;<br />&nbsp;&nbsp; &lt;merge key="input.x11_options.MinSpeed" type="string"&gt;0.40&lt;/merge&gt;<br />&nbsp;&nbsp; &lt;merge key="input.x11_options.MaxSpeed" type="string"&gt;0.60&lt;/merge&gt;<br />&nbsp;&nbsp; &lt;merge key="input.x11_options.AccelFactor" type="string"&gt;0.010&lt;/merge&gt;<br />&nbsp; &lt;/match&gt;<br />&nbsp;&lt;/device&gt;<br />&lt;/deviceinfo&gt;<br /><br />That worked, but never quite satisfactorily.&nbsp; In some versions, the trackball would only work properly if plugged in after I'd booted up and logged in.&nbsp; In later versions (notably Fedora 12 and 13) it would never work correctly at all.&nbsp; In Fedora 13, the HAL method was deprecated and replaced with a method via files under /etc/X11/xorg.conf.d/.&nbsp; I added a file called "01-trackball.conf" containing:<br /><br />Section "InputClass"<br />&nbsp; Identifier&nbsp;&nbsp;&nbsp;&nbsp; "trackball"<br />&nbsp; MatchProduct&nbsp;&nbsp; "Logitech USB Trackball"<br />&nbsp; Option&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Buttons" "9"<br />&nbsp; Option&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "EmulateWheel" "on"<br />&nbsp; Option&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "EmulateWheelButton" "9"<br />&nbsp; Option&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "ButtonMapping" "3 8 1 4 5 6 7 2 9"<br />EndSection<br /><br />Section "InputClass"<br />&nbsp; Identifier&nbsp;&nbsp;&nbsp;&nbsp; "trackpad"<br />&nbsp; MatchProduct&nbsp;&nbsp; "SynPS/2 Synaptics TouchPad"<br />&nbsp; Option&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "ButtonMapping" "1 2 3"<br />EndSection<br /><br />These lines define the exact button configuration for both the trackball and the trackpad, and the combination of InputClass and MatchProduct means that the rule works even if the trackball isn't present when X starts.<br /><br />But it still didn't quite work.&nbsp; It seemed that the settings always got overridden by Gnome's central mouse options, left or right handed but not my strange mixture.&nbsp; The main buttons (left and right click) on the trackball had to be the same as the trackpad because Gnome couldn't understand the idea of having the two configured differently.<br /><br />With a little clear thought, it's probably already obvious what was going wrong, though it was infuriating for a long time.&nbsp; Gnome (specifically gnome-settings-daemon) does indeed override your nicely thought out X config.&nbsp; Fortunately, besides "left handed" and "right handed" modes, it also has an extra mode called "don't screw with my damn setup you piece of ****".&nbsp; It just takes a little more surgery to enable:<br /><br />$ gconftool-2 -s /apps/gnome_settings_daemon/plugins/mouse/active --type bool false<br /><br />With Gnome's mouse config stuff safely (and permanently) anaesthetised, you're clear to configure things your way again. <br /><br />
]]>
        
    </content>
</entry>

<entry>
    <title>Thinkpad DVD Noise</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2010/08/thinkpad-dvd-noise.html" />
    <id>tag:www.bitwiz.org.uk,2010:/s//1.78</id>

    <published>2010-08-22T20:40:20Z</published>
    <updated>2010-08-22T20:50:17Z</updated>

    <summary><![CDATA[My handy household hint for the weekend:One problem I've been experiencing with my new(ish) Thinkpad T500 is the large amount of noise made by the DVD drive.&nbsp; It's loud enough to be distracting when watching a film - not quite...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Computer" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="bios" label="BIOS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="dvd" label="DVD" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="noise" label="noise" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="t500" label="T500" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="thinkpad" label="Thinkpad" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[My handy household hint for the weekend:<br /><br />One problem I've been experiencing with my new(ish) Thinkpad T500 is the large amount of noise made by the DVD drive.&nbsp; It's loud enough to be distracting when watching a film - not quite enough to drown it out, but enough to be clearly heard over even the louder parts until your mind starts filtering it out.&nbsp; The tray rattles against the casing, which makes it much worse.&nbsp; I found the noise could be reduced significantly by squashing one or two bits of folded tissue between then tray and the casing above, but that's a nasty solution.<br /><br />Of course, there's a proper fix for this.&nbsp; Just go into the BIOS config (press the blue ThinkVantage button when the BIOS boot screen shows up, hold it down until the message goes away, then follow the instructions), and find the options for the CD drive, and set it to "Silent".&nbsp; Problem solved - the drive becomes almost inaudible, and it doesn't seem to have any adverse effect on the playback of DVDs.<br /> ]]>
        
    </content>
</entry>

<entry>
    <title>iAudio X5 Tagging</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2010/06/iaudio-x5-tagging.html" />
    <id>tag:www.bitwiz.org.uk,2010:/s//1.77</id>

    <published>2010-06-30T08:17:42Z</published>
    <updated>2010-06-30T09:15:40Z</updated>

    <summary><![CDATA[The Cowon iAudio X5 is, in many ways, the ideal music player for the discerning geek.&nbsp; It's Linux friendly, behaving as a normal USB mass storage device requiring no special software nor drivers; it plays Ogg/Vorbis and FLAC files; it...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Computer" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cowon" label="Cowon" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iaudio" label="iAudio" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ogg" label="Ogg" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tag" label="tag" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="vorbis" label="Vorbis" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="x5" label="X5" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="x5l" label="X5L" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[The <a href="http://www.cowonglobal.com/product_wide/product_X5_feature.php">Cowon iAudio X5</a> is, in many ways, the ideal music player for the discerning geek.&nbsp; It's Linux friendly, behaving as a normal USB mass storage device requiring no special software nor drivers; it plays Ogg/Vorbis and FLAC files; it has a line in connector; it has fantastic sound quality; it organises your files by folder, so you can have your files organised how you really want them.&nbsp; It also has a battery which lasts ages, particularly the X5L version.&nbsp; When my X5L was younger, a full charge would last for about two weeks of fairly constant use at work.&nbsp; Now it's several years old - I've actually forgotten how old exactly - and it still lasts for many days.<br /><br />It does, however, have a particular weirdness when handling Ogg/Vorbis files.&nbsp; Its tag parser is extremely basic, and apparently just skips one character (the equals sign) after finding the letters "ARTIST" in the tags.&nbsp; But most recent ripping software adds an extra field, called ARTISTSORT.&nbsp; The X5 often finds that instead of ARTIST, and thinks the name of the artist is something like "ORT=Haza, Ofra" instead of "Ofra Haza".<br /><br />So, I wrote a little script to remove the ARTISTSORT tags altogether.&nbsp; It's a cheap solution - it'd probably be better just to move that tag to the end (possibly the start, I didn't really test) of the tags field, but this field isn't used for sorting on the X5 anyway.<br /><br />Here's the script ("<code>ogg-retag</code>").&nbsp; It's really simple:<br /><br /><code>#!/bin/sh<br /><br />if [ -e ogg.tags ]; then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "ogg.tags file exists.&nbsp; Please remove it first."<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit 1<br />fi<br /><br />for FILENAME in "$@"; do<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Processing "$FILENAME<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dump tags to file, removing ARTISTSORT tag<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vorbiscomment -l "$FILENAME" | grep -v "ARTISTSORT=" \<br /></code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </code><code>&gt; ogg.tags<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Write tags back<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vorbiscomment -w -c ogg.tags "$FILENAME"<br /><br />done<br /><br />rm -f ogg.tags<br /></code><br />To run, simply "cd" into the folder containing the problematic Ogg/Vorbis files, then run "ogg-retag *.ogg" or similar.<br />]]>
        
    </content>
</entry>

<entry>
    <title>Easier Partial &quot;DCommitting&quot;</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2010/05/partial-dcommitting.html" />
    <id>tag:www.bitwiz.org.uk,2010:/s//1.76</id>

    <published>2010-05-24T13:14:39Z</published>
    <updated>2010-05-30T10:42:08Z</updated>

    <summary><![CDATA[I've been making extensive use of Git-SVN recently, because I vastly prefer the user interface of Git to that of SVN, yet am collaborating on a project which uses SVN. &nbsp;My workflow consists of keeping a set of commits on...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Computer" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="git" label="git" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="subversion" label="subversion" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[I've been making extensive use of Git-SVN recently, because I vastly prefer the user interface of Git to that of SVN, yet am collaborating on a project which uses SVN. &nbsp;My workflow consists of keeping a set of commits on top of the commits from SVN, which do things like add .gitignore files (hint: use git svn create-ignore to make these automatically), or contain code that I'm not ready to show other people just yet, or don't ever want to release.<div><br /></div><div>This isn't the most advanced use of git-svn possible, but it's quite neat, simple and difficult to make mistakes with. &nbsp;When I described the method on IRC to someone who was asking about exactly this situation, it sounded like my method was of interest. &nbsp;I promised to do a short write-up, and here it is.<br /><div><br /></div><div>My workflow consists of three simple(ish) aliases. &nbsp;The first one is the simplest, for updating to the latest SVN trunk:</div><div><br /></div><div>git stash &amp;&amp; git svn rebase &amp;&amp; git stash pop</div><div><br /></div><div>This just stashes any local changes to the working tree, then rebases the unpublished, "floating" commits on top of the latest commits from SVN.</div><div><br /></div><div>The second is used when I have one or more commits to add to the SVN repository. Having previously created a branch "for-commit" (it doesn't matter where it's based initially), I open "gitk" and make sure it's up to date. &nbsp;It probably looks something like this:</div><div><br /></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="before.png" src="http://www.bitwiz.org.uk/s/gsvn/before.png" width="490" height="311" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></span></div><div>Then I invoke the second alias, which is:</div><div><br /></div><div>git stash &amp;&amp; git checkout for-commit &amp;&amp; git reset --hard remotes/git-svn</div><div><br /></div><div>This stashes local changes, checks out the "for-commit" branch and resets it to the most recent known head of the Subversion trunk. &nbsp;Then I refresh my gitk window, which then looks like this:</div><div><br /></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="during-1.png" src="http://www.bitwiz.org.uk/s/gsvn/during-1.png" width="490" height="311" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" />Nothing too exciting has happened, but we're now on the "for-commit" branch which points in a sensible place. &nbsp;I right-click* each commit that's to be committed to Subversion, and cherry-pick them onto the "for-commit" branch:</span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><br /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="during-2.png" src="http://www.bitwiz.org.uk/s/gsvn/during-2.png" width="490" height="311" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;">So, now the "for-commit" branch has diverged from "master" because the commits have been re-written by the cherry-pick operation. &nbsp;Now comes the clever(ish) part, which is the third alias:</span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><br /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;">git svn dcommit &amp;&amp; git checkout master &amp;&amp; git svn rebase &amp;&amp; git stash pop</span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><br /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;">This commits the contents of the for-commit branch to SVN, then switches back to master and rebases it on top of the latest SVN branch, which now includes the commits just added. &nbsp;Git-SVN is clever enough to realise that some of the commits, but not all, are now in SVN. &nbsp;Gitk looks like this after a final update:</span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><br /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="after.png" src="http://www.bitwiz.org.uk/s/gsvn/after.png" width="490" height="311" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;">There are a couple of "sidings" in the history. &nbsp;The lower of the two is the old location of the "floating" commits on master. &nbsp;The upper one is the previous location of the for-commit branch. &nbsp;You could tidy them up by restarting gitk, but I find they're useful for keeping track of what I did. &nbsp;If you look closely, you'll notice that someone else added a commit to the Subversion branch between the last time I updated and the final commit, and git-svn dealt with that too.</span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><br /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;">So there you go. &nbsp;Maybe that's useful to someone.</span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><br /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;">* I don't actually "right-click", since I'm left-handed. &nbsp;I also use a trackball instead of a mouse. &nbsp;You should get one - they're awesome.</span></div></div>]]>
        
    </content>
</entry>

<entry>
    <title>Drilling for Oil</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2010/05/drilling-for-oil.html" />
    <id>tag:www.bitwiz.org.uk,2010:/s//1.75</id>

    <published>2010-05-22T12:08:19Z</published>
    <updated>2010-05-22T13:29:44Z</updated>

    <summary><![CDATA[I find it somehow disturbing that&nbsp;we are able to drill a hole&nbsp;into our planet and make it "bleed", and in such a way that it's so hard to do anything about it.In fact, come to think of it, the whole...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Everything Else" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="oil" label="oil" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[I find it somehow disturbing that&nbsp;<a href="http://www.bp.com/extendedsectiongenericarticle.do?categoryId=40&amp;contentId=7061813">we are able to drill a hole</a>&nbsp;into our planet and make it "bleed", and in such a way that it's so hard to do anything about it.<div><br /></div><div>In fact, come to think of it, the whole idea of drilling a hole that deep, under so much water, is pretty incredible. &nbsp;I've never really thought about it before.</div>]]>
        
    </content>
</entry>

<entry>
    <title>Expat Financial Scams</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2010/04/expat-financial-scams.html" />
    <id>tag:www.bitwiz.org.uk,2010:/s//1.74</id>

    <published>2010-04-04T19:32:01Z</published>
    <updated>2010-04-04T20:48:18Z</updated>

    <summary><![CDATA[A somewhat eye-opening experience last week.I had a phone call from a company offering "independent" financial advice regarding offshore savings and pensions - to "make the most" of my residence abroad. &nbsp;The company in question will not be mentioned on...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Everything Else" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="scam" label="scam" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[A somewhat eye-opening experience last week.<div><br /></div><div>I had a phone call from a company offering "independent" financial advice regarding offshore savings and pensions - to "make the most" of my residence abroad. &nbsp;The company in question will not be mentioned on here, but there is&nbsp;<a href="http://www.redtape.ru/forum/showthread.php?t=37205">plenty of information</a>&nbsp;about their&nbsp;<a href="http://www.cqdx.gov.cn/Faq/FinancialPlanning/200909/19460.html">dodgy business methods</a>&nbsp;and&nbsp;even&nbsp;<a href="http://realrussia.co.uk/forum/forums/thread-view.asp?tid=2980&amp;posts=17">their recruiting strategies</a>&nbsp;available on the web. &nbsp;To cut a long story short: &nbsp;&nbsp;It's nothing more than a&nbsp;scam: their representatives are usually not qualified financial advisors, but simply salespeople who will subject you to high-pressure sales tactics in the hope of getting their (huge, up-front) commission&nbsp;which is taken from your contributions, and can be as much as your whole first year's worth of payments.</div><div><br /></div><div><div>While the underlying products they may advertise may be basically sound, they tend to be very expensive and unsuitable for people in my kind of situation. The worst thing, however, is that they often use restrictive contract terms which lock you in to paying huge fees which negate any potential tax benefits.</div><div><br /></div><div>It seems like there's quite a lot of this kind of thing going around. &nbsp;Needless to say, I know where I'll tell any other financial "advisors" who call me to go...</div><div><br /></div><div>Most readers probably think they're far too clever to fall for such a thing, but I've now experienced first-hand how powerful the illusion is and how easy it can be to fall under the spell, and it's very scary. &nbsp;Beware.</div></div><div><br /></div><div><div>As ever, if something sounds too good to be true, it probably is..!</div></div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>OpenCL Calculation and Reduction</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2010/02/opencl-calculation-and-reduction.html" />
    <id>tag:www.bitwiz.org.uk,2010:/s//1.73</id>

    <published>2010-02-25T21:35:08Z</published>
    <updated>2010-02-25T22:13:25Z</updated>

    <summary><![CDATA[Otherwise known as "calculating a long list of numbers then adding them all up". &nbsp;For a GPGPU (OpenCL) simulation program at work, I needed to calculate around 160 numbers which would be averaged to produce one result for storage in...]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Computer" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Science" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="gpgpu" label="GPGPU" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gpu" label="GPU" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="opencl" label="OpenCL" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[Otherwise known as "calculating a long list of numbers then adding them all up". &nbsp;For a GPGPU (OpenCL) simulation program at work, I needed to calculate around 160 numbers which would be averaged to produce one result for storage in a 1024x1024 element array. &nbsp;That's 160 numbers for each of 1024x1024 pixels, which would be a lot to store as an intermediate result for a later step of averaging on the GPU, or (heaven forbid) to be copied back to system memory.<div><br /></div><div>The magic word to search for in tackling this is <i>reduction, </i>and there's plenty of hardcore compsci knowledge about how to make it go as fast as possible in a parallel environment. &nbsp;But, basically the trick is to have 160x1024x1024 threads operate in groups of 160 (one group for each of the 1024x1024 overall elements). &nbsp;Threads cooperating like this can share memory, and each thread writes its individual value to an array in that local memory. &nbsp;Then, one of the 160 threads adds up all the values and does a single write of the final average value to the global array. &nbsp;For the kernel to test if it's running the "chosen thread" is as simple as something like this:</div><div><br /></div><div><code>if ( get_local_id(0) == 0 )</code></div><div><br /></div><div>The only bit of "funny business" is that each of the 160 threads has to have finished calculating before the results can be added. &nbsp;That's done with this statement, which&nbsp;guarantees that all previous local memory writes have completed for all threads:&nbsp;</div><div><br /></div><div><code>barrier(CLK_LOCAL_MEM_FENCE);</code></div><div><br />This is a really simple example: for one thread to do all of the averaging is a waste of resources when the reduction itself could be parallelised. &nbsp;In that case, one thread would (say) add up values 0-79 while another added up 80-159, then one of those threads would (after another barrier) add up the remaining two values. &nbsp;It's easy to see how it can be broken down more and more, and there are variations which make better use of the GPU resources, avoid memory conflicts, and so on.</div><div><br /></div><div>So, if you'd ever heard of the thread groups and local memory used in OpenCL (also CUDA) and wondered what they were good for, now you know..</div><div><br /></div><div>NVidia's&nbsp;<a href="http://www.nvidia.com/content/cudazone/download/OpenCL/NVIDIA_OpenCL_ProgrammingOverview.pdf">OpenCL Programming Guide</a>&nbsp;has a lot of discussion of this topic, and there's loads more to be found around the web.</div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>OpenStreetMap&apos;s Role in Haiti</title>
    <link rel="alternate" type="text/html" href="http://www.bitwiz.org.uk/s/2010/02/openstreetmaps-role-in-haiti.html" />
    <id>tag:www.bitwiz.org.uk,2010:/s//1.72</id>

    <published>2010-02-25T20:12:49Z</published>
    <updated>2010-02-25T20:25:20Z</updated>

    <summary><![CDATA[This&nbsp;is very cool. &nbsp;Volunteer contributors used satellite imagery, which was made available especially, to create detailed maps of Haiti which the aid workers used to help find their way....]]></summary>
    <author>
        <name>Tom</name>
        
    </author>
    
        <category term="Computer" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Everything Else" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="haiti" label="Haiti" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="openstreetmap" label="OpenStreetMap" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.bitwiz.org.uk/s/">
        <![CDATA[<a href="http://news.bbc.co.uk/2/hi/uk_news/magazine/8517057.stm">This</a>&nbsp;is very cool. &nbsp;Volunteer contributors used satellite imagery, which was made available especially, to create detailed maps of Haiti which the aid workers used to help find their way.]]>
        
    </content>
</entry>

</feed>
