Charles Basenga Kiyanda

Use version control

I’m serious, do. (So, in other news, I’m back after a long hiatus, maybe I’ll explain one day.)

I kept track of my Ph.D. thesis using subversion as I wrote it. I’m sure my blood pressure went down a few notches because of that. I highly recommend everyone do the same. Now I recently participated in the transition of a project from subversion to git. I struggled at the start, but finally grew to wrap my head around maybe 60% of what git does. A colleague found a great visualization of git processes which I pass along here. It’s not a tutorial, of which there are plenty. Here’s one, for example. Now, if you try to learn git and find yourself a little baffled, I recommend you play with that D3-powered site.

Kludging your way to nice figures with ubuntu+kile+inkscape+cairo+eps+psfrag

Several inkscape+latex+psfrag users have been complaining for quite a while now about the changes in cairo. I periodically forget how to kludge my way through while I wait for the situation to stabilize and I have to search the tubes for a couple hours before I remember all the details, so here it is for all to enjoy (and for me to find much more quickly the next time). I use linux (ubuntu), kile, tetex, inkscape and psfrag. If you’re on windows, well, I can probably not help.

The problem: The later versions of inkscape use cairo to generate eps files. The new version of cairo doesn’t have explicit strings for the words in the eps files. Instead of having the string “(hello)Tj” somewhere in your eps file, you have the string “<0102030304>Tj”. Psfrag looks for hello somewhere, can’t find it and hence is utterly confused. As a result, so are you. (Un)fortunately, inkscape is a really good FOSS program and I’m unwilling to change my ways at this point.

The solution: Here’s my workflow.

  1. Make a file in inkscape as usual. Use short labels (which will later be replaced by psfrag) if you want to make it quicker later on. I just go through the alphabet in sequence.
  2. Replace all the <##>Tj strings with (CC)Tj. Make sure to change the numbers to the right letters. (If you write the letters in order in inkscape, then 01 corresponds to a, 02 corresponds to b, etc.) To be a bit quicker, I make a epsfix.sh script, which does it for me once I’ve figured it out. This way, I can modify the figure later on and not go completely mad. A sample script is shown at the bottom for 2 labels, a and b.
  3. run epsfix.sh
  4. produce dvi using kile (I use kile, you might not)
  5. produce ps from dvi using kile (or whatever it is you use)
  6. ps2pdf text.ps text.pdf (because using kile and dvi2pdf(?), the pdf doesn’t have the psfrag substitutions in)

As an extra (which I always forget also): to get text on multiple lines using psfrag, use a shortstack: “\psfrag{label}{\shortstack[l]{some more\\text}}”.

Not simple and not pretty. There are probably more succint and elegant scripts for epsfix.sh. You might be able to get the pdf generation to work from withing kile. Personally, I’ve given up and just keep a terminal window open for that operation.

Sample script epsfix.sh with 2 labels, a and b:

#! /bin/sh
cp fig.eps fig.eps.backup ##(for your sanity the first time you run the script)
mv temp.eps fig.eps
sed ‘s/<01>/(a)/’ fig.eps | sed ‘s/<02>/(b)/’ > temp.eps
rm fig.eps
mv temp.eps fig.eps

How to improve, as a foreign speaker, your written english.

I really, really, REALLY hope I got the commas right in the title. I’m a native French speaker and struggle to no end when writing documents in English. I’ve been looking for ways to improve my written English. Writing more often on this blog is, in part, an effort to achieve this goal.

My wife recently started a Master’s degree and I’ve discovered that correcting the texts of another non-native speaker. Consider it a game of chess against a well-matched opponent. Despite my limited abilities, I’m amazed I can actually make her texts better.

I’ve found some resources most useful in correcting (others and myself alike). Regarding commas, the best explanation I’ve seen so far online is here. The oatmeal also has an informative and funny poster about semicolons.

social software and science

I haven’t been through this entire post on academicproductivity.com, but glancing at the first few lines seems interesting. On the subject of science and social software.

API design

An interesting post on API design. Not so much technical information as reaffirming the value of being concise, consistent and predictable when designing interfaces.

classifying papers

Every few months I ask myself the question again: “What to do with my scientific library?” I’ve run across solutions here and there, bu none which convinced me: jabref, zotero, papers, etc.

I actually tried jabref, but it struck me as not having many functions beyond holding a list of all my papers and generating a bibtex file. Zotero is hosted on servers far away somewhere and my work doesn’t allow this. (Well, they might allow it, but to be prudent I host all work related files locally.) Papers seems awesome, but is unfortunately mac only. The situation seemed desperate until I saw gPapers! I thought I finally had found THE program of my dreams. Alas, gPapers is rather unfinished. The person who developed it originally doesn’t seem to have contributed in a while. What to do? Well, contribute of course! Though I have been known to file bug reports and test alphas, I’ve never contributed actual code to an open-source project, so this is my first experience. It seems like the timing and circumstances are perfect for me to get involved:

  • gPapers is written in python, which I’ve taken the time to learn lately;
  • I’m tired of looking for this perfect software and have gotten frustrated enough that I’m willing to write it;
  • right now, the feature-set of gPapers seems contained, so the initial deciphering of the code shouldn’t be impossible (it’s not like I just decided to rewrite the whole linux kernel);
  • there are few developers and the pace is slow, so I should have time to get up to speed without having the software go through three major revisions.

The only problem is: the active fork of gPapers is hosted on github. I have no idea how git works, let alone github. (I DO use version control, but I’m a svn user right now and have no experience with distributed version control.) I managed to create an account on github, create keypairs and upload the public key to github and…that’s pretty much where I was as of this morning. After a few days of looking, I came across a great tutorial containing the information I had been looking for so far. It basically answers the question I’ve been stuck with for a while: “Ok, I’ve created an account on github and now I want to contribute to a project. What do I do?” (spoiler: the answer is basically that you fork the project, as surprising as it may sound to svn users.)

Getting started with GitHub from Charles Max Wood on Vimeo.

As for gPapers itself, I got the software to run a few days back and now I’m off to see if I can actually make it work. Let’s see how much has to be done to make gPapers better than papers.

[Update 11/17/2010: I was corrected by a commenter. You can use zotero entirely locally. I’ll give zotero a whirl again sometime in the next few days then. I’ll probably still try to contribute to gpapers, be it only to learn how to use git properly.]

Creating an online persona

A (really good!) friend of mine was recently contacted by a head hunter. He was subsequently flown to the company headquarters and given a tour. He’s also an engineer, though his specialty is not at all in the same domain as mine. (I still like him though.) While touring this company, he noticed they actually needed people with a strong background in combustion/explosives/stuff I could do… so he spontaneously decided to give them my name. I’m not necessarily looking for a job now, though I’ll probably be looking for a job at some point in the future (my current post-doctoral contract is for 2+1 years) and there’s no harm in keeping options open. (Actually, I’m quite happy he gave them my name).

I haven’t been contacted by a head hunter yet…

Why is that?

  • They might not be looking for people like me that hard. I can’t do anything about that.
  • They might need more time to look/find me. I can’t do anything about that either.
  • I might not exist in their wold. Now there’s a problem.

My friend was contacted on LinkedIn, which I guess by now is a de facto standard for translating online your professional identity. I didn’t have a linkedin account until this morning. In fact, unless you’re absolutely intent on finding who I am as a researcher and a scientist using online search tools, you have to really know what you’re looking for. You need to know I work on detonation waves and solid explosives mostly. In fact, if you go on google and look for my online professional self, you don’t find him. You quickly learn I like photography (and you get to see some of the pictures I’ve taken over the years), you find this blog (which is neither very well maintained nor very¬† professional) and you discover that I commented on a Richard Martineau’s cyberpresse blog years ago and I was once too drunk. I don’t regret what I wrote, but it’s hardly a good description of my professional life.

Hence the title of this post and my need to create a new (additional?) online persona. The professional me: Charles-the-scientist-online.

There’s not a standard site scientists and researcher types should go to in order to define that online persona. There’s not yet a clear standard for an online-facebook-scientist-social-network. Here are thus the first 2 steps I’ve picked:

  1. At-least-weekly updates to this blog (which ultimately will be beneficial for me in several other ways);
  2. Create a proper account on linkedin.

Why those first two steps?

  1. My facebook account is rather non-professional and I’ve kept it rather hidden. When you look for me online, my facebook account doesn’t come up very high (as of 11/06/2010, it doesn’t show up on the first page of google results for my name). I’d like to keep it that way. This website, on the other hand, has been coming up in first place for a while. I may as well capitalize on this.
  2. As I hinted earlier, linkedin seems to be a de facto standard now. I’m guessing I can use that site as a repository of CV, links to stuff I’ve created, etc.

So far, I’ve successfully created an account on linkedin and I already had a question. I had to pick between the basic (free) account and the premium experience (25$/month) account. As I’m not really looking for a job just now, I decided to go with the free option. I wasn’t quite sure at first what the best option was to be found. Then again, I imagine most people are probably on the free account anyway (they claim to have 80 million users, which if everyone was on the paid option would mean 1.6 billion dollars monthly revenue…)

More news on the creation of the new online persona as time goes by, although an interesting question has already popped up in my head. Is there room on the internet for two of me? My personal facebook profile is pretty much limited to facebook. What if I wanted that information to be public, would I have a problem? Would the personal friend-me be competing with the professional-scientist-me for online exposure? How do you manage that situation?

How social networks are not at all like real people networks

An interesting presentation by Paul Adams on how online social networks are not built at all in the same way real life networks are. For a long time now I’ve kept, on the back of my mind, this idea that there must be a way for scientists to interact in a 21st century way rather than our current, ‘tried and tested’, peer-reviewed publication system. This talk has sparked quite a few ideas in my head but none clear enough for me to actually describe here. Nonetheless, a really interesting presentation worth the 200-and-some slides!

Finally

After neglecting way too much in my life, I’ve finally defended my thesis. Being in the process of making final corrections, I thought I’d post here a couple of tricks I discovered along the way for the list of abbreviations and the list of symbols. If you’re using latex and (for abbreviations) linux, read on.

List of abbreviations

Took an afternoon, but I remembered how to use grep and sed long enough to craft this little bit of regexp voodoo.

sed -r input.tex ‘s/([a-z]{0,1}[A-Z]{2,})/\n\1\n/g’ | egrep ‘[a-z]{0,1}[A-Z]{2,}’ > output

It’ll catch the acronyms of the form AAAAA or aAAAAA (with obviously any number of As) as well stuff you write in all caps. It also obviously spits out all the acronyms in the order they appear without sorting them nor eliminating doubles. Took me 1.5 hours to do that, figured I didn’t really want to bother with writing a perl script.

List of symbols and variables

I’m stuck doing it by hand, although I found there was a way to automate the list of symbols. Unfortunately it requires some thinking ahead I didn’t do and it would probably take just as long to do it either way now. See here.

Enjoy and happy thesis writing if you’re going through the process as well.

Please be aware the content you browse may be visible to passengers around you.

I keep complaining about every little thing around me whenever I travel by plane, but I think I secretly enjoy it. The long lines at security, the overpriced food, the delays (although this time, my first flight is on time), the multiple check points where you have to show every piece of ID you have. At least, the airline companies are slowly getting with the time and we now have wifi onboard. It was about time.

I thought about the topic of this particular post while I was waiting for my carry-on at the “security” check point. The guy operating the x-ray machine looked perplexed while looking at the pink and purple picture of my bag. Just for kicks, I thought I’d make the list of the items that I’ve tested and can make it through the Albuquerque check point:

  • a 2.5″ diameter cardboard tube (it has pictures rolled inside there, christmas present for my parents and in-laws who, hopefully, don’t read my blog yet)
  • a camera tripod (with the head unscrewed so it can fit in the carry-on. I guess that makes it just a really big metal stick.)
  • frozen green chili (wrapped up in plastic, then in paper and then in plastic again. To be fair, it is Albuquerque, so they may be very familiar with what green chili looks like under x-ray.)
  • a bunch of electronic things (ipod, fm transmitter, headphones) with all the cords mangled together.

and finally, the one which really surprises me

  • two home made fruit cakes (made by my wife I should mention so nobody thinks I can actually cook). This is my mom’s recipe which is as dense as steel and each cake is wrapped in gauze (and drenched in brandy, hmmmmmm), then wrapped in plastic foil and then wrapped in tin foil. I can’t believe that looks like anything intelligible on an x-ray.

Thank god for airport security keeping me and my holiday festivities safe!