<?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>Lunchtime Semaphore</title>
	<atom:link href="http://www.melaneum.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.melaneum.com/blog</link>
	<description>from and to 372433 143758 48 N</description>
	<lastBuildDate>Sun, 03 Jun 2012 02:21:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Command of the week</title>
		<link>http://www.melaneum.com/blog/python/command-of-the-week</link>
		<comments>http://www.melaneum.com/blog/python/command-of-the-week#comments</comments>
		<pubDate>Sun, 03 Jun 2012 02:20:48 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=399</guid>
		<description><![CDATA[To quickly test some web development stuff: python -m SimpleHTTPServer This serves the current directory on port 8000. Avoid that if you&#8217;re not firewalled, but on a local machine, that&#8217;s really practical for quick testing.]]></description>
			<content:encoded><![CDATA[<p>To quickly test some web development stuff:</p>
<pre>python -m SimpleHTTPServer</pre>
<p>This serves the current directory on port 8000. Avoid that if you&#8217;re not firewalled, but on a local machine, that&#8217;s really practical for quick testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/python/command-of-the-week/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load solved!</title>
		<link>http://www.melaneum.com/blog/linux/load-solved</link>
		<comments>http://www.melaneum.com/blog/linux/load-solved#comments</comments>
		<pubDate>Wed, 23 May 2012 18:06:14 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[slow]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=387</guid>
		<description><![CDATA[Finally, I solved an issue that had been pestering me for months. Regularly, when casually browsing, my computer would slow down dramatically for 1-2 min before continuing as if nothing happened. That was particularly irritating and I couldn&#8217;t fix this until I found a good way to reproduce it. This half broken bugs are the [...]]]></description>
			<content:encoded><![CDATA[<p>Finally, I solved an issue that had been pestering me for months. Regularly, when casually browsing, my computer would slow down dramatically for 1-2 min before continuing as if nothing happened. That was particularly irritating and I couldn&#8217;t fix this until I found a good way to reproduce it. This half broken bugs are the harder to fix because the incentive to sit down and fix it is much weaker than when everything is broken.</p>
<p><span id="more-387"></span></p>
<p><strong>The symptoms</strong></p>
<p>As it appears at random time, and slows down everything, diagnosing is not easy. I usually keep gkrellm open to monitor what&#8217;s happening. During these slowdowns, almost everything seems normal: cpu at less than 5%, more than 70% of the memory free, no disk io, no network io. Nothing unusual either with <code>iftop</code> or <code>iotop</code>. The only visible problem in gkrellm and in <code>top</code> was the load average. <strong>The load was climbing up (sometimes to 10) before coming down slowly</strong>.</p>
<p><a href="http://www.melaneum.com/blog/wp-content/uploads/2012/05/load.png"><img class="aligncenter size-full wp-image-391" title="load" src="http://www.melaneum.com/blog/wp-content/uploads/2012/05/load.png" alt="" width="124" height="74" /></a></p>
<p>Note that I changed the default monitoring string for proc in gkrellm to &lt;code&gt;\w88\a$p\f procs\n\e$u\f users\n\e$l\f load&lt;/code&gt; to display the load value.</p>
<p>It would happen on any website, it would happen with chrome or firefox. And I couldn&#8217;t find anything relevant to this issue on the internet.</p>
<p><strong>Fixing</strong></p>
<p>The first step was to find a way to replicate this as it seems to happen at random time and on random sites. I finally figured that using chrome or firefox and going to google maps, heavily moving around, zooming in and out, navigating in street view would eventually trigger the problem. At this point I suddenly though about caching issues.</p>
<p>And then I got it.</p>
<p>My <code>/home</code> is on a raid 1 setup: I don&#8217;t want to loose all my photos to a hard disk crash (don&#8217;t worry, the raid is far from being the only backup of it). But most linux softwares are in the habit of putting all user related stuff in <code>~/.*</code> and chrome and firefox are no exception. For example chrome keeps its stuff in <code>~/.config/google-chrome</code>. Writing to the cache is not a cheap write operation and my guess is that is does a lot of random access write. Then the raid system has to sync all this between the disks and that increases the load of the system. It does not appear as disk IO in the different monitoring tools as this is not a filesystem IO.</p>
<p>From there, the fix was pretty simple. Move the <code>~/.config/google-chrome</code> to a non raid disk (as chrome sync everything to the cloud, loosing the config directory is not an issue) and create a symlink <code>~/.config/google-chrome</code> to the new location.</p>
<p><strong>Lessons</strong></p>
<p>Several useful lessons to get from that:</p>
<ul>
<li>Using <code>/home</code> for cache is bad. The assumption is often that data there are worth saving, mirroring etc and don&#8217;t require a fast access.</li>
<li>There is probably some room for improvement for the linux raid driver: I can&#8217;t believe it could be so inefficient for some write pattern. Or I didn&#8217;t select the correct options when setting it up.</li>
<li>I need to find a better monitoring tool for my raid.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/linux/load-solved/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>500 jours dans la vallée de silicium</title>
		<link>http://www.melaneum.com/blog/reflection/500-jours-dans-la-vallee-de-silicium</link>
		<comments>http://www.melaneum.com/blog/reflection/500-jours-dans-la-vallee-de-silicium#comments</comments>
		<pubDate>Thu, 03 May 2012 04:42:14 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Reflection]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=370</guid>
		<description><![CDATA[Ca fait à peu près 500 jours que je suis arrivé dans la vallée de silicium. C&#8217;est un monde un peu à part: dans un rayon de 10 km, on y trouve Apple, Cisco, Ebay, Facebook, Google, HP, Intel, Nvidia, Yahoo et aussi tous les gens qui y travaillent. Ca donne un univers un peu [...]]]></description>
			<content:encoded><![CDATA[<p>Ca fait à peu près 500 jours que je suis arrivé dans la vallée de silicium. C&#8217;est un monde un peu à part: dans un rayon de 10 km, on y trouve Apple, Cisco, Ebay, Facebook, Google, HP, Intel, Nvidia, Yahoo et aussi tous les gens qui y travaillent.</p>
<p><span id="more-370"></span></p>
<p>Ca donne un univers un peu décalé: au supermarché on peut voir des gens se balader avec un tee-shirt sur lequel il y a quelques lignes en Haskell, et le caissier poser des questions sur le sujet. C&#8217;est possible aussi que ce soit précisement le supermarché où les employés d&#8217;Apple sont allés acheter le beurrier et les déodorants (les billes!) pour réaliser une des premières souris il y a 30 ans&#8230;</p>
<p>Evidemment tous ces geeks, ca pose des problèmes: par exemple, je capte au moins 32 réseaux wifi chez moi avec toutes les interférences que ca pose (et il faut garder en tête qu&#8217;il y a très peu de batiments de plus de 2 étages et que la densité est très faible). Tout le monde change de canal de temps en temps pour optimiser sa réception. Ca donne aussi un monde hyperfocalisé sur les dernières nouveautés: la prochaine startup qui va révolutionner le monde, le dernier produit de X, l&#8217;achat de Y par Z, l&#8217;entrée en bourse de W, avec les loyers qui suivent le cours de la bulle&#8230; Le moindre couple d&#8217;amis a au moins une moitié dans le hardware ou le software.</p>
<p>Aux US, on peut aussi personnaliser sa plaque d&#8217;immatriculation. Du coup, ici on trouve des choses comme &#8220;C IN 3D&#8221; ou &#8220;UID EQ 0&#8243; pour quelques exemples que je croise régulièrement tous les matins. Dommage que ca soit limité à 7 charactères, sinon <a href="http://xkcd.com/327/">quelqu&#8217;un</a> aurait tenté un &#8220;&#8216;;DROP TABLE&#8221; pour faire sauter les contraventions.</p>
<p>A part ca, la diversité est impressionante, les gens viennent de partout (bon, ok, beaucoup d&#8217;inde et de chine, mais c&#8217;est surement proportionnel à la part dans la population mondiale). Dans la moindre équipe de travail, il y a au moins 3 continents représentés, pareil pour la moindre sortie avec des amis (euh ok, juste une sortie en famille et c&#8217;est déjà le cas pour moi&#8230;). Et même parfois on trouve des américains. L&#8217;avantage, c&#8217;est que du coup on n&#8217;a pas de problème pour trouver des bons restos et des ingrédients à cuisiner (ca contraste avec mon séjour dans &#8220;upstate New York&#8221; il y a quelques années).</p>
<p>C&#8217;est aussi un peu dans le futur, les <a href="http://www.youtube.com/watch?v=cdgQpa1pUUE" title="Voiture autonome">voitures autonomes</a> sont sur ma route tous les matins, les gens se promènent avec de <a href="http://www.youtube.com/watch?v=9c6W4CCU9M4" title="Lunettes">droles de lunettes</a> et tout le monde teste la dernière nouveauté secrète de sa compagnie respective.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/reflection/500-jours-dans-la-vallee-de-silicium/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sort tsv</title>
		<link>http://www.melaneum.com/blog/linux/sort-tsv</link>
		<comments>http://www.melaneum.com/blog/linux/sort-tsv#comments</comments>
		<pubDate>Sun, 22 Apr 2012 06:32:20 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=376</guid>
		<description><![CDATA[A syntax that I&#8217;ve been looking up far too many times over the past few days: sort -rnk2 -t $'\t' Basically that&#8217;s the answer to the question &#8220;How to sort a tsv file in reverse order by the values of the second column?&#8221;.]]></description>
			<content:encoded><![CDATA[<p>A syntax that I&#8217;ve been looking up far too many times over the past few days:</p>
<pre>sort -rnk2 -t $'\t'</pre>
<p><span id="more-376"></span></p>
<p>Basically that&#8217;s the answer to the question &#8220;How to sort a tsv file in reverse order by the values of the second column?&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/linux/sort-tsv/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch mode</title>
		<link>http://www.melaneum.com/blog/emacs/batch-mode</link>
		<comments>http://www.melaneum.com/blog/emacs/batch-mode#comments</comments>
		<pubDate>Sat, 17 Mar 2012 06:05:41 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=364</guid>
		<description><![CDATA[Sometimes, I reach the limit of what I can do with a line of find &#124; grep &#124; sed and all the \/\/$.*()\/\/ that goes in&#8230; Write once, never come back. It almost look like perl sometimes&#8230; Few days ago, I&#8217;ve just realized that emacs has a batch mode: you write your function (leveraging all [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, I reach the limit of what I can do with a line of <code>find | grep | sed</code> and all the <code>\/\/$.*()\/\/</code> that goes in&#8230; Write once, never come back. It almost look like perl sometimes&#8230;</p>
<p><span id="more-364"></span></p>
<p>Few days ago, I&#8217;ve just realized that emacs has a batch mode: you write your function (leveraging all the existing emacs functions), put it in a file and you can apply it on a bunch of files:</p>
<pre>emacs -batch myfile.cc \
-l the-lisp-file.el \
-f the-function</pre>
<p>Not necessarily the fastest or the most portable, but if you happen to have the right emacs function around, that&#8217;s invaluable. For example, I wouldn&#8217;t be too sure how to grep/sed to do this:</p>
<pre>
(defun apply-style ()
  (c-set-style "stroustrup")
  (indent-region (point-min) (point-max) nil)
  (save-buffer))
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/emacs/batch-mode/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs function of the day</title>
		<link>http://www.melaneum.com/blog/emacs/emacs-function-of-the-day</link>
		<comments>http://www.melaneum.com/blog/emacs/emacs-function-of-the-day#comments</comments>
		<pubDate>Mon, 12 Mar 2012 02:13:51 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=355</guid>
		<description><![CDATA[When playing with csv files today, I discovered two very useful function: The first one is M-x keep-lines that allow to remove all the lines that I don&#8217;t care about. The second one is M-x csv-kill-fields from the csv mode that allow me to remove all the columns I don&#8217;t want. With these (and some [...]]]></description>
			<content:encoded><![CDATA[<p>When playing with csv files today, I discovered two very useful function:</p>
<p>The first one is <code>M-x keep-lines</code> that allow to remove all the lines that I don&#8217;t care about. </p>
<p><span id="more-355"></span></p>
<p>The second one is <code>M-x csv-kill-fields</code> from the <a title="csv mode" href="http://www.emacswiki.org/emacs/csv-mode.el">csv mode</a> that allow me to remove all the columns I don&#8217;t want.</p>
<p>With these (and some variants around), I&#8217;m all set for some quick data filtering.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/emacs/emacs-function-of-the-day/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do-it-yourself infrared Monitoring</title>
		<link>http://www.melaneum.com/blog/open-source/do-it-yourself-infrared-monitoring</link>
		<comments>http://www.melaneum.com/blog/open-source/do-it-yourself-infrared-monitoring#comments</comments>
		<pubDate>Wed, 13 Jul 2011 04:40:20 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=294</guid>
		<description><![CDATA[Quick summary: night vision video on a budget. Apparently, or so I discovered recently, a baby requires care all the time. All the time. Even when sleeping peacefully. Just take at the range of products and you&#8217;ll see that this did not escape some astute companies. The most interesting part (also the most expensive and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Quick summary:</strong> night vision video on a budget.</p>
<p>Apparently, or so I discovered recently, a baby requires care all the time. All the time. Even when sleeping peacefully. Just take at the<br />
<a href="http://www.google.com/search?hl=en&amp;q=baby%20monitoring&amp;tbm=isch">range of products</a> and you&#8217;ll see that this did not escape some astute companies.</p>
<p><span id="more-294"></span></p>
<p>The most interesting part (also the most expensive and probably the most useless) is the video component. It comes in two parts:</p>
<ul>
<li>a wireless webcam, with some infrared LED to be able to monitor in the dark</li>
<li>a receiving unit with a screen roughly the size of a post stamp</li>
</ul>
<p>There is a huge range of products, with options ranging for 300 foot range (my place is not that big), support for 4 room camera simultaneously (don&#8217;t have enough rooms), belt clip, touch screen to zoom, waterproof, etc.</p>
<p>However, I was not very happy to go and buy one of these devices for several reasons:</p>
<ul>
<li>there is no information about the protocol used for the wireless communication. Given the security record for this kind of device (for examples on how to spy on your neighbor baby, see <a href="http://abcnews.go.com/Technology/baby-video-monitors-invite-burglars/story?id=11992731">here</a> and <a href="http://www.wired.com/threatlevel/2009/11/baby-monitor/">here again</a>), it&#8217;s better to assume that all the neighborhood can help you keep an eye on your baby. I&#8217;m not very comfortable with that.</li>
<li>it&#8217;s a one use device: you need to monitor the baby for a few months and then, you&#8217;re left with something to stuff in a cupboard (for a few years?).</li>
<li>it does what it was designed to do. And only that.</li>
<li>and it cost a few hundred dollars.</li>
</ul>
<p>So I started toying around with the idea of making my own. The basic idea is simple: hook a webcam to an old laptop and stream the video over wifi, then pick the stream on a computer screen, the tv, or whatever you can imagine. I was pretty confident for the second part of the project: once I have the image on the laptop, the rest would be straightforward.</p>
<p>The tricky part is to get to see in the dark: if you need to shine a projector on your newborn to seen if he is sleeping well, that could be disruptive. So I&#8217;ve started to do some research on the technology used by these products. They are all using the same principle, few infrared (IR) LED around the webcam so illuminated the scene without being disruptive (the human eye can&#8217;t see infrared). So this is active imagery, I needed to find a solution for the receiver (webcam) and for the emitter (IR-illuminator).</p>
<p>Some constraints for the emitter: as I wanted to avoid pluging too many stuff around, it has to be powered by the USB port (5V). </p>
<p>Standard CCD are sensitive to IR and will be able to show it very clearly. The trick is that most webcam have a filter to remove it as most user want to see the same stuff with the webcam than with their eye. Without this filter, most of the vegetation is bright white:</p>
<p><center><a href="http://www.melaneum.com/blog/wp-content/uploads/2011/06/Tree_example_IR1.jpg"><img class="size-medium wp-image-49 aligncenter" title="IR photography example" src="http://www.melaneum.com/blog/wp-content/uploads/2011/06/Tree_example_IR1.jpg" alt="IR photography example" width="160" height="106" /></a></center></p>
<p>This photo is from the wikipedia page on <a href="http://en.wikipedia.org/wiki/Infrared_photography">Infrared photography</a>.</p>
<p>Just to be clear, this has nothing to do with thermal IR, the wavelength of these LED is just above the red color (ended up using 950 nm LED).</p>
<p>Apart from the artistic aspect of it, IR imagery using cheap webcam has two main markets it seems. One is baby monitoring as we&#8217;ve already established, the other one is security monitoring (I sure hope that they don&#8217;t come with the security flaws we&#8217;ve seen above).</p>
<p>In the security camera market, the device are more flexible in the sense that they are made to be combined, adapted to existing systems, etc. Two major problems for me: outputs are usually RCA (great if you want to plug it to a VCR, not if you have an old laptop) and power for the IR illuminators is 12V (usb port deliver 5V). So out are the security devices.</p>
<p>The best option was to build my own illuminator. There are plenty of IR LED available on the web: just combine a few of them, with some resistors, connect it to the USB port and voila! Few questions, though:</p>
<ul>
<li>how many LED to use? I started with 3, tried 6 and settled on 12. It seems sufficient to provide some indirect illumination in a dark room</li>
<li>what resistor to use? I reused some basic rusty electronic skills, but it was great to check all on <a href="http://led.linear1.org/led.wiz">http://led.linear1.org/led.wiz</a>.</li>
<li>where to buy the material? The radioshack I tried was hopeless (I just got some wire from there), ebay had plenty of LED sellers (but the quality was dubious), so I settled for SparkFun (no problem at all).</li>
</ul>
<p>And few wire stripping later, here is the prototype:<br />
<center><img class="size-medium wp-image-49 aligncenter" title="IR illuminator" src="http://www.melaneum.com/blog/wp-content/uploads/2011/06/circuit.jpg" alt="IR illuminator" width="300" height="181" /></center></p>
<p>The laptop is an 8-years-old Thinkpad T40 (one of the most reliable piece of hardware I&#8217;ve seen), the webcam a logitech quickcam (as old as the T40) with the IR filter removed.</p>
<p>The thinkpad is connected to the wireless network (using WPA encryption) and the video streaming is started with:</p>
<pre><small>cvlc -vvv --color v4l:///dev/video0:norm=ntsc:frequency=543250:\
size=320x240:channel=0:adev=/dev/dsp:audio=0 --sout \
'#transcode{vcodec=mp4v,acodec=mpga,vb=500,ab=256,\
venc=ffmpeg{keyint=80,hurry-up,vt=800000}}:\
standard{access=http,mux=ts,dst=10.1.10.14,port=8080}' --ttl 2
</small></pre>
<p>On the other computer (which is conveniently placed in the middle of the living room), just open a vlc and open a network stream on </p>
<pre>http://10.1.10.14:8080</pre>
<p>And you get something like this:</p>
<p><center><br />
<img class="size-medium wp-image-49 aligncenter" title="vlc screenshot" src="http://www.melaneum.com/blog/wp-content/uploads/2011/06/vpn-snapshot3.png" alt="vlc screenshot" width="300" height="282" /><br />
</center></p>
<p>One problem still, there is some buffering issues and the video suffers a delay of a few seconds on the receiving side that increases slowly. I reach 20s delay after one hour. No solution yet apart from restarting vlc on the client side.</p>
<p>So we are done with the basic minimal setup, but there is a lot of room for improvement, limited only by imagination and by the sleepless nights to come.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/open-source/do-it-yourself-infrared-monitoring/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Back to Cuda</title>
		<link>http://www.melaneum.com/blog/cuda/back-to-cuda</link>
		<comments>http://www.melaneum.com/blog/cuda/back-to-cuda#comments</comments>
		<pubDate>Wed, 29 Jun 2011 05:10:15 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Cuda]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=333</guid>
		<description><![CDATA[After one year without doing much with cuda (since this), I&#8217;m back! Last time, I had some problems with gcc 4.4 not being supported, I had to downgrade to 4.3. Sure enough, similar problem this time when trying to compile the SDK: /usr/local/cuda/include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.5 and up are not [...]]]></description>
			<content:encoded><![CDATA[<p>After one year without doing much with cuda (since <a href="http://www.melaneum.com/documents/EChristophe2011-GPU.pdf">this</a>), I&#8217;m back!</p>
<p><span id="more-333"></span></p>
<p>Last time, I had some problems with gcc 4.4 not being supported, I had to downgrade to 4.3. Sure enough, similar problem this time when trying to compile the SDK:</p>
<pre>
/usr/local/cuda/include/host_config.h:82:2: error: #error --
unsupported GNU version! gcc 4.5 and up are not supported!
</pre>
<p>This time, my standard gcc is 4.6&#8230; we are two versions back now.</p>
<p>The fix is simple: edit the common.mk files to have</p>
<pre>
CXX        := g++-4.4 -fPIC
CC         := gcc-4.4 -fPIC
LINK       := g++-4.4 -fPIC
NVCCFLAGS       := --compiler-bindir /usr/bin/gcc-4.4
</pre>
<p>(note that there are two common.mk to compile the whole SDK).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/cuda/back-to-cuda/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Give me back the metric system!</title>
		<link>http://www.melaneum.com/blog/reflection/give-me-back-the-metric-system</link>
		<comments>http://www.melaneum.com/blog/reflection/give-me-back-the-metric-system#comments</comments>
		<pubDate>Sun, 23 Jan 2011 00:24:47 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Reflection]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=277</guid>
		<description><![CDATA[After living in the US for 3 months, I still don&#8217;t get it: how is it possible that this country is still not using the metric system? According to wikipedia US is among only 3 countries in the world where this is not the official system of measurement. The other two are Burma and Liberia. [...]]]></description>
			<content:encoded><![CDATA[<p>After living in the US for 3 months, I still don&#8217;t get it: how is it possible that this country is still not using the metric system? According to <a href="http://en.wikipedia.org/wiki/Metric_system">wikipedia</a> US is among only 3 countries in the world where this is not the official system of measurement. The other two are Burma and Liberia. No comment.</p>
<p><span id="more-277"></span></p>
<p>It&#8217;s not only a question of using a different system. I&#8217;m happy to adapt to driving on the <del datetime="2011-01-22T22:18:31+00:00">wrong</del> left side of the road in half of the countries in the world, or (try) to speak a different language, or eat different food (I love that last one!). Even if the fact that this is a different system alone can cause some issues (like the crash of the &#8220;Mars Climate Orbiter&#8221; due to <a href="http://en.wikipedia.org/wiki/Mars_Climate_Orbiter">the failure to use metric units</a>), the main issue is that the system in use here does not make sense.</p>
<p>The metric system has been invented more than 200 years ago and adopted by most countries for a good reason, <strong>it makes things easier!</strong> If it didn&#8217;t, the cost of change (which traumatize at most one generation) would have been enough to prevent most countries to change. Surprisingly enough, the US was among the first countries to sign the <a href="http://en.wikipedia.org/wiki/Metre_Convention">meter convention</a>. But the change has been slow to trickle down to people&#8230; (133 years so far, that&#8217;s more than 5 generations!)</p>
<p>The other day, I was driving down the 101, 3 ¼ <em>miles</em> before the exit I went under a bridge where the height limit was 14 <em>feet</em> and 4 <em>inches</em>, then I stopped in the supermarket (300 <em>feet</em> after the exit) to buy ½ <em>gallon</em> of milk as I needed 2 <em>cups</em> for a recipe (how many cups in a gallon anybody?), 8 <em>oz</em> of orange juice and a one <em>pound</em> steak (or was it 16 <em>oz</em>?). This obviously doesn&#8217;t make sense. And I&#8217;m not even going into the issues of combining these units for strength, density, etc&#8230; Also note that the cooking cup unit is not the same in UK, USA and Australia (more than 20% different)&#8230; that might make it more difficult to translate a cookbook from british to american that from chinese to french (who wants to translate a british cookbook anyway?).</p>
<p>I pity the poor primary school students who have to go through this and I can imagine the endless amount of exercises that this can generate. This would be enough to disgust anybody from science. Could this be a reason for the &#8220;<a href="http://science.education.nih.gov/SciEdBlog.nsf/dx/01262010112518AMDOMM9V.htm">US education crisis</a>&#8221; mentioned in <a href="http://www.washingtonpost.com/wp-dyn/content/article/2007/12/04/AR2007120400730.html">numerous articles</a>? That would probably not hurt to remove few months spent converting miles to feet to inch or explaining the concept of density (is it in pound per gallon or ounce per fluid ounce here?). </p>
<p>That could be even worst actually, I should feel lucky that the basic time unit is the second at least and not the microfortnight from the <a href="http://en.wikipedia.org/wiki/FFF_system">FFF system</a>.</p>
<p>One another interesting point is the way to measure the consumption of the cars. In most places is in l/km (litre per kilometer), in the US it&#8217;s in mph (miles per gallon). It&#8217;s not only the units which are changed, but the ratio is also inverted. Is it coming from a difference in objectives? In most of the places, people want to know how much they will use to go where they need to, but here, people want to know where they can go with what&#8217;s left in the car. Or maybe it&#8217;s just because here: bigger is better!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/reflection/give-me-back-the-metric-system/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Open source, licenses, patents et cetera</title>
		<link>http://www.melaneum.com/blog/open-source/open-source-licenses-patents-et-cetera</link>
		<comments>http://www.melaneum.com/blog/open-source/open-source-licenses-patents-et-cetera#comments</comments>
		<pubDate>Mon, 19 Apr 2010 13:59:28 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Reflection]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[gpl]]></category>
		<category><![CDATA[license]]></category>
		<category><![CDATA[patent]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=247</guid>
		<description><![CDATA[Recently, I got more interested in the subtleties of different open source licenses. Luis Ibáñez pointed be to some books about that. One is &#8220;Open Source Licensing, Software Freedom and Intellectual Property Law&#8221; by L. Rosen. This book is written in the context of US law, but lot of it should be applicable in international [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I got more interested in the subtleties of different open source licenses. <a href="http://www.kitware.com/company/team/ibanez.html">Luis Ibáñez</a> pointed be to some books about that.</p>
<p><span id="more-247"></span></p>
<p>One is &#8220;Open Source Licensing, Software Freedom and Intellectual Property Law&#8221; by L. Rosen. This book is written in the context of US law, but lot of it should be applicable in international contexts. Beyond the basis, I discovered some pretty interesting stuffs. Some are summarized here, but referring to the original book would be good idea. </p>
<p>The first one was the difference between copyright law and contract law. Basically, copyright prevent anybody from making copies of your program, the open source license is the thing that will allow other people to do so. The copyright law is enforceable only by the owner of the copyright. That mean that somebody creating a derivative work won&#8217;t be able to enforce the license (as he doesn&#8217;t own the copyright). To be able to do so, it must be done under contract law. Thus, a contract must be presented, considered and accepted by the user: <em>click-wrap</em> method (accept button on a website, at the installation, etc) are acceptable.</p>
<p>Few of the most popular licenses (BSD, GPL for example) explicitly mentioned that. Even, the GPL is intended to be applied only as license not a contract.</p>
<p>The possibility of dual licensing is also well explained. I was familiar with the example of Mysql where companies are ready to pay to avoid the obligation of the GPL. But the example of Ghostscript was more unusual: they use the concept of scheduled licensing, where companies pay to have the product one year before the open source version.</p>
<p>Another interesting part of the book is about the open source license with a commercial origin (CPL, OSL and AFL) and particularly their patent defense strategy. The idea is to say &#8220;you get a license to use, copy, etc this software, but if you sue us for any patent infringement, this license is revoked&#8221;. That work for big corporations with a significant patent portfolio, much less for small open source projects. That&#8217;s amazing to see how these big corporation are building an arsenal of patents mostly as a deterrent.</p>
<p>Related to the patent in softwares, the FSF came out with a short movie illustrating the issue: <a href="http://patentabsurdity.com/">Patent Absurdity</a>. In this movie, one analogy is particularly striking: what would have happened if the patent had been available for music in the 1800s ? As the end of this movie, they illustrate the concept with a Beethoven symphony:</p>
<p><object width="425" height="350"><param name="movie" value="slVseKxhjjU"></param><param name="wmode" value="transparent" ></param><embed src="http://www.youtube.com/v/slVseKxhjjU" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p>
<p>(Note: I sure hope this use of the video come under fair use, as I don&#8217;t think it can come under the CC-non derivation as I extracted only part of it. Let&#8217;s see if it gets me into trouble with the FSF&#8230;)</p>
<p>To come back to the license issue, one question is &#8220;what license to use?&#8221; Obviously, compatibility with the other softwares you&#8217;re planning to work with is an important consideration. The question of compatibility comes both ways: can you use this particular software and can you be used by this software? Of course, I&#8217;m not really being precise here: the issue is not really when <em>using</em> the software but <em>redistributing</em> it (but that the whole point of an open source license as they all guaranty that you can <em>use</em> the software with complete freedom anyway).</p>
<p>In most cases, the choice ends up being between an <em>academic license</em> (such as BSD) and a <em>reciprocal license</em> (GPL is one). If the philosophy of the GPL is laudable (every software would end up being shared), it is also very controversial with some even using the misleading term of <em>viral</em> (note: a virus is rarely something you can choose not to get, for a license, you can). On one hand, I wouldn&#8217;t want to have my own bugs served me back in a closed source software preventing me to fix them. Also, if somebody uses my work to make a good, fun, useful program, I&#8217;d hate not to be able to have a look in the inside to understand how they did it. But on the other hand, the controversy and misunderstanding around the GPL could slow down the progress of an open source project. This point was illustrated by Paul Ramsey on this post: <a href="http://blog.cleverelephant.ca/2010/04/on-road-to-damascus-gpl-to-bsd.html">On the road to Damascus&#8230; GPL to BSD</a>. The license is not all what matter in an open source project. The community around it is a very important asset and will more efficiently compel people to give back their improvements to avoid the hassle of keeping these improvements in synchronization while the project progress.</p>
<p>Patents and licenses are only part of the issue as the recent problem in <a href="http://www.itk.org/">ITK</a> with the <a href="http://www.itk.org/Wiki/Proposals:Sparse_Linear_Solvers">sparse linear solver</a> highlighted recently. In this particular case, the problem was that some code relied on algorithms copyrighted to the ACM (that&#8217;s what happen when you publish a paper in ACM). The <a href="http://www.acm.org/publications/copyright-statement?searchterm=copyright">ACM copyright</a> precludes uses for commercial purposes. As such, the ACM copyright is <em>incompatible</em> with <em>any</em> open source license (as they all guaranty <a href="http://www.opensource.org/docs/osd">No Discrimination Against Fields of Endeavor</a>) at least without an explicit permission from the ACM. Apparently, request from ITK to the ACM for the inclusion of these particular algorithms were not successful. At the end, another algorithm was included requiring a translation from Fortran to C++. That&#8217;s quite an unfortunate and (from a technical point of view) unnecessary duplication of efforts, wasting resources (i.e. developer time) that could have been better employed (ITK objective is to provide image analysis tools in the medical domain).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/open-source/open-source-licenses-patents-et-cetera/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

