My PhD research requires a bit of a split personality. My field, knowledge representation and ontologies, is mainly theoretical: I deal with description logics and reasoning algorithms, graph structures, set theory, but also aspects of cognitive complexity. On the other hand, my tool, however, to do all this is still a computer (or, as currently on my desk, 1 mac, 1 desktop PC running Ubuntu, and 3 screens… you can never have too many machines, right?).
I often stumble across minor things that make my work a bit tricky sometimes, but I also find that, in the wonderful age of the internet, most of my problems have already been solved by at least one other person – and I would like to share the solutions with you. In my first ‘Techie Toolbox’ post, I will share some pointers to the ACM Computing Classification System, a great way to handle CSV files, and a quick fix for an illegible command shell.
How to read and write CSV files in Java
Most of the data output I get from experiments (see posts below) are dumped into CSV files at first – a convenient way of storing your data for processing in Excel etc. Of course, the most straightforward way to read and write CSV files in Java is to simply treat it as a text file and read/add the commas (or other separators) manually. This works fine, but it requires a lot of checking and can get messy once you have full text that uses the separating character in a sentence. Luckily, I came across Java CSV, a very lightweight and very convenient open source Java implementation for CSV input/output. Check it out: http://csvreader.com/java_csv.php
How to use the ACM Computing Classification System
You’re writing a research paper. The conference has kindly supplied a LaTeX template for the submission. But, what’s that? A section called ‘Categories and Subject Descriptors‘ containing codes and keywords? What are you supposed to put in there?
Don’t worry, it’s just the codes from the ACM Computing Classification System, which has been used since 1964 to tag publications with the appropriate subsection of computer science. The current version is from 1998 and can be found here:ย ACM Computing Classification System as browsable HTML – simply click through the hierarchy and find the area that’s closest to the topic of your publication.
If you’re using a LaTeX template for your paper, such as the ACM Sig Proceedings template, you can input categories like this:
category{H.3.5}{On-Line Information Services}{Web-Based Services}
How to change the colour of your command shell (bash)
The Ubuntu machine I’ve mentioned above is mainly used to run Java programs that I can’t or don’t want to run on my mac, for example to process large numbers of OWL files. While I’ve got the PC connected to a monitor right in front of me, I usually just use ssh to connect to it. Until this morning I was literally tormented by the outrageous colour choice for the shell: in addition to the usual neon green, files and directories were displayed in dark blue and dark red – on black background! I had been putting up for it too long, so I decided to overcome my laziness and change the colours. A quick google took me to the nixCraft blog, which has some straightforward advice on how to change your shell settings:
Your current shell settings are stored in an environment variable PS1. In order to display this variable in your shell, type:
echo $PS1
The output will be something like this:
h:W u$
mymacbook:MyDirectory samantha$
export PS1=”u@h:W”
export PS1=”e[1;32u@h:We[m”
nano .bash_profile