<?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>Barklund.org &#187; General</title>
	<atom:link href="http://www.barklund.org/blog/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barklund.org/blog</link>
	<description>work smarter when building current web trends</description>
	<lastBuildDate>Wed, 26 May 2010 09:49:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>iPad detection the right way</title>
		<link>http://www.barklund.org/blog/2010/04/23/ipad-detection/</link>
		<comments>http://www.barklund.org/blog/2010/04/23/ipad-detection/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 09:22:34 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Konstellation]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=760</guid>
		<description><![CDATA[Here at Konstellation, we just launched the PageGangster for mobile devices including iPad, iPhone, iPod touch and Android. I developed the clientside for this in JavaScript and we launched it with automatic user agent detection serverside. But this had some problems. I read some info about this and conclude, that some iPad user agent strings [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<div id="attachment_766" class="wp-caption alignright" style="width: 160px"><img src="http://www.barklund.org/blog/wp-content/uploads/2010/04/ipad-300x241.jpg" alt="iPad in action" title="iPad" width="150" height="120" class="size-medium wp-image-766" /><p class="wp-caption-text">The famous large flat thing slightly more useful than a rock</p></div>
<p>Here at <a href="http://konstellation.dk/" title="Konstellation homepage">Konstellation</a>, we just launched the <a href="http://pagegangster.com" title="PageGangster - convert your PDF to an experience">PageGangster</a> for <a href="http://www.pagegangster.com/mobile-devices/" title="Introduction about PageGangster for mobile devices">mobile devices</a> including iPad, iPhone, iPod touch and Android. I developed the clientside for this in JavaScript and we launched it with automatic user agent detection serverside. But this had some problems.</p>
<p><span id="more-760"></span></p>
<p>I read <a href="http://www.nczonline.net/blog/2010/04/06/ipad-web-development-tips/" title="iPad web development tips from nczonline.net">some info</a> about this and conclude, that some iPad user agent strings include the word &#8220;iPhone&#8221; and some users of all types of devices fake their user agent strings.</p>
<p>But then I read on the above link, that no matter what, the <code>navigator.platform</code> attribute would always be set to the right type of device. So in the regular web version of the publication viewer we have now (which uses Flash), we have added a JavaScript detecting if the serverside script did not redirect the client properly:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator <span style="color: #339933;">&amp;&amp;</span> navigator.<span style="color: #660066;">platform</span> <span style="color: #339933;">&amp;&amp;</span> navigator.<span style="color: #660066;">platform</span>.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^(iPad|iPod|iPhone)$/</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	location.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>location.<span style="color: #660066;">href</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;?force-mobile&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It seems simple, but solves the problem of some users seeing the dreaded blue box instead of their publication optimized for their device.</p>
<p>On another node, this experience of developing a web application for the iPad/iPhone was very rewarding and I gained many insights, which might spawn other posts. And if you have any questions about it in any way, feel free to ask here &#8211; but please do not submit bug reports about the PageGangster for mobile &#8211; do that via <a href="mailto:info@pagegangster.com">info@pagegangster.com</a> instead.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2010/04/23/ipad-detection/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>365 Social Ideas is now the Month of Ideas</title>
		<link>http://www.barklund.org/blog/2010/02/26/365-now-month-of-ideas/</link>
		<comments>http://www.barklund.org/blog/2010/02/26/365-now-month-of-ideas/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 15:32:37 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Month of Ideas]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=691</guid>
		<description><![CDATA[An idea per day was simply too much for me, I must admit now being almost a month behind after only two months. Thus I change the concept into a Month of Ideas and the first such was then January 2010. I will now update the previous entries to reflect this change and restructure the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>An idea per day was simply too much for me, I must admit now being almost a month behind after only two months. Thus I change the concept into a <a href="/blog/month-of-ideas/">Month of Ideas</a> and the first such was then <a href="/blog/month-of-ideas/january-2010/">January 2010</a>.</p>
<p><span id="more-691"></span></p>
<p>I will now update the previous entries to reflect this change and restructure the current content.</p>
<p>The next Month of Ideas will be either April or May 2010 &#8211; and I will start now collecting ideas for this just keeping them hidden until I am confident, that I can complete the task for the given month. But at least I tried and have actually produced a wealth of cool things in my opinion &#8211; I hoped you have enjoyed it as well.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2010/02/26/365-now-month-of-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twikicatalyzer  &#8211; January 2010 Ideas</title>
		<link>http://www.barklund.org/blog/2010/01/05/twikicatalyzer-january-2010-idea/</link>
		<comments>http://www.barklund.org/blog/2010/01/05/twikicatalyzer-january-2010-idea/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 18:00:54 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[January 2010 Ideas]]></category>
		<category><![CDATA[Wikipedia]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=550</guid>
		<description><![CDATA[The fifth idea for my 365 Social Ideas is a Twitter- and Wikipedia-mashup idea (and some maps): Find out who&#8217;s talking about what on Twitter through Wikipedia categories. There are many sites for tracking Twitter trends , but they all require that you know what you&#8217;re looking for (or where you&#8217;re looking for it geographically). [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The fifth idea for my <a href="/blog/365ideas/" title="365 Social Ideas from Barklund.org">365 Social Ideas</a> is a <a href="http://twitter.com" title="Twitter">Twitter-</a> and <a href="http://en.wikipedia.org/wiki/" title="The English-languaged Wikipedia Homepage">Wikipedia-mashup</a> idea (and some maps): Find out who&#8217;s talking about what on Twitter through Wikipedia categories. There are many sites for tracking Twitter trends , but they all require that you know what you&#8217;re looking for (or where you&#8217;re looking for it geographically). But what if you simply wanted to know what movies people are tweeting about? Or what about bands, musicians, flowers, four-legged mammals, financial institutions, politicians from Guadelupe or any other arbitrarily broad or narrow category of items?</p>
<p><span id="more-550"></span></p>
<p>For that purpose, <a href="http://en.wikipedia.org/wiki/Wikipedia:Categories" title="Categories described on Wikipedia">Wikipedia categories</a> seem very useful and given the openness of the Wikipedia philosophy, it would actually be quite simple. The site could be as simple as a single input field with input suggestions based on the Wikipedia category system. For example you could input <a href="http://en.wikipedia.org/wiki/Category:1950s_in_film" title="1950s in film category on Wikipedia">&#8220;1950s in film&#8221;</a> and maybe even intersect it with another category like <a href="http://en.wikipedia.org/wiki/Category:Best_Picture_Academy_Award_winners" title="Best Picture Academy Award winners category on Wikipedia">&#8220;Best Picture Academy Award winners&#8221;</a> and the resulting list (including all sub-category entries as well of course) would then be looked up in recent tweets on Twitter and the results would be displayed in different ways &#8211; including a list of most popular items, time-based breakdowns, geographic breakdowns, related links, most dominant profiles etc.</p>
<p>The technology behind it is quite simple and Wikipedia category search and even intersection has been seen in many different applications before. But using it for creating lists of items in a certain category to lookup in a different medium all-together is a new in my book.</p>
<p>Oh, and yes, the name used in the headline is quite stupid, agreed, but with Twitter and Wikipedia involved, Twiki-something seems appropriate.</p>
<h4 id="toc-why">Why?</h4>
<p>Trending topics on Twitter are highly popular and the target of many services, lots of discussion and even some succesful spamming attempts. But the general trends are way to general to be interesting for analyzing what&#8217;s happening in a certain industry or area of interest. This application/service/mashup is a low-hanging fruit, and might carry some hype once deployed, but might not have a long-standing potential. I do however personally find it very interesting and believe that a lot of &#8220;social media experts&#8221;, trend researchers and marketeers will as well.</p>
<h4 id="toc-whats-next">What&#8217;s next?</h4>
<p>Do with this idea whatever you like &#8211; expand, implement, trash or forget. Just remember, that if you use it in anyway make sure to attribute me according to the Creative Commons Attribution 3.0 License, that all these <a href="/blog/365ideas" title="365 Social Ideas from Barklund.org">365 Social Ideas</a> are published under.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2010/01/05/twikicatalyzer-january-2010-idea/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The XKCD book page numbering explained (or skew binary explained)</title>
		<link>http://www.barklund.org/blog/2009/11/24/xkcd-book-page-numbering-explained/</link>
		<comments>http://www.barklund.org/blog/2009/11/24/xkcd-book-page-numbering-explained/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 15:06:19 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=473</guid>
		<description><![CDATA[We got the XKCD book &#8220;volume 0&#8243; here at work yesterday, and I have of course skimmed through it many times already. I quickly found the solution to the page numbering scheme, but wanted to see if I could find a simple conversion formula from real number to XKCD page number and vice versa. Introduction [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>We got the <a href="http://store.xkcd.com/xkcd/" title="Buy it if you haven't already - if for nothing else, to support Randall">XKCD book &#8220;volume 0&#8243;</a> <a href="http://konstellation.dk" title="Konstellation.dk - the company website">here at work</a> yesterday, and I have of course skimmed through it many times already. I quickly found the solution to the page numbering scheme, but wanted to see if I could find a simple conversion formula from real number to XKCD page number and vice versa.</p>
<p><span id="more-473"></span></p>
<div class="toc">
<ol>
<li><a href="http://www.barklund.org/blog/2009/11/24/xkcd-book-page-numbering-explained/#toc-introduction">Introduction</a></li>
<li><a href="http://www.barklund.org/blog/2009/11/24/xkcd-book-page-numbering-explained/#toc-conversions">Conversions</a></li>
<li><a href="http://www.barklund.org/blog/2009/11/24/xkcd-book-page-numbering-explained/#toc-properties">Properties</a></li>
<li><a href="http://www.barklund.org/blog/2009/11/24/xkcd-book-page-numbering-explained/#toc-algebra">Algebra</a>
<ol>
<li><a href="http://www.barklund.org/blog/2009/11/24/xkcd-book-page-numbering-explained/#toc-implementation">Implementation</a></li>
</ol>
</li>
<li><a href="http://www.barklund.org/blog/2009/11/24/xkcd-book-page-numbering-explained/#toc-conclusion">Conclusion</a></li>
</ol>
</div>
<h3 id="toc-introduction">Introduction</h3>
<p>In a regular (i.e. useful) number system, the digit values are powers of a given number starting with the right-most digit representing a digit value of the given base number to the power of 0, the second digit from the right representing a digit value of the given base number to the power of 1 etc. This has a lot of advantages beyond the topic of this post. Thus, in a base 10 number system, the right-most digit value is 1, the second from the right is 10, then 100 etc. There is a simple rule for how we go from one digit value to the next and for how to find an arbitrary digit value just by knowing the digit position.</p>
<p>But the simple point I&#8217;m making here is, that we could invent a number system, where the digits represent arbitrary values &#8211; e.g. the first digit from the right represent 1s, the second digit represent 4s, the third represent 178s, the fourth represent 179s etc. We can express any number in this (we could just extend the available numbers with letters or other symbols as we see fit) &#8211; in the example given here, the decimal number <code>2000</code> would be represented as <code>11*179 + 0*178 + 7*4 + 3*1 = B073</code>. It is quite a useless set of digit values, and it is a very hard representational number system to do any math in.</p>
<p>For the XKCD book page numbering, Randall has chosen a number system, where the first digit from the right represent 1s, the second digit represent 3s, the third represent 7s, the fourth represent 15s and so on &#8211; thus there is actually a rule for finding the digit value for the <code>n</code>&#8216;th digit (from the right) = <code>2<sup>i</sup>-1</code> &#8211; compare this to the binary system, in which the digit values can be calculated as <code>2<sup>(i-1)</sup></code>.</p>
<p><strong>UPDATE 2009-11-26:</strong> As <a href="http://www.reddit.com/r/programming/comments/a800q/the_xkcd_book_page_numbering_explained_contains/c0gaav5" title="Part of a reddit comment thread">it has been pointed out to me</a>, this number system (which is skewed one off binary) is called <a href="http://online-judge.uva.es/problemset/v5/575.html">skew binary</a>. The only interesting property that I can find anyone reference is the fact, that increment only ever has one carry-over, which makes increment very easy to implement (and I could thus implement it in regexp as given further below). It is however only a &#8220;scientific&#8221; numbering system, and I can find no reference to any (other) usage in the wild. The article linked before is the first Google hit for &#8220;skew binary&#8221; and it is an 11 year old slide &#8211; which indicates further, that it is a rarely used system with only theoretical purposes.</p>
<h3 id="toc-conversions">Conversions</h3>
<p>So, how to find the value, that a given XKCD page number represent? Simply multiply each digit by the digit value &#8211; if the <code>i</code>&#8216;th digit (where <code>i=1</code> represent the right-most digit) has the value <code>x<sub>i</sub></code> the translation of an <code>n</code> digit XKCD page number can be done via this formula:</p>
<div class="wp-caption aligncenter" style="width: 260px"><img src="http://chart.apis.google.com/chart?cht=tx&#038;chf=bg,s,FFFFFF00&#038;chco=000000&#038;chl=\sum_{i=1}^n x_i (2^i-1)" alt="General conversion rule from XKCD page numbers to decimal numbers" title="General conversion rule from XKCD page numbers to decimal numbers" class="size-full" /><p class="wp-caption-text">General conversion rule from XKCD page numbers to decimal numbers</p></div>
<p>The reverse translation can&#8217;t be done like regular conversion between regular bases bulding the number from the right (using modulus and division), but has to be done from the left. Thus we need to find the maximum <code>i</code> for which <code>2<sup>i</sup>-1</code> is less than the given number &#8211; which we do via <code>log2(number+1)</code>. Then we go from this maximum <code>i</code> (which denotes the number of digits <code>n</code> in the XKCD page number) to 1 and for each step find the <code>i</code>&#8216;th digit by evenly dividing the target number with <code>2<sup>i</sup>-1</code> and storing the remainder as the new target number &#8211; here both implemented in JavaScript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> dec2xkcd<span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>d<span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>Math.<span style="color: #660066;">LN2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> r<span style="color: #339933;">,</span> x <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">;</span> i<span style="color: #339933;">;</span> i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     r <span style="color: #339933;">=</span> Math.<span style="color: #660066;">pow</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
     x <span style="color: #339933;">+=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>d<span style="color: #339933;">/</span>r<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     d <span style="color: #339933;">=</span> d<span style="color: #339933;">%</span>r<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> xkcd2dec<span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> d <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> l <span style="color: #339933;">=</span> x.<span style="color: #660066;">length</span><span style="color: #339933;">,</span> i <span style="color: #339933;">=</span> l<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    d <span style="color: #339933;">+=</span> parseInt<span style="color: #009900;">&#40;</span>x.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">pow</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span>l<span style="color: #339933;">-</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> d<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>We can verify these by running some tests converting back and forth:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> c<span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> d_ <span style="color: #339933;">=</span> xkcd2dec<span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">return</span> d<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; =&gt; &quot;</span><span style="color: #339933;">+</span>x<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; =&gt; &quot;</span><span style="color: #339933;">+</span>d_<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
c<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 1 =&gt; 1 =&gt; 1</span>
c<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 6 =&gt; 20 =&gt; 6</span>
c<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 15 =&gt; 1000 =&gt; 15</span>
c<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 16 =&gt; 1001 =&gt; 16</span>
c<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">119</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 119 =&gt; 111110 =&gt; 119</span>
c<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">120</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 120 =&gt; 111111 =&gt; 120</span>
c<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">6542</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 6542 =&gt; 110011001010 =&gt; 6542</span>
c<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">5469835</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 5469835 =&gt; 1010011011101101001020 =&gt; 5469835</span></pre></div></div>

<h3 id="toc-properties">Properties</h3>
<p>The selection of digit values are not completely random, they do follow some system, but not the systems of regular power-based number systems. So the properties, that regular power-based number systems have are not present in this, but it does have other properties.</p>
<p>First of all, the notion <code>2^n-1</code> is known from <a href="http://en.wikipedia.org/wiki/Mersenne_prime" title="Mersenne prime on Wikipedia">Mersenne primes</a>. What this tells us however, is nothing useful about the system except that some digit values are prime &#8211; like 3, 7, 31 and maybe, maybe not an infinite number of the infinite other digit values.</p>
<p>Another property is, that from any digit value <code>d<sub>n</sub></code>, the next digit value can always be calculated as <code>2d<sub>n</sub> + 1</code>. This means, that the largest number the can be represented by <code>n</code> digits is a left-most 2 followed by <code>n-1</code> 0s &#8211; the next number in sequence is a left-most 1 followed by <code>n</code> 0s. But again, this is quite trivial and not really that useful.</p>
<p>The <a href="http://en.wikipedia.org/wiki/Repunit">repunit numbers</a> (numbers consisting solely of 1s) in this representational system represent the numbers 1 (<code>1</code>), 4 (<code>11</code>), 11 (<code>111</code>), 26 (<code>1111</code>), 57 (<code>11111</code>) and this order is actually the <a href="http://en.wikipedia.org/wiki/Eulerian_number">second column of the Eulerian numbers</a> (defined by <a href="http://www.research.att.com/~njas/sequences/A000295">sequence A000295 in OEIS</a>) &#8211; but this is still quite useless.</p>
<h3 id="toc-algebra">Algebra</h3>
<p>So, is this usable as a number system? Can we do math in it? Can we in a simple way multiply numbers? Let&#8217;s start by making an algorithm for adding 1 to (incrementing) an arbitrary number. Observe, that we cannot simply safely increment the last digit if it is a zero &#8211; because if the number has a 2 in it (which only occurs in at most one position in the number and with no trailing 1&#8242;s), increment is done by converting the 2 to a 1 and incrementing the digit to the left of the 2 &#8211; examples:</p>
<ul>
<li>Increment 2 => 10</li>
<li>Increment 12 => 20</li>
<li>Increment 102 => 110</li>
<li>Increment 120 => 200</li>
<li>Increment 1012 => 1020</li>
<li>Increment 2000 => 10000</li>
</ul>
<p>It is not trivial, but then again, not that hard. For numbers without a 2, simply increment the right-most digit (which has to be a 0 incremented to a 1 or a 1 incremented to a 2).</p>
<p>Then, how do we subtract 1 (decrement)? Here the rule is, if the number has trailing 0s (one or more right-most digits are 0), decrement the right-most non-zero digit and change the left-most of the trailing 0s (the number just to the right of the right-most non-zero) to a 2 and keep the remaining as 0. If the number does not end in a 0, simply decrement the last digit &#8211; examples:</p>
<ul>
<li>Decrement 2 => 1</li>
<li>Decrement 10 => 2</li>
<li>Decrement 12 => 11</li>
<li>Decrement 112 => 111</li>
<li>Decrement 1010 => 1002</li>
<li>Decrement 1020 => 1012</li>
<li>Decrement 10000 => 2000</li>
</ul>
<p>Still not trivial, but not impossible. <strong>UPDATE 2009-11-26:</strong> The fact that you at most have to alter two connected digits when decrementing or incrementing is what makes this number system interesting as this is a lot easier to implement that normal &#8220;base-based&#8221; number systems, where you worst-case have to alter all digits of the number when in- or decrementing &#8211; compare incrementing the decimal number 999999.</p>
<p>Comparison of numbers is done exactly as for numbers in any (regular) base &#8211; if one has more digits that the other, the &#8220;longest&#8221; number is higher. If not, compare digit by digit starting from the left, if a digit is higher in one number, than the same in the other, that number is larger, if equal, go to next digit. If all digits are the same, the numbers are equal.</p>
<p>All right, so far so good. Then we can add and subtract (but as we won&#8217;t consider negative numbers, subtraction cannot be negative). We add x to y by incrementing y and decrementing x at the same time until x equals 0 &#8211; the value of y is then the result. For subtracting x from y (i.e. <code>y - x</code>), we decrement both numbers until either is zero &#8211; the value of y is then the result (thus 1 &#8211; 2 is 0, as we don&#8217;t do negative number).</p>
<p>The next logical step is to consider multiplication (of positive numbers only of course). We multiply x by y by creating a result variable r and add x to it y times (decrement y each time until 0).</p>
<h4 id="toc-implementation">Implementation</h4>
<blockquote><p>Note: this gets very pointless, so feel free to skip to the conclusion &#8211; which is that all of this is just silly and pointless.</p></blockquote>
<p>First, increment and decrement in JavaScript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> inc<span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!/</span><span style="color: #CC0000;">2</span><span style="color: #339933;">/</span>.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> x
      .<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/1$/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #009900;">&#41;</span>
      .<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/0$/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x
    .<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/(0|^)2/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;10&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/12/</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;20&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> dcr<span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!/</span><span style="color: #CC0000;">0</span>$<span style="color: #339933;">/</span>.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> x
      .<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/1$/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #009900;">&#41;</span>
      .<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/2$/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x
    .<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/20(0*)$/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;12$1&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/10(0*)$/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;02$1&quot;</span><span style="color: #009900;">&#41;</span>
    .<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^0+/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> id_test<span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x2 <span style="color: #339933;">=</span> inc<span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x0 <span style="color: #339933;">=</span> dcr<span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x0<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>xkcd2dec<span style="color: #009900;">&#40;</span>x0<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) =&gt; &quot;</span><span style="color: #339933;">+</span>x<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) =&gt; &quot;</span><span style="color: #339933;">+</span>x2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>xkcd2dec<span style="color: #009900;">&#40;</span>x2<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
id_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 0 (0) =&gt; 1 (1) =&gt; 2 (2)</span>
id_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 1 (1) =&gt; 2 (2) =&gt; 10 (3)</span>
id_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 12 (5) =&gt; 20 (6) =&gt; 100 (7)</span>
id_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 20 (6) =&gt; 100 (7) =&gt; 101 (8)</span>
id_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">117</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 111100 (116) =&gt; 111101 (117) =&gt; 111102 (118)</span>
id_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">123</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 111120 (122) =&gt; 111200 (123) =&gt; 112000 (124)</span>
id_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">127</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 200000 (126) =&gt; 1000000 (127) =&gt; 1000001 (128)</span>
id_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">128</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 1000000 (127) =&gt; 1000001 (128) =&gt; 1000002 (129)</span>
id_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">603</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 100101120 (602) =&gt; 100101200 (603) =&gt; 100102000 (604)</span></pre></div></div>

<p>Then comparison:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> cmp<span style="color: #009900;">&#40;</span>x1<span style="color: #339933;">,</span>x2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> l <span style="color: #339933;">=</span> x1.<span style="color: #660066;">length</span><span style="color: #339933;">,</span> l2 <span style="color: #339933;">=</span> x2.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>l <span style="color: #339933;">!=</span> l2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> l <span style="color: #339933;">&gt;</span> l2 <span style="color: #339933;">?</span> <span style="color: #CC0000;">1</span> <span style="color: #339933;">:</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">,</span> c1<span style="color: #339933;">,</span> c2<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>l<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    c1 <span style="color: #339933;">=</span> x1.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    c2 <span style="color: #339933;">=</span> x2.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>c1 <span style="color: #339933;">&gt;</span> c2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>c2 <span style="color: #339933;">&gt;</span> c1<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> 
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> cmp_test<span style="color: #009900;">&#40;</span>d1<span style="color: #339933;">,</span> d2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x1 <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x2 <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> c <span style="color: #339933;">=</span> cmp<span style="color: #009900;">&#40;</span>x1<span style="color: #339933;">,</span> x2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>c <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> x1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) is greater than &quot;</span><span style="color: #339933;">+</span>x2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>c <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> x2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) is greater than &quot;</span><span style="color: #339933;">+</span>x1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) equals &quot;</span><span style="color: #339933;">+</span>x2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
cmp_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #006600; font-style: italic;">// 1 (1) equals 1 (1)</span>
cmp_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #006600; font-style: italic;">// 2 (2) is greater than 1 (1)</span>
cmp_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #006600; font-style: italic;">// 2 (2) is greater than 1 (1)</span>
cmp_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">117</span><span style="color: #339933;">,</span><span style="color: #CC0000;">117</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 111101 (117) equals 111101 (117)</span>
cmp_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">117</span><span style="color: #339933;">,</span><span style="color: #CC0000;">121</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 111112 (121) is greater than 111101 (117)</span>
cmp_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">127</span><span style="color: #339933;">,</span><span style="color: #CC0000;">128</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 1000001 (128) is greater than 1000000 (127)</span>
cmp_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">127</span><span style="color: #339933;">,</span><span style="color: #CC0000;">126</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 1000000 (127) is greater than 200000 (126)</span></pre></div></div>

<p>Then addition:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> add<span style="color: #009900;">&#40;</span>x1<span style="color: #339933;">,</span> x2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>cmp<span style="color: #009900;">&#40;</span>x2<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    x1 <span style="color: #339933;">=</span> inc<span style="color: #009900;">&#40;</span>x1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    x2 <span style="color: #339933;">=</span> dcr<span style="color: #009900;">&#40;</span>x2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x1<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> add_test<span style="color: #009900;">&#40;</span>d1<span style="color: #339933;">,</span> d2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x1 <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x2 <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> xs <span style="color: #339933;">=</span> add<span style="color: #009900;">&#40;</span>x1<span style="color: #339933;">,</span> x2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> ds <span style="color: #339933;">=</span> xkcd2dec<span style="color: #009900;">&#40;</span>xs<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) + &quot;</span><span style="color: #339933;">+</span>x2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) = &quot;</span><span style="color: #339933;">+</span>xs<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>ds<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 1 (1) + 1 (1) = 2 (2)</span>
add_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 1 (1) + 2 (2) = 10 (3)</span>
add_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 2 (2) + 1 (1) = 10 (3)</span>
add_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">7</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 100 (7) + 100 (7) = 200 (14)</span>
add_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">8</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">17</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">// 101 (8) + 1002 (17) = 1110 (25)</span>
add_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">53</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">17</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 11100 (53) + 1002 (17) = 100100 (70)</span></pre></div></div>

<p>Then subtraction:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> sub<span style="color: #009900;">&#40;</span>x1<span style="color: #339933;">,</span> x2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>cmp<span style="color: #009900;">&#40;</span>x1<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> cmp<span style="color: #009900;">&#40;</span>x2<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    x1 <span style="color: #339933;">=</span> dcr<span style="color: #009900;">&#40;</span>x1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    x2 <span style="color: #339933;">=</span> dcr<span style="color: #009900;">&#40;</span>x2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x1<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> sub_test<span style="color: #009900;">&#40;</span>d1<span style="color: #339933;">,</span> d2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x1 <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x2 <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> xs <span style="color: #339933;">=</span> sub<span style="color: #009900;">&#40;</span>x1<span style="color: #339933;">,</span> x2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> ds <span style="color: #339933;">=</span> xkcd2dec<span style="color: #009900;">&#40;</span>xs<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) - &quot;</span><span style="color: #339933;">+</span>x2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) = &quot;</span><span style="color: #339933;">+</span>xs<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>ds<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
sub_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 1 (1) - 1 (1) = 0 (0)</span>
sub_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 1 (1) - 2 (2) = 0 (0)</span>
sub_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 2 (2) - 1 (1) = 1 (1)</span>
sub_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">7</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 100 (7) - 100 (7) = 0 (0)</span>
sub_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">17</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">// 1002 (17) - 101 (8) = 102 (9)</span>
sub_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">53</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">17</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 11100 (53) - 1002 (17) = 10012 (36)</span></pre></div></div>

<p>Finally multiplication:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> mul<span style="color: #009900;">&#40;</span>x1<span style="color: #339933;">,</span> x2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>cmp<span style="color: #009900;">&#40;</span>x2<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> x2<span style="color: #339933;">;</span>
  <span style="color: #006600; font-style: italic;">// x2 is not zero, go</span>
  <span style="color: #003366; font-weight: bold;">var</span> r <span style="color: #339933;">=</span> x1<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>cmp<span style="color: #009900;">&#40;</span>x2<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    r <span style="color: #339933;">=</span> add<span style="color: #009900;">&#40;</span>r<span style="color: #339933;">,</span> x1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    x2 <span style="color: #339933;">=</span> dcr<span style="color: #009900;">&#40;</span>x2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> r<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> mul_test<span style="color: #009900;">&#40;</span>d1<span style="color: #339933;">,</span> d2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x1 <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> x2 <span style="color: #339933;">=</span> dec2xkcd<span style="color: #009900;">&#40;</span>d2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> xs <span style="color: #339933;">=</span> mul<span style="color: #009900;">&#40;</span>x1<span style="color: #339933;">,</span> x2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> ds <span style="color: #339933;">=</span> xkcd2dec<span style="color: #009900;">&#40;</span>xs<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">return</span> x1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d1<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) * &quot;</span><span style="color: #339933;">+</span>x2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>d2<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;) = &quot;</span><span style="color: #339933;">+</span>xs<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">+</span>ds<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
mul_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 1 (1) * 1 (1) = 1 (1)</span>
mul_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 1 (1) * 2 (2) = 2 (2)</span>
mul_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 2 (2) * 1 (1) = 2 (2)</span>
mul_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">7</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// 100 (7) * 100 (7) = 11010 (49)</span>
mul_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">17</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">// 1002 (17) * 101 (8) = 1000102 (136)</span>
mul_test<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">53</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">17</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 11100 (53) * 1002 (17) = 111000101 (901)</span></pre></div></div>

<h3 id="toc-conclusion">Conclusion</h3>
<p>As expected, it is just a silly and very useless number system &#8211; but fun to play around with though. If you however find other interesting properties of this representational system, please feel free to comment.</p>
<p>However, it should be clear to anyone, that this has nothing to do with a <a href="http://en.wikipedia.org/wiki/Ternary_numeral_system" title="Ternary numeral system on Wikipedia">ternary number system</a> just because the only digits are 0, 1 and 2 &#8211; it is closer related to the binary number system.</p>
<p><strong>UPDATE 2009-11-26:</strong> Albeit still useless, the number system actually has the name &#8220;skew binary&#8221; as mentioned in the introduction &#8211; and thus has been the target of some scientific research previously.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2009/11/24/xkcd-book-page-numbering-explained/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Link sharing spam on Facebook</title>
		<link>http://www.barklund.org/blog/2009/11/23/link-sharing-spam-facebook/</link>
		<comments>http://www.barklund.org/blog/2009/11/23/link-sharing-spam-facebook/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 13:25:59 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=455</guid>
		<description><![CDATA[I just saw a link on Facebook, that I somehow had to interact with &#8211; it featured a not-that-dressed girl and said &#8220;Wanna C Something Hot?&#8221;/&#8221;Want 2 C Something Hot?&#8221; or variations of this. Well, clicking the link sent to me to an external site featuring a single button and the same image urging me [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I just saw a link on Facebook, that I somehow had to interact with &#8211; it featured a not-that-dressed girl and said &#8220;Wanna C Something Hot?&#8221;/&#8221;Want 2 C Something Hot?&#8221; or variations of this. Well, clicking the link sent to me to an external site featuring a single button and the same image urging me to click it. When clicked, I came to some porn site. But why would several of my friends post links to this site, which incidentally sent me to a porn site? Well, as I soon after saw on Facebook, I had just posted the same link on my wall for all my friends to see. How?
<p>It is a &#8220;simple&#8221; case of &#8220;click-jacking&#8221; and the site tricks you to click a Facebook share button, but disguises this as some other button. Please read on for full description.</p>
<p><strong>UPDATE 2009-12-2:</strong> &#8220;Press the button or dog dies&#8221;/&#8221;Push the button or this dog dies&#8221; (located at pressthebuttonordogdies.com, but don&#8217;t go there) is a new such site. The target website is &#8220;thisblogrules.com&#8221; and the measures used are a little different but all in all the same anyway.</p>
<p>Furthermore, I have used bit.ly for tracking how much these links have been used so far on Facebook &#8211; it is pretty inflicting: The &#8220;hot&#8221; girl has <a href="http://bit.ly/info/shesnotthathot">been shared almost 59,000 times</a> and the poor dog has <a href="http://bit.ly/info/stilldontpressthebutton">been shared 5,309 times</a> as of this writing. You can see the direct stats from the <a href="http://wiki.developers.facebook.com/index.php/Links.getStats">Facebook link.getStats API</a> here: <a href="http://api.facebook.com/restserver.php?method=links.getStats&#038;urls=http://3dvv.com/somethinghot/">Somthing Hot</a> and <a href="http://api.facebook.com/restserver.php?method=links.getStats&#038;urls=http://www.pressthebuttonordogdies.com/">Or Dog Dies</a></p>
<p><span id="more-455"></span></p>
<p>The original post looked like this (taken from my own feed):</p>
<div id="attachment_456" class="wp-caption aligncenter" style="width: 339px"><img src="http://www.barklund.org/blog/wp-content/uploads/2009/11/facebook_post.png" alt="Don&#039;t go to this page if you see this post" title="Facebook Link Post" width="329" height="185" class="size-full wp-image-456" /><p class="wp-caption-text">Don't go to this page if you see this post</p></div>
<p>The page it linked to was <code>http://3dvv.com/somethinghot/</code> (don&#8217;t go there, nothing to see) and looks like:</p>
<div id="attachment_457" class="wp-caption aligncenter" style="width: 310px"><img src="http://www.barklund.org/blog/wp-content/uploads/2009/11/wanna_c_page-300x195.png" alt="The page tricking you to share the link" title="Want 2 C Something Hot?" width="300" height="195" class="size-medium wp-image-457" /><p class="wp-caption-text">The page tricking you to share the link</p></div>
<p>When you press the &#8220;button&#8221; you actually press this (opacity on iframe set to 1 instead of 0):</p>
<div class="wp-caption aligncenter" style="width: 481px"><img src="http://www.barklund.org/blog/wp-content/uploads/2009/11/the_real_button.png" alt="The real button that you actually press kind of looks like a Facebook button, right?" title="The real button that you actually press kind of looks like a Facebook button, right?" width="471" height="181" class="aligncenter size-full wp-image-458" /><p class="wp-caption-text">The real button that you actually press kind of looks like a Facebook button, right?</p></div>
<p>The trick here is, that they have used the layout of this page about sharing the link (safe to go to, just don&#8217;t actually press the share button): <a href="http://www.facebook.com/share.php?u=http://3dvv.com/somethinghot/">http://www.facebook.com/share.php?u=http://3dvv.com/somethinghot/</a>. Then, they included this page inside an iframe that was offset the right amount negatively to the left and to the top, to leave just the share button visible in the corner here (no need to visit): <code>http://3dvv.com/somethinghot/ngr.php</code>, which looks simply like:</p>
<div class="wp-caption aligncenter" style="width: 210px"><img src="http://www.barklund.org/blog/wp-content/uploads/2009/11/only_share.png" alt="How to only show the share button by iframing the share.php page" title="How to only show the share button by iframing the share.php page" width="67" height="35" class="aligncenter size-full wp-image-460" /><p class="wp-caption-text">How to only show the share button by iframing the share.php page</p></div>
<p>If we on this page remove the constraints, we can see the whole bottom corner of the page like this:</p>
<div class="wp-caption aligncenter" style="width: 318px"><img src="http://www.barklund.org/blog/wp-content/uploads/2009/11/rest_of_share.png" alt="The rest of the share cutout with the button in the corner" title="The rest of the share cutout with the button in the corner" width="308" height="127" class="aligncenter size-full wp-image-461" /><p class="wp-caption-text">The rest of the share cutout with the button in the corner</p></div>
<p>Well, this is not all. In order not to have the page simply redirect to what facebook normally would after having shared a link, this page with only the share button visible is wrapped in another iframe, that steals the redirect Facebook creates and make their own redirect to the actual target (porn) site.</p>
<p>All in all, it is a very clever albeit strictly illegal way of using the Facebook sharing functionality for viral spamming purposes.</p>
<p>What can Facebook do about it? One thing would be to not allow share.php to be embedded in iframes via a simple javascript, but that might break desired functionality in other places. Otherwise, they could shift the placement of the sharebutton slightly of different page loads, but that could probably be circumvented by detecting the position of the button via script and isn&#8217;t a viable solution. Or they could require that the user had to type some captcha before being able to post links to new sites not posted before, but that creates a lot of other problems (and a good scammer could simply require the user to answer the captcha as well as click the button &#8211; users would do that). I&#8217;m sure Facebook can think of something, though.</p>
<p>What can you as a user do about it? Nothing really. Only click on &#8220;links&#8221; on foreign pages that you know for sure are legitimate and that you trust that your friends really did post on their own. But it is pretty hard to protect against. It really is Facebook&#8217;s job to make sure this doesn&#8217;t happen.</p>
<p>Please share this with everyone!</p>
<p><strong>Update 2009-11-24:</strong> <a href="http://www.geek.com/articles/news/facebook-worm-wants-you-to-click-da-button-baby-20091124/" title="Report on geek.com">Several</a> <a href="http://itknowledgeexchange.techtarget.com/security-bytes/new-facebook-worm-uses-sexy-model-to-get-guys-to-click-da%E2%80%99-button/" title="TechTarget.com">sites</a> <a href="http://www.itwire.com/content/view/29561/53/" title="ITWire.com">report</a> this as an example of CSRF/XSRF (Cross-Site Request Forgery) and most use <a href="http://fitzgerald.blog.avg.com/2009/11/new-facebook-worm-dont-click-da-button-baby.html" title="New Facebook worm - don't click da' button baby!">this AVG blog post</a> as source. Not that it really matters, but it is not <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery" title="XSRF on Wikipedia">XSRF</a> &#8211; it is <a href="http://en.wikipedia.org/wiki/Clickjacking" title="Clickjacking on Facebook">clickjacking</a>. There is a slight difference, the main difference being, that the countermeasures are very different.</a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2009/11/23/link-sharing-spam-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The iPhone developer boycott in the works</title>
		<link>http://www.barklund.org/blog/2009/11/23/iphone-developer-boycott-in-the-works/</link>
		<comments>http://www.barklund.org/blog/2009/11/23/iphone-developer-boycott-in-the-works/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 10:13:25 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=446</guid>
		<description><![CDATA[Being a set of talented web developers in a trendy, cutting-edge digital agency, we have wanted to create and thus pitched on many an iPhone application &#8211; as the iPhone is just the slickest, meanest, coolest, hottest and most alluring device on the market. It has been so for a long time and it will [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Being a set of talented web developers in a trendy, cutting-edge digital agency, we have wanted to create and thus pitched on many an iPhone application &#8211; as the iPhone is just the slickest, meanest, coolest, hottest and most alluring device on the market. It has been so for a long time and it will be so for some time to come (but not that long).</p>
<p>But that craving for getting hands on building something for the iPhone is gone &#8211; completely. I&#8217;m sorry Apple, you might not miss me, but as things stand right now, I won&#8217;t miss you either. And I am certainly not alone &#8211; there is a large front in the developer community building up resentment against the policy of the App Store review process. A veritable boycott is brewing.</p>
<p><span id="more-446"></span></p>
<p>First of all here are some horror stories about how incredibly tiresome, ridiculous and illogical the review process is:</p>
<ul>
<li>
<a href="http://www.mikeash.com/?page=pyblog/the-iphone-development-story.html" title="The iPhone Development Story by Mike Ash">The iPhone Development Story by Mike Ash</a> &#8211; about the entire app review process and how time-consuming it is.
</li>
<li>
<a href="http://www.rogueamoeba.com/utm/2009/11/13/airfoil-speakers-touch-1-0-1-finally-ships/" title="Airfoil Speakers Touch 1.0.1 Finally Ships from Rogue Amoeba">Airfoil Speakers Touch 1.0.1 Finally Ships from Rogue Amoeba</a> &#8211; about how a simple bug fix ended up making the developer choose between a less functional or a less user friendly version of his app.
</li>
<li>
<a href="http://www.maclife.com/article/news/apples_fcc_response_infuriates_google_voice_app_developer" title="Apple’s FCC Response Infuriates Google Voice App Developer from MacLife.com">Apple’s FCC Response Infuriates Google Voice App Developer from MacLife.com</a> &#8211; about how Apple randomly picks out already approved applications for removal, if they see fit (and of course give no real reason, only air in response).
</li>
<li>
<a href="http://aralbalkan.com/2530" title="How Apple’s App Store review process hurt Occipital’s RedLaser SDK and my very own ‘avit iPhone app by Aral Balkan">How Apple’s App Store review process hurt Occipital’s RedLaser SDK and my very own ‘avit iPhone app by Aral Balkan</a> &#8211; about how Apple&#8217;s policies are hurting everyone and not making any business sense whatsoever&#8230;
</li>
</ul>
<p>Second, how developers are fleeing the platform:</p>
<ul>
<li>
<a href="http://joehewitt.com/post/on-middle-men/" title="On Middle Men by Joe Hewitt">On Middle Men by Joe Hewitt</a> &#8211; about how his experiences with Apple and the App Store during his development of the Facebook App for iPhone has made him quit developing for iPhone.
</li>
<li>
<a href="http://www.mikeash.com/?page=pyblog/the-iphone-development-story-one-year-later.html" title="The iPhone Development Story: One Year Later by Mike Ash">The iPhone Development Story: One Year Later by Mike Ash</a> &#8211; about how Mike&#8217;s experience and Apple&#8217;s lack of response one year after his initial bad experience has caused him to skip the platform.
</li>
<li>
<a href="http://carpeaqua.com/2009/10/16/back-to-the-mac/" title="Back To The Mac from CarpeAqua.com">Back To The Mac from CarpeAqua.com</a> &#8211; about how the overall experience has caused yet another value-adding developer to only develop for Mac, not iPhone.
</li>
</ul>
<p>Third, how commentators are warning Apple about the no-go of trying to be a &#8220;software publisher&#8221; as that is bound to go bad:</p>
<ul>
<li>
<a href="http://radar.oreilly.com/2009/11/the-war-for-the-web.html" title="The War For the Web by Tim O'Reilly">The War For the Web by Tim O&#8217;Reilly</a> &#8211; about how trying to control your medium will lead to doom or big business (but most likely doom in the long run).
</li>
<li>
<a href="http://www.paulgraham.com/apple.html" title="Apple's Mistake by Paul Graham">Apple&#8217;s Mistake by Paul Graham</a> &#8211; about Apple trying to be the middle man where no such was needed or even fits.
</li>
</ul>
<p>All in all, my conclusion is clear: Symbian/Droid/Palm/WinMo/TouchWiz/whatever open mobile operating system you can name, here I come!</p>
<p>UPDATE: PPK just posted his solution to the dilemma: <a href="http://www.quirksmode.org/blog/archives/2009/11/apple_is_not_ev.html" title="Apple is not evil. iPhone developeers are stupid from quirksmode.org">create web apps, not native apps</a> (but in a somewhat cryptic wording though) &#8211; and since that post he then <a href="http://www.quirksmode.org/blog/archives/2009/11/native_iphone_a.html" title="Native iPhone apps vs. Web apps from quirksmode.org">posted an equally strangely worded &#8220;rebuttal&#8221;</a>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2009/11/23/iphone-developer-boycott-in-the-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>100,000 spam comments fought off</title>
		<link>http://www.barklund.org/blog/2009/11/06/100-000-spam-comments/</link>
		<comments>http://www.barklund.org/blog/2009/11/06/100-000-spam-comments/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 22:04:46 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=438</guid>
		<description><![CDATA[My blog just turned a huge corner &#8211; Akismet has now protected me from 100,000 spam comments in total. Well, that&#8217;s a lot more attention, that anyone else has ever given my blog &#8211; now what does that mean? Feel free to post non-spam-y comments ;) No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>My blog just turned a huge corner &#8211; Akismet has now protected me from 100,000 spam comments in total.</p>
<p><span id="more-438"></span><br />
<img src="http://www.barklund.org/blog/wp-content/uploads/2009/11/Screen-shot-2009-11-05-at-23.00.46.png" alt="100.000th spam comment" title="100.000th spam comment" width="567" height="66" class="aligncenter size-full wp-image-437" /></p>
<p>Well, that&#8217;s a lot more attention, that anyone else has ever given my blog &#8211; now what does that mean? Feel free to post non-spam-y comments ;)</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2009/11/06/100-000-spam-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why UK copyright law does extend copyright to the digitization of public domain works</title>
		<link>http://www.barklund.org/blog/2009/07/17/uk-copyright-does-extend-to-digitization/</link>
		<comments>http://www.barklund.org/blog/2009/07/17/uk-copyright-does-extend-to-digitization/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 13:57:49 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[Online Rights]]></category>
		<category><![CDATA[Wikipedia]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=219</guid>
		<description><![CDATA[I&#8217;ve been reading up on the matter of the National Portrait Gallery in the United Kingdom and their threatening letters to the Wikimedia Foundation about the legal status of the digitised works created by said public institution. After reading up on UK copyright law, my judgment is unclear &#8211; but mostly in favor of the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been reading up on <a href="http://news.slashdot.org/story/09/07/17/085244/New-Developments-In-NPGWikipedia-Lawsuit-Threat?from=rss" title="New Developments in NPG/Wikimedia Lawsuit Threat from slashdot.org">the matter</a> of the <a href="http://www.npg.org.uk/" title="Official website of the National Portrait Gallery">National Portrait Gallery in the United Kingdom</a> and <a href="http://yro.slashdot.org/story/09/07/11/1239244/UKs-National-Portrait-Gallery-Threatens-To-Sue-Wikipedia-User" title="UK's National Portrait Gallery Threatens To Sue Wikipedia User from slashdot.org">their threatening letters</a> to the <a href="http://wikimediafoundation.org/wiki/Home" title="Home of the Wikimedia Foundation">Wikimedia Foundation</a> about the legal status of the digitised works created by said public institution.</p>
<p>After reading up on UK copyright law, my judgment is unclear &#8211; but mostly in favor of the NPG and thus against Wikimedia.</p>
<p><span id="more-219"></span></p>
<p>The CDPA of 1988 clearly states in <a href="http://www.opsi.gov.uk/acts/acts1988/ukpga_19880048_en_2#pt1-ch1-pb1-l1g1" title="Copyright, Designs and Patents Act 1988, Chapter 1, Paragraph 1">the very first paragraph</a>:</p>
<blockquote><ol>
<li>Copyright and copyright works</p>
<ol>
<li>Copyright is a property right which subsists in accordance with this Part in the following descriptions of work—</p>
<ol>
<li style="list-style-type:lower-latin"><strong>original</strong> literary, dramatic, musical or artistic works, </li>
<li style="list-style-type:lower-latin">[...]</li>
</ol>
</li>
</ol>
</li>
</ol>
</blockquote>
<p>To me, one crucial part is the word &#8220;original&#8221;. This removes the possibility of claiming, that merely taking a photograph of another work is copyrightable in itself. The law goes on to specify what each of the four here-described works are, and it is clear, that taking a photo is an artistic work (defined in §4 sec. 1.a), but it is not an <strong>original</strong> work (in my opinion), when it is a photograph of a painting.</p>
<p>But the manipulation <a href="http://en.wikipedia.org/wiki/Conservation-restoration" title="Conservation-restoration on the English Wikipedia">done by the conservationists when digitizing the photos</a> includes a lot of work, which is definitely craftsmanship, but if deemed as artistic craftsmanship, it <strong>is</strong> in itself covered by the CDPA in <a href="http://www.opsi.gov.uk/acts/acts1988/ukpga_19880048_en_2#pt1-ch1-pb2-l1g4" title="Copyright, Designs and Patents Act 1988, Chapter 1, Paragraph 4">§4 section 1.c</a>:</p>
<blockquote><ol>
<li style="list-style:none"/>
<li style="list-style:none"/>
<li style="list-style:none"/>
<li>Artistic works</p>
<ol>
<li>In this Part “artistic work” means—</p>
<ol>
<li style="list-style:none" />
<li style="list-style-type:lower-latin">[...]</li>
<li style="list-style-type:lower-latin">a work of artistic craftsmanship.</li>
</ol>
</li>
</ol>
</li>
</ol>
</blockquote>
<p>My conclusion is thus, that it is irrelevant whether it is a derivative work or not (non-original works are never copyrightable) &#8211; the matter of the case is, whether the work of conservationists is artistic craftsmanship or not. And I&#8217;m leaning towards a &#8220;yes&#8221;, but I&#8217;m pretty sure the case cannot be settled without a court ruling, as it is clearly a case of interpretation. You can argue that a conservationist is merely a scientist, not an artist &#8211; but even scientific papers and articles are subject to copyright, and thus I believe, that the work of a conservationist is subject to copyright given that it is artistic craftsmanship and/or original scientific work.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2009/07/17/uk-copyright-does-extend-to-digitization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight Smooth Streaming &#8211; not that impressive</title>
		<link>http://www.barklund.org/blog/2009/07/14/silverlight-smooth-streaming-not-that-impressive/</link>
		<comments>http://www.barklund.org/blog/2009/07/14/silverlight-smooth-streaming-not-that-impressive/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 10:41:23 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=186</guid>
		<description><![CDATA[Just saw someone post a link to the new Silverlight Smooth Streaming site. Clicked my way to the site and the download of Silverlight for Firefox 3 for Mac 10.5 worked smoothly &#8211; so far so good. After the install was complete however, all I saw was this: Probably not the result I was expected [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Just saw someone post a link to the new <a href="http://www.iis.net/media/experiencesmoothstreaming" title="Experience Smooth Streaming from iis.net">Silverlight Smooth Streaming</a> site. Clicked my way to the site and the download of Silverlight for Firefox 3 for Mac 10.5 worked smoothly &#8211; so far so good.</p>
<p><span id="more-186"></span></p>
<p>After the install was complete however, all I saw was this:</p>
<div id="attachment_187" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.barklund.org/blog/2009/07/14/silverlight-smooth-streaming-not-that-impressive/silverlight_in_action/" rel="attachment wp-att-187"><img src="http://www.barklund.org/blog/wp-content/uploads/2009/07/Silverlight_in_action-300x177.png" alt="Silverlight Smooth Streaming - not a very smooth start though" title="Silverlight in action" width="300" height="177" class="size-medium wp-image-187" /></a><p class="wp-caption-text">Silverlight Smooth Streaming - not a very smooth start though</p></div>
<p>Probably not the result I was expected to see &#8211; it was quite a terrible first impression to give me. I might just need to reload, I might just need to restart my browser, but if any of that was needed, the installer should have done just that &#8211; and not give me this ridiculous result.</p>
<p>Better luck next time, <a href="http://team.silverlight.net" title="The official Silverlight development team blog">Team Silverlight</a>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2009/07/14/silverlight-smooth-streaming-not-that-impressive/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ccTLD&#8217;s for second-level foreign registration</title>
		<link>http://www.barklund.org/blog/2009/06/22/cctlds-for-second-level-foreign-registration/</link>
		<comments>http://www.barklund.org/blog/2009/06/22/cctlds-for-second-level-foreign-registration/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 12:49:45 +0000</pubDate>
		<dc:creator>Barklund</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.barklund.org/blog/?p=135</guid>
		<description><![CDATA[When creating different online services, it can often be nice to have a good short domain name. And domain name hacks like del.icio.us (which though changed their primary name to delicious.com) might be a bit 2007-ish, but can still be used for a lot of services. For this use, I was missing a good list [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>When creating different online services, it can often be nice to have a good short domain name. And domain name hacks like del.icio.us (which though changed their primary name to delicious.com) might be a bit 2007-ish, but can still be used for a lot of services.</p>
<p>For this use, I was missing a good list of <acronym title="Country code top-level domain">ccTLD</acronym>&#8216;s, that are available for direct second-level registration without local presence. Some countries don&#8217;t allow direct second-level registration like .uk (United Kingdom) or .tr (Turkey). All of the below-mentioned domain names are available for direct second-level registration and do not require local administrative contacts, trade licenses or similar restrictions. Most of them can be purchased online, but some require paper forms sent back and forth and might take some time to register.</p>
<p><span id="more-135"></span></p>
<table border="1">
<col style="width:90px" />
<col style="width:130px" />
<col style="width:180px" />
<col style="width:180px" />
<thead>
<tr>
<th>Country code</th>
<th>Country</th>
<th>Price first year</th>
<th>Link to buy</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.ac" title=".ac on Wikipedia">.ac</a></td>
<td><a href="http://en.wikipedia.org/wiki/Ascension_Island" title="Ascension Island on Wikipedia">Ascension Island</a></td>
<td>£60 ~ €71 ~ $99 USD</td>
<td><a href="https://www.nic.ac/cgi-bin/whois?M1=abcdefgh.ac" title="Check abcdefgh.ac at nic.ac">whois and buy abcdefgh.ac</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.af" title=".af on Wikipedia">.af</a></td>
<td><a href="http://en.wikipedia.org/wiki/Afghanistan" title="Afghanistan on Wikipedia">Afghanistan</a></td>
<td>£30 ~ €35 ~ $50 USD</td>
<td><a href="http://www.nic.af/whois.asp?domain=abcdefgh&#038;ext=.af" title="Check abcdefgh.af at nic.af">whois and buy abcdefgh.af</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.ag" title=".ag on Wikipedia">.ag</a></td>
<td><a href="http://en.wikipedia.org/wiki/Antigua_and_Barbuda" title="Antigua and Barbuda on Wikipedia">Antigua and Barbuda</a></td>
<td>£90 ~ €105 ~ $150 USD</td>
<td><a href="http://ns1.nic.ag/tools/whois.pl?abcdefgh.ag" title="whois abcdefgh.ag at nic.ag">whois abcdefgh.ag</a> or <a href="https://payment.nic.ag/ab/" title="Registration for .ag domain - BEWARE: expired security certificate">buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.am" title=".am on Wikipedia">.am</a></td>
<td><a href="http://en.wikipedia.org/wiki/Armenia" title="Armenia on Wikipedia">Armenia</a></td>
<td>£30 ~ €35 ~ $50 USD</td>
<td><a href="https://www.amnic.net/whois/?domain=abcdefgh.am" title="whois abcdefgh.am at amnic.net">whois abcdefgh.am</a> or <a href="https://www.amnic.net/register/" title="Registration for .am domain">buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.as" title=".as on Wikipedia">.as</a></td>
<td><a href="http://en.wikipedia.org/wiki/American_Samoa" title="American Samoa on Wikipedia">American Samoa</a></td>
<td>£30 ~ €35 ~ $50 USD<sup><a href="#domain_list_note_2_years" title="2 years minimum registration - listed priced here is half that">*</a></sup></td>
<td><a href="http://www.nic.as/whois.cfm?domain=abcdefgh.as" title="Whois and registration for .as domain">whois and buy abcdefgh.as</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.at" title=".at on Wikipedia">.at</a></td>
<td><a href="http://en.wikipedia.org/wiki/Austria" title="Austria on Wikipedia">Austria</a></td>
<td>£60 ~ €72 ~ $100 USD</td>
<td><a href="https://www.nic.at/ui/index.php/domainintro/pageselectregdomain/?domain[domainname]=abcdefgh.at" title="whois abcdefgh.at at nic.at">whois and buy abcdefgh.at</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.be" title=".be on Wikipedia">.be</a></td>
<td><a href="http://en.wikipedia.org/wiki/Belgium" title="Belgium on Wikipedia">Belgium</a></td>
<td>£8 ~ €9 ~ $12 USD</td>
<td><a href="http://www.europeregistry.com/domains/domains-be.htm" title="whois or buy .be through a registrar">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.bi" title=".bi on Wikipedia">.bi</a></td>
<td><a href="http://en.wikipedia.org/wiki/Burundi" title="Burundi on Wikipedia">Burundi</a></td>
<td>£120 ~ €140 ~ $200 USD<sup><a href="#domain_list_note_2_years" title="2 years minimum registration - listed priced here is half that">*</a></sup></td>
<td><a href="http://whois.nic.bi/register/index.hei" title="whois">whois</a> or <a href="http://www.bluesit.com/bi.htm" title="buy through registrar">buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.bo" title=".bo on Wikipedia">.bo</a></td>
<td><a href="http://en.wikipedia.org/wiki/Bolivia" title="Bolivia on Wikipedia">Bolivia</a></td>
<td>£130 ~ €155 ~ $216 USD</td>
<td><a href="http://www.nic.bo/index.php" title="whois and buy from nic.bo">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.bs" title=".bs on Wikipedia">.bs</a></td>
<td><a href="http://en.wikipedia.org/wiki/Bahamas" title="Bahamas on Wikipedia">Bahamas</a></td>
<td>£150 ~ €180 ~ $250 USD<sup><a href="#domain_list_note_2_years" title="2 years minimum registration - listed priced here is half that">*</a></sup></td>
<td><a href="http://www.register.bs/cgi-bin/search.pl?name=abcdefgh.bs" title="whois abcdefgh.bs">whois abcdefgh.bs</a> or <a href="http://www.register.bs/cgi-bin/fsub.pl" title="buy from register.bs">buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.by" title=".bz on Wikipedia">.bz</a></td>
<td><a href="http://en.wikipedia.org/wiki/Belize" title="Belize on Wikipedia">Belize</a></td>
<td>£21 ~ €25 ~ $35 USD</td>
<td><a href="http://www.belizenic.bz/cgi-bin/Registrar_YTest?Data.domain=abcdefgh&#038;Action.command=check" title="Whois and registration for abcdefgh.bz">whois and buy abcdefgh.bz</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.cg" title=".cg on Wikipedia">.cg</a></td>
<td><a href="http://en.wikipedia.org/wiki/Republic_of_the_Congo" title="Republic of the Congo Islands on Wikipedia">Congo</a></td>
<td>£18 ~ €22 ~ $30 USD</td>
<td><a href="http://www.enom.cc/domains/Register.asp?SLD=abcdefgh&#038;TLD=cc" title="Whois and registration for abcdefgh.cc">whois and buy abcdefgh.cc</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.cd" title=".cd on Wikipedia">.cd</a></td>
<td><a href="http://en.wikipedia.org/wiki/Democratic_Republic_of_the_Congo" title="Democratic Republic of the Congo on Wikipedia">DR Congo</a></td>
<td>£40 ~ €49 ~ $65 USD</td>
<td><a href="http://www.nic.cd/domain/register.jsp?indomain=ABCDEFGH" title="Whois and registration for abcdefgh.cd">whois and buy abcdefgh.cd</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.cg" title=".cg on Wikipedia">.cg</a></td>
<td><a href="http://en.wikipedia.org/wiki/Republic_of_the_Congo" title="Republic of the Congo on Wikipedia">Congo</a></td>
<td>£137 ~ €162 ~ $225 USD</td>
<td><a href="http://www.nic.cg/cgi-bin/search.pl" title="Whois and registration at nic.cg">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.ch" title=".ch on Wikipedia">.ch</a></td>
<td><a href="http://en.wikipedia.org/wiki/Switzerland" title="Switzerland on Wikipedia">Switzerland</a></td>
<td>£10 ~ €11 ~ $16 USD</td>
<td><a href="https://nic.switch.ch/reg/indexDEView.action" title="Whois and registration at switch.ch">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.cn" title=".cn on Wikipedia">.cn</a></td>
<td><a href="http://en.wikipedia.org/wiki/People's_Republic_of_China" title="People's Republic of China on Wikipedia">PR China</a></td>
<td>£24 ~ €29 ~ $40 USD</td>
<td><a href="http://www.godaddy.com/domains/" title="Whois and registration at GoDaddy">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.cr" title=".cr on Wikipedia">.cr</a></td>
<td><a href="http://en.wikipedia.org/wiki/Costa_Rica" title="Costa Rica on Wikipedia">Costa Rica</a></td>
<td>£48 ~ €58 ~ $80 USD</td>
<td><a href="https://www.nic.cr/niccr_publico/findDomain.do?dominio=abcdefgh&#038;codtipdom=8&#038;confirmrequestavailability=true&#038;submit=Continuar" title="Whois and registration at nic.cr - only in Spanish">whois and buy abcdefgh.cr</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.cv" title=".cv on Wikipedia">.cv</a></td>
<td><a href="http://en.wikipedia.org/wiki/Cape_Verde" title="Cape Verde on Wikipedia">Cape Verde</a></td>
<td>Unknown</td>
<td><a href="http://www.dns.cv/">instructions</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.cz" title=".cz on Wikipedia">.cz</a></td>
<td><a href="http://en.wikipedia.org/wiki/Czech_Republic" title="Czech Republic on Wikipedia">Czech Republic</a></td>
<td>£18 ~ €22 ~ $30 USD</td>
<td><a href="http://www.nic.cz/whois/?d=abcdefghi.cz" title="Whois">whois</a> or <a href="https://www.gandi.net/domain/buy/search/" title="Buy .cz domain from gandi.com">buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.dj" title=".dj on Wikipedia">.dj</a></td>
<td><a href="http://en.wikipedia.org/wiki/Djibouti" title="Djibouti on Wikipedia">Djibouti</a></td>
<td>£34 ~ €40 ~ $55 USD</td>
<td><a href="http://www.dj/scgi-bin/quiest.cgi?dn=abcdefgh" title="Whois and buy from www.dj">whois and buy abcdefgh.dj</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.dm" title=".dm on Wikipedia">.dm</a></td>
<td><a href="http://en.wikipedia.org/wiki/Dominica" title="Dominica on Wikipedia">Dominica</a></td>
<td>£90 ~ €105 ~ $150 USD</td>
<td><a href="https://www.domains.dm/" title="Whois and registration for .dm domain - BEWARE: expired security certificate">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.ec" title=".ec on Wikipedia">.ec</a></td>
<td><a href="http://en.wikipedia.org/wiki/Ecuador" title="Ecuador on Wikipedia">Ecuador</a></td>
<td>£30 ~ €35 ~ $50 USD</td>
<td><a href="https://www.nic.ec/reg/eng/paso1.asp" title="Whois and registration for .ec domain at nic.ec">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.es" title=".es on Wikipedia">.es</a></td>
<td><a href="http://en.wikipedia.org/wiki/Spain" title="Spain on Wikipedia">Spain</a></td>
<td>£17 ~ €20 ~ $28 USD</td>
<td><a href="http://www.register.es/" title="Whois and registration for .es domain at register.es">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.fm" title=".fm on Wikipedia">.fm</a></td>
<td><a href="http://en.wikipedia.org/wiki/Federated_States_of_Micronesia" title="Federated States of Micronesia on Wikipedia">Micronesia</a></td>
<td>£58 ~ €68 ~ $95 USD</td>
<td><a href="https://www.dot.fm/order0.cfm?domain=abcdefgh.fm&#038;tld=fm" title="Whois and registration for .fm domain at dot.fm">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.gg" title=".gg on Wikipedia">.gg</a></td>
<td><a href="http://en.wikipedia.org/wiki/Guernsey" title="Guernsey on Wikipedia">Guernsey</a></td>
<td>£88 ~ €104 ~ $145 USD</td>
<td><a href="http://www.channelisles.net/applic/application.shtml" title="Registration for .gg domain at channelisles.net">instructions</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.gl" title=".gl on Wikipedia">.gl</a></td>
<td><a href="http://en.wikipedia.org/wiki/Greenland" title="Greenland on Wikipedia">Greenland</a></td>
<td>£23 ~ €27 ~ $37 USD</td>
<td><a href="http://www.tele.gl/uk/Services/tele_services/Hostmaster/index.htm" title="Registration for .gl domain at tele.gl">instructions</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.gp" title=".gp on Wikipedia">.gp</a></td>
<td><a href="http://en.wikipedia.org/wiki/Guadelupe" title="Guadelupe on Wikipedia">Guadelupe</a></td>
<td>£51 ~ €60 ~ $84 USD</td>
<td><a href="http://www.nic.gp/index.php?action=subscribe" title="Whois and registration for .gp domain at nic.gp">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.gr" title=".gr on Wikipedia">.gr</a></td>
<td><a href="http://en.wikipedia.org/wiki/Greece" title="Greece on Wikipedia">Greece</a></td>
<td>£13 ~ €15 ~ $21 USD</td>
<td><a href="https://grweb.ics.forth.gr/Whois?lang=en" title="Whois at GR Hostmaster">whois</a> or <a href="http://www.netim.eu/domain/search.php?DOMAINE=abcdefgh.gr" title="Buy from">buy abcdefgh.gr</a> </td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.gs" title=".gs on Wikipedia">.gs</a></td>
<td><a href="http://en.wikipedia.org/wiki/South_Georgia_and_the_South_Sandwich_Islands" title="South Georgia and the South Sandwich Islands on Wikipedia">G&#038;S Islands</a></td>
<td>£33 ~ €39 ~ $55 USD</td>
<td><a href="http://www.name.com/name?domain=abcdefgh.gs" title="Whois and buy abcdefgh.gs at name.com">whois and buy abcdefgh.gs</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.gy" title=".gy on Wikipedia">.gy</a></td>
<td><a href="http://en.wikipedia.org/wiki/Guyana" title="Guyana on Wikipedia">Guyana</a></td>
<td>£30 ~ €35 ~ $50 USD</td>
<td><a href="https://secure.cctldnames.net/index.jsp" title="Whois and buy .gs domain at cctldnames.com">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.hk" title=".hk on Wikipedia">.hk</a></td>
<td><a href="http://en.wikipedia.org/wiki/Hong_Kong" title="Hong Kong on Wikipedia">Hong Kong</a></td>
<td>£20 ~ €23 ~ $32 USD</td>
<td><a href="https://www1.hkirc.hk/domain/NDN_N.jsp" title="Whois and buy .hk domain at hkirc.hk">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.hm" title=".hm on Wikipedia">.hm</a></td>
<td><a href="http://en.wikipedia.org/wiki/Heard_Island_and_McDonald_Islands" title="Heard and McDonald Islands on Wikipedia">H&#038;M Islands</a></td>
<td>£21 ~ €25 ~ $35 USD</td>
<td><a href="http://www.registry.hm/" title="Whois and buy .hm domain at registry.hm">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.hn" title=".hn on Wikipedia">.hn</a></td>
<td><a href="http://en.wikipedia.org/wiki/Honduras" title="Honduras on Wikipedia">Honduras</a></td>
<td>£90 ~ €105 ~ $150 USD</td>
<td><a href="http://nic.hn/registro.php" title="Whois and buy .hn domain at nic.hn">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.ht" title=".ht on Wikipedia">.ht</a></td>
<td><a href="http://en.wikipedia.org/wiki/Haiti" title="Haiti on Wikipedia">Haiti</a></td>
<td>£58 ~ €68 ~ $96 USD<sup><a href="#domain_list_note_hosting_plan" title="Price is based on the cheapest available hosting plan - not domain only">**</a></sup></td>
<td><a href="http://www.innter.net/order.center/oForm.php?domain_name=abcdefgh&#038;tld_id=418&#038;action=check_domain" title="Whois and buy abcdefgh.ht domain at innter.net">whois and buy abcdefgh.ht</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.im" title=".im on Wikipedia">.im</a></td>
<td><a href="http://en.wikipedia.org/wiki/Isle_of_Man" title="Isle of Man on Wikipedia">Isle of Man</a></td>
<td>£40 ~ €47 ~ $66 USD</td>
<td><a href="https://www.nic.im/public/newdomain.mth?initialdomain=abcdefgh.im" title="Whois and buy abcdefgh.ht domain at nic.im">whois and buy abcdefgh.im</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.in" title=".in on Wikipedia">.in</a></td>
<td><a href="http://en.wikipedia.org/wiki/India" title="India on Wikipedia">India</a></td>
<td>£2 ~ €3 ~ $4 USD</td>
<td><a href="http://www.name.com/name?domain=abcdefghijkl.in" title="Whois and buy abcdefghijkl.in domain at name.com">whois and buy abcdefghijkl.in</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.io" title=".io on Wikipedia">.io</a></td>
<td><a href="http://en.wikipedia.org/wiki/British_Indian_Ocean_Territory" title="British Indian Ocean Territory on Wikipedia">GB Indian Ocean</a></td>
<td>£60 ~ €71 ~ $99 USD</td>
<td><a href="http://www.nic.io/" title="Whois and buy .io domain at nic.io">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.is" title=".is on Wikipedia">.is</a></td>
<td><a href="http://en.wikipedia.org/wiki/Iceland" title="Iceland on Wikipedia">Iceland</a></td>
<td>£33 ~ €39 ~ $55 USD</td>
<td><a href="http://www.isnic.is/" title="Whois and buy .is domain at isnic.is">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.je" title=".je on Wikipedia">.je</a></td>
<td><a href="http://en.wikipedia.org/wiki/Jersey" title="Jersey on Wikipedia">Jersey</a></td>
<td>£88 ~ €104 ~ $145 USD</td>
<td><a href="http://www.channelisles.net/applic/application.shtml" title="Registration for .je domain at channelisles.net">instructions</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.km" title=".km on Wikipedia">.km</a></td>
<td><a href="http://en.wikipedia.org/wiki/Comoros" title="Comoros on Wikipedia">Comoros</a></td>
<td>£85 ~ €100 ~ $140 USD</td>
<td><a href="http://www.domaine.km/" title="Registration for .km domain at domaine.km">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.kz" title=".kz on Wikipedia">.kz</a></td>
<td><a href="http://en.wikipedia.org/wiki/Kazakhstan" title="Kazakhstan on Wikipedia">Kazakhstan</a></td>
<td>£18 ~ €21 ~ $30 USD</td>
<td><a href="http://www.nic.kz/cgi-bin/whois" title="Registration for .kz domain at nic.kz">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.la" title=".la on Wikipedia">.la</a></td>
<td><a href="http://en.wikipedia.org/wiki/Laos" title="Laos on Wikipedia">Laos</a></td>
<td>£30 ~ €37 ~ $50 USD</td>
<td><a href="https://www.la/?op=search&#038;domain=abcdefgh" title="Registration for abcdefgh.la domain at www.la">whois and buy abcdefgh.la</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.lc" title=".lc on Wikipedia">.lc</a></td>
<td><a href="http://en.wikipedia.org/wiki/Saint_Lucia" title="Saint Lucia on Wikipedia">Saint Lucia</a></td>
<td>£46 ~ €53 ~ $75 USD</td>
<td><a href="http://www.nic.lc/register.htm" title="Registration for .lc domain at nic.lc">instructions</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.li" title=".li on Wikipedia">.li</a></td>
<td><a href="http://en.wikipedia.org/wiki/Liechtenstein" title="Liechtenstein on Wikipedia">Liechtenstein</a></td>
<td>£10 ~ €11 ~ $16 USD</td>
<td><a href="https://nic.switch.ch/reg/indexDEView.action" title=Whois and registration at switch.ch">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.lt" title=".lt on Wikipedia">.lt</a></td>
<td><a href="http://en.wikipedia.org/wiki/Lithuania" title="Lithuania on Wikipedia">Lithuania</a></td>
<td>£85 ~ €100 ~ $140 USD</td>
<td><a href="http://www.eurodns.com/" title="Registration for .lt domain at eurodns.com">whois and buy</a></td>
</tr>
<tr>
<td colspan="4">&#8230;</td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.mu" title=".mu on Wikipedia">.mu</a></td>
<td><a href="http://en.wikipedia.org/wiki/Mauritius" title="Mauritius on Wikipedia">Mauritius</a></td>
<td>£60 ~ €72 ~ $100 USD</td>
<td><a href="https://secure.cctldnames.net/index.jsp" title="Whois and buy .mu domain at cctldnames.com">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.tl" title=".tl on Wikipedia">.tl</a></td>
<td><a href="http://en.wikipedia.org/wiki/East_Timor" title="East Timor on Wikipedia">East Timor</a></td>
<td>£21 ~ €25 ~ $35 USD</td>
<td><a href="https://secure.cctldnames.net/index.jsp" title="Whois and buy .tl domain at cctldnames.com">whois and buy</a></td>
</tr>
<tr>
<td><a href="http://en.wikipedia.org/wiki/.tv" title=".tv on Wikipedia">.tv</a></td>
<td><a href="http://en.wikipedia.org/wiki/Tuvalu" title="Tuvalu on Wikipedia">Tuvalu</a></td>
<td>£15 ~ €18 ~ $25 USD</td>
<td><a href="http://www.enom.tv/" title=Whois and registration at enom.tv">whois and buy</a></td>
</tr>
</tbody>
</table>
<p><em>Table not yet complete&#8230;</em></p>
<p>
Notes:</p>
<ul>
<li><sup id="domain_list_note_2_years">*</a></sup> 2 years minimum registration &#8211; listed priced here is half that</li>
<li><sup id="domain_list_note_hosting_plan">**</a></sup> Price is based on the cheapest available hosting plan &#8211; not domain only</li>
</ul>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.barklund.org/blog/2009/06/22/cctlds-for-second-level-foreign-registration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
