How to comment your code: an example from Hadoop

How to comment your source code? This topic comes up every once in a while, and sometimes it leads to heated discussions. The consensus is something like “comment why, and not how”. Useful as it seems, I think it is important to give examples from real-world scenarios. So, let’s look at such a case.

I’ve been working on the integration between Hadoop and HGST Active Archive S3 Object Storage product recently, and while dealing with the internals of the S3A File System that we are improving at the company, as well its interaction with YARN,  I’ve come across an interesting piece of code in the Hadoop code base. Before going into its details, look at it without any comments:

Read the rest of this entry »

Leave a comment

Posted by on March 11, 2016 in java, Programlama


Tags: , , ,

Old Computers: A Trip Down the Memory Lane and History of Computing

A few weeks ago I went to the computer science building of KU Leuven for a Haskell meet-up. I was surprised to see a lot of very old computers beautifully put on an exhibition. It felt like a time travel in the history of computing. I captured a few of them using the camera of my smartphone, trying to imagine what the pioneers of computing back then would’ve thought if they had seen this smartphone in action (full resolution photos of these and many others are available in my Flickr album.)

Some of the computers were happily churning and crunching data long before I was born such as this one:


Read the rest of this entry »

Leave a comment

Posted by on December 24, 2015 in Programlama


Tags: , , , , ,

Is there a high quality and free Text to Speech system for Dutch that runs on GNU/Linux?

Dear Text to Speech and open source experts:

For a toy / hobby project (non-commercial), I’m trying to find a suitable Text to Speech system for Dutch that I can run on GNU/Linux. So far, the situation does not look very promising. I’ve tried eSpeak, but using it for Dutch is not as good as I expect. I made my experiment using a file “computer.txt” that has the following contents:

Een computer is een apparaat waarmee gegevens volgens formele procedures zoals algoritmen kunnen worden verwerkt. Meestal wordt met het woord computer een elektronisch, digitaal apparaat bedoeld, maar er bestaan ook mechanische en analoge computers.

$ espeak -vnl+7 -s 170 -f computer.txt

Read the rest of this entry »


Posted by on December 3, 2015 in Linguistics, Linux


Tags: , , ,

How to edit remote files within Emacs when a program automatically runs after you SSH

If you are used to TRAMP functionality of Emacs to edit remote files without leaving the comfort of your beloved editor on your host machine, you do your best to keep it working even when different conditions arise. In my case, I’ve been recently working with virtual machines at work and the product that I’m working on is configured to run some program automatically right after I log into the machine via SSH. This prevents TRAMP functioning correctly with its default settings, because instead of receiving the shell prompt immediately, it receives from the machine the final line of the program that automatically runs and expects the user enter some response:

    ... some text menu options ...
    Please make a selection >>

Above that line, the text menu says that the user should enter 0 to exit the program or some other menu option to continue. Therefore, I had to find a way to tell Emacs that it had to send a 0 after it connects to the machine. The high-quality TRAMP manual was immediately helpful by providing a relevant example and I came up with the following: Read the rest of this entry »


Posted by on November 30, 2015 in Emacs, Lisp, Programlama


Tags: , , ,

How to detect Friday the 13th with full moon using Emacs

nrAlmost 21 years ago, in 1994, I bought the brand new edition of Numerical Recipes in C: The Art of Scientific Computing. As an engineering and mathematics student who was much into programming, I still remember my excitement then, as well as the bright red hard-cover.

The first algorithm presented in the book (and its implementation in C programming language) was about calculating the dates that were Friday the 13th and had full moon. Now that I’m approaching the 21st anniversary of that day, I wanted to share a similar program to detect if the current date is Friday the 13th with full moon. This time, my preference is for Emacs Lisp, and instead of re-implementing the same algorithm, I simply use the calculations already provided by Emacs. In other words, I rely on the lunar-phase-list function that returns the lunar phases of the upcoming dates given a month and a year.

It’s been ages since I’ve done Common Lisp programming and many years since I’ve practiced Emacs Lisp, so the code below is probably not optimal and idiomatic, but nevertheless it follows:

You can used the function defined above to see whether it is your “unlucky” day:

This will return “Good luck!” most of the time, luckily! 🙂

Can you come up with other ways of detecting Friday the 13th with full moon using existing utilities, such as GNU calendar program? Or, how would you calculate the next 10 Friday the 13ths that had full moon, using Emacs Lisp or some existing utility?


Leave a comment

Posted by on November 12, 2015 in Emacs, Lisp, Programlama


Tags: , ,

Do Great Minds Necessarily Need Fancy Technology to Collaborate?

We’re living in the age of touch enabled wireless devices that are connected to Internet almost always. We can have instant one-to-one video communication very easily and cheaply. It is possible to organize video teleconferences with many participants instantly (well, the last part might be a little exaggerated). Scientists and programmers separated from each other by thousands of kilometers and many time zones can work and collaborate on projects daily. It is almost natural to think that, without such technologies, we would be living in dark ages, and our greatest thinkers would suffer from isolation miserably. But is it really the case?

The following pages are from the chapter titled “Was Cantor Surprised?”, from a popular mathematics book, The Best Writing on Mathematics 2012:


Let’s focus on those particular sentences: Read the rest of this entry »

Leave a comment

Posted by on October 18, 2015 in General


How and Why is Scala Used in Aerospace Industry?

There’s been a recent thread in scala-user e-mail list that touched an interesting topic: How and Why is Scala Used in Aerospace Industry?

A few highlights from the thread:

* Scala and Akka are currently used for spacecraft telemetry data display, storage and analysis for European Space Agency. The software is used for all missions at GSOC (the Columbus Module of the ISS, the SAR earth observation satellites TerraSAR-X/TanDEM-X, and some other missions) and for LEOPs at Eutelsat.

* DLR GSOC ( ) will be using Scala and Spire for space mission planning. The next generation of the GSOC scheduling engine PLATO ( is currently being written in Scala.

* Scala is also used for telemetry analysis at JPL (NASA’s Jet Propulsion Laboratory), and more generally for development of modeling DSLs. We are part of a research lab (Laboratory for Reliable Software), which works in close interaction with missions.

* Rüdiger Klaehn’s words: “I am absolutely convinced that functional programming (meaning not just a language that has closures, but programming using almost exclusively with pure functions) is the correct path to reliable software. The most ubiquitous and accepted platform in space operations at DLR and in general in european space operations is the JVM. Even the next generation European Mission Control system (MCS) is going to be written for the JVM: So you need a functional language that runs on the JVM and can seamlessly consume JVM libraries. This leaves Scala and Clojure as serious contenders. Since I favour strongly typed languages, the choice was clear.”

Some reasons given by programmers that chose Scala for aerospace industry software: Read the rest of this entry »

1 Comment

Posted by on December 22, 2014 in FunctionalProgramming