<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" version="2.0" xml:base="http://www.solitude.dk">
<channel>
 <title>Andreas Haugstrup Pedersen | solitude.dk</title>
 <link>http://www.solitude.dk</link>
 <description />
 <language>en</language>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/solitudedk" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="solitudedk" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
 <title>People who are confused with each other in our home #1</title>
 <link>http://www.solitude.dk/archives/20091129-0452</link>
 <description>&lt;p class="center"&gt;&lt;img src="http://www.solitude.dk/archives/files/2009/confusing1.jpg" width="500" height="265" alt="" class="center" /&gt;&lt;/p&gt;
&lt;p&gt;Ralph Fiennes, Alan Cumming &amp; Liam Neeson&lt;/p&gt;</description>
 <comments>http://www.solitude.dk/archives/20091129-0452#comments</comments>
 <category domain="http://www.solitude.dk/tag/confusing%20people">confusing people</category>
 <pubDate>Sun, 29 Nov 2009 12:52:05 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">467 at http://www.solitude.dk</guid>
</item>
<item>
 <title>Ten (love) songs from my iTunes library with parentheses</title>
 <link>http://www.solitude.dk/archives/20091119-1446</link>
 <description>&lt;p&gt;In no particular order here are ten love songs from my iTunes library &lt;strong&gt;that all have parentheses in their titles&lt;/strong&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You're So Square (Baby, I Don't Care)&lt;/strong&gt;—Buddy Holly&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;My Mistake (Was to Love You)&lt;/strong&gt;—Marvin Gaye&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;(Night Time Is) The Right Time&lt;/strong&gt;—Ray Charles&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Anyway You Want Me (That's How I Will Be)&lt;/strong&gt;—Elvis Presley&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wishing (If I Had a Photograph of You)&lt;/strong&gt;—A Flock of Seagulls&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gimme! Gimme! Gimme! (A Man After Midnight)&lt;/strong&gt;—ABBA&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lady (You Bring Me Up)&lt;/strong&gt;—The Commodores&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ready or Not Here I Come (Can't Hide from Love)&lt;/strong&gt;—The Delfonics&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How Sweet It Is (To Be Loved By You)&lt;/strong&gt;—Marvin Gaye&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;You Won't Be Satisfied (Until You Break My Heart)&lt;/strong&gt;—Louis Armstrong&lt;/li&gt;
&lt;/ul&gt;</description>
 <comments>http://www.solitude.dk/archives/20091119-1446#comments</comments>
 <category domain="http://www.solitude.dk/tag/music">music</category>
 <pubDate>Thu, 19 Nov 2009 22:46:33 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">466 at http://www.solitude.dk</guid>
</item>
<item>
 <title>Lucky Star</title>
 <link>http://www.solitude.dk/archives/20091021-0159</link>
 <description>&lt;div class="hvlog"&gt; &lt;a href="http://www.solitude.dk/archives/files/2009/cinemateket.mov" rel="enclosure"&gt; &lt;img src="http://www.solitude.dk/archives/files/2009/cinemateket.jpg"&gt;&lt;/a&gt; &lt;/div&gt;
&lt;p&gt;&lt;a href="http://videoblogging.info/"&gt;More lumiere videos&lt;/a&gt;.&lt;/p&gt;</description>
 <comments>http://www.solitude.dk/archives/20091021-0159#comments</comments>
 <category domain="http://www.solitude.dk/tag/lumierevideo">lumierevideo</category>
 <pubDate>Wed, 21 Oct 2009 08:59:22 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">465 at http://www.solitude.dk</guid>
<enclosure url="http://www.solitude.dk/archives/files/2009/cinemateket.mov" length="5443760" type="video/quicktime" /><media:content url="http://www.solitude.dk/archives/files/2009/cinemateket.mov" fileSize="5443760" type="video/quicktime" /></item>
<item>
 <title>Handling special characters in Drupal mail headers</title>
 <link>http://www.solitude.dk/archives/20090909-1325</link>
 <description>&lt;p&gt;Drupal is usually great at handling special characters. Unlike &lt;a href="http://wordpress.org/"&gt;other systems&lt;/a&gt; everything has always worked out of the box for me in Drupal. Recently however I did end up with an edge case involving mail headers.&lt;/p&gt;
&lt;p&gt;What I wanted to do was to send a nicely formatted From-header so the site name would show up instead of just the e-mail address. The header could for example look like this: &lt;code&gt;From: Mÿ Fäncÿ Sitë &amp;lt;mail@example.com&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;As e-mail headers can only contain US-ASCII characters any special characters needs to be escaped, but Drupal does this automatically, right? Yes and no. Drupal does run all mail headers through &lt;a href="http://api.drupal.org/api/function/mime_header_encode"&gt;&lt;code&gt;mime_header_encode()&lt;/code&gt;&lt;/a&gt; to escape non-US-ASCII characters. In our case that results in:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;From: =?UTF-8?B?TcO/IEbDpG5jw78gU2l0w6sgPG1haWxAZXhhbXBsZS5jb20+?=&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It's a little more garbled than it should be. A correctly formatted header in our case would be:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;From: =?UTF-8?B?TcO/IEbDpG5jw78gU2l0w6s=?= &amp;lt;mail@example.com&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see the "name" of the from-address should be escaped with all the &lt;a href="http://www.rfc-editor.org/rfc/rfc2047.txt"&gt;UTF-8 magic&lt;/a&gt;, but the e-mail address itself should not be encoded. E-mail clients handle these malformed headers badly—often showing no From-name at all or showing a part of the following header as the From-name.&lt;/p&gt;
&lt;p&gt;The solution is to do the encoding yourself before sending the header off to &lt;a href="http://api.drupal.org/api/function/drupal_mail"&gt;&lt;code&gt;drupal_mail()&lt;/code&gt;&lt;/a&gt;. In our case it would look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$from = mime_header_encode('Mÿ Fäncÿ Sitë'). ' &amp;lt;mail@example.com&amp;gt;';&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This of course means that the name is runs through the encode twice—once by you and once by &lt;code&gt;drupal_mail()&lt;/code&gt;. Fortunately, &lt;code&gt;mime_header_encode()&lt;/code&gt; is smart enough to only encode strings which contain non-US-ASCII characters and you can safely run strings through it multiple times without risking double-encoding issues.&lt;/p&gt;</description>
 <comments>http://www.solitude.dk/archives/20090909-1325#comments</comments>
 <category domain="http://www.solitude.dk/tag/drupal">drupal</category>
 <pubDate>Sat, 17 Oct 2009 21:26:43 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">463 at http://www.solitude.dk</guid>
</item>
<item>
 <title>Drupal Day in Copenhagen October 3rd</title>
 <link>http://www.solitude.dk/archives/20090917-1308</link>
 <description>&lt;p&gt;It's been too long since we had a Drupal event in Copenhagen so on October 3 the Drupal Denmark association is putting on a &lt;a href="http://drupaldag.dk/"&gt;Drupal Day&lt;/a&gt;. It'll be a one-day, free event in Barcamp-style with all kinds of Drupal goodness. Come meet us all, we don't bite!&lt;/p&gt;</description>
 <comments>http://www.solitude.dk/archives/20090917-1308#comments</comments>
 <category domain="http://www.solitude.dk/tag/copenhagen">copenhagen</category>
 <category domain="http://www.solitude.dk/tag/drupal">drupal</category>
 <pubDate>Thu, 17 Sep 2009 20:08:29 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">464 at http://www.solitude.dk</guid>
</item>
<item>
 <title>joey19w please pick up your mail</title>
 <link>http://www.solitude.dk/archives/20090717-0345</link>
 <description>&lt;p class="center"&gt;&lt;img src="http://www.solitude.dk/archives/files/2009/email.png" width="543" height="327" alt="" class="center" /&gt;&lt;/p&gt;</description>
 <comments>http://www.solitude.dk/archives/20090717-0345#comments</comments>
 <category domain="http://www.solitude.dk/tag/spam">spam</category>
 <pubDate>Fri, 17 Jul 2009 10:45:37 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">462 at http://www.solitude.dk</guid>
</item>
<item>
 <title>Anniversaries and new beginnings</title>
 <link>http://www.solitude.dk/archives/20090620-1448</link>
 <description>&lt;p&gt;&lt;img src="http://www.solitude.dk/archives/files/2009/businesscard.jpg" class="right"&gt;&lt;a href="http://videoblogging.info/"&gt;The lumiere project&lt;/a&gt; has been a collection of soundless minutes for two years now with &lt;a href="http://brittanyshoot.com/"&gt;Brittany&lt;/a&gt; and I collecting videos. The project is still going strong in no small part due to continued participation and support from talented people like &lt;a href="http://www.somedancersandmusicians.com/vlog/ScenesOfProvincialLife.cgi"&gt;Michael&lt;/a&gt; and &lt;a href="http://patalab02.blogspot.com/"&gt;Sam&lt;/a&gt;. The first four videos are still online showing rusty tools and cars moving slowly (&lt;a href="http://www.solitude.dk/archives/20070522-2220"&gt;1&lt;/a&gt;, &lt;a href="http://www.solitude.dk/archives/20070522-2337"&gt;2&lt;/a&gt;, &lt;a href="http://www.solitude.dk/archives/20070523-0837"&gt;3&lt;/a&gt;, &lt;a href="http://www.solitude.dk/archives/20070526-0152"&gt;4&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;In the department on non-moving, non-digital images &lt;a href="http://factorytakeover.com/"&gt;factory takeover&lt;/a&gt; has turned one year old. It is full of images from the household's old cameras and it is a very fun thing to produce. The latest addition is a Lubitel 166 and I'm enjoying the medium format film.&lt;/p&gt;
&lt;p&gt;This year's the new project is the new &lt;a href="http://hoisthq.com/"&gt;Hoist&lt;/a&gt; that I mentioned in my previous post. We have taken all the things we learned from making collaboration software for two years and applied it to the new product and the result is software that works like you (rather than software that dictates how you should work). It's a new paradigm for collaboration where the individual is empowered in a way you don't usually see. I'm very excited about showing off the result of 5 months development off next week when we start holding workshops.&lt;/p&gt;</description>
 <comments>http://www.solitude.dk/archives/20090620-1448#comments</comments>
 <category domain="http://www.solitude.dk/tag/hoist">hoist</category>
 <category domain="http://www.solitude.dk/tag/lumiere">lumiere</category>
 <category domain="http://www.solitude.dk/tag/photography">photography</category>
 <pubDate>Sat, 20 Jun 2009 21:48:26 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">461 at http://www.solitude.dk</guid>
</item>
<item>
 <title>Executing javascript in Drupal after node is posted</title>
 <link>http://www.solitude.dk/archives/20090619-0048</link>
 <description>&lt;p&gt;The day are busy at &lt;a href="http://hoisthq.com/"&gt;Hoist&lt;/a&gt;. We are ready to launch our new work tool very soon (workshops are held next week with few spots left—let me know if you're interested).&lt;/p&gt;
&lt;p&gt;Working on the user interface goodness I needed to execute some javascript immediately after a node has been posted in Drupal. The javascript should not be included on every node view, only the first. The nodeapi's 'insert' operation can't be used to include javascript because there is a redirect after it is processed and the 'view' operation can't tell if a node is brand new or not.&lt;/p&gt;
&lt;p&gt;The solution I used is to set a session variable. It feels a little hackish, but it works great.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;function yourmodule_nodeapi(&amp;$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($op == 'insert') {
    $_SESSION['yourmodule'][$node-&gt;nid] = $node-&gt;nid;
  }
  if ($op == 'view' &amp;&amp; $_SESSION['yourmodule'][$node-&gt;nid]) {
    // Insert call to drupal_add_js() here.
    unset($_SESSION['yourmodule'][$node-&gt;nid]);
  }
}&lt;/code&gt;&lt;/pre&gt;</description>
 <comments>http://www.solitude.dk/archives/20090619-0048#comments</comments>
 <category domain="http://www.solitude.dk/tag/drupal">drupal</category>
 <category domain="http://www.solitude.dk/tag/geekout">geekout</category>
 <category domain="http://www.solitude.dk/tag/javascript">javascript</category>
 <pubDate>Fri, 19 Jun 2009 07:48:47 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">460 at http://www.solitude.dk</guid>
</item>
<item>
 <title>Caged</title>
 <link>http://www.solitude.dk/archives/20090523-1418</link>
 <description>&lt;div class="hvlog"&gt; &lt;a href="http://www.solitude.dk/archives/files/2009/caged.mov" rel="enclosure"&gt; &lt;img src="http://www.solitude.dk/archives/files/2009/caged.jpg"&gt;&lt;/a&gt; &lt;/div&gt;
&lt;p&gt;&lt;a href="http://videoblogging.info/"&gt;Lumiere video&lt;/a&gt;.&lt;/p&gt;</description>
 <comments>http://www.solitude.dk/archives/20090523-1418#comments</comments>
 <category domain="http://www.solitude.dk/tag/lumierevideo">lumierevideo</category>
 <pubDate>Sat, 23 May 2009 21:17:39 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">459 at http://www.solitude.dk</guid>
<enclosure url="http://www.solitude.dk/archives/files/2009/caged.mov" length="7195843" type="video/quicktime" /><media:content url="http://www.solitude.dk/archives/files/2009/caged.mov" fileSize="7195843" type="video/quicktime" /></item>
<item>
 <title>Lines</title>
 <link>http://www.solitude.dk/archives/20090523-1417</link>
 <description>&lt;div class="hvlog"&gt; &lt;a href="http://www.solitude.dk/archives/files/2009/lines.mov" rel="enclosure"&gt; &lt;img src="http://www.solitude.dk/archives/files/2009/lines.jpg"&gt;&lt;/a&gt; &lt;/div&gt;
&lt;p&gt;&lt;a href="http://videoblogging.info/"&gt;Lumiere video&lt;/a&gt;.&lt;/p&gt;</description>
 <comments>http://www.solitude.dk/archives/20090523-1417#comments</comments>
 <category domain="http://www.solitude.dk/tag/lumierevideo">lumierevideo</category>
 <pubDate>Sat, 23 May 2009 21:17:03 +0000</pubDate>
 <dc:creator>andreas</dc:creator>
 <guid isPermaLink="false">458 at http://www.solitude.dk</guid>
<enclosure url="http://www.solitude.dk/archives/files/2009/lines.mov" length="8031494" type="video/quicktime" /><media:content url="http://www.solitude.dk/archives/files/2009/lines.mov" fileSize="8031494" type="video/quicktime" /></item>
<media:rating>nonadult</media:rating></channel>
</rss>
