<?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>The Twilight Zone</title>
	<atom:link href="http://www.twilight-zone.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.twilight-zone.com</link>
	<description>Scientia potentia est - Research is what I&#039;m doing when I don&#039;t know what I&#039;m doing</description>
	<lastBuildDate>Wed, 24 Oct 2012 08:46:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4</generator>
		<item>
		<title>Building Joomla! extensions with Phing</title>
		<link>http://www.twilight-zone.com/2012/04/building-joomla-extensions-with-phing/</link>
		<comments>http://www.twilight-zone.com/2012/04/building-joomla-extensions-with-phing/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 13:19:48 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[Joomla! Tutorials]]></category>
		<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://www.twilight-zone.com/?p=350</guid>
		<description><![CDATA[This script is intended to be used if you are in a situation where you develop your extensions inside a joomla tree but store them in a repository or folder outside the tree. The script provides functionality to copy the &#8230; <a href="http://www.twilight-zone.com/2012/04/building-joomla-extensions-with-phing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This script is intended to be used if you are in a situation where you develop your extensions inside a joomla tree but store them in a repository or folder outside the tree. The script provides functionality to copy the extension by name out of the joomla tree.</p>
<h2>Configuration</h2>
<p>Rename build.properties.dist to build.properties and set the <strong>src.dir</strong> variable to the Joomla! path. For example</p>
<pre>src.dir=/var/www/joomla</pre>
<p>This is where the script will look for the components you are trying to build.</p>
<h2>Naming conventions</h2>
<p>The script uses the extension prefix to determine the extension type, so you have to use the following prefixes to the extension=VALUE</p>
<ul>
<li>component : &#8220;com_&#8221;</li>
<li>module : &#8220;mod_&#8221;</li>
<li>template : &#8220;tpl_&#8221;</li>
<li>plugin: &#8220;plg_GROUP_&#8221;</li>
</ul>
<p>Administrator modules and templates must use the following prefixes</p>
<ul>
<li>module: &#8220;mod_admin_&#8221;</li>
<li>template: &#8220;tpl_admin_&#8221;</li>
</ul>
<h2>Language files</h2>
<p>When using this script, the language files for an extension needs to be stored within the folder of the extension itself and not in the global language folder.</p>
<h2>Usage examples</h2>
<p><strong>Building an extension from the joomla source tree</strong></p>
<pre>phing -Dextension=com_content build</pre>
<p><strong>Creating a package</strong></p>
<p>Once you have built an extension you can create an installable package from the build using the following command.</p>
<pre>phing -Dextension=com_content</pre>
<p>This will create a package file &#8220;<em>com_content_DATE.zip</em>&#8221;</p>
<p>If you also wish to add a version number you can use the following procedure</p>
<pre>phing -Dextension=com_content -Dversion=2.5</pre>
<h2><a href="https://github.com/downloads/rvsjoen/joomla-helloworld/joomla_phing_latest.zip">Download latest version<br />
</a>or&#8230;<br />
<a href="https://github.com/rvsjoen/joomla-helloworld/tree/master/25" target="_blank">Take a peek at the source</a></h2>
]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2012/04/building-joomla-extensions-with-phing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading the Joomla! Platform in an external script</title>
		<link>http://www.twilight-zone.com/2011/08/loading-the-joomla-platform-in-an-external-script/</link>
		<comments>http://www.twilight-zone.com/2011/08/loading-the-joomla-platform-in-an-external-script/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 11:04:06 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[Joomla! Tutorials]]></category>
		<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://www.twilight-zone.com/?p=340</guid>
		<description><![CDATA[If you are looking to execute an external PHP script, and still have access to the functionality of the platform and your site, you can do something like this in order to load the platform. &#60;?php define&#40;'_JEXEC', 1&#41;; define&#40;'DS', DIRECTORY_SEPARATOR&#41;; &#8230; <a href="http://www.twilight-zone.com/2011/08/loading-the-joomla-platform-in-an-external-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are looking to execute an external PHP script, and still have access to the functionality of the platform and your site, you can do something like this in order to load the platform.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_JEXEC'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DS'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">DIRECTORY_SEPARATOR</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/defines.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">include_once</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/defines.php'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_JDEFINES'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'JPATH_BASE'</span><span style="color: #339933;">,</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">require_once</span> JPATH_BASE<span style="color: #339933;">.</span><span style="color: #0000ff;">'/includes/defines.php'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">require_once</span> JPATH_BASE<span style="color: #339933;">.</span><span style="color: #0000ff;">'/includes/framework.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Your code here */</span></pre></div></div>

<p>If we take a closer look at the code, the first if construct will check if there exists a <code>defines.php</code> file in the directory of your external PHP script, and use if in case it does. If that file is not found, it will look in the <code>includes</code> subdirectory for <code>defines.php</code>. After the defines are included, the platform is loaded. There is really not much more to it, now you will be able to use the Joomla! platform like you would inside Jooml!. For example by instantiating <code>JDatabase</code> through <code>$database = JFactory::getDBO();</code> or accessing the request through <code>JRequest</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2011/08/loading-the-joomla-platform-in-an-external-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing the components administrator menu</title>
		<link>http://www.twilight-zone.com/2011/08/removing-the-components-administrator-menu/</link>
		<comments>http://www.twilight-zone.com/2011/08/removing-the-components-administrator-menu/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 11:27:36 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[Joomla! Tutorials]]></category>
		<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://www.twilight-zone.com/?p=311</guid>
		<description><![CDATA[So, your shiny new frontend component is all written and works flawlessly without any kind of bugs whatsoever and now you would like to remove the component menu item in the administrator Components menu. Why you say ? Of course &#8230; <a href="http://www.twilight-zone.com/2011/08/removing-the-components-administrator-menu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
So, your shiny new frontend component is all written and works flawlessly without any kind of bugs whatsoever and now you would like to remove the component menu item in the administrator Components menu. Why you say ? Of course because your shiny new component is a frontend-only component and you do not want to implement a dummy backend interface just because it is cool.
</p>
<p>
So here is how you do it, if you need to know how to create an installer script for your component, please refer to the official Joomla! MVC Component tutorial.
</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Com_HelloworldInstallerScript <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> postflight<span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span><span style="color: #339933;">,</span> <span style="color: #000088;">$parent</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'install'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'update'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> JFactory<span style="color: #339933;">::</span><span style="color: #004000;">getDBO</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getQuery</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#__menu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> JComponentHelper<span style="color: #339933;">::</span><span style="color: #004000;">getComponent</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'com_helloworld'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">where</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'component_id = '</span><span style="color: #339933;">.</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">where</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'client_id = 1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setQuery</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>   
    <span style="color: #009900;">&#125;</span>   
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Note that during uninstall of a component which has had its menu entry removing in this manner, there will be a warning/error in versions 1.7.0 and older. The component will still uninstall like it should so do not worry if you see this error.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2011/08/removing-the-components-administrator-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Atomic locking in Intel® 64 and IA-32 architectures</title>
		<link>http://www.twilight-zone.com/2011/07/atomic-locking-in-intel%c2%ae-64-and-ia-32-architectures/</link>
		<comments>http://www.twilight-zone.com/2011/07/atomic-locking-in-intel%c2%ae-64-and-ia-32-architectures/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 12:19:05 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[OS Development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[asm]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">http://www.twilight-zone.com/?p=302</guid>
		<description><![CDATA[The Intel® 64 and IA-32 architecture guarantees atomicity if one of the following conditions are met Reading or writing a byte Reading or writing a word aligned on a 16-bit boundary Reading or writing a double word aligned on a &#8230; <a href="http://www.twilight-zone.com/2011/07/atomic-locking-in-intel%c2%ae-64-and-ia-32-architectures/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Intel® 64 and IA-32 architecture guarantees atomicity if one of the following conditions are met</p>
<ul>
<li>Reading or writing a byte</li>
<li>Reading or writing a word aligned on a 16-bit boundary</li>
<li>Reading or writing a double word aligned on a 32-bit boundary</li>
</ul>
<div>So what does this mean ? It means that if we are clever about it, we can implement a simple lock using atomic reading and writing of a single byte.</div>
<div>
<p>The following function will use the <strong>XCHG</strong> instruction to swap two registers atomically, so all we have to do is give it the address to our locking variable and check the return value. If the value returned from the function is <strong>LOCKED</strong> it means that the thread was unable to acquire the lock. The beauty about this instruction is that if it is used to reference one general purpose register and a memory address, the processor bus locking protocol will be invoked causing the operation to become atomic.</p>
<p>The inline assembly statement might look daunting at first, but it is not really that complicated.</p>
<p>Per definition the structure of such an inline extended assembly statement is like this:</p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;">       asm <span style="color: #009900; font-weight: bold;">&#40;</span> assembler template 
           <span style="color: #339933;">:</span> output operands
           <span style="color: #339933;">:</span> input operands
           <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">list</span> of clobbered registers
           <span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #666666; font-style: italic;">;</span></pre></div></div>

<p>The use of the operands is optional, and we do not use and clobbered registers in this statement, we trust the compiler to figure that out.</p>
<p>As you can see, we provide one output operand and two input operands. The output operand is the variable where we will store the previous value of the lock, and the variable that the caller uses to check if the lock was successfully acquired.</p>
<p>In input and output operands we can specify various constraints:</p>
<ul>
<li>As you look at the <strong>&#8220;0&#8243;(value)</strong> operand, the <strong>&#8220;0&#8243;</strong> is the constraint telling it that the value of this input operand is <strong>ONLY</strong> allowed to be stored in the <strong>0th output variable</strong>, which is the output variable <strong>value</strong>.</li>
<li>The <strong>&#8220;a&#8221;</strong> constraint of address specifies that the value should be stored in the <strong>EAX</strong> register.</li>
<li>The <strong>&#8220;=b&#8221;</strong> constraint of the output operand specifies that this value should be read from <strong>EBX</strong>, and the operand is write-only.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define LOCKED   = 1</span>
<span style="color: #339933;">#define UNLOCKED = 0</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">int</span> test_and_set<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> <span style="color: #339933;">*</span>address<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> value <span style="color: #339933;">=</span> LOCKED<span style="color: #339933;">;</span>
	asm <span style="color: #993333;">volatile</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;xchg (%%eax), %%ebx&quot;</span>
		      <span style="color: #339933;">:</span><span style="color: #ff0000;">&quot;=b&quot;</span> <span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span>
		      <span style="color: #339933;">:</span><span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;a&quot;</span><span style="color: #009900;">&#40;</span>address<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> value<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So there we have it, essentially this says &#8220;Take the memory address given in the <strong>address</strong> variable and store the value given in the <strong>value</strong> variable in it, while putting the previous content of that memory address into the <strong>value</strong> variable when done.&#8221;</p>
<p>When the caller checks the returned value, if the value is <strong>LOCKED</strong> it will know that the lock was already taken, and if the value is <strong>UNLOCKED</strong> it will know that the previous value was unlocked, thus the locked has now been taken.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2011/07/atomic-locking-in-intel%c2%ae-64-and-ia-32-architectures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fort l&#8217;Ecluse &amp; Climbing at Leaz</title>
		<link>http://www.twilight-zone.com/2011/07/fort-lecluse-climbing-at-leaz/</link>
		<comments>http://www.twilight-zone.com/2011/07/fort-lecluse-climbing-at-leaz/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 11:26:19 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[climbing]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.twilight-zone.com/?p=297</guid>
		<description><![CDATA[So we went to visit Fort l&#8217;Ecluse which was at the time hosting an exhibition from CERN featuring a lot of nice pictures from the various detectors and also some very nice holographic imagery that I managed to get a &#8230; <a href="http://www.twilight-zone.com/2011/07/fort-lecluse-climbing-at-leaz/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So we went to visit <a href="http://en.wikipedia.org/wiki/Fort_l'%C3%89cluse" title="Fort l'Ecluse" target="_blank">Fort l&#8217;Ecluse</a> which was at the time hosting an exhibition from CERN featuring a lot of nice pictures from the various detectors and also some very nice holographic imagery that I managed to get a couple of good shots of.</p>
<p>There is also a very nice via ferrata climbing route there which I hope to be able to do in the near future.</p>
<p>After spending the day walking around in the old castle (yes, plenty of stairs&#8230;) we went for a nice climbing trip at Leaz, which is a small village at the foot of the <a href="http://en.wikipedia.org/wiki/Jura_Mountains" target="_blank">Jura mountains</a>.</p>
<div class='alignleft' ><a href="http://lh5.ggpht.com/-IRvglZAznbs/ThSfQunqRQI/AAAAAAAAAY0/c2t_mCO1XZU/2011-07%25252015-39-11_0002.jpg" title="2011-07 15-39-11_0002.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh5.ggpht.com/-IRvglZAznbs/ThSfQunqRQI/AAAAAAAAAY0/c2t_mCO1XZU/s150-c/2011-07%25252015-39-11_0002.jpg" alt="2011-07 15-39-11_0002.jpg" title="2011-07 15-39-11_0002.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh5.ggpht.com/-NrKFEyf4YKw/ThSfRQUTmsI/AAAAAAAAAY4/UspPFi8nvto/2011-07%25252015-39-20_0003.jpg" title="2011-07 15-39-20_0003.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh5.ggpht.com/-NrKFEyf4YKw/ThSfRQUTmsI/AAAAAAAAAY4/UspPFi8nvto/s150-c/2011-07%25252015-39-20_0003.jpg" alt="2011-07 15-39-20_0003.jpg" title="2011-07 15-39-20_0003.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh5.ggpht.com/-QbhilvyrzOA/ThSfSO3EGAI/AAAAAAAAAY8/Jlk7W9lFlo8/2011-07%25252015-21-28_0001.jpg" title="2011-07 15-21-28_0001.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh5.ggpht.com/-QbhilvyrzOA/ThSfSO3EGAI/AAAAAAAAAY8/Jlk7W9lFlo8/s150-c/2011-07%25252015-21-28_0001.jpg" alt="2011-07 15-21-28_0001.jpg" title="2011-07 15-21-28_0001.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh3.ggpht.com/-GWG07LvIcd0/ThSfUYHFaYI/AAAAAAAAAZA/mltr06lPAkY/2011-07%25252015-40-58_0004.jpg" title="2011-07 15-40-58_0004.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh3.ggpht.com/-GWG07LvIcd0/ThSfUYHFaYI/AAAAAAAAAZA/mltr06lPAkY/s150-c/2011-07%25252015-40-58_0004.jpg" alt="2011-07 15-40-58_0004.jpg" title="2011-07 15-40-58_0004.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh3.ggpht.com/-l8Emt1rKc0E/ThSfWtHkPCI/AAAAAAAAAZE/PjtP-WyYxH0/2011-07%25252015-55-59_0005.jpg" title="2011-07 15-55-59_0005.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh3.ggpht.com/-l8Emt1rKc0E/ThSfWtHkPCI/AAAAAAAAAZE/PjtP-WyYxH0/s150-c/2011-07%25252015-55-59_0005.jpg" alt="2011-07 15-55-59_0005.jpg" title="2011-07 15-55-59_0005.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh4.ggpht.com/-3ibvvL1XHz4/ThSfXvgZkvI/AAAAAAAAAZI/5s5zv-96s2k/2011-07%25252015-57-14_0006.jpg" title="2011-07 15-57-14_0006.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh4.ggpht.com/-3ibvvL1XHz4/ThSfXvgZkvI/AAAAAAAAAZI/5s5zv-96s2k/s150-c/2011-07%25252015-57-14_0006.jpg" alt="2011-07 15-57-14_0006.jpg" title="2011-07 15-57-14_0006.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh3.ggpht.com/-5OU0XBQEQbM/ThSfZts065I/AAAAAAAAAZM/jvRFxh97Q4c/2011-07%25252015-58-02_0007.jpg" title="2011-07 15-58-02_0007.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh3.ggpht.com/-5OU0XBQEQbM/ThSfZts065I/AAAAAAAAAZM/jvRFxh97Q4c/s150-c/2011-07%25252015-58-02_0007.jpg" alt="2011-07 15-58-02_0007.jpg" title="2011-07 15-58-02_0007.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh3.ggpht.com/-1I65CY8LMFQ/ThSfbgLoAWI/AAAAAAAAAZQ/mOqQYApyjMY/2011-07%25252016-13-42_0009.jpg" title="2011-07 16-13-42_0009.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh3.ggpht.com/-1I65CY8LMFQ/ThSfbgLoAWI/AAAAAAAAAZQ/mOqQYApyjMY/s150-c/2011-07%25252016-13-42_0009.jpg" alt="2011-07 16-13-42_0009.jpg" title="2011-07 16-13-42_0009.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh6.ggpht.com/-ka1ckIemo2M/ThSfbrn7JyI/AAAAAAAAAaw/lovXLu1_DDA/2011-07%25252016-17-35_0010.jpg" title="2011-07 16-17-35_0010.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh6.ggpht.com/-ka1ckIemo2M/ThSfbrn7JyI/AAAAAAAAAaw/lovXLu1_DDA/s150-c/2011-07%25252016-17-35_0010.jpg" alt="2011-07 16-17-35_0010.jpg" title="2011-07 16-17-35_0010.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh5.ggpht.com/-KTUC7Z5b5l8/ThSffQxTASI/AAAAAAAAAbA/LG_ZZ86PkUc/2011-07%25252017-36-17_0011.jpg" title="2011-07 17-36-17_0011.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh5.ggpht.com/-KTUC7Z5b5l8/ThSffQxTASI/AAAAAAAAAbA/LG_ZZ86PkUc/s150-c/2011-07%25252017-36-17_0011.jpg" alt="2011-07 17-36-17_0011.jpg" title="2011-07 17-36-17_0011.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh4.ggpht.com/-ykK-xBgub8M/ThSffjApgKI/AAAAAAAAAZc/okXUuVOpHSI/2011-07%25252017-37-49_0012.jpg" title="2011-07 17-37-49_0012.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh4.ggpht.com/-ykK-xBgub8M/ThSffjApgKI/AAAAAAAAAZc/okXUuVOpHSI/s150-c/2011-07%25252017-37-49_0012.jpg" alt="2011-07 17-37-49_0012.jpg" title="2011-07 17-37-49_0012.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh3.ggpht.com/-7jh8vGRNeoI/ThSfgQGVVHI/AAAAAAAAAZg/tM16wSrISUo/2011-07%25252016-11-56_0008.jpg" title="2011-07 16-11-56_0008.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh3.ggpht.com/-7jh8vGRNeoI/ThSfgQGVVHI/AAAAAAAAAZg/tM16wSrISUo/s150-c/2011-07%25252016-11-56_0008.jpg" alt="2011-07 16-11-56_0008.jpg" title="2011-07 16-11-56_0008.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh5.ggpht.com/-AOnwDi57d2Y/ThSflYH7oGI/AAAAAAAAAZk/WKxXqLj8cgo/2011-07%25252017-43-45_0014.jpg" title="2011-07 17-43-45_0014.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh5.ggpht.com/-AOnwDi57d2Y/ThSflYH7oGI/AAAAAAAAAZk/WKxXqLj8cgo/s150-c/2011-07%25252017-43-45_0014.jpg" alt="2011-07 17-43-45_0014.jpg" title="2011-07 17-43-45_0014.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh4.ggpht.com/-tMLRghv7_cA/ThSflVoWjpI/AAAAAAAAAbI/CADpC_CsZP8/2011-07%25252017-46-20_0015.jpg" title="2011-07 17-46-20_0015.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh4.ggpht.com/-tMLRghv7_cA/ThSflVoWjpI/AAAAAAAAAbI/CADpC_CsZP8/s150-c/2011-07%25252017-46-20_0015.jpg" alt="2011-07 17-46-20_0015.jpg" title="2011-07 17-46-20_0015.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh6.ggpht.com/-AdD2Hswt_Hc/ThSfl12eZSI/AAAAAAAAAbQ/PfZwYEgFylw/2011-07%25252017-40-18_0013.jpg" title="2011-07 17-40-18_0013.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh6.ggpht.com/-AdD2Hswt_Hc/ThSfl12eZSI/AAAAAAAAAbQ/PfZwYEgFylw/s150-c/2011-07%25252017-40-18_0013.jpg" alt="2011-07 17-40-18_0013.jpg" title="2011-07 17-40-18_0013.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh5.ggpht.com/-HiQS5LsGQWk/ThSfn5XtRHI/AAAAAAAAAZw/f8pmoKsgC3A/2011-07%25252018-06-27_0017.jpg" title="2011-07 18-06-27_0017.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh5.ggpht.com/-HiQS5LsGQWk/ThSfn5XtRHI/AAAAAAAAAZw/f8pmoKsgC3A/s150-c/2011-07%25252018-06-27_0017.jpg" alt="2011-07 18-06-27_0017.jpg" title="2011-07 18-06-27_0017.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh5.ggpht.com/-j-B0OILdTWw/ThSfr8L5XCI/AAAAAAAAAZ0/_XhehssolBU/2011-07%25252018-08-22_0018.jpg" title="2011-07 18-08-22_0018.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh5.ggpht.com/-j-B0OILdTWw/ThSfr8L5XCI/AAAAAAAAAZ0/_XhehssolBU/s150-c/2011-07%25252018-08-22_0018.jpg" alt="2011-07 18-08-22_0018.jpg" title="2011-07 18-08-22_0018.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh4.ggpht.com/-IbhFDY4X-Wo/ThSfsaOGUFI/AAAAAAAAAbY/pekKjf-K9V4/2011-07%25252017-51-30_0016.jpg" title="2011-07 17-51-30_0016.jpg" class="highslidethickbox" rel="519c1ab562818"  onclick="return hs.expand(this)"><img src="http://lh4.ggpht.com/-IbhFDY4X-Wo/ThSfsaOGUFI/AAAAAAAAAbY/pekKjf-K9V4/s150-c/2011-07%25252017-51-30_0016.jpg" alt="2011-07 17-51-30_0016.jpg" title="2011-07 17-51-30_0016.jpg" class="alignleft" width="150" height="150"  /></a></div><div class='clear'></div>
]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2011/07/fort-lecluse-climbing-at-leaz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autumn in Oslo</title>
		<link>http://www.twilight-zone.com/2010/10/autumn-in-oslo/</link>
		<comments>http://www.twilight-zone.com/2010/10/autumn-in-oslo/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 23:54:35 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://twilight-zone.com/blog/?p=196</guid>
		<description><![CDATA[I went walkabout here the other day with my camera, and this is what came out in the other end]]></description>
			<content:encoded><![CDATA[<p>I went walkabout here the other day with my camera, and this is what came out in the other end <img src='http://www.twilight-zone.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class='alignleft' ><a href="http://lh6.ggpht.com/-3njNwKWoUcc/Th4VM-SQMEI/AAAAAAAAAfE/9x9rJwjkDmE/2010-10-12%25252017-35-54%252520-%2525200015%252520-%252520web.jpg" title="2010-10-12 17-35-54 - 0015 - web.jpg" class="highslidethickbox" rel="519c1ab63f3a2"  onclick="return hs.expand(this)"><img src="http://lh6.ggpht.com/-3njNwKWoUcc/Th4VM-SQMEI/AAAAAAAAAfE/9x9rJwjkDmE/s150-c/2010-10-12%25252017-35-54%252520-%2525200015%252520-%252520web.jpg" alt="2010-10-12 17-35-54 - 0015 - web.jpg" title="2010-10-12 17-35-54 - 0015 - web.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh4.ggpht.com/-0_-hguB2Xpw/Th4VNDyZbLI/AAAAAAAAAfE/7dLoIxTc3RY/2010-10-12%25252017-42-15%252520-%2525200024%252520-%252520web.jpg" title="2010-10-12 17-42-15 - 0024 - web.jpg" class="highslidethickbox" rel="519c1ab63f3a2"  onclick="return hs.expand(this)"><img src="http://lh4.ggpht.com/-0_-hguB2Xpw/Th4VNDyZbLI/AAAAAAAAAfE/7dLoIxTc3RY/s150-c/2010-10-12%25252017-42-15%252520-%2525200024%252520-%252520web.jpg" alt="2010-10-12 17-42-15 - 0024 - web.jpg" title="2010-10-12 17-42-15 - 0024 - web.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh6.ggpht.com/-1aXDsCazgwE/Th4VMyU0OpI/AAAAAAAAAfE/q_ZaR0BS3IQ/2010-10-12%25252017-40-56%252520-%2525200018%252520-%252520web.jpg" title="2010-10-12 17-40-56 - 0018 - web.jpg" class="highslidethickbox" rel="519c1ab63f3a2"  onclick="return hs.expand(this)"><img src="http://lh6.ggpht.com/-1aXDsCazgwE/Th4VMyU0OpI/AAAAAAAAAfE/q_ZaR0BS3IQ/s150-c/2010-10-12%25252017-40-56%252520-%2525200018%252520-%252520web.jpg" alt="2010-10-12 17-40-56 - 0018 - web.jpg" title="2010-10-12 17-40-56 - 0018 - web.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh5.ggpht.com/-FoCLs9Aq3s8/Th4VOZ8JeFI/AAAAAAAAAfE/EMdv3JCwEpg/2010-10-12%25252017-43-45%252520-%2525200038%252520-%252520web.jpg" title="2010-10-12 17-43-45 - 0038 - web.jpg" class="highslidethickbox" rel="519c1ab63f3a2"  onclick="return hs.expand(this)"><img src="http://lh5.ggpht.com/-FoCLs9Aq3s8/Th4VOZ8JeFI/AAAAAAAAAfE/EMdv3JCwEpg/s150-c/2010-10-12%25252017-43-45%252520-%2525200038%252520-%252520web.jpg" alt="2010-10-12 17-43-45 - 0038 - web.jpg" title="2010-10-12 17-43-45 - 0038 - web.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh6.ggpht.com/-M0it9m69Lps/Th4VOjiRUrI/AAAAAAAAAfE/KJ-N7p49rT4/2010-10-12%25252017-44-04%252520-%2525200041%252520-%252520web.jpg" title="2010-10-12 17-44-04 - 0041 - web.jpg" class="highslidethickbox" rel="519c1ab63f3a2"  onclick="return hs.expand(this)"><img src="http://lh6.ggpht.com/-M0it9m69Lps/Th4VOjiRUrI/AAAAAAAAAfE/KJ-N7p49rT4/s150-c/2010-10-12%25252017-44-04%252520-%2525200041%252520-%252520web.jpg" alt="2010-10-12 17-44-04 - 0041 - web.jpg" title="2010-10-12 17-44-04 - 0041 - web.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh5.ggpht.com/-_Z-VnIP3OgA/Th4VRcZ1seI/AAAAAAAAAfE/op66BirbKsM/2010-10-12%25252017-31-52%252520-%2525200005%252520-%252520web.jpg" title="2010-10-12 17-31-52 - 0005 - web.jpg" class="highslidethickbox" rel="519c1ab63f3a2"  onclick="return hs.expand(this)"><img src="http://lh5.ggpht.com/-_Z-VnIP3OgA/Th4VRcZ1seI/AAAAAAAAAfE/op66BirbKsM/s150-c/2010-10-12%25252017-31-52%252520-%2525200005%252520-%252520web.jpg" alt="2010-10-12 17-31-52 - 0005 - web.jpg" title="2010-10-12 17-31-52 - 0005 - web.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh6.ggpht.com/-S3OHpwwH6fo/Th4VRZBWcMI/AAAAAAAAAfE/l6DQ9GcFJqQ/2010-10-12%25252017-29-54%252520-%2525200002%252520-%252520web.jpg" title="2010-10-12 17-29-54 - 0002 - web.jpg" class="highslidethickbox" rel="519c1ab63f3a2"  onclick="return hs.expand(this)"><img src="http://lh6.ggpht.com/-S3OHpwwH6fo/Th4VRZBWcMI/AAAAAAAAAfE/l6DQ9GcFJqQ/s150-c/2010-10-12%25252017-29-54%252520-%2525200002%252520-%252520web.jpg" alt="2010-10-12 17-29-54 - 0002 - web.jpg" title="2010-10-12 17-29-54 - 0002 - web.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh4.ggpht.com/-SNv6P0t1Va0/Th4VR4_ihAI/AAAAAAAAAfE/PTj_pBycks4/2010-10-12%25252017-30-48%252520-%2525200004%252520-%252520web.jpg" title="2010-10-12 17-30-48 - 0004 - web.jpg" class="highslidethickbox" rel="519c1ab63f3a2"  onclick="return hs.expand(this)"><img src="http://lh4.ggpht.com/-SNv6P0t1Va0/Th4VR4_ihAI/AAAAAAAAAfE/PTj_pBycks4/s150-c/2010-10-12%25252017-30-48%252520-%2525200004%252520-%252520web.jpg" alt="2010-10-12 17-30-48 - 0004 - web.jpg" title="2010-10-12 17-30-48 - 0004 - web.jpg" class="alignleft" width="150" height="150"  /></a><a href="http://lh4.ggpht.com/-0IS5HBJJEo4/Th4VSTbgkUI/AAAAAAAAAfE/skT8p6RLjxo/2010-10-12%25252017-32-54%252520-%2525200010%252520-%252520web.jpg" title="2010-10-12 17-32-54 - 0010 - web.jpg" class="highslidethickbox" rel="519c1ab63f3a2"  onclick="return hs.expand(this)"><img src="http://lh4.ggpht.com/-0IS5HBJJEo4/Th4VSTbgkUI/AAAAAAAAAfE/skT8p6RLjxo/s150-c/2010-10-12%25252017-32-54%252520-%2525200010%252520-%252520web.jpg" alt="2010-10-12 17-32-54 - 0010 - web.jpg" title="2010-10-12 17-32-54 - 0010 - web.jpg" class="alignleft" width="150" height="150"  /></a></div><div class='clear'></div>
]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2010/10/autumn-in-oslo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D Model of the Solar System</title>
		<link>http://www.twilight-zone.com/2010/06/3d-model-of-the-solar-system/</link>
		<comments>http://www.twilight-zone.com/2010/06/3d-model-of-the-solar-system/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 19:28:35 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://twilight-zone.com/blog/?p=144</guid>
		<description><![CDATA[Once upon a time we did a OpenGL implementation of the Solar System in C#, I thought i&#8217;d put it here]]></description>
			<content:encoded><![CDATA[<p>Once upon a time we did a OpenGL implementation of the Solar System in C#, I thought i&#8217;d put it here  <img src='http://www.twilight-zone.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="text-align: center;"><a class="highslide img_29" href="http://twilight-zone.com/blog/wp-content/uploads/2010/09/solar_system1.png" onclick="return hs.expand(this)"><img class="aligncenter size-full wp-image-145" title="Solar System Screenshot" src="http://twilight-zone.com/blog/wp-content/uploads/2010/09/solar_system1.png" alt="" width="800" height="600" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2010/06/3d-model-of-the-solar-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IBM Active Protection System</title>
		<link>http://www.twilight-zone.com/2010/05/ibm-active-protection-system/</link>
		<comments>http://www.twilight-zone.com/2010/05/ibm-active-protection-system/#comments</comments>
		<pubDate>Thu, 06 May 2010 20:23:18 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://twilight-zone.com/blog/?p=148</guid>
		<description><![CDATA[Playing around on my thinkpad, I discovered that the HDAPS system can be used to do more than just protect your hard drive in case of a fall. The following application displays a 3D model of a cube representing the &#8230; <a href="http://www.twilight-zone.com/2010/05/ibm-active-protection-system/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a class="highslide img_31" href="http://twilight-zone.com/blog/wp-content/uploads/2010/09/hdaps_client.png" onclick="return hs.expand(this)"><img class="alignright size-full wp-image-149" style="margin-left: 20px;" title="HDAPS Client" src="http://twilight-zone.com/blog/wp-content/uploads/2010/09/hdaps_client.png" alt="" width="342" height="316" /></a><br />
Playing around on my thinkpad, I discovered that the HDAPS system can be used to do more than just protect your hard drive in case of a fall.</p>
<p>The following application displays a 3D model of a cube representing the monitored laptop, a  server running on that laptop is sending real-time updates using  information it gets from the IBM Hard Drive Active Protection System  (HDAPS). This allows a remote client to monitor the movement of the  laptop. The application itself is not very impressive, but I included a screenshot anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2010/05/ibm-active-protection-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conway&#8217;s Game of Life</title>
		<link>http://www.twilight-zone.com/2010/04/conways-game-of-life/</link>
		<comments>http://www.twilight-zone.com/2010/04/conways-game-of-life/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 13:13:31 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://twilight-zone.com/blog/?p=141</guid>
		<description><![CDATA[Just for kicks, I thought i&#8217;d do a ncurses implementation of Conway&#8217;s Game of Life. Gospergun # #### ## #### ## ## # # # ## ### ## ## # # ## ## ## # # ##### # ### # &#8230; <a href="http://www.twilight-zone.com/2010/04/conways-game-of-life/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just for kicks, I thought i&#8217;d do a ncurses implementation of <a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Conway&#8217;s Game of Life</a>.</p>
<p><strong>Gospergun</strong></p>
<hr />
<pre>                             #
                           ####
                  ##     #### ##         ##
                #  #   #   ## ###        ##
       ##      #       #   ## ##
       ##      #      #   #####
               #       ###   #
                #  #
                  ##

                               #
                                ##
                               ##</pre>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2010/04/conways-game-of-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hooking up to the input subsystem through JNI</title>
		<link>http://www.twilight-zone.com/2010/03/hooking-up-to-the-input-subsystem-through-jni/</link>
		<comments>http://www.twilight-zone.com/2010/03/hooking-up-to-the-input-subsystem-through-jni/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 22:21:31 +0000</pubDate>
		<dc:creator>rvsjoen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[java3d]]></category>
		<category><![CDATA[jni]]></category>

		<guid isPermaLink="false">http://twilight-zone.com/blog/?p=105</guid>
		<description><![CDATA[Making raw input data available to Java3D through the use of JNI. The device is a 3dConnexion Space Navigator, it registers itself as an event device through the input subsystem. Our Java class class ReadFile &#123; native static int&#91;&#93; readEvent&#40;&#41;; &#8230; <a href="http://www.twilight-zone.com/2010/03/hooking-up-to-the-input-subsystem-through-jni/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Making raw input data available to Java3D through the use of JNI. The device is a <a href="http://www.3dconnexion.com/products/spacenavigator.html" target="_blank">3dConnexion Space Navigator</a>, it registers itself as an event device through the input subsystem.</p>
<p>Our Java class</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> ReadFile <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">native</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> readEvent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Load the library</span>
    <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">loadLibrary</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;nativelib&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> args<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">int</span> event<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ReadEvents<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">readEvent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">print</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Event: (&quot;</span><span style="color: #339933;">+</span>event.<span style="color: #006633;">length</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; bytes): &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> b<span style="color: #339933;">:</span> event<span style="color: #009900;">&#41;</span>
                <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">print</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Integer</span><span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The Makefile used to build the shared library</p>

<div class="wp_syntax"><div class="code"><pre class="make" style="font-family:monospace;">CC<span style="color: #004400;">=</span>gcc
JC<span style="color: #004400;">=</span>javac
JH<span style="color: #004400;">=</span>javah
&nbsp;
CFLAGS<span style="color: #004400;">=</span> <span style="color: #004400;">-</span>shared <span style="color: #004400;">-</span>Wall
INCLUDEPATH<span style="color: #004400;">=</span> \
     <span style="color: #004400;">-</span>I<span style="color: #004400;">/</span>usr<span style="color: #004400;">/</span>lib<span style="color: #004400;">/</span>jvm<span style="color: #004400;">/</span>java<span style="color: #004400;">-</span><span style="color: #CC2200;">6</span><span style="color: #004400;">-</span>sun<span style="color: #004400;">-</span>1<span style="color: #004400;">.</span>6<span style="color: #004400;">.</span>0<span style="color: #004400;">.</span>16<span style="color: #004400;">/</span><span style="color: #666622; font-weight: bold;">include</span><span style="color: #004400;">/</span> \
     <span style="color: #004400;">-</span>I<span style="color: #004400;">/</span>usr<span style="color: #004400;">/</span>lib<span style="color: #004400;">/</span>jvm<span style="color: #004400;">/</span>java<span style="color: #004400;">-</span><span style="color: #CC2200;">6</span><span style="color: #004400;">-</span>sun<span style="color: #004400;">-</span>1<span style="color: #004400;">.</span>6<span style="color: #004400;">.</span>0<span style="color: #004400;">.</span>16<span style="color: #004400;">/</span><span style="color: #666622; font-weight: bold;">include</span><span style="color: #004400;">/</span>linux
&nbsp;
all<span style="color: #004400;">:</span>
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">JC</span><span style="color: #004400;">&#41;</span> ReadEvents<span style="color: #004400;">.</span>java
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">JH</span><span style="color: #004400;">&#41;</span> ReadEvents
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CC</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CFLAGS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>o libnativelib<span style="color: #004400;">.</span>so <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">INCLUDEPATH</span><span style="color: #004400;">&#41;</span> events<span style="color: #004400;">.</span>c</pre></div></div>

<p>This is really all the C code we need to pass the axes array</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define EVENTNODE &quot;/dev/input/event6&quot;</span>
&nbsp;
<span style="color: #993333;">int</span> axes<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">6</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> btns<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> fd <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
&nbsp;
JNIEXPORT jintArray JNICALL Java_ReadEvents_readEvent<span style="color: #009900;">&#40;</span>
    JNIEnv<span style="color: #339933;">*</span> env<span style="color: #339933;">,</span> jclass cl<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>fd <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                fd <span style="color: #339933;">=</span> open<span style="color: #009900;">&#40;</span>EVENTNODE <span style="color: #339933;">,</span> O_RDONLY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #993333;">struct</span> input_event ev<span style="color: #339933;">;</span>
        read<span style="color: #009900;">&#40;</span>fd<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>ev<span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> input_event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span>ev.<span style="color: #202020;">type</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                        <span style="color: #b1b100;">case</span> EV_KEY<span style="color: #339933;">:</span>
                                btns<span style="color: #009900;">&#91;</span>ev.<span style="color: #202020;">code</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> ev.<span style="color: #202020;">value</span><span style="color: #339933;">;</span>
                                <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">case</span> EV_REL<span style="color: #339933;">:</span>
                                axes<span style="color: #009900;">&#91;</span>ev.<span style="color: #202020;">code</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> ev.<span style="color: #202020;">value</span><span style="color: #339933;">;</span>
                                <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        jintArray jb<span style="color: #339933;">;</span>
        jb <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>env<span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>NewIntArray<span style="color: #009900;">&#40;</span>env<span style="color: #339933;">,</span> <span style="color: #0000dd;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>env<span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>SetIntArrayRegion<span style="color: #009900;">&#40;</span>env<span style="color: #339933;">,</span> jb<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">6</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span>jint <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>axes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span>jb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.twilight-zone.com/2010/03/hooking-up-to-the-input-subsystem-through-jni/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
