bookmark_borderStarCluster: Streaming node addition refactoring and dupe alias fixing

About a month ago I created the streaming node addition functionality within StarCluster. As the time went by, I fixed some of its issues and found it a bit messy and hard to understand so I decided to move it to a separate file. The new version is ready and battle tested.

Another feature that I found to not be working as expected is the handler for nodes having the same alias. I fixed it and made a clean commit easy to pull/cherry-pick. It’s only a matter of calling _recover_duplicate_aliases.

bookmark_borderStarCluster: Streaming node addition

In the core version of StarCluster, when you add many nodes at once (command “addnode -n #”), StarCluster goes through three sequential checks[*] that all nodes need to fulfill in order to move forward and eventually start configuring the nodes within the cluster.

  1. Wait for the spot instance requests to propagate.
  2. Wait for all spot instance requests to become active.
  3. Wait for ssh on all those nodes to be active.

If you add a single node, that’s fine, but if you add 10, you lose some time as the first node might be ready a few minutes before the last node is. That is to say, you are wasting some computing time.

Continue reading “StarCluster: Streaming node addition”

bookmark_borderWhen is a good time to document software?

Everyone knows about the benefits of having documentation. What is harder to agree on is when is a good time to produce it.

A good development cycle should always have its phase of documenting for the new features and the new behaviors to be expected. But, if it’s not your case, there are two other very good moments for documenting.

Continue reading “When is a good time to document software?”

bookmark_borderTimestamps

I want to write about timestamps. Not because it’s a subject I like, but on the contrary, because it’s a subject I somewhat hate. What is a simple day to day thing for humans is a real source of headaches for programmers.

The list of reasons for that is about as long as the number of permutations programming languages allow you to do while parsing dates with a string format. Just to name a few, symbols can change (“-” vs “/”), order can change, years can either be 4 or 2 digits (probably those born post year 2000 aren’t aware we had a major bug back then), 24 hours vs AM/PM and even locales (English “February” vs French «Février»).

You don’t think it’s a problem? To this date, 18 596 questions bear the tag “datetime” on stackoverflow.com. That’s huge! Still to this date, there are 294 443 questions tagged “c++”. So there are about 15.8 times as many questions for a full language, namely c++, as there are for a what should be a trivial subject: datetime.

Continue reading “Timestamps”

bookmark_borderGithub files navigator conversion 0.2.0 is out

I just released an update to my chrome extension. Here are the new features.

  • Urls are properly updated when clicking on files as well as when selecting file lines.
  • The back/forward actions work.
  • Clicking the extension icon will toggle it.

Somehow, it might not work as the chrome store gives my a somewhat vague warning message.

Screenshot from 2014-03-04 00:12:42It reads: This element risks to install incorrectly over Chrome version 33. Please check the package and the manifest and proceed to a new import if necessary.

Well. I guess it won’t work. But it does work for me. So how am I supposed to know what to fix with such a vague message? We’ll see…

EDIT 2014-03-04

It seems that trying to install the new version gives a more decent error message.

Screenshot from 2014-03-04 07:43:08

Just bad that it doesn’t print that message straight in the developer’s page.

bookmark_borderA chrome extension to navigate Github files differently

Last week, I was somewhat complaining that Github’s file navigator was not to my taste. When moving across files and directory, you have to go back and forth a lot. If you quickly want to switch between 2 files not in the same directory, it’s painful. Of course, one could open another tab, but tabbing doesn’t cut it. I wanted something more like a files navigator that we can find in any OS.

Then I though, hey, surely I can simply manipulate the HTML to make it work the way I want. I started coding… 45 minutes later, I had a working prototype of JavaScript code that I could simply paste in the browser console and bang; a nice file tree navigator-like experience right in Github.

Continue reading “A chrome extension to navigate Github files differently”

bookmark_borderStarCluster 0.95

English version will follow.

La version 0.95 de StarCluster, à laquelle j’ai contribué à travers mon emploi chez Datacratic et mon implication sur le canal IRC, est sortie hier. Consultez la liste des changements pour plus d’informations.

StarCluster version 0.95, which I contributed to through my work at Datacratic and my implication via the IRC channel, was released yesterday. See the list of changes for more information.

bookmark_borderGenerating a downloadable file from JavaScript

Recently, a friend asked me if I could help him with a very simple task: have a dialog with an input text field where he could paste some csv lines and press a “save” button that would reformat the csv and write it to a file.

I thought that the input text field and the reformatting could be done very easily with a web page and a few JavaScript lines, but I was afraid I wouldn’t be able to save anything back to the disk without having some sort of server to serve the final result.

Continue reading “Generating a downloadable file from JavaScript”

bookmark_borderPhpMyAdmin error: JSON extension is missing

Today I found out that my phpMyAdmin installation over apache2 and Ubuntu 13.10 was broken. The error was straight forward: “JSON extension is missing”.

Okay, but how can it be gone?

I recently updated my Ubuntu installation from 13.04 to 13.10. Turns out that it somehow breaks the PHP JSON extension.

The fix is very simple, run


sudo apt-get install php5-json
sudo service apache2 restart

Problem sovled.