<?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>some random text about funky things &#187; Web</title>
	<atom:link href="http://janpaulposma.nl/category/web/feed" rel="self" type="application/rss+xml" />
	<link>http://janpaulposma.nl</link>
	<description>by Jan Paul Posma</description>
	<lastBuildDate>Sun, 08 Jan 2012 22:01:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Help, I want to change Wikipedia!</title>
		<link>http://janpaulposma.nl/help-i-want-to-change-wikipedia</link>
		<comments>http://janpaulposma.nl/help-i-want-to-change-wikipedia#comments</comments>
		<pubDate>Wed, 30 Nov 2011 17:09:55 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://janpaulposma.nl/?p=573</guid>
		<description><![CDATA[Wikipedia has a problem. The number of active volunteers has been slowly decreasing for a couple of years. There are several reasons for this, and one of them is that it has become more difficult to edit Wikipedia. When you click the &#8220;Edit&#8221; button on some page, one expects to see an interface like Microsoft [...]]]></description>
			<content:encoded><![CDATA[<p>Wikipedia has a problem. The number of active volunteers has been slowly decreasing for a couple of years. There are several reasons for this, and one of them is that it has become more difficult to edit Wikipedia. When you click the &#8220;Edit&#8221; button on some page, one expects to see an interface like Microsoft Word or Google Docs. Exactly the same appearance as when viewing the page, only now with a cursor and controls to edit the text and insert links and media. However, the opposite is true: you see a huge text box containing something that looks like a programming language.</p>
<p><a href="http://janpaulposma.nl/wp-content/uploads/2011/11/traditional.png" class="lightbox"><img src="http://janpaulposma.nl/wp-content/uploads/2011/11/traditional-300x155.png" alt="Traditional wikitext editor" title="Traditional wikitext editor" width="300" height="155" class="alignnone size-medium wp-image-575" /></a></p>
<p><span id="more-573"></span></p>
<p>For my bachelor&#8217;s thesis at the <a href="http://www.rug.nl/corporate/index?lang=en">University of Groningen</a> I investigated ways of improving this experience of editing Wikipedia. Why doesn&#8217;t it already use a visual editor such as Google Docs? This has everything to do with <a href="http://en.wikipedia.org/wiki/Wiki_markup">wikitext</a>, this language you see when editing a page. Wikitext is the language in which pages on several wikis, including Wikipedia, are stored and edited. Once you save a page, this wikitext gets translated into HTML, the language used by web browsers to show a page.</p>
<p>Wikipedia was founded in 2001, just after the internet bubble, but before people were speaking of a Web 2.0. Back then it made sense to use such a language as wikitext. Microsoft Word already existed, but an online variant simply wasn&#8217;t there yet. The techniques and standards for such an interface on the web were not developed yet, and only some early experimental designs were being tested. It was possible to use simple text boxes in web browsers, though, so initially this was used to edit pages. To be able to apply some markup to pages, some codes were introduced, such as <code>'''</code><strong>bold</strong><code>'''</code>, <code>''</code><em>italic</em>&#8221;, <code>[[</code><a href="#">link</a><code>]]</code>, and <span style="font-size: 120%; font-weight: bold;"><code>==</code> heading <code>==</code></span>. These codes were translated into HTML by means of substitution: first occurrences of <code>'''</code> were replaced by <code>&lt;b&gt;</code> and <code>&lt;/b&gt;</code>, the HTML tags denoting bold tags. Similarly the other codes were replaced by their harder to read HTML equivalents.</p>
<p>Because Wikipedia was growing rapidly, it became necessary to extend this list of codes to make common tasks easier, such as maintaining lists of references, including info boxes placed at the top right of pages, and so on. These additions were essential to Wikipedia&#8217;s volunteers, but at the same time the wikitext language became ever more convoluted.</p>
<p>Now, however, people are expecting something better than a huge text box. To make it easier for potential volunteers to contribute, it is necessary to offer an interface that is widely known, such as a visual editor. On the other hand, it isn&#8217;t desirable to get rid of wikitext completely, as this would alienate tens of thousands currently active contributors, who are used to this language. A better solution would be to still store the pages in wikitext, but to offer both ways of editing: visual editor for new users, and traditional wikitext editing for existing users.</p>
<p>However, building a visual editor on top of wikitext is easier said than done. This is because of the way wikitext is transformed to HTML, with a number of subsequent substitutions. A common way of building a visual editor on top of a language, is by using an intermediate representation of the text, called a document tree or syntax tree. Such a tree represents the page in a hierarchical way. A page contains paragraphs, paragraphs contain sentences, and sentences contain pieces of text, links, media, and so on. Alas, wikitext can&#8217;t be described by such a hierarchical model, because these substitutions make sure there is no such thing as <em>wrong</em> wikitext. There are even substitutions that fix common mistakes, such as <code>'''bold [[link''']]</code>. This is equivalent to <code>'''bold [[link]]'''</code>, which <em>has</em> a defined hierarchy: the link is inside the bold text. In the former example, this hierarchy is not present: the bold text ends before the link element is closed.</p>
<p>While this is a silly example, there are more <a href="http://www.wikisym.org/ws2011/_media/proceedings:p72-dohrn.pdf">complex cases</a>, which are widely used in Wikipedia. There are people <a href="http://www.mediawiki.org/wiki/Wikitext.next">working</a> on a intermediate representation that <em>does</em> allow for these kinds of cases, but as this is quite difficult it may take a while.</p>
<p>For my thesis I investigated if it&#8217;s perhaps possible to build a different kind of interface instead of a visual editor, which is both easy to use and easier to implement on top of wikitext. Eventually I arrived at a compromise: users get to see the same page when editing as when viewing, but they can&#8217;t edit it directly. Instead, there are some explicitly marked elements on the page that are editable, such as sentences, paragraphs, lists, info boxes, etc. Such editable elements are marked by either a light blue background colour, or in case of larger elements such as paragraphs, by a bar at the left of the element. When a user moves the mouse over such an element, it lights up in a darker colour, indicating it can be clicked.</p>
<p><a href="http://janpaulposma.nl/wp-content/uploads/2011/11/editor.png" class="lightbox"><img src="http://janpaulposma.nl/wp-content/uploads/2011/11/editor-300x271.png" alt="In-line editor" title="In-line editor" width="300" height="271" class="alignnone size-medium wp-image-599" /></a></p>
<p>Once clicked, a popup appears with the <em>original</em> wikitext for that element. Once the user has edited the wikitext and confirmed the change, the popup disappears and the page is updated with the new content.</p>
<p><img src="http://janpaulposma.nl/wp-content/uploads/2011/11/basic.png" alt="Basic idea for in-line editing" title="Basic idea for in-line editing" width="423" height="169" class="alignnone size-full wp-image-592" /></p>
<p>Now, the user still has to edit wikitext, but in much smaller quantities. The idea is that there are not so many complex codes inside a single sentence or even paragraph, which makes it a lot less scary for potential volunteers to play around with a page. Also, the direct feedback when editing a small piece of wikitext may help in this, as it immediately clear what effect the changed wikitext has on the page.</p>
<p>The big advantage is that it&#8217;s not required to use an intermediate representation when generating such an interface. It&#8217;s only necessary to know for the editable elements to which parts of the original wikitext they correspond. For example, if it is known for a certain paragraph in the HTML output to which exact lines in the wikitext it corresponds, then we can show this wikitext when clicking the paragraph on the HTML page, and replace it when the user changes this wikitext.</p>
<p>To get the correspondence between wikitext and HTML I use a trick: <em>annotation</em>. Before the wikitext is transformed to HTML, I add some codes to it to mark some positions. These codes are chosen in such a way that they are not transformed into anything else, and they are also all unique. They are placed around basic elements, such as paragraphs, sentences, in fact everything we want to make editable and is easy to recognise. For every added code, we also record the exact position of the code inside the original wikitext. After this, the <em>annotated wikitext</em> is transformed into HTML, and the codes survive this transformation. Finally, the codes themselves are transformed again to make a valid HTML page (see Example 1). This way, every editable element gets a unique identifier based on the code it belongs to, so now it is possible to look up positions in the original wikitext whenever an such an element is clicked.</p>
<div style="border: 1px solid #EFF8FB;">
<ul style="list-style-type: lower-alpha">
<li><code>This is an example. A sentence with a [[link]].</code></li>
<li><code>&lt;paragraph-0&gt;<br />
&lt;sentence-0&gt;This is an example.&lt;/sentence-0&gt;<br />
&lt;sentence-1&gt;A sentence with a [[link]].&lt;/sentence-1&gt;<br />
&lt;/paragraph-0&gt;<br />
</code></li>
<li><code>* paragraph-0: [1..47]<br />
* sentence-0: [1..19]<br />
* sentence-1: [20..47]<br />
</code></li>
<li><code>&lt;p&gt;<br />
&lt;paragraph-0&gt;<br />
&lt;sentence-0&gt;This is an example.&lt;/sentence-0&gt;<br />
&lt;sentence-1&gt;A sentence with a [[link]].<br />
&lt;/sentence-1&gt;<br />
&lt;/paragraph-0&gt;<br />
&lt;/p&gt;<br />
</code></li>
<li><code>&lt;p id=”paragraph-0”&gt;<br />
&lt;span id=”sentence-0”&gt;This is an example.&lt;/span&gt;<br />
&lt;span id=”sentence-1”&gt;A sentence with a [[link]].&lt;/span&gt;<br />
&lt;/p&gt;<br />
</code></li>
</ul>
<p style="margin: 10px 10px 10px 25px"><strong>Example 1</strong>. Annotation during transformation of wikitext to HTML:<br />
(a) original wikitext, (b) wikitext after annotation, (c) list with positions, (d) HTML after transformation, (e) final HTML after using the annotations to generate HTML tags.</p>
</div>
<p>This doesn&#8217;t directly solve the problem of hierarchy, as HTML itself expects a strict hierarchy on elements. In the transformation this is fixed for the wikitext, but not for the added codes. This means that the example from above is still invalid:<br />
<code><br />
&lt;sentence-0&gt;<br />
&lt;bold-0&gt;'''bold &lt;link-0&gt;[[link'''&lt;/bold-0&gt;]]&lt;/link-0&gt;<br />
&lt;/sentence-0&gt;<br />
</code></p>
<p>After all, <code>link-0</code> has to be closed before <code>bold-0</code> is closed. This time, however, there is a remarkable simple solution: we can just remove all the conflicting codes! If it&#8217;s not possible to edit a single link in some cases, this doesn&#8217;t really matter, as it can still be changed by editing the entire sentence:</p>
<p><code><br />
&lt;sentence-0&gt;<br />
'''bold [[link''']]<br />
&lt;/sentence-0&gt;<br />
</code></p>
<p>There is always an element at a higher level that doesn&#8217;t conflict with any other element. In the worst case this means the highest element — the entire page — has to be edited, as that can never conflict with anything else. This is rare, however, and in most cases editing a single sentence or paragraph suffices. Such a fallback mechanism for weirder cases of wikitext does not exist for a visual editor.</p>
<p>You may wonder whether or not such an interface in which the user still has to edit wikitext — be it a bit less — is any improvement at all. To test this, I&#8217;ve worked together with <a href="http://grnet.gr/default.asp?pid=1&amp;la=2">GRNET</a>, a Greek research institute, to test this hypothesis. They tested my final interface with &#8220;real&#8221; users, to see whether it works or not. The results were mostly positive, users found it quite easy to do most basic operations. Complex tasks were still difficult for most users, especially because users tried to do things they were used to do with visual editors, such as dragging and dropping of elements. While this is a downside of such a new editing paradigm, it was great to see how most tasks became a lot easier.</p>
<p>Despite these positive results you won&#8217;t see this interface on Wikipedia anytime soon, as it&#8217;s not finished. In my thesis I describe all the algorithms and other ideas for finishing the interface, but as the Wikmedia Foundation recently started working on a true <a href="http://www.mediawiki.org/wiki/Visual_editor">visual editor</a>, I decided to put this project on hold for now. On the other hand, an editor like this has other advantages, such as being easier to use than one big text box for power users who don&#8217;t want to use a visual editor, or for newcomers who&#8217;d like to slowly learn to do more complex tasks. So who knows, perhaps one day you can use my interface to edit Wikipedia!</p>
<ul>
<li>Adapted from &#8220;<a href="http://janpaulposma.nl/wp-content/uploads/2011/11/perio-final.pdf">Help, ik wil Wikipedia veranderen</a>&#8220;, <a href="http://perio.fmf.nl/">FMF Periodiek</a>, #3 2011.</li>
<li>Based on the bachelor&#8217;s thesis &#8220;<a href="http://janpaulposma.nl/wp-content/uploads/2011/11/INF-BA-2011-J.P.Posma.pdf">In-line Editing: a New Approach to Editing Wikis</a>&#8220;, Jan Paul Posma, University of Groningen, 2011.</li>
<li>Implemented in the MediaWiki extension <a href="http://www.mediawiki.org/wiki/Extension:InlineEditor">InlineEditor</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://janpaulposma.nl/help-i-want-to-change-wikipedia/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple home automation system</title>
		<link>http://janpaulposma.nl/simple-home-automation-system</link>
		<comments>http://janpaulposma.nl/simple-home-automation-system#comments</comments>
		<pubDate>Thu, 11 Mar 2010 18:09:39 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://janpaulposma.nl/?p=430</guid>
		<description><![CDATA[Last time I talked about my photoframe and room control setup. It was a laptop modification, and some hacking around in cheap remote controlled switches and simple scripts. I rebuilt most of the system now: a silent PC with normal screen serves the photos, it can control the lights and devices using a commercial product, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://janpaulposma.nl/photoframe">Last time</a> I talked about my photoframe and room control setup. It was a laptop modification, and some hacking around in cheap remote controlled switches and simple scripts. I rebuilt most of the system now: a silent PC with normal screen serves the photos, it can control the lights and devices using a commercial product, there are cameras in the room and on the street, it&#8217;s all being shown and controlled by a slick webinterface, and my grandparents are quite happy with my old photoframe in their living room. :-)</p>
<p><img src="http://janpaulposma.nl/wp-content/uploads/2010/03/IMG_0001-300x224.jpg" alt="New setup" title="New setup" width="300" height="224" class="alignnone size-medium wp-image-431" /></p>
<p><span id="more-430"></span></p>
<p>Let&#8217;s get into details! The system is running on <a href="http://www.aleutia.com/products/t1">Aleutia T1</a>, which is a really nice, silent PC-ish thing. PC-ish, because the performance is not really up to todays standards, but on the other hand it&#8217;s quite cheap, really silent and comes pre-installed with Ubuntu. Cool! <span style="font-size: 80%; color: #AAA">(However, I installed Windows XP&#8230;)</span> I got mine with a <abbr title="Solid State Drive">SSD</abbr>, which means that there are no moving parts whatsoever, therefore it can stay on 24/7.</p>
<p>Using a simple <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> setup, it runs my photoframed software mentioned in the previous post (<a href="http://janpaulposma.nl/photoframed">demo</a>, <a href="http://github.com/janpaul123/photoframed">source</a>).</p>

<a href='http://janpaulposma.nl/simple-home-automation-system-photos-photoframe/img_0002' title='Photoframed software'><img width="150" height="111" src="http://janpaulposma.nl/wp-content/uploads/2010/03/IMG_0002-150x111.jpg" class="attachment-thumbnail" alt="Photoframed software" title="Photoframed software" /></a>
<a href='http://janpaulposma.nl/simple-home-automation-system-photos-photoframe/img_0001-2' title='Current setup'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/03/IMG_00011-150x112.jpg" class="attachment-thumbnail" alt="Current setup" title="Current setup" /></a>
<a href='http://janpaulposma.nl/simple-home-automation-system-photos-photoframe/img_0010' title='Webcams'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/03/IMG_0010-150x112.jpg" class="attachment-thumbnail" alt="Webcams" title="Webcams" /></a>
<a href='http://janpaulposma.nl/simple-home-automation-system-photos-photoframe/img_0008' title='Aleutia T1'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/03/IMG_0008-150x112.jpg" class="attachment-thumbnail" alt="Aleutia T1" title="Aleutia T1" /></a>

<p>The webcam setup is quite interesting. First I tried to plug the webcams using some <abbr title="Universal Serial Bus">USB</abbr> extension cords. It was highly unstable, so now the PC is actually positioned in a cardboard box, lifted from the ground, so all the cables fit exactly.</p>
<p>Another issue with the webcams is having it stream, but also have it stream securely. A promising format seemed to be <abbr title="Motion JPEG">MJPEG</abbr>: this is just like sending out JPEG frames as fast as the connection can manage. I run the following code to generate a MJPEG stream using <abbr title="VideoLan Client">VLC</abbr>. The stream is only accessible from localhost for security reasons.</p>
<p><code><br />
vlc.exe dshow:// :dshow-vdev="USB Video Device"    :dshow-adev=none :dshow-size=640x480 --no-sout-audio --sout=#transcode{vcodec=mjpg, vb=512, fps=1, width=640, height=480}:standard{access=http{mime="multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a"}, mux=mpjpeg, dst=127.0.0.1:8080/cam.mjpg}<br />
</code></p>
<p>The boundary thing is a code required for modern browsers to correctly recognize the data type. If you remove the IP-address at the end, you&#8217;ll allow anyone to watch the stream. Now the next proxy is to make sure only authenticated people are able to see the stream. I tried this using a PHP script which simply read the stream and echo&#8217;ed it (and some other variants). I also tried using the Apache proxy module. But both options have the same problem: as I have a terrible internet connection, I really need the last frame. Once a frame is transmitted, the new frame must be the most recent frame possible. However, all options I tried seem to cache the data, so you&#8217;ll see 1 second of recording spread out on, like, half a minute on the client.</p>
<p>In the end I just went with a simple script I found online somewhere, that reads exactly one MJPEG frame and spits it out as ordinary JPEG:</p>
<p><code><br />
$boundary="\n--";</p>
<p>$f = fopen($_GET['url'],"r") ;</p>
<p>if($f)<br />
{<br />
        while (substr_count($r,"Content-Length") != 2) $r.=fread($f,512);</p>
<p>        $start = strpos($r,'Ø');<br />
        $end   = strpos($r,$boundary,$start)-1;<br />
        $frame = substr("$r",$start,$end - $start);</p>
<p>        header("Content-type: image/jpeg");<br />
        echo $frame;<br />
}</p>
<p>fclose($f);<br />
</code></p>
<p>Now you have to refresh the image using for example Javascript, so that&#8217;s fine too. The webinterface I&#8217;ve written for this purpose also features a slider to set refresh interval, which is pretty handy if you&#8217;ve got a shitty connection like myself. Also, this brings me to the home automation part, which is actually pretty brief. All devices in my room are plugged into a <a href="http://klikaanklikuit.nl">KlikAanKlikUit</a> unit, and the PC&#8217;s got a <a href="http://klikaanklikuit.nl/product_detail.asp?id=25">TPC-200</a> interface plugged in, and a little bit of software does the trick (<a href="http://janpaulposma.nl/kakurc">demo</a>, <a href="http://github.com/janpaul123/kakurc">source</a>).</p>
<p>The TPC-200 interface comes with a <abbr title="Dynamic Link Library">DLL</abbr> which has one single command: <em>Send(id, value)</em>, with <em>id</em> being an integer and <em>value</em> a boolean. A simple executable wrapper, hacked together in <abbr title="Visual Basic">VB</abbr>, makes it easy to send commands from PHP, using <em>exec</em>.</p>

<a href='http://janpaulposma.nl/simple-home-automation-system-photos-webcams/mac_screenshot' title='Room control interface'><img width="150" height="84" src="http://janpaulposma.nl/wp-content/uploads/2010/03/mac_screenshot-150x84.png" class="attachment-thumbnail" alt="Room control interface" title="Room control interface" /></a>
<a href='http://janpaulposma.nl/simple-home-automation-system-photos-webcams/img_0003' title='Webcam inside'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/03/IMG_0003-150x112.jpg" class="attachment-thumbnail" alt="Webcam inside" title="Webcam inside" /></a>
<a href='http://janpaulposma.nl/simple-home-automation-system-photos-webcams/img_0005' title='Webcam outside'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/03/IMG_0005-150x112.jpg" class="attachment-thumbnail" alt="Webcam outside" title="Webcam outside" /></a>

<p>The first room control breach has happened already: I used the inferior Apache Basic Authentication for the login procedure, and it turns out that sessions can keep open for a long period of time. Even when the server restarts during that time. I logged on the system on the laptop of a friend of mine, and 3 days later, he scared the crap out of me by playing with my lights. ;-) The PC restarts every night at 5am, so I&#8217;m still amazed that the session lasted that long. </p>
<p>Anyway, I quickly tracked him down using the access logs and we had a good laugh about it, but I still don&#8217;t trust the security anymore: the inside camera is pointed at the ceiling now&#8230; <abbr title="Secure Sockets Layer">SSL</abbr> and stuff like that will probably be secure enough, but if you&#8217;re considering building the same setup, don&#8217;t plug in your nuclear power plant.</p>
]]></content:encoded>
			<wfw:commentRss>http://janpaulposma.nl/simple-home-automation-system/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Photoframe(d)</title>
		<link>http://janpaulposma.nl/photoframe</link>
		<comments>http://janpaulposma.nl/photoframe#comments</comments>
		<pubDate>Mon, 18 Jan 2010 00:05:17 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://janpaulposma.nl/?p=306</guid>
		<description><![CDATA[In 2007 I decided it would be cool to build a digital photo frame, out of a broken laptop. I bought the laptop from a friend of mine, as it was pretty old and useless, considering the keyboard didn&#8217;t work. With some help of my grandpa and his tools, I built it. Later, I added [...]]]></description>
			<content:encoded><![CDATA[<p>In 2007 I decided it would be cool to build a digital photo frame, out of a broken laptop. I bought the laptop from a <a href="http://www.brouwer-varenhorst.nl">friend</a> of mine, as it was pretty old and useless, considering the keyboard didn&#8217;t work. With some help of my grandpa and his tools, I built it. Later, I added speech recognition and control of the lights in my room. </p>
<p>Most of the original source code is lost, and the system doesn&#8217;t work well anymore, so I&#8217;m redesigning it. In a few months you can expect another blog post on this, but I thought a writeup of the old design would be nice.</p>
<p><img src="http://janpaulposma.nl/wp-content/uploads/2010/01/IMG_0104-300x225.jpg" alt="Photoframe" title="Photoframe" width="300" height="225" class="alignnone size-medium wp-image-307" /></p>
<p><span id="more-306"></span></p>
<p>It started with an old laptop. In an impulse I decided to see how quickly I was able to strip it until only the bare essentials were left. It was quite easy to disassemble it, and the wires were long enough to separate the display from the other components.</p>

<a href='http://janpaulposma.nl/photoframed-photos-laptop/dsc00222' title='Removed some casings'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00222-150x112.jpg" class="attachment-thumbnail" alt="Removed some casings" title="Removed some casings" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-laptop/dsc00223' title='Different components'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00223-150x112.jpg" class="attachment-thumbnail" alt="Different components" title="Different components" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-laptop/dsc00224' title='Disassembled!'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00224-150x112.jpg" class="attachment-thumbnail" alt="Disassembled!" title="Disassembled!" /></a>

<p>Once the laptop was disassembled, it was easy enough to go to the DIY store and buy some materials. With some careful measuring, patience and painting twice, the job was done in a few evenings.</p>

<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00225' title='Assembling the casing'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00225-150x112.jpg" class="attachment-thumbnail" alt="Assembling the casing" title="Assembling the casing" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00227' title='Assembling the casing'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00227-150x112.jpg" class="attachment-thumbnail" alt="Assembling the casing" title="Assembling the casing" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00228' title='Assembling the casing'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00228-150x112.jpg" class="attachment-thumbnail" alt="Assembling the casing" title="Assembling the casing" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00231' title='Assembling the casing'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00231-150x112.jpg" class="attachment-thumbnail" alt="Assembling the casing" title="Assembling the casing" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00232' title='Assembling the casing'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00232-150x112.jpg" class="attachment-thumbnail" alt="Assembling the casing" title="Assembling the casing" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00233' title='The screen fits!'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00233-150x112.jpg" class="attachment-thumbnail" alt="The screen fits!" title="The screen fits!" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00234' title='Adding the borders'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00234-150x112.jpg" class="attachment-thumbnail" alt="Adding the borders" title="Adding the borders" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00235' title='Adding the borders'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00235-150x112.jpg" class="attachment-thumbnail" alt="Adding the borders" title="Adding the borders" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00236' title='First paintjob'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00236-150x112.jpg" class="attachment-thumbnail" alt="First paintjob" title="First paintjob" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00238' title='First paintjob'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00238-150x112.jpg" class="attachment-thumbnail" alt="First paintjob" title="First paintjob" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00239' title='Flattening the surface'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00239-150x112.jpg" class="attachment-thumbnail" alt="Flattening the surface" title="Flattening the surface" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00240' title='Second paintjob'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00240-150x112.jpg" class="attachment-thumbnail" alt="Second paintjob" title="Second paintjob" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00241' title='Assembling internals'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00241-150x112.jpg" class="attachment-thumbnail" alt="Assembling internals" title="Assembling internals" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00248' title='Assembling internals'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00248-150x112.jpg" class="attachment-thumbnail" alt="Assembling internals" title="Assembling internals" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00249' title='Assembling internals'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00249-150x112.jpg" class="attachment-thumbnail" alt="Assembling internals" title="Assembling internals" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00243' title='It works!'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00243-150x112.jpg" class="attachment-thumbnail" alt="It works!" title="It works!" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-building-the-frame/dsc00244' title='It works!'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00244-150x112.jpg" class="attachment-thumbnail" alt="It works!" title="It works!" /></a>

<p>To display the photos, a clock, and some RSS feeds, I used a <a href="http://gathering.tweakers.net/forum/list_message/27709204#27709204">PHP script</a> by <a href="http://tommy.ech-wel.nl/vaio-fotolijst">Tommy van der Vorst</a>, running in a fullscreen Firefox window. It worked pretty well. After some modifications, it was used by myself and others for 3 years.</p>

<a href='http://janpaulposma.nl/photoframed-photos-script-by-misterdata/dsc00245' title='The script'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00245-150x112.jpg" class="attachment-thumbnail" alt="The script" title="The script" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-script-by-misterdata/dsc00246' title='The script'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00246-150x112.jpg" class="attachment-thumbnail" alt="The script" title="The script" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-script-by-misterdata/dsc00247' title='The script'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00247-150x112.jpg" class="attachment-thumbnail" alt="The script" title="The script" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-script-by-misterdata/dsc00258' title='The script'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00258-150x112.jpg" class="attachment-thumbnail" alt="The script" title="The script" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-script-by-misterdata/dsc00257' title='The script'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00257-150x112.jpg" class="attachment-thumbnail" alt="The script" title="The script" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-script-by-misterdata/dsc00256' title='The script'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00256-150x112.jpg" class="attachment-thumbnail" alt="The script" title="The script" /></a>

<p>A few months later I stumbled upon <a href="http://gathering.tweakers.net/forum/list_messages/1077675">this post</a> on a forum, which describes how to easily hack a cheap home automation remote control to hook it up to a computer. There were sets available for about €20 to control lights and devices with a remote control. So I bought two of these sets. The first hack was to hook it up to ordinary lights that are directly connected to a power source, without a wall socket in between. The setup wasn&#8217;t very safe, but it worked.</p>

<a href='http://janpaulposma.nl/photoframed-photos-receiver-hacks/dsc00259' title='A receiver'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00259-150x112.jpg" class="attachment-thumbnail" alt="A receiver" title="A receiver" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-receiver-hacks/dsc00262' title='Receiver, disassembled'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00262-150x112.jpg" class="attachment-thumbnail" alt="Receiver, disassembled" title="Receiver, disassembled" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-receiver-hacks/dsc00264' title='Original wiring'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00264-150x112.jpg" class="attachment-thumbnail" alt="Original wiring" title="Original wiring" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-receiver-hacks/dsc00265' title='Wiring with receiver'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00265-150x112.jpg" class="attachment-thumbnail" alt="Wiring with receiver" title="Wiring with receiver" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-receiver-hacks/dsc00267' title='It works!'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00267-150x112.jpg" class="attachment-thumbnail" alt="It works!" title="It works!" /></a>

<p>Next, I followed the instructions on the forum post: hook up the remote control to the serial port, detect commands using <a href="http://www.lirc.org/">LIRC</a>, and send them back to the remote control. It worked fine on the computer, but the problem is that on laptops the serial port is weaker: it usually won&#8217;t give a <a href="http://hackaday.com/2007/05/19/serial-port-power-booster/">nice and strong 12 volt signal</a>.</p>

<a href='http://janpaulposma.nl/photoframed-photos-serial-hack/dsc00268' title='Remote control'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00268-150x112.jpg" class="attachment-thumbnail" alt="Remote control" title="Remote control" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-serial-hack/dsc00271' title='Remote control, disassembled'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00271-150x112.jpg" class="attachment-thumbnail" alt="Remote control, disassembled" title="Remote control, disassembled" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-serial-hack/dsc00272' title='Original wiring'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00272-150x112.jpg" class="attachment-thumbnail" alt="Original wiring" title="Original wiring" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-serial-hack/dsc00278' title='Added sending and receiving wiring'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00278-150x112.jpg" class="attachment-thumbnail" alt="Added sending and receiving wiring" title="Added sending and receiving wiring" /></a>
<a href='http://janpaulposma.nl/photoframed-photos-serial-hack/dsc00277' title='Signal on the scope'><img width="150" height="112" src="http://janpaulposma.nl/wp-content/uploads/2010/01/DSC00277-150x112.jpg" class="attachment-thumbnail" alt="Signal on the scope" title="Signal on the scope" /></a>

<p>The solution was rather simple: by hooking up transistors to every button, you can simulate a press of that button simply by putting a small voltage on the transistor. The easiest way to do this is by using the parallel port. Fortunately, the laptop was pretty old so this was no problem.</p>
<p><img src="http://janpaulposma.nl/wp-content/uploads/2010/01/IMG_0186-300x225.jpg" alt="Transistor hack" title="Transistor hack" width="300" height="225" class="alignnone size-medium wp-image-409" /></p>
<p>With some Visual Basic programming, the <a href="http://www.microsoft.com/speech/default.aspx">Microsoft Speech API</a> and some PHP scripts it was possible to control the lights by voice and over the internet. Which is pretty cool. Unfortunately, I lost most of the source code, so I won&#8217;t be able to share it here. Right now I&#8217;m building a new version, and when it&#8217;s done I&#8217;ll share the code!</p>
<p>For now, I&#8217;ve started <a href="http://janpaulposma.nl/photoframed">improving</a> the PHP script that shows the photos, which I&#8217;ve dubbed <em>photoframed</em>. It&#8217;s pretty nice already, you can download and contribute to it on <a href="http://github.com/janpaul123/photoframed">my github page</a>. It even works perfectly fine in an iframe like the one below.</p>
<p><iframe src="http://janpaulposma.nl/photoframed" width="600" height="450"></iframe></p>
<p>In a few months the new system should be up and running, so I&#8217;ll probably write another blog post then. Meanwhile, I invite everyone to look at the source code of photoframed and contribute. Or you can just leave a message in the form below. ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://janpaulposma.nl/photoframe/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why this blog uses WordPress now</title>
		<link>http://janpaulposma.nl/why-this-blog-uses-wordpress-now</link>
		<comments>http://janpaulposma.nl/why-this-blog-uses-wordpress-now#comments</comments>
		<pubDate>Sat, 05 Sep 2009 18:59:00 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://janpaulposma.nl/?p=113</guid>
		<description><![CDATA[Posterous is a pretty good idea. You just send an e-mail with your blog text, some photos, video and sound, and they&#8217;ll automatically make a nice blog for you, all for free. The photo gallery is also pretty nice. They even upload your photos to Flickr, Picasa, Facebook, etc., and put your video on Youtube [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://posterous.com/">Posterous</a> is a pretty good idea. You just send an e-mail with your blog text, some photos, video and sound, and they&#8217;ll automatically make a nice blog for you, all for free. The photo gallery is also pretty nice.</p>
<p>They even upload your photos to <a href="http://flickr.com">Flickr</a>, <a href="http://picasaweb.google.com">Picasa</a>, <a href="http://facebook.com">Facebook</a>, etc., and put your video on <a href="http://youtube.com">Youtube</a> and other video services. They also send notifications on <a href="http://twitter.com">Twitter</a>, and other microblogging sites, and even on social network sites and other blogs. They have an <a href="http://posterous.com/help/autopost">extended list</a> of all the sites they support auto-posting to.</p>
<p>They also support custom domain names, <a href="http://www.google.com/analytics/">Google Analytics</a>, <a href="http://feedburner.com">Feedburner</a>, a <a href="http://posterous.com/help/bookmarklet">bookmarklet</a> and a nice <a href="http://posterous.com/help/waystoshare">Share on Posterous</a> button. It&#8217;s simply amazing.</p>
<p><em>However</em>, the limitations of Posterous quickly became obvious to me. No options whatsoever to customize the design and the media options are pretty limited. </p>
<p><span id="more-113"></span></p>
<p>An example: for my next blog post I want to be able to embed multiple small galleries on different places in the post, as it&#8217;s quite a long read. There are no upload facilities on the site, so I just e-mailed all the photos using multiple e-mails for the different galleries. Now I copied the gallery code from the different posts that were generated to the &#8216;main&#8217; post. It looks something like this:</p>
<blockquote><p>[[posterous-content:XfwIQTnahWsSQOSZUGMi]]</p></blockquote>
<p>Thinking that the photo access would be limited to the user account, I thought it was a nice way to add multiple galleries to one post. Wrong: the access to photos is limited to the same post. Still, why use such a complex code with a hash; if the photos are limited to the post, why not use something like:</p>
<blockquote><p>[[ gallery ]]</p></blockquote>
<p>Maybe it&#8217;s an upcoming feature, maybe it already exists but hidden somewhere (like those crazy tag options in the subject field).. </p>
<p>Anyroad, WordPress works excellent, it&#8217;s a really sound system, and very easy to setup. I&#8217;m also quite happy with this minimalistic theme.</p>
<p>In conclusion, Posterous is a fine system for people who ..</p>
<ol>
<li> .. don&#8217;t understand much of blogging and just want to type some nice stories, optionally with pictures. Useful for the average non-tech person who barely understands e-mail.
<li> .. want to be able to write a nice photo- or videoblog, very easy to add photos from vacation or a mobile device, just by mailing them. Your various social accounts will be updated too, very nice.
<li> .. don&#8217;t have the time updating the status of all their 10+ social, microblogging and blog accounts and want one nice interface to add things to all of them. Finding out what went wrong with their lives would be a great idea for these people as well.
</ol>
<p>What do you think? What is your favorite blogging site or system? Do you have suggestions for this blog?</p>
]]></content:encoded>
			<wfw:commentRss>http://janpaulposma.nl/why-this-blog-uses-wordpress-now/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

