<?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>jalf.dk &#187; Meta</title>
	<atom:link href="http://jalf.dk/blog/category/meta/feed/" rel="self" type="application/rss+xml" />
	<link>http://jalf.dk/blog</link>
	<description>Musings and thoughts on programming and other geeky stuff</description>
	<lastBuildDate>Sun, 25 Mar 2012 09:51:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>I’m not dead!</title>
		<link>http://jalf.dk/blog/2012/01/im-not-dead/</link>
		<comments>http://jalf.dk/blog/2012/01/im-not-dead/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 15:41:07 +0000</pubDate>
		<dc:creator>jalf</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://jalf.dk/blog/?p=1019</guid>
		<description><![CDATA[I know, it’s been ages since I updated my blog. I started on a new job back in August, which took up a lot of my attention for the first couple of months. On the home front, things have been kind of busy too, and I’ve had less time than usual for programming, and writing [...]]]></description>
			<content:encoded><![CDATA[<p>I know, it’s been ages since I updated my blog.</p>

<p>I started on a new job back in August, which took up a lot of my attention for the first couple of months. On the home front, things have been kind of busy too, and I’ve had less time than usual for programming, and writing about programming.
<span id="more-1019"></span></p>

<p>But I’m not giving up on my blog. I just checked, and I have nearly as many draft posts lying around in various states of completion (47) as I’ve published (49). That is a lot of draft posts, and some of them are <em>nearly</em> finished.</p>

<p>So over the next weeks, I’ll see if I can’t wrap up a few of them, clearing out the backlog a bit and just making this place look a bit more “alive”.</p>
]]></content:encoded>
			<wfw:commentRss>http://jalf.dk/blog/2012/01/im-not-dead/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy new year — Hopes for 2010</title>
		<link>http://jalf.dk/blog/2009/12/happy-new-year-hopes-for-2010/</link>
		<comments>http://jalf.dk/blog/2009/12/happy-new-year-hopes-for-2010/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 17:00:29 +0000</pubDate>
		<dc:creator>jalf</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[new-year]]></category>

		<guid isPermaLink="false">http://jalf.dk/blog/?p=352</guid>
		<description><![CDATA[So it’s the new year. Yay! How time flies when you’re having fun. I don’t know about you, but I had a blast this last year. New (awesome) apartment, started on my thesis, launched this blog, and just generally had a good time. So how to follow it up? What can 2010 do to beat [...]]]></description>
			<content:encoded><![CDATA[<p>So it’s the new year. Yay! How time flies when you’re having fun.</p>

<p>I don’t know about you, but I had a blast this last year. New (awesome) apartment, started on my thesis, launched this blog, and just generally had a good time.</p>

<p>So how to follow it up? What can 2010 do to beat this?</p>

<p>Rather than coming up with a whole bunch of new year’s resolutions for myself, I thought it might be more interesting to reverse the process — and say what I’d like to see <em>others</em> do in the coming year.</p>

<p>Throughout the year, I’ve encountered a lot of software products that, for one reason or another, I’d like to see improve. Perhaps they simply suck currently, and desperately need to be fixed — or perhaps they’re already so good that I’m happy to use them, but I can think of further improvements that’d really make the “best in class”.</p>

<p>So for the next couple of days, I’ll post my thoughts on what I’d like to see from a few of these products during the coming year.</p>

<p>Hope you have a great new year’s eve! See you next year.</p>
]]></content:encoded>
			<wfw:commentRss>http://jalf.dk/blog/2009/12/happy-new-year-hopes-for-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenID 2.0 and HTTP redirects</title>
		<link>http://jalf.dk/blog/2009/12/openid-2-0-and-http-redirects/</link>
		<comments>http://jalf.dk/blog/2009/12/openid-2-0-and-http-redirects/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 23:48:36 +0000</pubDate>
		<dc:creator>jalf</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[openid]]></category>

		<guid isPermaLink="false">http://jalf.dk/blog/?p=417</guid>
		<description><![CDATA[Ever since I signed up on StackOverflow.com roughly a year ago, I’ve had an OpenID. On the whole, I think it’s a great concept, and I wish more sites would allow me to sign in with it. However, a few things have been bothering me about it. When I first signed up, I did a [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I signed up on <a href="http://stackoverflow.com/">StackOverflow.com</a> roughly a year ago, I’ve had an OpenID. On the whole, I think it’s a great concept, and I wish more sites would allow me to sign in with it.</p>

<p>However, a few things have been bothering me about it.<span id="more-417"></span></p>

<p>When I first signed up, I did a bit of research, and found out that you can use your own domain as your OpenID. You simply enter the following in a <code>&lt;head&gt;</code> of a HTML page you control:</p>

<pre><code>&lt;link rel="openid.server" href="http://myopenidprovider" /&gt;
&lt;link rel="openid.delegate" href="http://myopenid-at-that-provider/" /&gt;
</code></pre>

<p>And the URI of that HTML page can now be used as your OpenID. It will forward authentication requests to the specified provider. This gave me a nice clean URI to use as my OpenID, and as a bonus, it meant that I could change my OpenID provider and keep my ID, just by editing this HTML.</p>

<p>Of course, I quickly found out there was a downside as well. When I created this blog, I placed it in <code>http://jalf.dk/blog</code>. I figured I could easily add a redirect from <code>http://jalf.dk</code> and so it wouldn’t matter in the long run.</p>

<p>When I tried adding this redirect, I realized that this of course would also redirect any OpenID requests. My OpenID provider would then see a login attempt from <code>http://jalf.dk/blog</code> instead, and all hell would break loose.</p>

<p>So I removed the redirect, and instead placed this message in <code>http://jalf.dk/</code> along with the OpenID <code>&lt;link&gt;</code> tags:</p>

<blockquote>
  <p>Please go <a href="http://jalf.dk/blog/">here</a> for my blog. Sorry for the lack of a proper redirect.</p>
</blockquote>

<p>Not very elegant, but it worked. OpenID requests were handled correctly, and readers of my blog could follow the link, or just bookmark <code>/blog</code> in the first place.</p>

<p>Today, a friend asked me why I didn’t have a redirect, and I explained the above problem. I didn’t think about it any further until half an hour ago, when I realized that Facebook can be tied to an OpenID account. As I said before, the more services I can log in to with my OpenID, the better, so I attempted to add my OpenID… And got a nasty error message telling me that my OpenID only supported version 1.1, and Facebook required 2.0.</p>

<p>Geez, I hadn’t even realized there were multiple versions.</p>

<p>So I went hunting for a solution. And it turned out to be pretty simple, and have the nice side effect of solving the redirection problem as well!</p>

<p>It turns out that the <code>&lt;link&gt;</code> tags embedded in HTML only work for OpenID 1.0 and 1.1. For 2.0, you have to provide a YADIS XML file when a request is sent with the MIME-type <code>application/xrds+xml</code>.</p>

<p>Unfortunately, there seems to be very few examples online of what this file should <em>look like</em>.
I did find a nice example of using a YADIS file for OpenID 1.0 <a href="http://blog.paulisageek.com/2009/06/easy-openid-delegation-with-yadis.html">here</a>, which got me started. The Wikipedia article on <a href="http://en.wikipedia.org/wiki/Yadis">YADIS</a> held another example, but again only with OpenID 1.0. However, it also shows how to specify LID 2.0, so while I have no clue what LID is for, at least it gave a hint of how to support multiple versions.</p>

<p>Finally, diving into the <a href="http://openid.net/specs/openid-authentication-2_0.html">specification for OpenID 2.0</a>, I discovered the correct URI to specify as <code>&lt;Type&gt;</code> in the YADIS file: <code>http://specs.openid.net/auth/2.0</code>. Of course they just <em>had</em> to change the URI format between versions 1.1 and 2.0. Nothing is ever that easy.</p>

<p>But with this, the last piece fell into place. I created an <code>openid.xml</code> file looking like this:</p>

<pre><code>< ?xml version="1.0" encoding="UTF-8"?>
&lt;xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)"
xmlns:openid="http://openid.net/xmlns/1.0"&gt;
  &lt;XRD&gt;
    &lt;Service priority="50"&gt;
      &lt;Type&gt;http://specs.openid.net/auth/2.0/signon&lt;/Type&gt;
      &lt;URI&gt;http://myopenidprovider&lt;/URI&gt;
      &lt;openid:Delegate&gt;http://myopenid-at-that-provider/&lt;/openid:Delegate&gt;
    &lt;/Service&gt;
    &lt;Service priority="20"&gt;
      &lt;Type&gt;http://openid.net/signon/1.1&lt;/Type&gt;
      &lt;URI&gt;http://myopenidprovider&lt;/URI&gt;
      &lt;openid:Delegate&gt;http://myopenid-at-that-provider/&lt;/openid:Delegate&gt;
    &lt;/Service&gt;
    &lt;Service priority="10"&gt;
      &lt;Type&gt;http://openid.net/signon/1.0&lt;/Type&gt;
      &lt;URI&gt;http://myopenidprovider&lt;/URI&gt;
      &lt;openid:Delegate&gt;http://myopenid-at-that-provider/&lt;/openid:Delegate&gt;
    &lt;/Service&gt;
  &lt;/XRD&gt;
&lt;/xrds:XRDS&gt;
</code></pre>

<p>and using the PHP snippet from <a href="http://blog.paulisageek.com/2009/06/easy-openid-delegation-with-yadis.html">paulisageek</a>, which, if the content-type <code>application/xrds+xml</code> is detected, returns the contents of the <code>YADIS</code> file (and for any other content-type, simply forwards to <code>/blog</code>).</p>

<pre><code>< ?php
if (strpos($_SERVER['HTTP_ACCEPT'], "application/xrds+xml") !== FALSE) {
  header("Content-Type: application/xrds+xml");
  echo file_get_contents("openid.xml");
}
else {
  header("Location: http://jalf.dk/blog");
}
?>
</code></pre>

<p>I now have:</p>

<ul>
<li>The same nice, short, easy-to-remember OpenID URI I always had</li>
<li>My blog accessible form <code>http://jalf.dk</code></li>
<li>My Facebook account linked to my OpenID</li>
<li>Support for OpenID version 2.0</li>
</ul>

<p>All in all, I’m happy. And now that I’ve documented the process, perhaps the next person who runs into this problem may be a bit happier too.</p>
]]></content:encoded>
			<wfw:commentRss>http://jalf.dk/blog/2009/12/openid-2-0-and-http-redirects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Spam spam spam spam spam spam</title>
		<link>http://jalf.dk/blog/2009/08/spam-spam-spam-spam-spam-spam/</link>
		<comments>http://jalf.dk/blog/2009/08/spam-spam-spam-spam-spam-spam/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 12:05:33 +0000</pubDate>
		<dc:creator>jalf</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://jalf.dk/blog/?p=273</guid>
		<description><![CDATA[Looks like the spammers found me. Just had to delete 10 spam comments that appeared overnight. What a shame. I’m going to try enabling the Akismet antispam plugin. Hopefully it doesn’t mark real comments as spam. If it does, my apologies. Let me know and I’ll beat it into submission.]]></description>
			<content:encoded><![CDATA[<p>Looks like the spammers found me. Just had to delete 10 spam comments that appeared overnight. What a shame. I’m going to try enabling the Akismet antispam plugin. Hopefully it doesn’t mark real comments as spam. If it does, my apologies. Let me know and I’ll beat it into submission.</p>
]]></content:encoded>
			<wfw:commentRss>http://jalf.dk/blog/2009/08/spam-spam-spam-spam-spam-spam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Markdown and web typography</title>
		<link>http://jalf.dk/blog/2009/07/markdown-and-web-typography/</link>
		<comments>http://jalf.dk/blog/2009/07/markdown-and-web-typography/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 01:11:14 +0000</pubDate>
		<dc:creator>jalf</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[typography]]></category>
		<category><![CDATA[web-design]]></category>

		<guid isPermaLink="false">http://jalf.dk/blog/?p=33</guid>
		<description><![CDATA[As a general rule, I swore years ago to stay as far away from web design and web development as at all possible. I still believe that this is one of the fundamental rules of happiness, and I haven’t regretted it, but for once, I was actually impressed (rather than depressed, which is what web [...]]]></description>
			<content:encoded><![CDATA[<p>As a general rule, I swore years ago to stay as far away from web design and web development as at all possible. I still believe that this is one of the fundamental rules of happiness, and I haven’t regretted it, but for once, I was actually <em>impressed</em> (rather than <em>de</em>pressed, which is what web development usually makes me feel like) with a few pieces of web design, and so I decided to make an exception and talk about it for a moment.</p>

<p>After launching this blog earlier today, I spent a bit of time researching how to get a more intuitive syntax for formatting my posts. I’m not really a fan of “rich text” text editors like the one WordPress uses by default (luckily it can be disabled). It offers limited control, is awkward to use, and just doesn’t lend itself to well-formatted posts.</p>

<p>So I decided to look for alternatives.</p>

<p><span id="more-33"></span> 
One source of inspiration is obviously LaTeX, which just does a ton of formatting automatically — converting quotes and adjusting spacing, hyphenation rules and a bunch of other fancy features. It also automatically converts multiple dashes to their typographic equivalents — a single dash is just rendered as a minus, two of them (<code>--</code>) as an en-dash, and three (<code>---</code>) as an em-dash.</p>

<p>I’ve also been very impressed with the formatting syntax used on <a href="http://stackoverflow.com">StackOverflow.com</a> for its simplicity and ease of use, and I happen to know they use Markdown to achieve it.</p>

<p>So those were things I went looking for in the WordPress plugin jungle, and those are pretty much what I came back with.</p>

<p>The <a href="http://wordpress.org/extend/plugins/wp-typography/">wp-typography</a> plugin takes care of much of the general typographic formatting, including hyphenation, converting single and double quotes, and even guessing at the correct type of dashes (so a <code>-</code> between words is rendered as an em-dash, exactly as it should be).</p>

<p>And the <a href="http://michelf.com/projects/php-markdown/">PHP Markdown Extra</a> plugin did the rest, giving me control over the formatting. With the Markdown plugin, I can format text freely without having to mess around with buttons above the editor textbox, and without having to use the “Visual” view which I’ve never trusted.</p>

<p>Instead, *text surrounded by asterisks* is automatically <em>emphasised</em> and  **double asterisks** becomes <strong>bolded</strong>.</p>

<p>Block quotes are written the way email replies typically did it: Starting each line with a <code>&gt;</code>, so this:</p>

<p>&gt; Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna<br />
&gt; aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex<br />
&gt; ea commodo consequat</p>

<p>ends up looking like this:</p>

<blockquote>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
  aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex 
  ea commodo consequat</p>
</blockquote>

<p>Since I’m likely to end up posting quite a bit of code snippets here, it’s worth mentioning the lovely simple syntax for that as well. Inline code is simply surrounded by backticks (‘), so ‘sqrt(42.0f);‘ ends up looking like this: <code>sqrt(42.0f);</code>.</p>

<p>Block code can be done either by starting and ending the block with a line with three tilde characters:</p>

<pre><code>~~~  
int foo() {  
  return 42;  
}  
~~~  
</code></pre>

<p>Or by starting each line with 4 or more spaces:</p>

<pre><code>    int foo() {  
      return 42;  
    }  
</code></pre>

<p>and ends up looking like this:</p>

<pre><code>int foo() {
  return 42;
}
</code></pre>

<p>Lists can be created just by starting each line with a dash:</p>

<p>- a<br />
– b<br />
– c</p>

<p>Will look like:</p>

<ul>
<li>a</li>
<li>b</li>
<li>c</li>
</ul>

<p>And links can be created like this:</p>

<pre><code>[this is a link](http://google.com)
</code></pre>

<p>and the result: <a href="http://google.com">this is a link</a></p>

<p>Horizontal rules can be placed just by writing three asterisks on a line by themselves:</p>

<p>***</p>

<p>ends up looking like</p>

<hr />

<p>The overall effect is quite simply that the raw unformatted text still looks perfectly readable. It looks much like what you’d see in ASCII-only emails. And that I can format my posts easily and the end result actually looks nice!</p>

<p>If you see any badly formatted text on this site, you can now rest safe in the knowledge that it’s just me being bad at typography and layout. It’s my fault, and mine alone. The WordPress WYSIWYG editor is no longer an issue.</p>

<p>So a big thank you to the developers of those two plugins for making my blog posts look a hell of a lot nicer than they would if it’d been left to WordPress alone.</p>
]]></content:encoded>
			<wfw:commentRss>http://jalf.dk/blog/2009/07/markdown-and-web-typography/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hi!</title>
		<link>http://jalf.dk/blog/2009/07/hi/</link>
		<comments>http://jalf.dk/blog/2009/07/hi/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 19:38:19 +0000</pubDate>
		<dc:creator>jalf</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://jalf.dk/blog/?p=6</guid>
		<description><![CDATA[Here we go again! I think this is probably my third attempt at blogging. Hopefully I won’t get distracted this time. At least I’ve got a handful of topics lined up this time, and honestly, how hard can it be? It’s just writing stuff! :p So yeah, welcome to my blog!]]></description>
			<content:encoded><![CDATA[<p>Here we go again!</p>

<p>I think this is probably my third attempt at blogging. Hopefully I won’t get distracted this time. At least I’ve got a handful of topics lined up this time, and honestly, how hard can it be? It’s just writing stuff! :p</p>

<p>So yeah, welcome to my blog!</p>
]]></content:encoded>
			<wfw:commentRss>http://jalf.dk/blog/2009/07/hi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

