Search Results: "nate"

11 April 2009

Dirk Eddelbuettel: New Garmin Forerunner

Going for a run--or a race--almost always meant grabbing the GPS and often also meant setting a target pace and distance. For the last four and a half years, this was measured by a Garmin Forerunner 201. That's the large rectangular model in the original "brick" form factor. I've come to love the device. Training is great because the distance log, as well as the pacing, keeps you honest. Racing is probably better because it helps a lot with the pacing (but then I also had PRs in race where I had forgotten the GPS at home). But there is a downside. This model sometimes takes forever to find tracking, and has interference / weak signal problems when it is cloudy or moist. But worst of all, it just bonks out in the 'urban jungle' downtown where it drops signals too easily. And now after all these years the display had some minor damage, the strap didn't really hold anymore, and it was generally time for something new. On Tuesday it even lost a quarter mile when we were going for a short but really fast three miler. But then a few days prior I had followed fellow Debian marathoner Christian and used my birthday at the end of this month (as well as the upcoming Boston Marathon) as an excuse for conspicuous comsumption. After some price comparison, I ordered a factory reconditioned Garmin Forerunner 405 from this web discounter at a nice rebate to the regular price. It arrived this afternoon, seemingly shining new and I have been fiddling with it for the last little while. This device features wireless data transfer to a usbstick. This meant booting the laptop in windoze for the first time in years to load the 'client software' after which data transfer proceeded. The Garmin Connect site has very slick presentation and aggregation of the data. The trouble is of course how to get the data there when running Linux... Christian had mentioned the garmin-forerunner-tools package. Unfortunately, this seems to really be written for the Forerunner 305 models as it doesn't see the device at all. Some more googling lead to this page and the gant tarball. All still fairly raw, but with some prodding in the settings of the 405 ('pairing' set to 'on', 'force send' set to 'yes'; which may have to be reset each time ?) I got my two xml files off the gps watch. Yay. We'll see what mode I will settle one. With the 201 and its ancient serial port, I basically just dropped the run and training histories which their fairly limited data collections. Last but not least, fellow Oak Park runner Peter Sagal had a humorous Runner's World column on the whole GPS geekyness. If he'd only known how to pair it with programming geekyness...

10 April 2009

Jurij Smakov: Series of unfortunate events

While I did not think I would continue hacking on VoiDroid after achieving a semi-broken proof-of-concept implementation, it seems that I can t get out of it easily :-). I spent today trying to implement a solution which would allow the native C++ code to call into Java - for example, if we have a call in progress, and want to update the call status displayed to the user when it changes. The JNI library has some native callbacks which are getting called on call state changes, but getting the information to Java turned out to be a quite an experience, which, I thought, would be amusing to document, and, hopefully, save someone some quality bang-head-on-desk time. 1. Some of the threads calling native callbacks were initiated in Java (and thus known to JVM), and some where not, they were started in the native code. As JVM did not know anything about them, JNI calls would fail without too much explanation. Eventually I figured that out, and started attaching them as appropriate (JNI provides facilities for that). 2. Even after attaching, I could not resolve references to my classes from the native code, until I found a mysterious line in JNI docs: When a thread is attached to the VM, the context class loader is the bootstrap loader.. Basically, it means that when you attach a native thread, it is only capable of resolving built-in Java classes. 3. I later found a reference to a technique, suggesting to cache a good classloader from a Java-initiated thread, and later set the classloader for the attached thread to it. I implemented that, only to find out that Android s JVM is not your regular JVM, so things are slightly different here, and this technique does not work. 4. Luckily, there is an incredibly useful post describing the problem, and suggesting a workaround: caching an instance of needed class globally in native code, after calling NewGlobalRef on it, to avoid garbage collection on exit from a native function. I did that, however I only had access to the class, and Android JNI only supports calling NewGlobalRef on an object, so I had to create a dummy object in the native code (JNI_OnLoad() function, actually) and cache that. 5. That finally enabled me to call into Java from native, attached threads (w00t!). Unfortunately, you are not allowed to modify the UI (exactly what I wanted to do from my Java callback!) from a non-UI thread, which brought me right back to the drawing board. 6. As callbacks initiated from native code would not work for this reason, it was suggested to me to use a classic producer-consumer mechanism, getting Java call into the native library block until new information gets delivered by a native thread. Easily done with some pthread mutexes, and the goal is close, right? 7. Wrong! Now the problem was that if I started a UI Java thread, which would call the native function in a loop to retrieve the data (it would not actually spin, as the native function blocks until new data is available), then it would be declared not responding by the UI framework in a few seconds. I could start a non-UI thread for that, but you guessed it a non-UI thread is not allowed to update UI! Instead of resolving the problem we just shifted it into the Java land. 8. While I was simply thinking about stuffing the result into a class variable and passing it to the UI thread this way, this tutorial, showing how to display a progress indicator while doing some heavy calculations in the background, provided a more elegant idea. One can use Android s android.os.Handler class to pass messages (with arbitrary payload) between threads. That was the last piece of the puzzle, which allowed me to finally achieve a working implementation (some 10 hours or so later :-).

Kapil Paranjape: Controvertialism

Rahul Basu pointed out an article by the eminent scientist Freeman Dyson. In the past Dyson has raised a number of interesting questions and has been thought-provoking, but it is difficult to read him when he writes like this. I have re-phrased what he has said (debunking climatologists) and turned it into an argument against the Large Hadron Collider so that we can see how obnoxious it sounds.1
My first heresy says that all the fuss about the Higgs particle is grossly exaggerated. Here I am opposing the holy brotherhood of high energy physicists and the crowd of deluded citizens who believe that the world is predicted by the standard model. Of course, they say, I have no degree in physics and I am therefore not qualified to speak. But I have studied the standard model and I know what it can do. The model solves the equations of gauge theory in the simplest cases, and it does a very good job of describing the interactions of the known particles. It does a very poor job of describing how mass arises and the chemistry and the biology of phenomena we see everyday. It does not begin to describe the real world that we live in. The real world is muddy and messy and full of things that we do not yet understand. It is much easier for a scientist to sit in an air-conditioned building and run computer models, than to put on a lab coat and measure what is really happening in the complex phenomena of compounds and materials. That is why the high enery physicists end up believing their own models.
The rest of the article can then be similarly re-phrased but I will just summarise it as:
There is no reason for the rest of the world to believe the high energy physicists and squander billions of dollars into following their proposed unique solution to the questions of physics.
Of course, there is a good chance that Dyson will agree with the above point of view as well! The problem with controversialists'' like Dyson is that they believe that taking extreme positions helps clarify issues. Unfortunately, extremists are a-dime-a-dozen in today's world. I suppose I should clarify that I accept neither the extreme position on climatology nor the one on the LHC!

  1. My friend is a high energy physics theorist!

MJ Ray: Do Some Good on Good Friday

Bloggers Unite for Earth Day
from BloggersUnite resources It s Good Friday and even if you don t believe the stories, maybe you d like to do some good today. Here are some things you might want to support:-

9 April 2009

Manoj Srivastava: Manoj: kernel-package: Add support for kernel image debug package

A new version of kernel-package in Incoming at the time of writing adds support for creating a package which contains the Linux kernel debug image. This means the debugging information for the modules in the kernel image package, and the uncompressed vmlinux image. This builds on suggestions and code from Troy Heber, Theodore Y. Ts o, and Dann Frazier. As support for kexec/kdump support becomes more real, it will be very useful to be able to build kernels that have debugging information available, but not necessarily to install the debugging information on every single client system. The .ko object files are stripped of the debugging information before they are placed in the standard linux-image installation package. However, before that, a copy of the vmlinux and unstripped .ko files are saved in a debuginfo package, and everything except for the debugging information is removed from them using objcopy --keep-only-debug. This means that if someone ends up with a crash dump, they can send it to a support engineer and only the support engineer needs to install the debuginfo package and use the crash utility to debug the crash dump. It s also useful for developers, since the debuginfo information can be stored somewhere outside of /lib for storing its debug information, for example. This is useful for keeping the size of the root partition small, for those who keep / separate from /usr. The locations used are compatible also with SystemTap, which provides free software infrastructure to simplify the gathering of information about the running Linux system. This assists diagnosis of a performance or functional problem. SystemTap eliminates the need for the developer to go through the tedious and disruptive instrument, recompile, install, and reboot sequence that may be otherwise required to collect data. Also, I had to clear out some FUD about kernel-package from the ircbot dpkg on the OFTC Debian IRC channel, since someone had implied that kernel-package was some how obsolete. As can be seen, it is being actively developed, and features are being added apace.

8 April 2009

Mike Hommey: Detecting per-process namespaces

Back with per-process namespaces. This time, I will give several methods to more or less reliably detect their use, some requiring root access, some not. We will, though, limit ourselves to mount namespaces , that is, not PID, UTS or network namespaces. The first method, which is based on the contents of /proc/pid/mounts should work on any kernel supporting namespaces (since 2.4.19):
$ md5sum /proc/[0-9]*/mounts awk -F [ /]* ns[$1] = ns[$1] ? ns[$1] , $3 : $3 END for (n in ns) print n, ns[n]
/proc/[0-9]* is used instead of /proc/* to avoid listing self, too. The awk script displays a summary : a md5 sum followed by the PID of all processes which /proc/self/mounts file has this md5 sum.
This method relies on the fact that the /proc/pid/mounts files may be different between namespaces, even when the same mount points are used because the ordering may differ. This method is obviously unreliable, except when all namespaces have different mount points. During my tests, it has been reliable to detect whether a process uses the same namespace as the init process, but different processes with different namespaces were reliably listed together as having the same namespace. The next method, based on the contents of /proc/pid/mountinfo will work on any kernel implementing this file (since 2.6.26):
$ md5sum /proc/[0-9]*/mountinfo awk -F [ /]* ns[$1] = ns[$1] ? ns[$1] , $3 : $3 END for (n in ns) print n, ns[n]
The script is essentially the same, only pointing at mountinfo instead of mounts.
This method is quite reliable, as /proc/pid/mountinfo does contain different information even when no mount point was changed within a namespace. Unfortunately, chrooted processes can have a different content while not being in a separate namespace. I ve not investigated further, but you may be able to spot chrooted processes by comparing /proc/pid/mountinfo and /proc/pid/mounts. Both the above methods can be executed as unprivileged user, which alleviates the fact they are not totally reliable. The last method, on the other hand, is reliable, but requires root privileges, and cgroup filesystem support in the kernel (since 2.6.24).
$ mkdir -p /dev/cgroup/ns
$ mount -t cgroup -o ns /dev/cgroup/ns
$ find /dev/cgroup/ns -name tasks xargs -l1 sed ':a;N;s/\n/,/g;ta'
The output here is a group of PID on separate lines for separate namespaces. The sed one-liner replaces all carriage returns in the tasks files with a comma.
You don t actually need root privileges for the last command, if the cgroup filesystem is already mounted. But there has been no normalization as to where the cgroup filesystems should be mounted yet, and they aren t mounted by default on most GNU/Linux distributions, I believe. Cgroups (Control groups) allow to put sets of processes together to give them special behaviour (cpu provisioning, memory limitations, namespaces, etc.). They also allow to do so in a hierarchical way, such that a cgroup can inherit the properties of its parent cgroup. As its name and the way it is mounted indicates, our /dev/cgroup/ns is specialized for namespaces cgroups. The directory itself contains a few files, most notably a tasks file containing a list of processes in the current set/cgroup (in our case, namespace). It also contains a subdirectory for each child namespace. Each of these subdirectories is similarly structured, so that it also contains a tasks list and possible subdirectories for its own children. This means that not only can you spot different namespaces, but you can also spot how they relate to each other. There are a few glitches, though. As with other cgroups subsystems, you can create new cgroups by creating a directory in the cgroup filesystem, but it happens not to create a new namespace in the case of the namespace subsystem. With all the kind of namespaces that now exist in Linux, this is not a big surprise, but there doesn t seem to be neither a feedback in the cgroup filesystem to know what kind of namespace is involved, nor a control to force creation of a really separate namespace. You also can t move processes from one mount namespace into another by writing a PID in the tasks file in a given namespace ; that just gives an Operation not permitted error. On the other hand, contrary to the second method, chrooted processes are not separated out. I will investigate further cgroups with PID, UTS and network namespaces and will post my findings.

6 April 2009

Francesco P. Lovergine: Current tasks for DebianGis

I'm still waiting some clarificatons by HDF team about their HDF5 roadmap with SONAMEs and libraries name. It seems they partially learned to manage libtool properly to follow C API changes, but still some oddities are present, such as using the same names for MPI and serial flavors. I will probably have to again diverge from upstream names, which is generally something I don't like, as in the case of GDAL. A summary document about HDF5 plans is due in a brief also.
When finished with HDF updates, I will concentrate on a couple of new beasts which still are lacking in DebianGis and are of so much interest, that are Ossim and the CNES Orfeo Toolbox. In the meantime I would hope that debian-science team will define a squeeze-related policy for MPI.

As always, I'm still worried of the low level of activities in the DebianGis team, which is a constant since years. Unfortunately, this is a situation I see quite common also in many other teams, but I still don't see a right way to improve the status of the team to avoid an almost one-man show. Also I would like to see again Qgis in main, but I'm still waiting for feed-backs by past/current contributors to my last qgis-dev list and off-lists polls.

5 April 2009

Christian Perrier: 42,195

Done. I'm right here now sitting on my couch and trying to recover my legs after that first marathon ever. As planned, I met Ralf Treinen and No l K the at the start of the Paris Marathon. As No l was targetting 3h30m while Ralf and I were targetting 4h, we left him go with the faster runners. As No l doesn't blog that much, I think I can say it now: he managed to run in 3h28m, which is awesome. He is incredibly happy with that (we unfortunately didn't manage to meet again after the race as the crowd was too huge and the cellphones were of course miserably failing). Ralf and I ran together the first 12 kilometers. Then we split because he had to stop for a few seconds. Up to the 21st kilometer, I kept the pace for 4h and I was even running a little bit faster. However, this advance vanished slowly from km 25, up to km 35 where the virtual runner that was running 4h passed me..:-). Ralf also passed me around km 38 which is indeed the moment where I was blowing up, running slower and slower. The last 3 kilometers were a nightmare but, still, I managed to finish and my GPS watch tells me I ran for 4h10m. The official time is 4h12m56s, because of a huge "runner jam" at Bastille where we had to wait for 3 minutes before being able to enter the Faubourg Saint-Antoine street. Running through Paris is really magic, particularly with the nice sun we had ( not *too* hot, though) and I am really proud and happy to have my first marathon finished *without walking*. Yay.

Vincent Fourmond: HADOPI: a great blow to freedom of expression and justice in France

Here I am, utterly disgusted. Last Thursday, around 11pm, two dozens of members of Assembl e Nationale (one of the two parliament chambers in France) voted the infamous law nicknamed HADOPI. Great... For the record, this chamber in principle counts 577 members. This law is an awful blow to the Internet, the freedom of expression and the legal system in France. The official aim of this law is to put a stop to illegal file-sharing within France. With this law, specially appointed private companies will file accusations saying: this IP downloaded something illegal at this date to a central authority, and this authority will send two warnings before cutting the Internet connection of the alleged illegal downloader for up to a year. You will notice that there is no mention of what the incriminated person allegedly downloaded. There will be no possibility of appeal until the sanction is executed. This scares the hell out of me. This spits upon so many aspects of the French legal system that it is honestly impressive... What about the French principle that says that everyone is innocent until proven guilty ? Here, you are declared guilty based on a rather weak evidence (on IP address !), and you'll have to prove your innocence. What about the principle that there needs to be a fair trial before the execution of the sanction ? You'll have to prove you are innocent after the execution, with the additional fun that it will turn almost impossible to prove it. Not to mention the fact that the companies harvesting IP addresses of alleged offenders will have a great deal of access to data you're exchanging; what about privacy ? For the record, this privilege, violating the way justice works in France, had only ever be granted to anti-terrorist cells. The fun thing is that this law is useless, at least in terms of the its official goal: the day it comes into application, illegal file sharers will encrypt their exchanges or fake their IP addresses, or do whatever else they might want to do to guarantee their anonymity, and no company will ever be able to find out what it is they exchange. I won't even mention the number of false positive of these automatic accusations: many innocent French web surfers will have their connection cut without ever knowing why and without any possibility to fight back. So, what is the real goal ? Or what will be the use ? I can only speculate, of course, but it is tempting to think that this law could be used to regulate what is being expressed from France on the web. Someone is saying disturbing things ? Well, easy to shut him/her up: either fake downloads from his/her IP address or bribe a company into filing false accusations, and you'll effectively remove his/her connection while having the opportunity to further discredit the person by publicly disclosing that he/she is such a pirate that their connection was cut... Sounds neat, doesn't it ? In my childhood, teachers kept on saying that France is the country of human rights, but I can't help thinking this is less and less the case[1]. Well. That was a long rant. But I can't keep it inside: this is touching me too much. I'll add that I'm not downloading anything, and I don't have anything a priori against laws which would tend to regulate illegal file sharing. I just don't think that the (small) profits of a few justify spitting upon the freedom and the elementary rights of all people living in France. Further information, in French, can be found there. The full text of the project can be found on the website of Assembl e Nationale. [1] Please don't get me wrong. There are many countries where life is definitely more difficult than here, and where human rights are constantly scorned upon, which is fortunately not the case here yet.

Andrew Pollock: [debian] DHCP package futures, the braindump

Now that Lenny is released, I've got some time to go to town on the ISC DHCP packages. The first thing I want to do is get DHCP 4.1 uploaded. Unfortunately, this first requires a bunch of transition work, and the associated coordination that goes with it. This post is an attempt to marshal the stream of consciousness and come up with a plan... Problem #1: everything has 3 in it The packages themselves need to lose the 3 everywhere. The source package is dhcp3. That seems kinda retarded if its DHCP 4.1.0. The binary packages all need to loose the 3 as well. apt-cache rdepends dhcp3-client tells me I'll need to reach out to the maintainers of the following packages:
avahi-autoipd
wifi-radar
synce-hal
rutilt
rootstrap
resolvconf
nfsboot
lxnm
laptop-net
ifupdown
education-desktop-other
dhcdbd
bpalogin
avahi-autoipd
Obviously I can keep the old packages around for a while for transitionary reasons. The 3's also persist in various directories provided by the packages: /etc/dhcp3, /var/lib/dhcp3 apt-file search /etc/dhcp3 tells me I need to reach out to the maintainers of the following packages:
avahi-autoipd
debian-edu-config
debian-installer
dhcdbd
fai-doc
fai-nfsroot
ntp
ntpdate
resolvconf
samba-common
sendmail-base
whereami
Obviously I can keep some compatibility symlinks around for a transition period. Problem #2: the names themselves Is it right to monopolise the name "dhcp-client" or "dhcp-server"? I tend to think not. So should I rename the source package to "isc-dhcp" and prefix all of the binary packages with "isc-"? I think this would cleanly address #520842 and the fact that there's apparently supposed to be a "dhcp-client" virtual package. Problem #3: dhclient-script is old and crufty This is less pressing, and less packaging related, but the dhclient-script we ship now is Debian-specific. There is room for optimisation, and there are better ways to implement the script so it's more externally customisable. I'd also dearly love to switch over to using iproute for everything possible. This brings us to the game plan, which I think I'll write in a future post after I've meditated on the problem a bit, now that I've finally written it all down...

1 April 2009

Francois Marier: Safer synergy setup for laptop-desktop keyboard sharing

Synergy is a very useful piece of software for anybody wanting to share a mouse and keyboard between two networked computers.

Here is the setup I use to:
First of all, I've got the following ~/.synergy.conf on both of my laptop and desktop machines:
section: screens
mylaptop:
mydesktop:
end
section: links
mylaptop:
right = mydesktop
mydesktop:
left = mylaptop
end
section: options
keystroke(alt+shift+space) = switchInDirection(left)
keystroke(alt+space) = switchInDirection(right)
end

With this, I am ready to start the server on my desktop machine:
synergys -a localhost
Now, in order to encrypt the synergy client/server traffic, I create an ssh tunnel between the two machines:
ssh -f -N -L localhost:24800:localhost:24800 mydesktop
Then I start the synergy client on my laptop. However, some recent problems have convinced me to have a more robust alternative to simply starting the client like this:
synergyc localhost
As recommended by a few helpful people on #debian-devel, I decided to use the supervise tool (part of the daemontools package) to automatically restart the synergy client if it crashes. Here is how I do it:
supervise ~/.synergyc &
This command refers to a ~/.synergyc directory containing a single run script. That shell script consists of:
#!/bin/sh
xset r rate 500 30
/usr/bin/synergyc --no-daemon localhost

(The xset call is necessary since synergyc crashes seem to reset the repeat flag of X for some reason...)

The only problem I still need to fix in my setup is the potential password leak in the next few seconds after the synergy client crashes. Such a crash has already caused me to accidentally type my laptop password into a desktop IRC window the other day :(

Ideally, I would like the synergy server to swallow the first second or two of keyboard input after its client suddenly drops out. This could eliminate quite a few embarrassing wrong windows.

Stefano Zacchiroli: ocaml autoconf 1.0

1st release of ocaml-autoconf A couple of months ago, I joined an effort by Richard Jones to give a decent shape to autoconf macros for OCaml. The situation was a tad annoying before, because we had unofficial ocaml.m4 files floating around, which have diverged one from another, with unclear licensing terms, incompatible features, ecc. So we started a project on the ocamlforge to coordinate all this, injected the best we could find around, add docs, polish features, and contacted copyright owner to uniform licensing terms (to a 3-clause BSD). Yesterday we finally released ocaml-autoconf 1.0. Rich's blog post on the subject contains a nice how to to kick start your OCaml project using autotools up to automake. A brief feature overview is in order: Enjoy, and give us feedback (bug reports, feature requests, ...) using our tracker.

31 March 2009

Martin Michlmayr: Kernel support for QNAP TS-119 and TS-219 Turbo NAS in 2.6.30

My patch for initial kernel support for the QNAP TS-119 and TS-219 Turbo NAS got accepted and will be in 2.6.30. I can run Debian on a USB disk without any problems but there are some issues left (some severe, some cosmetic): Unfortunately, I've no idea how to resolve these issues. However, the QNAP TS-119 and TS-219 have started shipping so hopefully someone else will investigate these issues.

Manoj Srivastava: Manoj: Fighting FUD: Working with openssl

Unfortunately, there is so much FUD associated with doing your own certificates, either based on how complex the operation is (which led to my previous supervisor insisting I use something like tinyca), and now to my employer succumbing to the FUD and shelling out several hundreds, perhaps several thousands, of dollars a year for something we could well have handled in house. Public key infrastructure, in the form of the X509 standard, is the underpinning of most of the secured communications over the net these days. The big winner in the transport protocols, TLS, and its predecessor, SSL, support X509 certificates. There are several ways of getting your own services their own X509 certs; one of which I am exploring below. One may, or course, opt to get a commercially signed certificate, and various companies are eager to do just that for you. They also charge about $400 per annum per certificate for the privilege of doing so. While there is some marginal benefit of doing so (some web browsers come with the commercial public certificate built in, allowing for an out of band distribution of the public cert), the benefit accrued is in the order or pennies, in my opinion, not hundreds of dollars, unless you are providing banking or retail services, where the end users might be justified in being paranoid. Why is there so much FUD your own certificates? Especially about how hard it is do to your own? As you can see below, it only takes three commands you have to master in order to set up your own private certifying authority, and sign your own certificates. The only marginal issue is that the user needs to verify your certificate out of band (if, really, they want to bother). Most people just accept the certificate, in my experience. The sole benefit that commercial entities provide is that they verify the identity of the person asking for the certificate, with varying degrees of diligence. For a Class 1 cert the CA usually just verifies that the email address of the requester was confirmed. For $400/year. For a Class two cert, they look up the company in a credit bureau records. A class 3 certs does an ID check with a notary public present, or a government issued ID. So, a class 3 cert is somewhat less diligent than becoming a Debian developer. Or getting your key signed at a Debian conference. As to the security aspects, or wondering whether to trust the information present on a designated web site, I have no idea how it helps verify any of those things in any way. So the web site is run by a person with a government provided ID, and who has a few hundred dollars to burn. So what? Me, I just sign my own certificates. And I think most small business web sites and mail servers are perfectly well served by using their own certificates. And there are just three simple commands that enable them to do this, in the Linux world. So what are these three commands? Gory practical details and recipes hidden here In conclusion, creating your own certifying authority is trivial, and certainly not worth several hundreds of dollars every year, and the functionality provided is identical.

30 March 2009

Erich Schubert: Java: 'base' classes and 'final' modifier

In a Java framework I'm working on, 'pairs' arise everywhere. Unfortunately in contrast to e.g. C++, Java doesn't include a predefined 'pair' class. C++ templates are really nice because of the way they are complied and optimized (in particular they also handle what Java calls 'native datatypes'); Java generics aren't up to par with that. (But yes, Java offers other benefits, such as being much easier to parse and thus refactor). Anyway, this is not going to be a rant on Generics.So I have this interface in Java called Pair<FIRST,SECOND> along with two implementations SimplePair<FIRST,SECOND> and ComparablePair<FIRST extends Comparable<FIRST>,SECOND extends Comparable<SECOND>>.For performance reasons, SimplePair is declared 'final', and so is ComparablePair. It's written everywhere that making classes final can make a large difference in Java, and since these objects will be used in a lot of places, it seems reasonable to care about this here.However, it would often be nice to have better readable code, that is assuming I'm using SimplePair<Monkey,Banana>, it would then be nice to make a derived class BananaPreference extends SimplePair<Monkey,Banana>, with added methods getMonkey() and getPreferredbanana() to make the resulting code more readable.Having readable code is also often quite as important as having performant code, after all ...If someone with solid experience in Java optimization has some ideas to share, please do so! Email: erich AT debian DOT org - no comments in blog.Right now, I have one idea on how it could be possible to achieve both (seriously, I could use some feedback from Java Gurus on that): make SimplePair and ComparablePair abstract, all methods there final, then derive final classes as needed. Does that combine the benefits?[Update: I received from Joachim Sauer the following helpful link: JavaOne presentation on performance tuning and various VMs. Basically this seems to indicate that in all these common situations, any modern Java VM should be able to figure out the inlining options automatically and optimize appropriately, so it won't benefit from any "final" hint by the developer. Note that a C++ compile doesn't do runtime optimization, but allows compile time optimization at a much lower level, so this rule doesn't apply to C++.]

Uwe Hermann: Coreboot hacking: How to solder a PLCC socket on your board

Desoldering station. When trying to port coreboot (previously LinuxBIOS) to a new mainboard you're often confronted with a big problem: the BIOS/ROM chip on the respective motherboard is soldered onto the board (i.e., not in a socket). This means that you cannot easily (hot-)swap the chip during development or for recovery purposes. So you basically have exactly one try to flash the ROM chip with a fully working/booting coreboot image. If that goes wrong your board is bricked. Desoldering the chip This makes it pretty much impossible to develop a coreboot port for such boards (and soldered-on ROM chips are becoming more and more common, unfortunately). However, I've recently tried to replace the soldered-on (PLCC) ROM chip on one of my boards with a socket. What sounds pretty scary at first, especially given that I have almost non-existant soldering skills, turned out to be really not that hard. Also, it can be done with relatively cheap and readily available equipment. I have written a short HOWTO for desoldering chips and soldering on sockets in the coreboot wiki, and also finished a video showing most of the process, which I hope will be helpful for others: Place the PLCC chip
The video is CC-BY-SA 3.0, music is taken from ccmixter.org and is CC-NC 3.0 licensed. Video editing was done using Kino (which uses ffmpeg2theora for Ogg Theora export). I also tried to upload the video to Vimeo, but first they told me to install the Flash 10 abomination (and there's no way I will do that). After browsing the help/forum pages a bit I found a traditional, non-flash upload form, but that then tells me that I cannot upload Ogg Theora videos. WTF? Soldering the socket The Ogg Theora video support feature request has been open for more that a year. Until that issue is fixed I'll just use other video services, thanks...

Russell Coker: Links March 2009

Cory Doctorow has written a column for The Guardian titled You shouldn t have to sell your soul just to download some music [1]. One really interesting point he made was The same companies that spent decades telling lawmakers that they were explicitly not the guardians of the morality of the young that they couldn t be held accountable for sex, drugs and rock n'roll, for gangsta rap, for drug-fuelled dance-parties did a complete reversal and began to beat their chests about the corrupting influence of downloading on the poor kiddies . The pt4me2 organisation advocates that the Victorian government spend more money on public transport infrastructure [2]. Recently the congestion on Melbourne roads has been getting worse, the costs of private car parks in the central city area have been increasing, and during peak hours all public transport is over-crowded. Some significant improvements are needed, and more trains, trams, and buses are the only possible way of coping with the number of people working in the city. Also there s the issue of suburbs that lack any public transport, I wouldn t want to live near one of those areas when petrol hits $8/L (as the CSIRO predicts for 2018). Michael Tiemann writes about Microsoft s latest patent attack against Linux [3]. He doesn t pull any punches which is a very noteworthy thing. It s pretty rare to see someone in a senior position in a company blog in a way that makes any significant comment about another company. Dan Ariely gave an interesting Ted.com talk about Our Buggy Moral Code [4]. One of the points was that people who declare themselves to be atheists are less likely to cheat when asked to swear on a bible first, another was that if someone who is identified as a member of the same group cheats then others will follow, but if an outsider cheats then they won t. It seems that if you want to minimise cheating then you want to have only outsiders be seen to do it, and you want everyone to swear to follow some sort of moral code. Flame has written a good rant titled Anarchy is Dead about the lack of popular outrage against the Australian government s censorship plans [5]. Rolling Stone magazine has a good article about the US banking crisis [6]. A moderate amount of bad language, but no more than is deserved. Amazing video of rounding up sheep that are fitted with LEDs at night [7]. Here s an interesting TED talk by Saul Griffith about using kites to generate electricity [8]. Unfortunately he didn t give much engineering information, it was more of an executive summary of what he has done. He claims that if a wartime level of effort was put in place then wind could supply all the electricity needs of the US within 10 years. Adam Savage (of Mythbusters fame) gave a talk for TED about his obsession with the Dodo [9]. One thing that surprised me is how his manner in that talk differed from his appearance in Mythbusters. It seems that most of his crazy antics in Mythbusters are an act to entertain the audience. The information about the dodo was really interesting too. He then went on to talk about his recreation of the Maltese Falcon. His work can serve as inspiration for other geeks who want to try sculpting.

28 March 2009

Ingo Juergensmann: Ubuntu, wireless and hex garbage in resolv.conf

For some days now I can't use my wireless on my Ubuntu (jaunty) laptop anymore. For whatever reason the domain-search option of my dhcpd causes the dhclient on the laptop to interpret the search list as hex values. For example I've the following line in my dhcpd.conf:

option domain-search "hro.localnet", "os.localnet", "localnet";


This line leads to the following on the client:

search hro.localnet 3:68:72:6f:8:6c:6f:63:61:6c:6e:65:74:0:2:6f:73:c0:4:6:62:65:72:6c:69:6e:c0:4:c0:4


So, my current work around is, to comment the option domain-search line out of my dhcpd.conf and to include a "append" line in my dhclient.conf - unfortunately I've to add this line on all clients I use.

Patrick Schoenfeld: Arcor EasyBox A801

Recently, my girl friend and I decided to get Arcor DigitalTV. So we got some hardware from Arcor (and unfortunately we needed to "upgrade" our real-ISDN-connection to a SIP-based-one):

That second piece of hardware is kinda interesting, because it is an ADSL2+-Modem, (WLAN-)Router, SIP-Gateway and file-/printserver (it has one USB port which can be used to connect an USB hub and up to 4 disks or 1 printer) and 4-Port Switch in one (I think it doesn't include whats called a 'Splitter', because with this kind of connection there is no ISDN signal to be splitted from the internet signal).

Unfortunately not all is well about this (or about my provider). This piece of hardware can be configured with a modem installation code. Which is good for an average user, because he does not need to care about anything. With this process the hardware configures itself by receiving configuration data from a configuration server of the provider. Regardless about other implications this might have: What disturbed me about this is, that I loose control about my router, if I use this. Because when configured this way some sites in the router are grayed out. If you click them you get a message that this setting is controlled by your provider. Uarg. Well, unfortunately IPTV from arcor does not simply use the same internet connection as I usually do (more about this later), so I were suffering from missing informations about how to configure the router manually.
Arcor wasn't particular helpful in this, because they told us "Der Router kann nicht manuell konfiguriert werden." (which means in Englisch: "The router cannot be configured manually."). Although this brought me to laugh, I were also disappointed and worried about this. So I decided to find it out myself. I won't tell what I tried after all, but in the end I found out that the modem installation code-installation does configure:

With this knowledge (and some good guessing, e.g. that both PPPoE links eventually use the same user data) I were able to configure the router fully myself, which also enables me to set QoS settings how I want them (which is why I went through the whole torture at all, because SSH was extremely laggish when watching TV). One thing is notable however, how I got the information:

The manufacturer of the router seems to do some things to protect the settings from the user. For example: The page for configuring the WAN is called wan_main.stm, it can be called without trouble if you are configureing the router manually, but the system would block access when you use the modem installation code. BUT and thats how I got the info that the third link is a MAC Encapsulation Link: The status page (where it shows that you are connected etc.) includes javascript vars for nearly everything you ever wanted to know about your router configuration. Not obfuscated after all. You just have to look at the source of the status frame. Thats real professional, Arcor.

27 March 2009

David Welton: CodingHorror and Open Source Economics

Jeff Atwood writes about the economics of open source software: http://www.codinghorror.com/blog/archives/001247.html Well, he actually doesn't say as much, but that's what it's about. Someone really ought to do a book about this subject. I have some ideas - any takers? It's always tough to write about because there's so much material. It's a topic that is near and dear to my heart - almost 10 years ago, I joined the Free Software Business mailing list, as I got curious about the intersection of free software and business, and how the whole thing worked. I've learned a lot in the meantime, including a stint at Linuxcare, which was one of the Linux companies during the dot com boom, and am still fascinated by the subject. Before we get started, let's reiterate something:
  • It's clear that open source software works. There's just no doubt about it - it's been through ups and downs, the dot com boom and bust, and it will trundle happily (well, as happy as anyone is with this economy) through the recession too.
That point bears repeating. Everything else needs to take it into consideration. Could it work better? Differently? Perhaps, but it does work, so you need to understand it very well before you fiddle with it. Jeff writes:
for the average user? Heck, how realistic is this for the average programmer? Even if you're the type of macho, gung-ho programmer who can master an alien code base just to get some small pet feature or bugfix in -- do you honestly have the kind of time it would take to do that? Sometimes, when people say this:
The source code is freely available. If you feel so strongly about this bugfix/tweak/feature/plugin, why don't you code it yourself?
They're really saying this:
F**k you.
Which is of course a terrible analysis of open source, and its pros and cons. I wrote the following comment on Hacker News:
Heck, how realistic is this for the average programmer? ...
"Actually, I have submitted lots of (mostly small and inconsequential) bugs and minor features over the years, to projects such as the Linux Kernel, Tcl, Erlang, Ruby, Rails, Apache, and probably lots of others I'm forgetting right now. I actually enjoy it quite a bit, come to think of it - there's something cool about diving in and studying something new and different, and a thrill that comes with nailing the bug. Sometimes, the knowledge required to actually fix it is too much, and you have to settle for sending in a good bug report, but in other cases it's very much possible to hack up quick, useful things despite not knowing much about the system in question. And, no, I'm not really that great a programmer... I'd consider myself fairly average." And I know I'm not alone, as I see similar sorts of people in Debian and the Apache Software Foundation. Debian, infact, is all about those kinds of tweaks to improve the operating system as a whole. And this sort of exchange goes on all the time, as evidenced by the huge success of a large number of open source projects. Now, granted, most projects are really driven by one or a few really committed hackers, who do the lion's share of the work. However, that large network of people who contribute, test, document, and suggest is certainly important to any open source project. As long as we're looking at my anecdote, let's look at it in a bit more depth - most of those projects are developer tools or closely related. A cynic might note that Jeff comes from the world of Microsoft, where the core developer tools are provided by a company and 'giving back' is limited to payments and bug reports. But leaving that be, I think the enormous success of stuff like Ruby, Perl, PHP, Python, Tcl, Apache, Linux, GCC, and on and on and on indicates that, at least in terms of stuff that developers share between one another, open source works. However, there are problems, one of which is that he (or, in unfortunately rather rarer cases, she) who writes the code does not necessarily get the money. And without money, he or she who writes the code must dedicate themselves to some means to actually accumulate a bit of money in order to pay for living expenses. Most likely, this is time taken away from the open source project, which is a loss for all the people who benefit from it. Proprietary software solves this feedback loop in a neater way (generally) - companies that create good products get money for their efforts, which can then be reinvested in development. Jeff suggests that "sponsorship seems like a constructive way for people who are unable or unwilling to write code to affect the direction of a project.", which is ok as far as it goes, and more or less works here and there, but hopefully he's not thinking about trying it on a larger scale. This sort of thing has been tried before, and never really seems to take off. Part of the problem is that it can work on a person-to-person basis, but is almost impossible to standardize in a way that it makes sense to have some kind of clearinghouse that operates as a business. There are simply too many factors - what kind of open source project it is, what motivates the people behind it, how the transaction costs of defining a specification, monitoring the results, sending money and so on compare to the actual value of a fix... the list goes on. Ultimately, it's a nice idea, but it doesn't seem to work out too well in practice. Anyway, while it's a good thought on Jeff's part, at the end of the day, it is fairly evident that he doesn't have a lot of first hand knowledge of open source business and economics. That said, to some degree, open source took everyone by surprise, and, lacking the nice, simple feedback loop that proprietary software has, can be a lot more difficult to get a handle on. I find it quite pleasant that way - it attracts both hard-headed business types and social-experiment idealist visionaries; both huge corporations (IBM!) and a huge number of individuals; both people who have gotten quite wealthy from open source as well as most of the rest of us who manage to make ends meet but still love it. It's not something that's easy to pigeonhole, and as such it's hard enough to figure out the many ways in which it does work, let alone figure out how to improve on it. Stay tuned for further installments: Software Economics - Public Goods

Next.

Previous.