Archive for December, 2011

Ground control to major Tom


This could be you!

Who hasn’t dreamed of becoming an astronaut? Well, now you can. The NASA has an open position for an “Astronaut Candidate” for the International Space Station in Houston, TX. The requirements are pretty interesting.

The training will take two to three years and will require a lot of traveling, probably mostly to Russia, since they will be using Soyuz to travel to and from the ISS. The required education is fairly broad, and more interestingly, the list of degrees that are not applicable is fairly short (technology, psychology, nursing(!), etc…). It looks like a CS degree is good enough, and you can make up for the lack of flying experience with an MS or better, a PhD.

“Correctable” 20/20 eyesight is required, which means that contact lenses and Lasik are accepted (I wonder how hard it is to put contact lenses on in zero gravity…). The ad also takes the time to explain each jargon occurrence: “Extravehicular Activities (space walks)”, “the extravehicular activity mobility unit (space suit)”.

Although the ad will only be open for the next couple of months, the selection process takes a while since the selection will be announced in the spring of 2013.

I was fortunate to be able to experience a Zero-G flight a few years ago, I can’t say I’m not tempted to apply :-)

Table of contents in Javascript

This is my week end project: a table of contents generator. Well, technically, it’s more like a two hour project interrupted four times over the course of a Saturday but I guess it still qualifies as a week end project.

I got tired of managing the table of contents of my documentations manually and in particular, of having to modify all the section numbers by hand whenever I moved things around. This short Javascript program now automatically takes care of it for me. Here is the quick documentation:

// A simple HTML "table of contents" generator.
// 
// 1) Include toc.js in your HTML file:
//          <script type="text/javascript" src="toc.js"></script>
// 
// 2) Call generateToc() in your onLoad() method:
//           <body onLoad="generateToc();">
// 
// 3) Declare a div with the id "table-of-contents" where you want
// your table of contents:
//           <div id="table-of-contents"></div>
// 
// 4) Put each of your sections in an <a> tag with class "section",
// specifying an "indent" representing the indentation of that section.
// Only the length of the indent matters, now its content. If no indent
// is found, a string of size 1 is the default.
// 
// Example:
// <a class="section" name="Section 1">Section 1</a>
// <a class="section" indent=".." name="Section 1a">Section 1a</a>
// <a class="section" name="Section 2">Section 2</a>

This script now powers both testng.org and jcommander.org, go take a look there if you want to see what it looks like.

Ideas for potential improvements:

  • Make the numbering optional or configurable.
  • Have the script add CSS classes to the sections for easier styling (“section1″, “section2″, etc…), since the indenting is pretty crude right now.