The better-than-open-source pledge

The choice of the license (free, open, or other) under which a piece of software is released is up to its copyright owner. But there is nothing that prevents a licensee to go beyond what was asked by the licensor.

A long time ago I was involved in discussions with a device vendor and my main requirement, as the person who had to make it work with our software, was to get the firmware source code under a license that would permit us to modify it and to install it in the devices that will be used by our customers. That seems the most obvious thing in the world: If there is a bug in the firmware, I want to be able to fix it immediately and under my own responsibility. Even if I was clear that the license I wanted would not permit any form of redistribution outside the devices that would have been paid for, this request was rejected. I never knew the real reasons but in my experience there is two main reasons companies refuse to share their code source: They do not own it in the first place, or they are ashamed of showing the source code to other developers.

Anyway, I still firmly believe that it should be illegal to sell a device without the source code under the kind of very restrictive license described above (an emulator should also be provided by the vendor, but that will be a discussion for another post). Now that I am working on my own device(see the Nephelion Project for more details), I plan to put my money where my mouth is and release all the source code under such licensing terms, so my future customers can do with it exactly what I want to do with the devices I buy. The closest license I could find is the AGPL3, so this is what I will be using.

As a producer of software, I highly value my own work, so if on the one hand I want my customers to be able to fix bugs and customize the software to their needs, on the other hand I still want some kind of payment for my work on the software. The AGPL3 license provides this as a form of “pay it forward” by forcing anybody that modified my software, for any reason, to publicly release these modifications under the same licensing terms.

Open Source licenses (as opposed to Free Software license) do not force this sharing. This is why consumers of software like these licenses – as consumers of software, we undervalue them because we do not want to spend any money or effort on it – or let investors know that we did not really write any new software.

What I think is wrong with this is that I should not ask others to release their modifications to my software and at the same time do not release my own modifications to software I use. As I said at the beginning, the license is the choice of the copyright owner, and only the copyright owner, and I am not saying that they should change this choice. But there is absolutely nothing that prevents me to treat a software released under an open source license as if it was released under a free software license, i.e. to publicly publish my modifications even if there is nothing in the license that force me to do so.

And this is why I pledge that, for any software that I will release under any FOSS license, I will treat all the modifications I made to all the dependent software used by that software as if they were licensed under the AGPL3 license, and release them publicly under a license that is compatible with the license of the dependent software.

Network applications demos in coffeehouses

Preparing a demo in your office is stressful enough – the demo need to be tested and rehearsed again and again until the time of the demo itself. A demo of a network application is even more challenging because even in a controlled environment like an office you never know when a coworker will bring down the network by transferring huge files, or when a system admin will decide to do maintenance on a server at the same time (all real life examples, sadly). But there is nothing worse than having to demo a network application in a coffeehouse or a restaurant, which is, it seems, where 99% of these demo are done in the Bay Area. I did a lot of demos of a network application in such conditions in the last 18 months, without one single failure, so this blog entry will explain the environment I used, in the hope that it will be useful to someone else.

The WiFi in these places is generally slow and flaky, so the worst thing to do would be to use it. That’s OK, I do not trust so-called experts to provide me a decent network, so why would I expect people whose job is to prepare a good cup of coffee to do better? Instead I used a laptop on which I installed the same software that is running in our data center, and I configured the laptop to be a WiFi Access Point. It was not the network application that was tailored to run on a special network (which would required to build an application that is different from the real product), it was my laptop that was simulating a very small instance of the Internet.

The first step was to find a Wifi adapter that could be used as a a Wifi Access Point (AP). I needed a adapter that is supported by the hostapd Debian package so I chose one from SIIG. The configuration of hostapd looks like this (/etc/hostapd/hostapd.conf):

interface=wlan1
driver=nl80211
ssid=demo
country_code=US
hw_mode=g
channel=5
macaddr_acl=0
auth_algs=3
wpa=2
wpa_passphrase=Wrokwait3
wpa_key_mgmt=WPA-PSK WPA-EAP

The adapter needs an IP address, which is configured in /etc/network/interfaces:

allow-hotplug wlan1
iface wlan1 inet static
  address 10.254.251.1
  netmask 255.255.255.0

We need a DHCP server (package isc-dhcp-server) to allocate IP addresses to the devices that will connect to our AP (/etc/dhcp/dhcpd.conf):

subnet 10.254.251.0 netmask 255.255.255.0 {
  range 10.254.251.10 10.254.251.20;
  option routers 10.254.251.1;
  option domain-name-servers 10.254.251.1;
}

You can see here that the laptop will also be our DNS server. As I explained above we cannot depend on a connection to the real Internet, so we will have to also serve DNS requests. My favorite DNS server is djbdns so after installing the package I created a new tinydns instance (tinydns is the djbdns component that implements an authoritative DNS server):

$ tinydns-conf tinydns tinydns /etc/service/tinydns 10.254.251.1

The next step was to start tcpdump on the IP address of the AP to see what requests the network application will send. For each of them I needed to install the corresponding server and to add the DNS resource records in djbdns. For example the devices I used for the demo (Android Nexus One) need to synchronize with NTP, so I installed the ntp server so it is running on the AP (/etc/default/ntp):

NTPD_OPTS='-g -I wlan1'

Then I added the following lines in djbdns to redirect the devices to my NTP server (/etc/service/tinydns/root/data):

.ntp.org:10.254.251.1:ns1.ntp.org
=north-america.pool.ntp.org:10.254.251.1:3600

Finally because my demo devices were Android based, I printed the QR Code of the WiFi demo network and taped it directly on the Wifi adapter so the Android devices can be easily configured with the ZXing app.

Poor man’s copyboard

When I design something I generally do it on paper, with pencil and eraser. Everything generally go into a folder here I can look at it later as I tend to work on lot of stuff at the same time so some projects stretches for years. Sometimes it is because of lack of time, but it can be because I cannot solve a problem and it must go into background mode for some time. I even have some projects that went into sleep mode for a decade because my employer and I did not have the same understanding of section 2870 of the California Labor Code…

The paper and pencil method has its own set of problems, e.g. there is a limit of how much erasing you can do before having to use another sheet of paper. One interesting piece of hardware that I will certainly try when it will be available is the NoteSlate but meanwhile I installed a whiteboard in my office, and it had been an improvement, excepted for the fact that I could not easily keep a copy of whatever design was on the whiteboard when I had to switch to another project.

A copyboard is the obvious solution to this problem, but there is a reason why you see this kind of tool only in your lawyer’s office: With a minimum price of $1200, it is really expensive. So what I did is to install my SLR camera on a tripod in front of the whiteboard, and to connect the camera to my computer, so I can take a picture of the whiteboard at any time.


The picture above shows the exact setting, excepted that I had to remove the camera to take this picture, because it was my only camera with the field of view required for this picture.

The camera is connected to the computer through USB and is powered by an AC adapter so there is no need to recharge the battery. I did not want to have to go to the computer each time I wanted a picture, so the camera is triggered by a wireless remote controller.

The next step was to write a small script that automatically downloads the picture as soon it is taken and display it on the monitor:


#!/bin/bash
case $ACTION in
  init) ;;
  start) ;;
  download)
    display -resize 1600 $ARGUMENT & ;;
  stop) ;;
  "")
    gphoto2 --capture-tethered --hook-script=$0 --filename="/home/petithug/.whiteboard/wb%Y%m%d%H%M%S.%C"
    ;;
esac

Parallax: The Race to Measure the Cosmos

I had a long discussion the other day with my sister during which I told her how one-fifth of North-American believe that the the Sun is orbiting the Earth. I kept thinking about this after the end of the discussion, and I was wondering if there was a way to demonstrate to people, by a sort of experience that everybody can do on their home, that it is in fact the Earth that is moving around the Sun. I was thinking of something like the experience were you put a non-moving stick of butter in a microwave oven, measure the distance between the melting point and by multiplying by the frequency of the microwave, demonstrate the speed of light. Obviously if it took until two hundred years ago to find this proof, that was probably more complex that I expected. But perhaps that, like the measurement of the speed of light that everybody can do at home thanks to the availability of stuff that scientists did not had access to in the past, there was a way to also reduce the complexity to a combination of available equipment (I am an incorrigible optimist who believe that any problem can be solved by time and a better education).

Certainly the most understandable proof that we have today is that we are capable to send missions to Mars and that this would be impossible if our knowledge of how the solar system works was wrong. But that would be forgetting that most people who believe that the Sun is orbiting the Earth probably also believe that the travels to the Moon were an hoax, so we are back to the same problem: Until people can do the experience themselves, there is no way they will believe it. This is the reason why those people say that evolution is just a theory when they have no problem with the gravitation theory.

So I started to search what was the proof that the Earth is orbiting the Sun (I had no idea myself what was this proof, even if I do not remember ever having any doubt about this). The most fascinating one was called the aberration of light and was soon searching what kind of hardware James Bradley used to make this discovery. I knew it was some sort of meridian telescope and I was thinking that hooking up a Celestron telescope with a webcam connected on the Internet would permit to show to everybody the movement of the star that indicates that the Earth is moving on an ellipse – hoping that the progress in optics and computer would permit to replicate the experience. This is how I went to read on Google one or two pages of “Parallax: The Race to Measure the Cosmos”, immediately order it on Amazon, and read it back to back on two evenings. The book is a fascinating reading and I strongly recommend but it was a disappointment to discover that the kind telescope used by Bradley was still out of reach for an amateur (Here’s a picture that shows exactly what I mean).

I have some ideas on how to perhaps solve these problems but by lack of available time this project will unfortunately have to go on the “things to do when I am retired” folder. But that was a great book to read.

Long distance flight

Everybody who ever had to take a long distance flight knows this sensation. As soon as the door is closed on the taxi taking you to the airport, all your preoccupations disappear and you fell instantaneously relaxed because there is nothing more that you can do. You spent the last hours frenetically trying to put everything in order, sorting important emails, preparing the baggages, calling the credit card company. After the door closed, the two only things you need to keep an eye on is your passport and your credit card – everything can be fixed as long as you still have these.

Well, resigning is just like this. You did your best to leave things in a good shape, but you no longer have access to the servers, or the code or the company’s emails, so there is nothing more that you can do. Then you feel this deep serenity where your mind is freed of all preoccupations – you know it will not last, but you appreciate very minute of it.

And there is another parallel that I can draw between resigning and long distance flights: Because I woke up each morning between 2:00am and 5:00am for so many years, I now have to recover from work-induced jetlag.

Bluetooth Stereo Headphones

I bought this Bluetooth Stereo Headphones at Fry’s three weeks ago, and finally manage to have them working with my Treo 650. I use Pocket Tunes (which is now free with the Treo 680) to play music from my ogg-encoded collection (stored on SD cards), but the headphones cannot directly work because the Treo 650 does not support the Bluetooth profile for stereo. The customer support for Pocket Tunes directed me to Softick Audio Gateway, a software that can redirect the audio to the Bluetooth headphones.
The buttons on the headset can be used to pause, skip and change the volume without having to touch the Treo 650.
The headphones can also be used as a phone headset with the disconnectable microphone. My only complaints would be that a smaller, integrated, microphone would have been better, and could have been used to implement noise reduction.
The sound is good, the battery lasts for more than 6 hours and can be recharged on a USB port, which means one less charger to carry around. I like this headphones very much as I no longer need to use the Palm Stereo Headset, excepted on-board a plane where I believe it is still forbidden to use Bluetooth.