<?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>Wed, 13 Jul 2011 04:40:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>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>0</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>
		<item>
		<title>Increasing disk performances</title>
		<link>http://www.melaneum.com/blog/linux/increasing-disk-performances</link>
		<comments>http://www.melaneum.com/blog/linux/increasing-disk-performances#comments</comments>
		<pubDate>Wed, 17 Feb 2010 13:58:28 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=243</guid>
		<description><![CDATA[With all the recent multicore CPU, the bottleneck of processing is increasingly the IO from the disk. When compiling a bit project (especially linking), when processing gigabyte of data (now that loading up 4 GB in RAM is not a problem)&#8230; Of course, some (expensive) solutions exist: SCSI disks, SAS, and now SSD. But before [...]]]></description>
			<content:encoded><![CDATA[<p>With all the recent multicore CPU, the bottleneck of processing is increasingly the IO from the disk. When compiling a bit project (especially linking), when processing gigabyte of data (now that loading up 4 GB in RAM is not a problem)&#8230;</p>
<p><span id="more-243"></span></p>
<p>Of course, some (expensive) solutions exist: SCSI disks, SAS, and now SSD. But before going into that, just standard hard drives and a software raid can increase significantly the output. Using software raid 0 with two disks, you double the output and don&#8217;t loose any capacity. Well of course, there is a price, you increase the failure probability: if only one disk fails, that&#8217;s it, your data are gone. Don&#8217;t use that to store your precious data, just as an additional processing space for data that you can regenerate in case something goes wrong.  Don&#8217;t use that for the system, don&#8217;t use that for /home, etc&#8230; Additionally to a heavy processing place, you can also use that for the swap.</p>
<p>The setup is quite easy using mdadm. First, partition the first disk as you need, then copy the partition table to the other disk</p>
<pre>sfdisk -d /dev/sde | sfdisk /dev/sdf</pre>
<p>Create the software raid:</p>
<pre>mdadm -C /dev/md0 -l0 -n2 /dev/sde1 /dev/sdf1</pre>
<p>Format it:</p>
<pre>mkfs.ext3 /dev/md0</pre>
<p>Add the configuration to the mdadm config file:</p>
<pre>mdadm --detail --scan >> /etc/mdadm/mdadm.cong</pre>
<p>Configure the mounting point in /etc/fstab as if /dev/md0 was a normal partition and that&#8217;s it, you&#8217;re done.</p>
<p>You should be able to reach 200MB/s effectively with this if you&#8217;re using some recent hard drives that are going for less than USD100/TB.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/linux/increasing-disk-performances/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Wisdom of Crowds</title>
		<link>http://www.melaneum.com/blog/books/the-wisdom-of-crowds</link>
		<comments>http://www.melaneum.com/blog/books/the-wisdom-of-crowds#comments</comments>
		<pubDate>Mon, 25 Jan 2010 12:22:57 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=222</guid>
		<description><![CDATA[The Wisdom of Crowds is one of the latest book I&#8217;ve read that got me thinking. The general idea of the book is now quite well-known: combining the decision of a great number of people can reach an optimal choice more reliably than relying on an expert. But there are also several examples that are [...]]]></description>
			<content:encoded><![CDATA[<p>The Wisdom of Crowds is one of the latest book I&#8217;ve read that got me thinking. The general idea of the book is now quite well-known: combining the decision of a great number of people can reach an optimal choice more reliably than relying on an expert. But there are also several examples that are worth mentioning.</p>
<p><span id="more-222"></span></p>
<p>The chapter 8 highlights the fact that science is all about collaboration: first, of course, between scientists (this is more and more the case with the capacity we have to communicate nowadays) but also at the idea level. An idea first get published, then validated by the scientific community and finally accepted. This process has been pretty reliable so far: there have been incomplete ideas that were widely accepted, yes, but any plainly wrong idea that was widely accepted? I can&#8217;t think of an example (obscurantism of the Middle Ages aside). One of the condition for this collaboration to flourish is the open access to information: the example of the <em>Philosophical Transactions</em> journal from the <em>Royal Society</em> shows how this idea of open communication of idea was <em>central to the success of Western science</em>.</p>
<p>It is not mentioned in the book but this could well be extended to softwares. Either the software is designed and developed by an expert (or a small group of them), this is the traditional software development process or either the software grows into a more organic fashion that is typically the case for open source softwares. Another advantage is the access to the information on how the software is working and the possibility to adapt it: even if only a small number of the users would ever do that, the leverage is huge. The last advantage is the <em>survival of the fittest</em>: many open source projects start with similar goals and have to compete for the scarce resource that is programmers&#8217; attention. The competition among these projects enable to improve most of them and finally the disappearance of the less fitted to the task. </p>
<p>In the open source world, decisions are usually taken by a group of people rather than imposed. The book also describes the shortcoming of small groups that could, in some conditions, easily switch to some extreme positions and fail to reach an optimal solution. This is an important problem for open source projects that usually gather like-minded people which could prevent the appearance of alternative solution: getting different people on-board is critical.</p>
<p>Another examples that got me thinking is the illustration of the failure of some small groups in the context of space agencies. The author compares the team of the men that managed to save the Apollo XIII mission: <em>&#8220;most of those men had worked outside of NASA in many different industries before coming to the agency</em>&#8220;, with those at the time of Challenger accident: &#8220;<em>NASA employee today are far more likely to have come to the agency directly out of graduate school, which means they are also far less likely to have divergent opinions</em>&#8220;. Does that mean that space agencies like NASA, or private companies aiming at particularly difficult tasks should emphasize the diversity of background in their employees?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/books/the-wisdom-of-crowds/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PolSARpro on Debian testing</title>
		<link>http://www.melaneum.com/blog/remote-sensing/polsarpro-on-debian-testing</link>
		<comments>http://www.melaneum.com/blog/remote-sensing/polsarpro-on-debian-testing#comments</comments>
		<pubDate>Tue, 19 Jan 2010 06:24:52 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Remote sensing]]></category>
		<category><![CDATA[polarimetry]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=218</guid>
		<description><![CDATA[That&#8217;s not the first time that I use PolSARpro, the free software from ESA for SAR polarimetry, but every time, the installation is a bit tricky. Here are the steps to get it running on an update Debian testing. Install the required packages: apt-get install bwidget itcl3 itk3 iwidgets4 libtk-img Follow the instruction in the [...]]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s not the first time that I use <a title="polsarpro" href="http://earth.esa.int/polsarpro/">PolSARpro</a>, the free software from ESA for SAR polarimetry, but every time, the installation is a bit tricky. Here are the steps to get it running on an update Debian testing.</p>
<p><span id="more-218"></span></p>
<p>Install the required packages:</p>
<pre>
apt-get install bwidget itcl3 itk3 iwidgets4 libtk-img
</pre>
<p>Follow the instruction in the README_PolSARpro_Install_Linux.pdf file (unzip, run Soft/Compil_PolSARpro_v4_Linux.bat to compile).</p>
<p>Here if you try to run polsarpro, you&#8217;ll get an error message (probably depending on which tcl package you have)</p>
<pre>
version conflict for package "Tcl": have 8.4, need 8.5
</pre>
<p>To solve that, edit PolSARpro_v4.03.tcl and in the 3rd line, replace &#8216;wish&#8217; by &#8216;wish8.5&#8242;.</p>
<p>That&#8217;s it, should be running now !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/remote-sensing/polsarpro-on-debian-testing/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Complex system</title>
		<link>http://blog.orfeo-toolbox.org/tips/complex-system</link>
		<comments>http://blog.orfeo-toolbox.org/tips/complex-system#comments</comments>
		<pubDate>Fri, 18 Dec 2009 09:44:26 +0000</pubDate>
		<dc:creator>Emmanuel Christophe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OTB]]></category>

		<guid isPermaLink="false">http://blog.orfeo-toolbox.org/?p=280</guid>
		<description><![CDATA[OTB is a complex system, if you don&#8217;t believe it, look at the image here (click on it for a full view):

This image shows the dynamic dependencies of otb: the libraries required by each element. This image was generated using cmake:

cmake . --graphviz=otb-dep.dot
dot -Tpng -ootb-dep.png otb-dep.dot

It is a very useful representation to understand the potential [...]]]></description>
			<content:encoded><![CDATA[OTB is a complex system, if you don&#8217;t believe it, look at the image here (click on it for a full view):

<span id="more-233"></span>

This image shows the dynamic dependencies of otb: the libraries required by each element. This image was generated using cmake:

cmake . --graphviz=otb-dep.dot
dot -Tpng -ootb-dep.png otb-dep.dot

It is a very useful representation to understand the potential [...]]]></content:encoded>
			<wfw:commentRss>http://blog.orfeo-toolbox.org/tips/complex-system/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coders at work</title>
		<link>http://www.melaneum.com/blog/books/coders-at-work</link>
		<comments>http://www.melaneum.com/blog/books/coders-at-work#comments</comments>
		<pubDate>Thu, 26 Nov 2009 15:54:35 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=212</guid>
		<description><![CDATA[Just finished the book &#8220;Coders at work&#8221; from Peter Seibel where he interviewed some of the most accomplished coders/programmers in the art/craft/engineering/science of programming. The form is a bit surprising. In a book where several of the people being interviewed insist on the importance of details, on a subject for which a misplaced semicolon (think [...]]]></description>
			<content:encoded><![CDATA[<p>Just finished the book &#8220;Coders at work&#8221; from Peter Seibel where he interviewed some of the most accomplished coders/programmers in the art/craft/engineering/science of programming.</p>
<p><span id="more-212"></span></p>
<p>The form is a bit surprising. In a book where several of the people being interviewed insist on the importance of details, on a subject for which a misplaced semicolon (think C or Java) or an extra space (think Python) will let the edifice crumble, I couldn&#8217;t help but be bothered by the numerous missing spaces after dots, the missing or repeated words, the extra or missing boldface, etc.</p>
<p>Using Tex for the typesetting would have been a good illustration of the last interview (Donald Knuth).</p>
<p>Enough complains&#8230; the content is great and inspiring. I never heard of most of these people before (I knew only 3) but it&#8217;s great to see these different paths. The lisp community seems to be well represented, is it because every programmer did some lisp in the 60-70&#8242;s or because the author himself is part of this community? Anyway, that raised my curiosity and I&#8217;ll definitely have a look at it (or some of its children).</p>
<p>Javascript also appear to be worth looking at. The last look I had was around 98 when most of the time was spent making things work well with IE5 and Netscape.</p>
<p>As a direct consequence of this book, I&#8217;d borrowed a copy of the first volume of the &#8220;Art of computer programming&#8221;. Quite eager to start it now&#8230; Not sure I&#8217;ll practice literate programming, but looking at Tex source code is on my todo list.</p>
<p>There are points where they seem to all agree: the challenge of concurrency programming (most of there worst bugs were this kind) and the fact that the ideal language still has to come.</p>
<p>The interesting part was also in the diversity of opinions:</p>
<ul>
<li>on C between those who think pointer was the best invention ever and those thinking that it prevented any further progress in computing</li>
<li>on Perl where some praise the freedom it gives and other describes its syntax on very striking terms</li>
<li>on Java whose extensibility is on debate as well as its progress compared to other languages</li>
<li>even on Lisp, some mention its parenthesis excess</li>
</ul>
<p>It seems that there is still room for improvement to satisfy everyone! Only on C++ they seem to be quite unanimous (and negative). Bjarne Stroustrup would fit well in the interviewee list to balance this a bit.</p>
<p>The good stuff is that most of them still seem to have fun with what they are doing (and it&#8217;s mostly programming related stuff). It appears that the more you learn about the subject, the more windows open up and the part you think you know becomes smaller and smaller&#8230; this book definitely opened up many windows for me!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/books/coders-at-work/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding with style (mercurial kwstyle hook)</title>
		<link>http://www.melaneum.com/blog/python/coding-with-style-mercurial-kwstyle-hook</link>
		<comments>http://www.melaneum.com/blog/python/coding-with-style-mercurial-kwstyle-hook#comments</comments>
		<pubDate>Wed, 14 Oct 2009 08:56:42 +0000</pubDate>
		<dc:creator>Melaneum</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://www.melaneum.com/blog/?p=201</guid>
		<description><![CDATA[I like the source code to look good, have uniform presentation, etc. Maybe I&#8217;m a bit particular, but I&#8217;m definitely not alone here: KWStyle is a great tool to check a number of files and signal the imperfections. This is especially valuable for project where several people are involved and all using different editors. You [...]]]></description>
			<content:encoded><![CDATA[<p>I like the source code to look good, have uniform presentation, etc. Maybe I&#8217;m a bit particular, but I&#8217;m definitely not alone here: <a href="http://public.kitware.com/KWStyle/">KWStyle</a> is a great tool to check a number of files and signal the imperfections. This is especially valuable for project where several people are involved and all using different editors.</p>
<p><span id="more-201"></span></p>
<p>You can produce a very nice matrix like <a title="OTB style" href="http://www.orfeo-toolbox.org/style/">this one</a>. The only problem is that you have to go and actively look for it. As all stuffs that require a conscious effort and are not on the high priority list, this slip away and end up forgotten.</p>
<p>Few weeks ago, I discovered the capabilities of <a href="http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html">mercurial hooks</a>. So here is the idea: check the style with KWStyle each time the code is pushed to the reference hg repository. We can also check when the code is committed, but that requires each developer to set up the hook.</p>
<p>I just came out with a quick solution using the KWStyle program. It would be much better with some python bindings, but in one hour, I had no time to start building that. Here is the hook:</p>
<pre>def kwstyle(ui, repo, **kwargs):
  '''Use it like:

  [hooks]
  commit.kwstyle = python:/path/to/this/file.py:kwstyle
  changegroup.kwstyle = python:/path/to/this/file.py:kwstyle
  '''

  if kwargs.get('parent2'):
      return
  node = kwargs['node']
  ctx = repo[node]
  tempDir = '/tmp/'
  for filename in ctx.files():
    if (fnmatch.fnmatch(filename, '*.cxx')
        or fnmatch.fnmatch(filename, '*.h')
        or fnmatch.fnmatch(filename, '*.txx')):

      fctx = ctx[filename]
      #This would be better handled with python binding for kwstyle
      tempFile = tempDir+filename.split('/')[-1]
      f = open(tempFile,'w')
      f.write(fctx.data())
      f.close()
      cmd = "/home/kwstyle/KWStyle -v -xml /home/kwstyle/OTB.kws.xml " \
        +tempFile
      out = commands.getoutput(cmd)
      message = '*** Checking '+filename \
        +'\n'+'\n'.join(out.split('\n')[1:])
      ui.write(message)
      os.remove(tempFile)</pre>
<p>When a new changeset is pushed to the repository, modified files are checked and the result is displayed to the use such as:</p>
<pre>*** Checking modifiedFile.cxx
Error #13 (1) The header is incomplete
Error #9 (10) Number of empty lines at the end of files: 2</pre>
<p>This is just a quick draft, if it works well, it will be good to have a look at KWStyle python bindings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.melaneum.com/blog/python/coding-with-style-mercurial-kwstyle-hook/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

