Archive for the ‘Interests’ Category

Remote CVS with :ext: protocol

Saturday, October 17th, 2009

For a while I have been wanting to access the CVS server in my laboratory intranet from home, but I never got around learning how to do that. Until today, that is. Here is the short version. First you make a tunnel to the CVS server through the gateway server:

$ CVS -f -L 10000:cvs:22 iba.t.u-tokyo.ac.jp -N

Then you edit .ssh/config to setup the ssh alias. Write the following in the file (create it if non-existant):

host cvsalias
hostname localhost
port 10000
username caranha

Finally you can connect, using ‘-d’ to override your normal CVS root configuration:

$ cvs -d :ext:caranha@cvsalias:/usr/local/home/cvs update

Some notes about the above:

  • It eluded me for a while that the tunnel command had to be done from the computer which you are accessing from,
    not the computer which will actually act as the “tunnel” - duh!
  • The -f and -N options in the ssh command allow for the SSH tunnel to keep running in the background, so you don’t have to keep a terminal window open.
  • For some bizarre reason you cannot tell CVS which port you want to use in the SSH connection when using the :ext: protocol. Even if you change the CVS_RSH variable to “ssh -p something” or create a shell alias, you’ll get an error - so you need to edit the ssh config file.
  • If for some reason you want to use the :pserver: protocol instead of :ext:, change the cvs:22 to cvs:2014 in the tunnel command line (and :ext: to :pserver: in the cvs command line, of course).
  • While I checked a bunch of websites until I got to the final solution above, this one also has all the steps needed (and a bunch of other information): http://www.cse.scitech.ac.uk/ccg/misc/cvs_remote.html
  • Another very useful site I found while googling this (not related only to CVS) is this small compilation of Unix hints and tricks: http://cb.vu/unixtoolbox.xhtml

Review: Bibliography Management Software

Wednesday, September 2nd, 2009

This weekend, I prepared a survey paper for a Japanese Symposium (which, incidentally, will become the basis of the bibliography chapter of my thesis :-P). I decided that it would be a great opportunity to leave the stone age and start using some bibliography management software. Following suggestions from friends, I tried out Mendeley, Zotero and Jabref - these are my impressions:

Mendeley is developed by some people from last.fm and skype. It has many very sexy features, including the ability to drag a PDF into it, which will create a new entry and pre-fill it with information gathered from the PDF. Mendeley can also update an entry’s fields by searching for its title on the web (google scholar), and the accuracy for this one is very good. The interface was clean and very intuitive - I could easily find all functions that I needed to without having to think/click too much about it, specially the addition of tags/comments to and article.

But (unfortunately, there is always a big But), Mendeley had some pretty big problems. The first one is that it would crash too often - After adding just a dozen or so entries, I would find the desktop application crashing without notice - and worse yet, without error messages or memory dumps that would help me track the problem down. In one of these crashes I lost my entire database (fortunately I was just trying the program at the time, no real data was lost). A secondary problem was that the search function was a bit buggy - If I added a keyword, say, finance, to 6 papers, searching for this keyword would only return 3 or 4 of them.

I hope that they fix those bugs eventually, but until they do, Mendeley is unusable for me :-(

Zotero is a firefox add-on that also claims to be able to search for paper details on the net. This is already one letdown (at least for me) - I want a standalone program, not something riding on a Firefox instance (specially because Firefox is SUCH a memory hog!). Zotero won’t even reside inside a tab, it must occupy the root screen of FF. Also, because it is an add-on, its data (including stored pdfs) is saved in a bizarre location inside the hidden mozilla folder - it would be cool if this was configurable, since it would make things easier to back up. These aside, it had many of the same features that I liked in Mendeley, like searching for paper information on the web, and getting info from PDF’s - although they were a bit clunkier to use - for instance, if Zotero couldn’t find the info from a PDF you dragged into it, you couldn’t just enter the info yourself in the entry, you had to create a new one, and drag the pdf into it. They also had a cool feature to link entries as “related” between themselves.

However, all of the above is pointless when Zotero simply chocked on my bibfile. Not sure if it was FF or Zotero’s fault, but trying to import my references file into Zotero would result in FF locking. Next.

Jabref is a java based bib management software. After installation, it read my bibliography file immediately, without glitches. The program was stable, with powerful options to select/search/group papers. However, the interface was very obscure - it took me a while to find the button I had to click to edit an entry (couldn’t just double click it), and there is no option to add tags (I can add keywords to a field and text-search it, but it is just not as easily automateable). Jabref can only search on IEEExplore, and can’t read PDF metadata (it can, interestingly enough, WRITE pdf metadata though - I wonder what is the point of it).

Anyway, after playing with it for about one hour or so, I got the hang of where most of the functions are. It could really use a “search the net for details of this paper” function that searched more than IEEExplore, or a “read PDF metadata function” for convenience of use, but other than that, jabref is functional enough to last me until the other options get their act together.

Robocon 2009

Saturday, August 22nd, 2009

This weekend I worked on the International (Asian) edition of the Robocon competition. This event is a robotic competition where 20 teams from 19 countries (Japan, as the host country this year, gets two teams) build robots to complete a certain task. All teams are composed of undergraduate students, who design, build, program and control the robots. The task for this year used three robots, the first two of which needed to carry the third robot through a obstacle course, so that the third robot could play three drums in the goal area (video here).

It was a very fun event. All the competitors were very young, and excited about being overseas (sometimes for their first time) to participate. It reminded me a bit of when I participated on the ICPC programming contest finals. In the Robocon 2009, I worked as a translator and assistant for the Macao team. At first they were a bit disappointed that the organization didn’t find a translator that could speak Cantonese, but eventually we got to get along well. Their team leader knew a lot about Japan, and I tried to encourage him to come for grad school here.

The competition itself was composed of two days. During the first day, the teams got to assemble their robots, do practice runs, and clear their questions with the judging team. The contest itself was on the second day. It was composed of two stages. On the first stage the teams were divided in 7 groups of 3 teams which played against each other. The second stage was championship style, with the first place from each of the 7 groups plus the best second place.

The winner of the contest was the Chinese team. The Chinese had a robot which was clearly superior to the other robots in the contest - it managed to finish the task in 18-19 seconds, while the best robots among the other teams would go for 23-26 seconds. It was a really good piece of engineering, and they really deserved to win, but their matches were a little boring to watch :-P

The second place was the team from Hong Kong - which was a nice surprise. The HK team were the “crazy kids” of the competition - unlike most other teams, they didn’t had an uniform and were often seen around joking. They didn’t do well during their test runs, and even almost broke the goal drum once, which brought a warning from the judges. But they managed to get their game together to fix whatever the problem was in time, and did great times in all their games in the competition. They also the best design prize.

The most disputed game in the day was between Korea and Thailand, in the first stage. In the match, both their robots hit the drum at the same time, and the judges decided to have them try again - but because both robots were based on compressed air, the teams had to rush to the pits to refill the air tanks - it was really tense!

Macao’s team didn’t have much experience - they were 1st and 2nd year students, and never been on a robotic competition before - but in their own way, they did quite well, winning against the Sri Lanka team, and losing against the favorite Toyohashi team. It was interesting to see that the Chinese in the audience would cheer up both the Macao and HK team as well as the team from the mainland - as the the team members put it in his interview to the Japanese TV, “In practice, we are like one country” - some lessons in geopolitics were had.

The competition ended without any serious problems happening (other than the Thais raiding the beer of every table in the farewell party :-D). Tomorrow will be a city tour for the participants, including lunch in the Tokyo Tower, a visit to the Tokyo Science and Technology Museum, and the Gundam in Odaiba. Of course, I’ll tag along to “provide translation” to the kids!

Montreal GECCO Trip - Day 7 (final)

Saturday, August 1st, 2009

In the last day of GECCO, there was little in terms of the conference itself. First we had the GECCO business meeting. A number of CFP were announced, including the CFP for GECCO 2010, in Portland, Oregon. It was also said that there was a plan to alternate GECCO between north america and Europe from them on - I hope it works, I think it would be nice. After that, the winners of the different competitions and awards were announced - no big surprises.

After the business meeting we had a plenary talk from professor J. Holland, who talked about the development of evolutionary computation in the past and present, tying it with the idea of complex systems. It reminded me how nice it is to be in a field where you can still hear talks from its pioneers.

After Prof. Holland’s talk, I attended to one of the Late Breaking Papers sessions, to see the work of Nunes that I mentioned in the previous post. It was interesting, and seemed to fit well with the work that other people in my lab are doing for finance.

GECCO was over, and then I went for lunch with many of the people I were hanging with in the conference. Supposedly, there was a “Conference Lunch”, in a restaurant in Chinatown, but when we got there we could see no one from GECCO - just shrimps. Shrimps. That chinese restaurant, for some reason, had 90% of its dishes composed of shrimps - fried shrimp, boiled shrimp, raw shrimp, yakisoba with shrimp, shrimp pie… some people in our group were getting quite sick of it, but I was loving! :-)

After the lunch, Verena, who was with us, said she was going Geocaching - and having heard about it before, I invited myself to accompany her, out of curiosity. I must say it was one of the coolest things I have done in a while. The idea of Geocaching is that people hide small caches in out of the way locations, or in the city, and then publish GPS coordinates for those caches. You get those coordinates and try to find them. When you do, you can sign a log book, and see what other people have left in the same cache.

Sounds simple enough, but for me the most amazing part of the experience was that 1- it took you to places you would never otherwise see in a town - It seems to me a great thing to do when you are in a place you have never been before (like the conference) 2- it also makes you see places you see every day in a very different way - something is hidden somewhere you pass by every day. Verena was quite a pro at it already, and in about 8 hour walking, we found almost a dozen caches in Mount Royal and the old town. We walked a total of almost 15 km! Quite an excercise too!

And that ended my short trip to Montreal :-) It was a good chance to make contacts with new people, re-establish old ones, see new research, and even do quite a bit of tourism.

Welcome back to the 90ies!

Thursday, June 25th, 2009

A few days ago, I took 20 minutes when I was bored and not really able to concentrate on my work, to set up a webcam feed to my laboratory desk. Here is the setup, for those interested (this is very basic stuff, but may interest those who are still beginning to explore their computers):

Ingredients:

  • An ubuntu box connected to the lan - root access (my computer)
  • A debian box connected to the internets - no root access (the lab’s web server)
  • A logitech webcam (forgot the exact model right now)

How to prepare:
A few years ago, I read many terrifying reports about the state of webcam support on linux. Seems that those dark ages are over, because my ubuntu box recognized my rather old webcam with no intervention from my part.

I apt-get’ed the “webcam” package in my personal box. The binary takes pictures from the webcam at regular intervals (settable in the .rc), and saves it to the indicated place in the filesystem. It has an option to automatically upload the picture via ssh or ftp, but that requires either leaving the password in plain text in the configuration file, or manually entering the password all the time, neither of which are acceptable alternatives.

So instead I installed apache at my machine, and saved the picture from “webcam” into the www folder. I would find a way to grab it from the server machine. The simplest way to do it is to use wget. At first I put wget into the crontab file, but the lowest resolution of the crontab file was 1-minute updates, and I was aiming for 5-second updates.

So instead, I created a small script:

while [ 0 -lt 1 ]
do
wget -q mybox myboxaddress/picture.jpg -O public_html/picture.jpg
sleep 5
done

And left that script running in the background (under nohup, so that it wouldn’t be ended after I logged off the computer).

Now, I have a picture in my public page which refreshes every 5 seconds - I just need an autorefreshing page to go with it (because clicking the refresh button all the time is boring). The way to do this in pure html is to add the following tag in your “head” section:

meta http-equiv=”refresh” content=”5″

(this must be in brackets, but silly wordpress won’t let me do it :-( )

This tells the browser to automatically refresh the page every 5 seconds - don’t make your page too heavy!

And there you go! You’re really to be the new Jennycam!

Now I just need to use all this energy to finish my paper :-)

Comments
This is a very simple and somewhat crude solution. The shell script to wget/sleep particularly bothers me. If anyone has a more elegant solution (maybe the reloading webpage grabs the picture from my box when requested via php? Which would be more computationally expensive?) I would like to hear it.

  • Categories

  • Archives

  • Meta


  • "Chivalry IS dead. And women killed it."
    Dave Chappelle