<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>shimweasel</title>
    <link>http://shimweasel.com:4001</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>when a bigger hammer isn't enough</description>
    <item>
      <title>... upgrade complete</title>
      <description>&lt;p&gt;well, that was surprisingly painless. now running on Ubuntu 8.04, and nothing seems to be significantly broken. Rock on. Now, for some git repos&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Wed, 20 Aug 2008 20:20:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f792061a-12db-4674-86e9-f570a9c4671a</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2008/08/20/upgrade-complete</link>
    </item>
    <item>
      <title>employment bitching</title>
      <description>&lt;p&gt;Why is it that in a world where Google can offer 2 gigabytes of email storage space for free to anyone who wants it that Optus offers its paying customers and loyal employees 20 megabytes? Beyond comprehension.&lt;/p&gt;</description>
      <pubDate>Thu, 14 Aug 2008 05:20:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:c2b81818-c5ef-4c76-95e9-0423f513df51</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2008/08/14/employment-bitching</link>
    </item>
    <item>
      <title>Swapping shift and control on Mac OS X Leopard</title>
      <description>&lt;p&gt;I&amp;#39;ve just bought myself a spanking new &lt;a href="typematrix.com" title="ergonomic keyboard"&gt;ergonomic keyboard&lt;/a&gt;, but to my horror, the control key is way down the bottom of the screen.&lt;/p&gt;&lt;p&gt;&amp;quot;This is normal!&amp;quot; you say. Yes, but I use emacs, and it&amp;#39;s far too far to reach every second keystroke. I like it where the caps lock usually is, and given that the caps lock is of no earthly use to anyone, it&amp;#39;s usually easily swapped in using Keyboard Preferences on the Mac. Too easy!&lt;/p&gt;&lt;p&gt;&amp;nbsp;Unfortunately, as you can see, the typematrix has sensibly done away with the caps lock, replacing it with a shift key the size of tasmania.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="http://www.typematrix.com/images/products/keyboard_2020_de_640.jpg" alt="my new keyboard" title="my new keyboard" width="465" height="244" /&gt;&lt;/p&gt;&lt;p&gt;Don&amp;#39;t get me wrong, gentle reader: I love that key. I salivate over it, entertaining lewd thoughts entirely inappropriate to this family (and frankly dusty) blog. However, I want it for my own filthy purposes: to wit, as a big old Control key. Shift can be demoted to the old control key, which is close-as-dammit to its normal position, and all will be well with the universe.&lt;/p&gt;&lt;p&gt;&amp;nbsp;But oh no! normal keyboard preferences will neither let you remap shift to something else, or remap anything else to shift! How can we fix this? Googling gave me &lt;a href="doublecommand.sf.net" title="doublecommand"&gt;DoubleCommand&lt;/a&gt;, which will let you change a few mappings in a distinctly non-orthogonal, non-extensible sort of way, and &lt;a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;amp;item_id=ukelele"&gt;Ukulele&lt;/a&gt;, while an admirable piece of software for changing the mapping of regular keys, has absolutely no truck with modifier key. It looks like we are sunk! But hold! a ray of light on the horizon: an &lt;a href="http://www.macosxhints.com/article.php?story=20050529121127515"&gt;article&lt;/a&gt; on mapping other keys to shift using Interface Builder. This solves half of the problem, allowing me to map the piddly little control key to shift. It doesn&amp;#39;t give me all of it, unfortunately. The approach can be extended, though: just copy one of the dropdown selectors and change the tag to &amp;#39;1&amp;#39;, just like we did for the list of tags. One last little bit: we have to control-click on the new dropdown, select &amp;#39;modifierMappingDidChange&amp;#39;, and drag it to the &amp;quot;File&amp;#39;s Owner&amp;quot; object.&amp;nbsp;&lt;/p&gt;&lt;p&gt;and there it is. &lt;/p&gt;&lt;p&gt;&lt;img src="keyboard_victory.png" alt="" /&gt;&amp;nbsp;&lt;img src="http://shimweasel.com/files/keyboard_victory.png" alt="" width="482" height="435" /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;it&amp;#39;s so beautiful I could cry. But instead, I&amp;#39;m going to bed, knowing that just an hour&amp;#39;s hacking has saved me milliseconds. Awesome. &lt;/p&gt;</description>
      <pubDate>Tue, 05 Aug 2008 09:31:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:c6251fd2-f67a-4adf-b970-f5b2a484a59e</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2008/08/05/swapping-shift-and-control-on-mac-os-x-leopard</link>
      <category>mac</category>
      <enclosure type="image/png" url="http://shimweasel.com:4001/files/keyboard_victory.png" length="80511"/>
    </item>
    <item>
      <title>simultaneously proud and chagrined</title>
      <description>&lt;p&gt;&lt;p&gt;I just defined an emacs macro for the first time.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;it&amp;#39;s really, really easy&lt;/li&gt;&lt;li&gt;it&amp;#39;s really, really useful&lt;/li&gt;&lt;li&gt;i&amp;#39;m sort of embarrassed i hadn&amp;#39;t done it before.&lt;/li&gt;&lt;/ol&gt;Still, onwards and upwards, right?&lt;/p&gt;</description>
      <pubDate>Wed, 25 Jun 2008 20:13:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d09d6717-8187-454b-84bd-a76f5f358fc7</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2008/06/25/simultaneously-proud-and-chagrined</link>
    </item>
    <item>
      <title>things i learned today</title>
      <description>&lt;p&gt;for LWP::UserAgent, giving field-value pairs to &amp;#39;post&amp;#39; sends them in the request. Giving them to &amp;#39;get&amp;#39; sets them in the header, which is less than useful. *sigh*&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;anyway, hi. I&amp;#39;ve moved again since i last posted - back to Gordon this time. Am now working for Optus on a web hacking contract, which is keeping me off the streets and adequately stressed. Oh, and google dev day yesterday. Mad fun, even if Android&amp;#39;s not quite as open (or GWT quite as un-java-y) as i&amp;#39;d like&amp;#8230; &lt;/p&gt;</description>
      <pubDate>Thu, 19 Jun 2008 01:06:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:90832051-4a31-4e93-a0f2-54a00cec5bad</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2008/06/19/things-i-learned-today</link>
    </item>
    <item>
      <title>nerdboy</title>
      <description>&lt;p&gt;ok, so that was embarrassing. 11:24 on NYE, and I&amp;#39;m still at home because I got interested in something off projecteuler.net. wonder if anyone&amp;#39;s still around&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Mon, 31 Dec 2007 06:21:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:8c928598-0329-485b-8cc2-833b86c2dc9e</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2007/12/31/nerdboy</link>
    </item>
    <item>
      <title>finally...</title>
      <description>&lt;p&gt;feels like half the posts here are lazarus with a triple bypass&amp;#8230; anyway, it&amp;#8217;s up and running on the pretty new VPS. feels good to have root on a constantly available machine.&lt;/p&gt;

&lt;p&gt;anyway, lately i&amp;#8217;ve been working on some event planning stuff, as well as some routing algorithms. more once i&amp;#8217;m sure this thing actually works - you might even get some capital letters.&lt;/p&gt;</description>
      <pubDate>Thu, 13 Dec 2007 23:53:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:f226f314-2489-4ed0-a1bb-b22ae4c8bede</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2007/12/13/finally</link>
      <enclosure type="image/jpeg" url="http://shimweasel.com:4001/files/final_bumfluff.jpg" length="48280"/>
    </item>
    <item>
      <title>i got ex-wives i like better than you</title>
      <description>&lt;p&gt;
oh, how very embarrassing. one &amp;#8220;chmod o+x dispatch.cgi&amp;#8221; later and I&amp;#8217;m back. Hello.
&lt;/p&gt;&lt;p&gt;
as far as news goes, I&amp;#8217;ve moved again, and am now living with an old uni mate in Redfern.
&lt;/p&gt;&lt;p&gt;
&lt;a href="http://www.shimweasel.com/files/Photo%206.jpg" onclick="window.open('http://www.shimweasel.com/files/Photo%206.jpg','popup','width=640,height=480,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=yes,left=0,top=0');return false"&gt;&lt;img src="http://www.shimweasel.com/files/Photo%206-tm.jpg" height="363" width="480" border="1" hspace="4" vspace="4" alt="Photo 6" /&gt;&lt;/a&gt;.
&lt;/p&gt;&lt;p&gt;
This is my room. It is a cube approximately three metres on a cube, and has a bucket in the corner to catch the leaks when it rains - the large structure above the berk grinning like an idiot is my loft bed, which is about three quarters of a metre from the roof, and behind is the impromptu bookshelf I just made from wardrobe planks and milk crates. I got undergrad ghetto chic &lt;em&gt;down.
&lt;/p&gt;&lt;p&gt;
&lt;/em&gt;Anyway, I&amp;#8217;m still working on Pink Pages stuff, as well as a few odd ideas. The Facebook app idea got scooped by some talented young bastard - check out Connection Cloud if you have a mind to.
&lt;/p&gt;</description>
      <pubDate>Fri, 05 Oct 2007 08:39:47 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1a098c7c962863647115461f1eaf9516</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2007/10/05/i-got-ex-wives-i-like-better-than-you</link>
    </item>
    <item>
      <title>fun file facts!</title>
      <description>&lt;p&gt;
so, I&amp;#8217;m doing this odd little visualisation project. Part of it is to do with &lt;a href="http://facebook.com"&gt;Facebook&lt;/a&gt;, which means that if it gets popular at all, my poor little server is going to get pounded harder than a goat at a furry convention. Therefore, I have some interesting constraints on resource usage.
&lt;/p&gt;&lt;p&gt;
&lt;a href="http://www.shimweasel.com/files/friends.png" onclick="window.open('http://www.shimweasel.com/files/friends.png','popup','width=965,height=665,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=yes,left=0,top=0');return false"&gt;&lt;img src="http://www.shimweasel.com/files/friends-tm.jpg" height="438" width="635" border="1" hspace="4" vspace="4" alt="Friends" /&gt;&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;
I&amp;#8217;m using the graph drawing library &lt;a href="http://graphviz.org"&gt;GraphViz&lt;/a&gt;, which is in C. I&amp;#8217;m writing my app in &lt;a href="http://haskell.org"&gt;Haskell&lt;/a&gt; using &lt;a href="http://happs.org"&gt;HAppS&lt;/a&gt;, and the Haskell interface to C is all fine and dandy: the difficulty comes because GraphViz wants to output its graph to a file, rather than making it available as a string in memory. This makes things difficult: I really don&amp;#8217;t want even the possibility of hitting the disk.
&lt;/p&gt;&lt;p&gt;
To make this more concrete, I wrote a little C testing script to see how fast this is on my laptop. I took three approaches:
&lt;br /&gt;100 times, either: 
&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;Copy the strings back and forth in memory - this should simulate what would be happening if &lt;a href="http://graphviz.org"&gt;GraphViz&lt;/a&gt; generated the graph in memory rather than insisted on copying it to a file.&lt;/li&gt;
&lt;li&gt;Create a ramdisk, and write the strings out to it&lt;/li&gt;
&lt;li&gt;Write the strings to disk, then read them in again: the hope here is that the built-in IO caching will save me&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;
The results for each approach respectively: 
&lt;/p&gt;&lt;pre&gt;
10:47 ~/projects/current % time ./a.out -m
./a.out -m  1.68s user 0.09s system 71% cpu 2.480 total
10:47 ~/projects/current % time ./a.out -r            
./a.out -r  0.43s user 2.56s system 48% cpu 6.233 total
10:47 ~/projects/current % time ./a.out -f
./a.out -f  0.49s user 4.09s system 28% cpu 16.107 total
&lt;/pre&gt;&lt;p&gt;
So it looks like the inbuilt caching method is not so great. The &lt;a href="http://osxdaily.com/2007/03/23/create-a-ram-disk-in-mac-os-x/"&gt;ramdisk&lt;/a&gt; is faster, but still not as good as using the strings in memory - presumably system call overhead is hurting me. A third option I haven&amp;#8217;t yet investigated would be for the Haskell process to open a named pipe and have C write to it, but I think that would require at least two processes: at the moment, I just have the one HAppS process and would like to keep it that way if possible. (My current host has a limit of 20 processes, which is a bit anemic.) In any case, it&amp;#8217;d be at least as bad as the ramdisk approach, although possibly a bit more doable on a shared host.
&lt;/p&gt;&lt;p&gt;
In other news, I saw the &lt;a href="http://myspace.com/themaladiesband"&gt;Maladies&lt;/a&gt; play last night at the &lt;a href="%20%20http://www.myspace.com/hopetounhotel%20%20"&gt;Hoey&lt;/a&gt;. They did an absolutely blistering set: I&amp;#8217;ve never seen them quite that sharp. Roll on the album&amp;#8230;
&lt;/p&gt;</description>
      <pubDate>Mon, 09 Jul 2007 01:09:36 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:8e90e53edd813cfd684fec02376a3010</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2007/07/09/fun-file-facts</link>
    </item>
    <item>
      <title>This thing is still here?</title>
      <description>&lt;p&gt;So, hi. I haven&amp;#8217;t blogged in forever and a day and am slightly embarrassed about it, but as Pete puts it, my shrug is entirely up to the task. &lt;em&gt;shrug&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Since I last wrote, I&amp;#8217;ve been to Thailand with Hallie, drunk beer with ladyboys, floated down a river on an inner tube in Laos, beer clasped firmly in hand, and endured the Vietnamese overnight bus line. (Special props to the Vietnamese motos for their ascending trio of &amp;#8220;Moto? Girl? Weed?&amp;#8221;)&lt;/p&gt;

&lt;p&gt;I have some photos somewhere, and will probably be putting them up. Somewhere. I&amp;#8217;ve been agonising about writing a post about the whole experience, but it&amp;#8217;s either too big or too small: it had a massive effect on me, but what on earth can I write that isn&amp;#8217;t indistinguishable from a million other banal travelogs? Feh.&lt;/p&gt;

&lt;p&gt;With Sisyphus&amp;#8217; stone neatly abandoned at the bottom of the hill, we can move on to other matters. I&amp;#8217;ve just got a beautiful room in a house in Erskineville. No longer must I crouch in stygian darkness under the bed in order to type: my desk has a full metre and a half of headroom, and even some natural light. My flatmates seem extraordinarily pleasant - the other Mark living here even helped me put up my ridiculous loft bed.&lt;/p&gt;

&lt;p&gt;As far as work goes, I&amp;#8217;m working on my standard webapp contract stuff and looking to do some hacking on the new Facebook API. Let me know if you have a brilliant idea that you feel like sharing&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Sun, 27 May 2007 15:00:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:7b4493b7d08e368b7301e2a670c364f8</guid>
      <author>Mark</author>
      <link>http://shimweasel.com:4001/articles/2007/05/27/this-thing-is-still-here</link>
      <trackback:ping>http://shimweasel.com:4001/articles/trackback/83</trackback:ping>
    </item>
  </channel>
</rss>
