<?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>Blog &#187; Hack</title>
	<atom:link href="http://blog.marcuscobden.co.uk/tag/hack/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.marcuscobden.co.uk</link>
	<description>Reflections of a compulsive engineer</description>
	<lastBuildDate>Wed, 01 Sep 2010 10:05:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Automating iSync and Bluetooth</title>
		<link>http://blog.marcuscobden.co.uk/2009/09/automating-isync-and-bluetooth/</link>
		<comments>http://blog.marcuscobden.co.uk/2009/09/automating-isync-and-bluetooth/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 18:17:00 +0000</pubDate>
		<dc:creator>Marcus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Applescript]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[iSync]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://newblog.marcuscobden.co.uk/?p=14</guid>
		<description><![CDATA[With some pointers from friends I've beaten applescript into submission and coded up a script to automate the bluetooth iSync syncing with my phone.]]></description>
			<content:encoded><![CDATA[<p>With some pointers from friends I&#8217;ve beaten applescript into submission and coded up a script to automate the bluetooth iSync syncing with my phone.<br/><br />
The script opens up System Preferences and enables Bluetooth, then launches iSync and instructs it to sync. It will then leave Bluetooth in the state that it found it in.<br/><br />
The code is below for anyone who might find it handy :) Oh and for the record this is written to run on Mac OS X Leopard.
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
</pre></td><td class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Sync?&quot;</span> <span style="color: #0066ff;">buttons</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Ok&quot;</span>, <span style="color: #009900;">&quot;Cancel&quot;</span><span style="color: #000000;">&#125;</span> default button <span style="color: #000000;">2</span>
<span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #ff0033;">the</span> button returned <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #ff0033;">the</span> <span style="color: #0066ff;">result</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #009900;">&quot;Cancel&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
    stop
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Preferences&quot;</span>
    <span style="color: #0066ff;">activate</span>
    <span style="color: #ff0033; font-weight: bold;">set</span> current pane <span style="color: #ff0033; font-weight: bold;">to</span> pane <span style="color: #009900;">&quot;com.apple.preferences.Bluetooth&quot;</span>
&nbsp;
        <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">window</span> <span style="color: #009900;">&quot;Bluetooth&quot;</span> <span style="color: #ff0033; font-weight: bold;">of</span> process <span style="color: #009900;">&quot;System Preferences&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">set</span> was_on <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033;">the</span> value <span style="color: #ff0033; font-weight: bold;">of</span> checkbox <span style="color: #009900;">&quot;On&quot;</span>
&nbsp;
            <span style="color: #ff0033; font-weight: bold;">if</span> value <span style="color: #ff0033; font-weight: bold;">of</span> checkbox <span style="color: #009900;">&quot;On&quot;</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">0</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">tell</span> checkbox <span style="color: #009900;">&quot;On&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> click
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iSync&quot;</span>
        synchronize
&nbsp;
        <span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">while</span> <span style="color: #000000;">&#40;</span>syncing <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #0066ff;">true</span><span style="color: #000000;">&#41;</span>
            delay <span style="color: #000000;">5</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> syncStatus <span style="color: #ff0033; font-weight: bold;">to</span> sync status
&nbsp;
        <span style="color: #ff0033; font-weight: bold;">if</span> syncStatus <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">not</span> <span style="color: #000000;">2</span> <span style="color: #ff0033; font-weight: bold;">then</span>
            <span style="color: #ff0033; font-weight: bold;">if</span> syncStatus <span style="color: #000000;">=</span> <span style="color: #000000;">3</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> syncStatus <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;completed with warnings&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> syncStatus <span style="color: #000000;">=</span> <span style="color: #000000;">4</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> syncStatus <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;completed with errors&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> syncStatus <span style="color: #000000;">=</span> <span style="color: #000000;">5</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> syncStatus <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;last sync cancelled&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> syncStatus <span style="color: #000000;">=</span> <span style="color: #000000;">6</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> syncStatus <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;last sync failed to complete&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> syncStatus <span style="color: #000000;">=</span> <span style="color: #000000;">7</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">set</span> syncStatus <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;never synced&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;syncStatus: &quot;</span> <span style="color: #000000;">&amp;</span>amp; syncStatus
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
    <span style="color: #0066ff;">quit</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">if</span> was_on <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">0</span> <span style="color: #ff0033; font-weight: bold;">then</span>
    <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Preferences&quot;</span>
        <span style="color: #ff0033; font-weight: bold;">set</span> current pane <span style="color: #ff0033; font-weight: bold;">to</span> pane <span style="color: #009900;">&quot;com.apple.preferences.Bluetooth&quot;</span>
&nbsp;
        <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">window</span> <span style="color: #009900;">&quot;Bluetooth&quot;</span> <span style="color: #ff0033; font-weight: bold;">of</span> process <span style="color: #009900;">&quot;System Preferences&quot;</span>
            <span style="color: #ff0033; font-weight: bold;">if</span> value <span style="color: #ff0033; font-weight: bold;">of</span> checkbox <span style="color: #009900;">&quot;On&quot;</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">then</span>
                <span style="color: #ff0033; font-weight: bold;">tell</span> checkbox <span style="color: #009900;">&quot;On&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> click
            <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
        <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
        <span style="color: #0066ff;">quit</span>
    <span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.marcuscobden.co.uk/2009/09/automating-isync-and-bluetooth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dual Booting Windows Vista and XP</title>
		<link>http://blog.marcuscobden.co.uk/2009/08/dual-booting-windows-vista-and-xp/</link>
		<comments>http://blog.marcuscobden.co.uk/2009/08/dual-booting-windows-vista-and-xp/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 20:10:00 +0000</pubDate>
		<dc:creator>Marcus</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Drive letters]]></category>
		<category><![CDATA[Dual boot]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Install]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Windows Vista]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://newblog.marcuscobden.co.uk/?p=13</guid>
		<description><![CDATA[You can use grub to hide an NTFS partition from the Windows XP installer, coaxing it to install on "C:" rather than something like "H:".]]></description>
			<content:encoded><![CDATA[<p>At work I have 3 Operating systems installed on my PC; Ubuntu Linux, Vista and XP. Originally I only had Ubuntu and Vista, and a big empty portion of the disk intended for XP if I needed it.</p>
<p>Due to these existing partitions, and a USB media card reader, the Windows XP installer would decide label it&#8217;s system partition &#8220;H:&#8221;, instead of the usual &#8220;C:&#8221;. I&#8217;m not sure how much this would have broken, but it annoyed me to the point that I found a hack to fix it.</p>
<p>I found that grub (the linux boot-loader) on my Linux partition allows you to <a href="http://www.gnu.org/software/grub/manual/html_node/DOS-Windows.html">edit the partition table and set the Vista NTFS partition to &#8216;hidden&#8217;</a>. The XP installer could still see there was a partition there, but it didn&#8217;t understand it, and thus labelled it&#8217;s new partition &#8220;C:&#8221;. XP will of course then proceed to clobber your existing bootloader, but that&#8217;s a common occurrence, and fixable from a LiveCD, google is your friend here.</p>
<p>You should also be able to use a copy of grub on a LiveCD to mark the partition as (un)hidden if you don&#8217;t have Linux on your system normally.</p>
<p>Apologies for any vagueness and lack of technical details, this post has been on the back burner for a few months now, and I&#8217;ve actually forgotten most of the details.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcuscobden.co.uk/2009/08/dual-booting-windows-vista-and-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unrestrict BBC Radio iPlayer</title>
		<link>http://blog.marcuscobden.co.uk/2008/04/urestrict-bbc-radio-iplayer/</link>
		<comments>http://blog.marcuscobden.co.uk/2008/04/urestrict-bbc-radio-iplayer/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 12:35:00 +0000</pubDate>
		<dc:creator>Marcus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[BBC]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Radio]]></category>

		<guid isPermaLink="false">http://newblog.marcuscobden.co.uk/?p=9</guid>
		<description><![CDATA[As long as I can remember, the BBC&#8217;s online music streaming service has restricted the control you have on playback streams, restricting the embedded realplayer controls to allow you pause, skip 5 minutes or skip 15 and change the volume. I can understand the legal obligations they may have, but from a piracy perspective stopping [...]]]></description>
			<content:encoded><![CDATA[<p>As long as I can remember, the <a href="http://www.bbc.co.uk/radio/aod/" title="BBC iPlayer">BBC&#8217;s online music</a> streaming service has restricted the control you have on playback streams, restricting the embedded realplayer controls to allow you pause, skip 5 minutes or skip 15 and change the volume. I can understand the legal obligations they may have, but from a piracy perspective stopping people skipping tracks is irrelevant, its only use is as a measure to stop people re-listening to the same track without having to go back to the start each time.</p>
<p>The controls on Mac OS X are less restrictive, but still restrict you to pause, fast forward or stop, however some simple javascript manipulation of the page can enable the regular <a href="http://service.real.com/help/library/guides/production8/media/embed/plugin.htm" title="RealPlayer Controls">RealPlayer controls</a>, complete with a seek-bar.</p>
<p>Bookmark either download the <a href="http://www.marcuscobden.co.uk/stuff/2008-03/R1.js" title="source code">source file</a> or view the <a href="http://www.marcuscobden.co.uk/stuff/2008-03/R1-bookmarklet.js" title="bookmarklet">bookmarklet source</a>. Unfortunately blogger won&#8217;t let me create an actual <a href="http://en.wikipedia.org/wiki/Bookmarklet" title="Wikipedia: Bookmarklet">bookmarklet</a> link, so you will manually have to save the bookmarklet into a bookmark in your browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcuscobden.co.uk/2008/04/urestrict-bbc-radio-iplayer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Maps Placemark</title>
		<link>http://blog.marcuscobden.co.uk/2008/03/google-maps-placemark/</link>
		<comments>http://blog.marcuscobden.co.uk/2008/03/google-maps-placemark/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 10:00:00 +0000</pubDate>
		<dc:creator>Marcus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://newblog.marcuscobden.co.uk/?p=8</guid>
		<description><![CDATA[This post has been sitting for quite a while now, pending me having time to sit down and write some text to go alongside the code. It would appear that I now have the time to write it up. Back when I was writing my Google Maps property finder I was using Google&#8217;s Geocoding API [...]]]></description>
			<content:encoded><![CDATA[<p>This post has been sitting for quite a while now, pending me having time to sit down and write some text to go alongside the code.<br />
It would appear that I now have the time to write it up.
</p>
<p>
<a href="http://blog.marcuscobden.co.uk/2007/12/spring-mvc-wizards-form-taglib.html" title="Spring MVC Wizards &amp; Form Taglib">Back when</a><br />
I was writing my Google Maps property finder I was using Google&#8217;s Geocoding API to get a set of co-ordinates based on a search string.
</p>
<p>
Specifically I was using the <code>getLocations</code> method of the <a href="http://code.google.com/apis/maps/documentation/reference.html#GClientGeocoder" title="Google Maps API - GClientGeocoder"><code>GClientGeocoder</code> object</a>.<br />
This would return a number of <code>Placemark</code> objects with a bunch of information about the potential matches.<br />
They don&#8217;t really document this object, but to be honest they don&#8217;t really need to, below is an example Placemark expressed in JSON-ish notation.
</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span>   <span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;p1&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;address&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;AddressDetails&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #3366CC;">&quot;Country&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #3366CC;">&quot;CountryNameCode&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;US&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #3366CC;">&quot;AdministrativeArea&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #3366CC;">&quot;AdministrativeAreaName&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;CA&quot;</span><span style="color: #339933;">,</span>
                <span style="color: #3366CC;">&quot;SubAdministrativeArea&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #3366CC;">&quot;SubAdministrativeAreaName&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Santa Clara&quot;</span><span style="color: #339933;">,</span>
                    <span style="color: #3366CC;">&quot;Locality&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #3366CC;">&quot;LocalityName&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Mountain View&quot;</span><span style="color: #339933;">,</span>
                        <span style="color: #3366CC;">&quot;Thoroughfare&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
                            <span style="color: #3366CC;">&quot;ThoroughfareName&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1600 Amphitheatre Pkwy&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
                            <span style="color: #3366CC;">&quot;PostalCode&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
                                <span style="color: #3366CC;">&quot;PostalCodeNumber&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;94043&quot;</span>
                            <span style="color: #009900;">&#125;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #3366CC;">&quot;Accuracy&quot;</span><span style="color: #339933;">:</span> <span style="color: #CC0000;">8</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;Point&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #3366CC;">&quot;coordinates&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">122.081783</span><span style="color: #339933;">,</span><span style="color: #CC0000;">37.423111</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The only thing is, if you want to get a specific element, the tree will not necessarily be the same each time, so traversal is a pain.<br />
The <a href="http://marcuscobden.co.uk/stuff/2008-03/Placemark.js" title="">code below</a> will condense all this into the root level of an object, so you can pick out the key/value pairs you want, and easily tell if some aren&#8217;t there.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> Placemark <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    initialize<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>placemark<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">traverse</span><span style="color: #009900;">&#40;</span>placemark<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    traverse<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">,</span> key<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> key <span style="color: #000066; font-weight: bold;">in</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>key <span style="color: #339933;">==</span> <span style="color: #3366CC;">'prototype'</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'object'</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">else</span>
                <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">traverse</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>One thing to note is that this was written for to use the <a href="http://mootools.net/" title="mootools">Mootools</a> class system, though it shouldn&#8217;t be very hard to remove this dependancy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcuscobden.co.uk/2008/03/google-maps-placemark/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making the most of Pandora.com</title>
		<link>http://blog.marcuscobden.co.uk/2008/01/making-the-most-of-pandora-com/</link>
		<comments>http://blog.marcuscobden.co.uk/2008/01/making-the-most-of-pandora-com/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 22:08:00 +0000</pubDate>
		<dc:creator>Marcus</dc:creator>
				<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[Cookies]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://newblog.marcuscobden.co.uk/?p=4</guid>
		<description><![CDATA[Pandora.com is pretty cool, it&#8217;s been around for a while now but I just went back to it for some easy listening background music to work to. Supposedly they&#8217;ve begun to use IP filtering to limit the audience to the US. Either this is no longer in place or they&#8217;ve made a mistake in a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pandora.com/">Pandora.com</a> is pretty cool, it&#8217;s been around for a while now but I just went back to it for some easy listening background music to work to.</p>
<p>Supposedly they&#8217;ve begun to use IP filtering to limit the audience to the US. Either this is no longer in place or they&#8217;ve made a mistake in a regex somewhere, as this is definitely not the US.</p>
<p>I&#8217;d forgotten about the limit to the unpaid service, which stops playback after so many songs, but it was quite a while before I actually encountered it.<br />
This may be a Mac OS X bug in the flash implementation, but it seems that if you keep the Firefox window containing the player minimised in the Dock, the music doesn&#8217;t stop playing!<br />
Of course this does get in the way of the whole feedback system slightly, but I&#8217;m sure there are those who won&#8217;t mind too much.</p>
<p>Once I did encounter the limit I couldn&#8217;t just refresh the page and go back to listening again as they&#8217;re smart enough to stop you doing that.</p>
<p>But not <span style="font-style: italic;">that</span> smart.</p>
<p>To completely stop this you would require either some heinous DRM-spawn system describable as cookies which you can&#8217;t delete, or some kind of unique client ID, effectively voiding all browser privacy. So to be fair, from the technologies they had to work with, they&#8217;ve done the best they could. ;)</p>
<p>So once you&#8217;ve been shut out of the Pandora player try the following:</p>
<ol>
<li>Delete your cookies from their domains.</li>
<li>Delete any data stored within Adobe Flash for their domain.</li>
</ol>
<p>The latter can be achieved by opening the Adobe Flash client settings and changing the data limit for the domain to 0KB, which will take effect upon refreshing the page, upon which the flash applet will request to store data in your browser again, and you&#8217;re back listening, but without any of your stations.</p>
<h3>Update:</h3>
<p>It appears that the region filtering will go live on January 15th, not quite yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcuscobden.co.uk/2008/01/making-the-most-of-pandora-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
