<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    
    <link href="http://marcus.bointon.com/feeds/atom10.xml" rel="self" title="Pet Pixels" type="application/atom+xml" />
    <link href="http://marcus.bointon.com/"                        rel="alternate"    title="Pet Pixels" type="text/html" />
    <link href="http://marcus.bointon.com/rss.php?version=2.0"     rel="alternate"    title="Pet Pixels" type="application/rss+xml" />
    <title type="html">Pet Pixels</title>
    <subtitle type="html">Skiing, Baking, Biking, PHP, Email, Music, in variable order</subtitle>
    <icon>http://marcus.bointon.com/templates/default/img/s9y_banner_small.png</icon>
    <id>http://marcus.bointon.com/</id>
    <updated>2011-11-22T13:00:30Z</updated>
    <generator uri="http://www.s9y.org/" version="1.5.5">Serendipity 1.5.5 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:marcusblog@bointon.com" />

    <entry>
        <link href="http://marcus.bointon.com/archives/95-Skype-5-strikes-again.html" rel="alternate" title="Skype 5 strikes again" />
        <author>
            <name>Marcus Bointon</name>
            <email>marcus@bointon.com</email>        </author>
    
        <published>2011-11-22T12:28:52Z</published>
        <updated>2011-11-22T13:00:30Z</updated>
        <wfw:comment>http://marcus.bointon.com/wfwcomment.php?cid=95</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://marcus.bointon.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=95</wfw:commentRss>
    
            <category scheme="http://marcus.bointon.com/categories/4-Techie" label="Techie" term="Techie" />
    
        <id>http://marcus.bointon.com/archives/95-guid.html</id>
        <title type="html">Skype 5 strikes again</title>
        <content type="xhtml" xml:base="http://marcus.bointon.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>It's been thoroughly documented that Mac Skype 5 is an utter piece of junk, but it just keeps getting 'better'!</p>
<p>Today it informed me that there had been a minor update to the current beta release (5.4).</p>
<p><!-- s9ymdb:36 --><img class="serendipity_image_center" width="514" height="170"  src="http://marcus.bointon.com/uploads/Skype5a.png"  alt="Skype update notification" /></p>
<p>Being wary of what Skype considers an 'upgrade', I clicked the 'what's new' button that it offered to see the changes. This took me to a page all about Skype 5.3, with no hint or link of any release notes. A bit of googling for the new version number led me to <a href="http://blogs.skype.com/garage/2011/11/skype_54_for_mac_beta_2_-_make.html">some release notes</a>. I thought this sounded fair enough, so clicked 'update'. It downloaded the new version like this:</p>
<p><!-- s9ymdb:42 --><img class="serendipity_image_center" width="514" height="199"  src="http://marcus.bointon.com/uploads/Skype5c.png"  alt="Skype downloading" /></p>
<p>but then presented me with this:</p>
<p><!-- s9ymdb:37 --><img class="serendipity_image_center" width="514" height="197"  src="http://marcus.bointon.com/uploads/Skype5b.png"  alt="Skype install fail" /></p>
<p>That's a very strange error. It's telling me that it accidentally downloaded the wrong version, and didn't check that it was the right one, it just assumed it was. Doesn't bode well for security. On top of that the reason it can't install is because it's not fat enough?? Are they trying to suggest that code bloat is mandatory? Clicking 'Manual update' took me to the Skype 5.3 page again. Sigh.</p>
<p>To their credit, this IS a beta version, but given that only bug fix mentioned for the last 2 months work on this release is "Skypenames ending with period do not work properly", I'm not holding my breath for a stable release.</p>
<p>Skype used to be a beautiful (well...), elegant, Mac-like app. It's now a pig in a dress. With lipstick.</p>
 
            </div>
        </content>
        <dc:subject>fail</dc:subject>
<dc:subject>mac</dc:subject>
<dc:subject>skype</dc:subject>

    </entry>
    <entry>
        <link href="http://marcus.bointon.com/archives/93-NASA-Space-Sounds-for-EXS-24.html" rel="alternate" title="NASA Space Sounds for EXS-24" />
        <author>
            <name>Marcus Bointon</name>
            <email>marcus@bointon.com</email>        </author>
    
        <published>2011-11-02T22:26:00Z</published>
        <updated>2011-11-02T22:38:31Z</updated>
        <wfw:comment>http://marcus.bointon.com/wfwcomment.php?cid=93</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://marcus.bointon.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=93</wfw:commentRss>
    
            <category scheme="http://marcus.bointon.com/categories/5-Music" label="Music" term="Music" />
    
        <id>http://marcus.bointon.com/archives/93-guid.html</id>
        <title type="html">NASA Space Sounds for EXS-24</title>
        <content type="xhtml" xml:base="http://marcus.bointon.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I saw that <a href="http://www.nasa.gov/connect/sounds/">NASA released a load of audio clips</a> from various historic space missions - from Sputnik to the final flight of Atlantis, via the moon! Space sounds have long been used musical contexts - SpaceOddity, Telstar, Pulsar, <a href="http://itunes.apple.com/gb/album/space-walk-radio-edit/id7059128?i=7059122">Lemon Jelly's "Space Walk"</a> to name but a few. I felt I had to make these more musically useful that the 'ringtone' MP3s available on NASA's site, so I wrapped them up as a library for the EXS-24 sampler (appears in Apple's Logic and Logic Express DAWs). The sounds will work straight away in Logic, but the sounds are accessible in the archive as AIFF files so you can easily convert them to other formats. I split up the sounds into the same historical categories as on the NASA site so you're not loading up all the samples at once. Keyboard mapping isn't anything particular (white notes starting at C1), but I did clean up the samples a little and edited down some shorter clips of the more familiar or musical sounds ("Houston, we have a problem", "The Eagle has landed", "That's one small step" etc).</p>
<p>The original sounds are mostly mono with low bandwidth, resolution and sample rate, but many are supplied as stereo 44.1KHz 16-bit files, so I've converted them all to that as EXS-24 doesn't seem to like mixing sample rates in one instrument.</p>
<p>So, go ahead and <a href="http://marcus.bointon.com/downloads/NASA-Sounds-EXS24.zip">download the NASA sample library</a>! (70Mb zip)</p>
<p>Obviously I have no rights to these samples; NASA is encouraging people to download and use them at will, and I assume it's being published under <a href="http://ti.arc.nasa.gov/opensource/nosa/">their open-source license</a>.</p>
<p>I wrote this entry a while ago but forgot to post it, duh.</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://marcus.bointon.com/archives/92-PHP-Base-62-encoding.html" rel="alternate" title="PHP Base-62 encoding" />
        <author>
            <name>Marcus Bointon</name>
            <email>marcus@bointon.com</email>        </author>
    
        <published>2011-08-10T15:31:20Z</published>
        <updated>2011-11-02T22:36:13Z</updated>
        <wfw:comment>http://marcus.bointon.com/wfwcomment.php?cid=92</wfw:comment>
    
        <slash:comments>10</slash:comments>
        <wfw:commentRss>http://marcus.bointon.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=92</wfw:commentRss>
    
            <category scheme="http://marcus.bointon.com/categories/1-PHP" label="PHP" term="PHP" />
            <category scheme="http://marcus.bointon.com/categories/4-Techie" label="Techie" term="Techie" />
    
        <id>http://marcus.bointon.com/archives/92-guid.html</id>
        <title type="html">PHP Base-62 encoding</title>
        <content type="xhtml" xml:base="http://marcus.bointon.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>There's a really horrible bug (they won't call it that, but I can't think of any use case for the default broken behaviour!) in Apache's mod_rewrite that means that urlencoded inputs in rewrites get unescaped in their transformation to output patterns. The underlying 'bug' remains unfixed even in 2.3, though a workaround in the form of the <a href="http://httpd.apache.org/docs/current/rewrite/flags.html#flag_b">'B' flag</a> first appeared in Apache 2.2.7, but was broken until 2.2.12 (which wasn't all that long ago). Put it like this: if you're not using the B flag in your mod_rewrite rules, your site is probably only working due to blind luck.</p>
<p>With that in mind, several years ago I spent ages looking for a base-62 encoder/decoder for PHP to replace mod_rewrite's broken urlencoding handling. Nobody seemed to have the slightest interest in writing one. Base-62 is interesting as it can be made safe for use in URLs, DNS, email addresses and pathnames, unlike any available encoding of base-64, as it only includes [0-9A-Za-z]. As a workaround for the above bug, I was interested in base-62 encoding URLs for embedding in redirects. At the time <a href="http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_21980473.html">I wrote something using bc_math</a>, but it was very slow (and weirdly got <a href="http://www.wtfnix.com/2008/05/base-62-encoding-php/" rel="nofollow">ripped off</a> by some dickhead and passed off as his own, despite that fact that I said it was crap!). I eventually gave up on that and switched to base-64, which led to occasional URL corruption. If you include hashes in URLs, keeping them in the default hex representation is quite wasteful, and can contribute to issues with line length in email. Having hashes in base-62 is a nice way of reducing their size.</p>
<p>There are a few posts on base-62 in PHP, notably <a href="http://programanddesign.com/php/base62-encode/">this one</a> and <a href="http://snipplr.com/view/22246/">this one</a>, but they make the assumption that you're talking about a numeric value, and while a hash is a numeric value, it's way too big for PHP to handle as an integer. Others take the multiprecision artithmetic route, which treats the input binary as a single very large, and calculates its representation in another base; that works, but it's horribly slow.</p>
<p>Since then, the gmp and bc_math extensions were improved in PHP 5.3.2, and now they handle (usefully) up to base-62. So here's a simple function for getting a hash in base-62:</p>
<div class="php geshi" style="text-align: left"><span style="color: #000000; font-weight: bold;">function</span> base62hash<span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />&#160; &#160; &#160; &#160; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/gmp_strval"><span style="color: #990000;">gmp_strval</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/gmp_init"><span style="color: #990000;">gmp_init</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/md5"><span style="color: #990000;">md5</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 16<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 62<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /><span style="color: #009900;">&#125;</span></div>
<p>and for converting to and from base-16 hashes:</p>
<div class="php geshi" style="text-align: left"><span style="color: #000000; font-weight: bold;">function</span> hash16to62<span style="color: #009900;">&#40;</span><span style="color: #000088;">$hash</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />&#160; &#160; &#160; &#160; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/gmp_strval"><span style="color: #990000;">gmp_strval</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/gmp_init"><span style="color: #990000;">gmp_init</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hash</span><span style="color: #339933;">,</span> 16<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 62<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /><span style="color: #009900;">&#125;</span><br /><br /><span style="color: #000000; font-weight: bold;">function</span> hash62to16<span style="color: #009900;">&#40;</span><span style="color: #000088;">$hash</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />&#160; &#160; &#160; &#160; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/gmp_strval"><span style="color: #990000;">gmp_strval</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/gmp_init"><span style="color: #990000;">gmp_init</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hash</span><span style="color: #339933;">,</span> 62<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 16<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br /><span style="color: #009900;">&#125;</span></div>
<p>I could still use a proper base-62 encoder for longer arbitrary strings, but at least now it should be simpler to write something iterative now that these extensions have (ahem) their bases covered.</p>
<p><strong>Update</strong>: I've written a sufficiently usable PHP base-62 encoder for arbitrary-length binary strings that's not too slow. You can find it on github in <a href="https://gist.github.com/1139429">this gist</a>. Let me know if you find it useful</p>
<p>Incidentally I discovered that the gmp functions use [0-9a-f] up to base 16, but [0-9A-Za-z] (i.e. upper case first) from bases 17 to 62. This differs from most of the base-62 implementations I've found that tend to use lower case first.</p>
<p>This is all slightly academic now as the apache B-flag workaround works, so standard urlencoding works properly and I don't need to use a different encoding any more, however, there were so many examples of slow encoders, I thought the world could do with a usable one.</p>
<p><strong>Update</strong> Something else worth mentioning is that if you use the apache B flag, you most likely need to turn the <a href="http://httpd.apache.org/docs/current/mod/core.html#allowencodedslashes">AllowEncodedSlashes</a> directive on too, as otherwise you'll get mysterious 404s. I posted <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=51669">a bug report</a> against the apache docs to make this clearer.</p>
<p><strong>Update</strong> Apache used <a href="http://httpd.apache.org/docs/trunk/rewrite/flags.html#flag_b">my rewrite of the B-flag docs</a>, yay!</p> 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://marcus.bointon.com/archives/94-Subversion-1.7-to-1.6-downgrade-with-MacPorts.html" rel="alternate" title="Subversion 1.7 to 1.6 downgrade with MacPorts" />
        <author>
            <name>Marcus Bointon</name>
            <email>marcus@bointon.com</email>        </author>
    
        <published>2011-11-02T21:50:38Z</published>
        <updated>2011-11-02T22:12:08Z</updated>
        <wfw:comment>http://marcus.bointon.com/wfwcomment.php?cid=94</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://marcus.bointon.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=94</wfw:commentRss>
    
            <category scheme="http://marcus.bointon.com/categories/1-PHP" label="PHP" term="PHP" />
            <category scheme="http://marcus.bointon.com/categories/4-Techie" label="Techie" term="Techie" />
    
        <id>http://marcus.bointon.com/archives/94-guid.html</id>
        <title type="html">Subversion 1.7 to 1.6 downgrade with MacPorts</title>
        <content type="xhtml" xml:base="http://marcus.bointon.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                MacPorts told me that there had been a subversion update (1.7.1), which I went ahead and installed. Woo! Huge speed improvements for everything I tried with the CLI client, great stuff. A short time later my IDE (PHPStorm) fell over screaming. <a href="http://youtrack.jetbrains.net/issue/IDEA-72400">It doesn't like 1.7 yet</a>, and it's a bit stuck until SVNKit supports it. I should have checked really.

So how to downgrade? Fortunately <a href="http://reinout.vanrees.org/weblog/2008/09/19/macports-downgrading-subversion.html">this post</a> makes it very easy. So I just did:
<p>
<tt>sudo port deactivate subversion @1.7.0_1</tt><br />
<tt>sudo port activate subversion @1.6.17_1</tt></p>
But now I'm stuck with a working copy in 1.7 format with uncommitted changes, and there is no tool to convert it back to 1.6 format. This is easily worked around; check out a new working copy (using svn 1.6) and sync across the changes, ignoring the .svn folders, like this:

<p><tt>
rsync -av --update --exclude=".svn/***" ~/Sites/myproject1.7/ ~/Sites/myproject1.6
</tt></p>
All happy now. 
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="http://marcus.bointon.com/archives/88-Google-Charts-API-Simple-and-Extended-Encoders-in-PHP.html" rel="alternate" title="Google Charts API Simple and Extended Encoders in PHP" />
        <author>
            <name>Marcus Bointon</name>
            <email>marcus@bointon.com</email>        </author>
    
        <published>2009-08-14T08:34:27Z</published>
        <updated>2011-09-26T23:53:46Z</updated>
        <wfw:comment>http://marcus.bointon.com/wfwcomment.php?cid=88</wfw:comment>
    
        <slash:comments>5</slash:comments>
        <wfw:commentRss>http://marcus.bointon.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=88</wfw:commentRss>
    
            <category scheme="http://marcus.bointon.com/categories/1-PHP" label="PHP" term="PHP" />
            <category scheme="http://marcus.bointon.com/categories/4-Techie" label="Techie" term="Techie" />
    
        <id>http://marcus.bointon.com/archives/88-guid.html</id>
        <title type="html">Google Charts API Simple and Extended Encoders in PHP</title>
        <content type="xhtml" xml:base="http://marcus.bointon.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                Google's charting API has been around for quite a while now, but I've only just needed to actually look at it. It became immediately obvious that I needed a PHP encoding function, so off to google I went. Though I found several implementations, they were all incomplete or deficient in one way or another (and it didn't help that there was an error in google's extended encoding docs), so I've written my own based on several different ones. Both simple and extended encoders support automatic scaling, inflated maximum and lower-bound truncation, so you can pretty much stuff whatever data you like in, with no particular regard for pre-scaling and you'll get a usable result out. They have an identical interface, so you can use either encoding interchangeably according to the output resolution you need (contrary to popular belief, the encoding to use has very little to do with the range of values you need to graph). By default, the full range of possible values is used as it just seems silly not to. I deliberately omit the 's:' and 'e:' prefixes so that you can call these functions for multiple data series, and I include a function that does just that. You still need to generate your own URLs and other formatting, but that's a different problem. Read on for the code... <br /><a href="http://marcus.bointon.com/archives/88-Google-Charts-API-Simple-and-Extended-Encoders-in-PHP.html#extended">Continue reading "Google Charts API Simple and Extended Encoders in PHP"</a>
            </div>
        </content>
        <dc:subject>api</dc:subject>
<dc:subject>charts</dc:subject>
<dc:subject>encoding</dc:subject>
<dc:subject>google</dc:subject>
<dc:subject>php</dc:subject>

    </entry>
    <entry>
        <link href="http://marcus.bointon.com/archives/91-Updating-PERC-6i-RAID-BIOS-on-Ubuntu.html" rel="alternate" title="Updating PERC 6/i RAID BIOS on Ubuntu" />
        <author>
            <name>Marcus Bointon</name>
            <email>marcus@bointon.com</email>        </author>
    
        <published>2011-06-14T13:51:34Z</published>
        <updated>2011-06-14T15:28:42Z</updated>
        <wfw:comment>http://marcus.bointon.com/wfwcomment.php?cid=91</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://marcus.bointon.com/rss.php?version=atom1.0&amp;type=comments&amp;cid=91</wfw:commentRss>
    
            <category scheme="http://marcus.bointon.com/categories/4-Techie" label="Techie" term="Techie" />
    
        <id>http://marcus.bointon.com/archives/91-guid.html</id>
        <title type="html">Updating PERC 6/i RAID BIOS on Ubuntu</title>
        <content type="xhtml" xml:base="http://marcus.bointon.com/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                </p>Dell's meagre Ubuntu support doesn't make firmware updates easy. Their monstrous OMSA doesn't do it, and their RedHat packages are pretty hideous even on RedHat! Here's a solution running on Ubuntu Lucid 10.04.</p> <br /><a href="http://marcus.bointon.com/archives/91-Updating-PERC-6i-RAID-BIOS-on-Ubuntu.html#extended">Continue reading "Updating PERC 6/i RAID BIOS on Ubuntu"</a>
            </div>
        </content>
        
    </entry>

</feed>
