Talk about best practices in Git

Today I gave a talk about best practices in Git at CERN‘s IT Technical Forum.

I am a big fan of Git and, since I started using it, I learned a few tricks and ways to get a more “healthy” repository, so I wanted to share this with users that are already using Git but still have doubts about the best way to do certain things.

Here is the presentation’s slides:

This is the kind of presentation where one might disagree about some of the recommended measures but hopefully there’s a subset of those that will help make things better for teams.

Practice your git-fu!

What a year!

What a crazy year this was! In 2013 many important events happened in my life that would make this a very busy year.
To start, I began the year looking for a new job after 4 years working for Igalia. This meant that I had to travel a lot and move (with Helena) from the place I felt like home (the city of Coruña), having to say good bye to many good friends.

This search also took me to the U.S.A. for first time where I met a very interesting company and people. Since Helena and I didn’t do our traditional travelling this year, going to San Francisco was definitely the most interesting trip of the year for me. I really want to visit it again some day together with Helena.
Then I ended up joining Red Hat, where I kept working with GNOME technologies — mainly on the Wacom related pieces — together with some of the best Open Source developers in the world. I also moved to Berlin, the city I am in love with, which meant fulfilling a dream we had for a few years. My dear friend Chris Kühl helped make this move smoother so I have to thank him here again.

After just a few months in Berlin, I received the positive result of an application to CERN that I had done before all this and I had to make yet another decision. We decided to do it and we moved out of Berlin just shortly after knowing that we will become a family of 3 next year! Our little girl Olivia will be born next March and we cannot express how excited we are about it!

Life in this region is very different from Berlin’s (not bad, just different) but CERN is a very unique place and I am enjoying the experience.
Our arrival here was also easier because of Quim and his wife Ana Marta, a couple of friends from University who really couldn’t have helped us more. Together with our good friend Nacho, they are really “5 stars” as we say in Portuguese :)
I need also to mention my parents who not only helped us with moving out of Spain but also drove all the way from Portugal to France in order to visit us and bring us our stuff.

Technically, I live in France, in a small town called St Genis Pouilly, close to CERN on the French side of the border but it’s really still Geneva’s area. A curious thing about Geneva is that its largest foreign community is the Portuguese. I hear more people speaking Portuguese at the supermarkets in here than in Algarve :)
One of the things I miss from Berlin is the possibility to easily ride a bike anywhere. In here it is dangerous (drivers are crazy and there’s no bike lanes) and less convenient (Berlin is flat, here it isn’t) but I found another physical activity to compensate a bit my sedentary job: I started playing squash and I love it!

As a result of all these changes, my personal projects got a bit neglected. I released only one new version of Skeltrack and OCRFeeder (actually I got a new version of OCRFeeder almost ready to ship) and I did a couple of quick hacks with the Leap Motion Controller.
The number of books I read was also lower than ever this year. I read a couple of books by Cory Doctorow and a spy thriller called The Shanghai Factor.

Not all things in 2013 were as great as my words might indicate. My grandmother (to whom I was very close) passed away a month ago. It was a very sad event, but she lived a long life and had her family beside her in every moment.

About 2014, my biggest wish is that everything goes well with the baby and Helena. I think I will probably have to miss some of the Open Source events I usually attend but I got a good excuse, right?
I hope it’ll be a quieter year than 2013 in terms of moving and that I can still dedicate time to my personal projects.

2013 was a year I will surely remember all my life. I am a lucky person to have had the opportunity of different experiences, to have friends in many places and to have my wife and family supporting me all the time.

I wish you all an excellent 2014!

Olivia in Helena's belly!

Playing GTA V on a PS3 with Leap Motion

I have a PlayStation 3 and I love working with new types of user input so, as my last hack of the year, I wanted to use the Leap Motion Controller to play some game on the PS3.
The Leap Motion Controller is obviously not compatible with the PS3 so the plan was to use a regular computer, interpret the gestures from the Leap Motion, and send the respective controls to the console.

For the game, I chose GTA V because it involves many different actions such as running, jumping, driving or shooting… and it’s awesome!.

Here is the video of yours truly using this script to do some disastrous driving but having a lot of fun with the Leap Motion and GTA V:

The reason why the big video has such a low quality and the tiny one is fine is that they were recorded with my Nexus 5 and my Canon S95, respectively, and my living room was very dark.

How it works

As seen in the video, it is also possible to control the PS3 menu and choose the game from there. The player’s actions I chose to implement were walking, running, jumping, driving and enter/leaving a vehicle. All of those were easy to implement except for the driving. The thing is that I can easily get the angle for the imaginary steering wheel that a user does with the Leap Motion device but I could only simulate turning the left analog stick fully to the left or to the right. This makes it kind of difficult to steer a car, as can be seen in the video, but it’s still fun to do it.

For the communication with the PS3, it uses the GIMX project which makes it possible to simulate a SixAxis game pad from a computer and send its actions over bluetooth to the PS3. GIMX has some nice utilities, being its main one the emuclient which detects key events and uses a configuration file to map them to the actions of the SixAxis. It would be much more elegant to send the commands to the PS3 directly from the script I wrote but it was simply faster to instead simulate the key events and let GIMX do the rest with the right configuration file.

As with the Leap GNOME Controller, this is a small script rather than a big project. To know how to use the project, please refer to the README file that ships with it. Hopefully someone will like to try it out and improve the current gestures or make new ones.

Get the source at GitHub and have a great 2014!

Two Weeks in Japan, Part 5: Takayama

This article is part of the “Two Weeks in Japan” series and follows Two Weeks in Japan, Part 4: Nagoya and Hikone.

After Hikone we headed to Takayama, it was August the 15th, 2012. The scenery was beautiful, you will read in guides that Takayama is located in the Japanese Alps, that means beautiful dense forests, creeks and mountains. Bullet trains in Japan were very comfortable and fast but it was actually nice that the train that took us to Takayama was not a high-speed one, this way we could better appreciate landscape.
Our seats were right after the driver’s cab, he wore white gloves and we were intrigued with these gestures he did: about four times per minute he would raise his hand, point it to a railway sign and then to some of the panel’s instruments which looked like some kind of ritual…

Japan 2012

Driver waving: a mystery to be solved!

Japan 2012

The Japanese Alps

When we arrived at Takayama, it was already night and we had to walk about 20 minutes to our ryokan: Sosuke. The room was about 50 €/person/night, it was much nicer than the one in Nagoya but less fancy than the expensive one at Kinosaki Onsen.
Since we had waken up early, walked all over the castle area in Hikone, and ridden the train for more than 5 hours, all with a smothering heat and humidity, we decided to grab dinner at a supermarket nearby and eat at our room. After that I just laid back and watched Japanese TV as they have quite some interesting TV shows there!

The next morning we went to a local street market. It wasn’t as impressive as our Lonely Planet Guide mentioned so we walked all over town, visiting some temples, traditional stores and even a small museum. Wood craftsmanship is a traditional art in Takayama so there were really beautiful wood carvings but we also entered a very interesting shop with the most original figures hand-made with bolts, nuts, washes, etc. We ended up buying a small donkey figure which we named Giló (just a funny sounding Portuguese name).

Takayama

Our donkey Giló doesn’t look this dangerous but it is also awesome!

Takayama

Beautiful bridge in a temple in Takayama

Hida Furukawa

During the evening that same day, we also took the train to a small town nearby, called Hida Furukawa which has some canals going through it with giant Koi fish. There were small wooden boxes in front of the canals with small bags of pieces of bread. Each bag 100 ¥ if I remember correctly and since it’s Japan and everybody is honest, there was no security mechanism whatsoever in the boxes to guarantee people paid (and yes, in case you’re wondering, we did pay). I love Koi fish, so I really enjoyed this small trip.

Koi fish in Hida Furukawa

Koi fish in Hida Furukawa

Koi fish in Hida Furukawa

Koi fish are great!

Koi fish in Hida Furukawa

It’s a beauty!

After a visit to some of the Hida Furukawa’s temples, we headed back to our ryokan in Takayama only to find some kind of ceremony in the entrance of a fancy hotel nearby. People were playing traditional songs and dancing in a circle with a strange participant: someone with a costume of what looked to be Godzilla… :)

Takayama

I thought Godzilla liked Tokyo, maybe he retired to Takayama for the relaxed environment!

Hida No Sato

The next morning we went to Hida No Sato (or Hida Folk Village), an open air museum about 20 minutes walking from our hotel which turned out not to be so easy to make because we took a wrong turn and it was freaking hot!
Anyway, we eventually got to Hida No Sato and it was totally worth the walk and the price (about 10 €). It had many traditional houses which belonged to several parts of the region and had been reassembled there. Inside the houses there were texts and pictures showing how the villagers used to live. We saw pictures of men carrying tree logs (which looked bigger then themselves) down a snowy mountain; it was a very hard life.

Hida no Sato (Hida Folk Village), Takayama

Us, passing as locals in the museum!

Hida no Sato (Hida Folk Village), Takayama

A traditional house of the region

Hida no Sato (Hida Folk Village), Takayama

A gate in Hida No Sato

After Hida No Sato, we took the train to Tokyo. It would be the 2nd half of our trip and we would spend an amazing week at this great city but that is the subject of the next post.

to be continued…

Two Weeks in Japan, Part 4: Nagoya and Hikone

This article is part of the “Two Weeks in Japan” series and follows Two Weeks in Japan, Part 3: Kinosaki Onsen.
This series of articles has been dragging but I need to make an effort and finish it, especially because I have had such a great feedback.

Our original plans for Kinosaki Onsen were to go to the beach to the north of it but it was raining a lot and we decided instead to start the trip to Takayama but it was just too far away so we chose a point in the middle of the route to stay: Nagoya.

Nagoya

I had read on our guide that Nagoya didn’t have much to see and it was right. We found a ryokan to stay by choosing one from the list we got at the tourist information office at Nagoya’s train station and calling them to check for the availability.
This ryokan, which I cannot really remember the name (and I don’t have my notes here unfortunately) was a bit cheaper than the others but of course, it wasn’t half as good as the others.
The room was big and with a Japanese garden in a patio but while it looked nice, the garden turned out to be composed of artificial plants and the tatamis, futan, etc. also didn’t have the same quality as the other ryokans we stayed at.

Our room's plastic garden in Nagoya

Zen fake: always green, never ending relaxation

On Toilets

The worst though, was the toilet. In the previous article I forgot to tell you how cool the toilet was in Morizuya ryokan. Yes, it was one of those high tech Japanese toilets. When I opened the door to the toilet’s cabinet, the toilet opened it lid automagically! It also included a heated seat but there was no toilet paper… Instead, I had a control pad mounted in the wall next to it, illustrated with pictographs of what the buttons did. See, one doesn’t need toilet paper in Japan… think water jets. I can tell you that you’ll feel very fresh! In comparison, we’re in the dark ages of hygiene here in the West. I could go on about how I think they got smart computer vision algorithms who can find the exact spot where to point the water jet but I’m not.

Hi-tech toilet controls

Hit the right button and you’ll feel reborn!

Anyway, this was not the case in Nagoya’s ryokan. You would think that with such advanced technology in fields for which innovation isn’t the first thing we think about, I expected the “beginner’s” level to be a regular, western toilet but it was in fact a squat one. I still tried to utilize it but my lazy, western body doesn’t have the balance required. Luckily there was a 7-Eleven around the corner with a regular toilet and very clean (as everything in Japan).

During the evening we didn’t know what to see so we just took a walk until the Nagoya Noh Theater which has a nice samurai statue outside.

Japan 2012

Nice Samurai statue outside Nagoya Noh Theater

Hikone Castle

The next day, we headed to Takayama but we did a little detour to visit Hikone Castle. I love Japanese architecture so I wanted to visit a Japanese castle during our trip but we discarded the famous Himeji Castle because it is under restoration until 2014. Hikone Castle was the alternative we chose, it was conveniently located on our way to Takayama.
Hikone Castle is a small one but is one of the few which hasn’t been destroyed in any war or any other tragic events throughout history. I also kept thinking “I think I sneaked into this place in Tenchu“!

Hikone's Castle

The Magnificent Hikone Castle

Hikone's Castle

Simply beautiful

Hikone's Castle garden

Relaxing at the garden on the back of Hikone Castle

Since our backpacks were very heavy, it was crazy hot&humid and there were too many steps to climb, we kindly asked for the tickets office to keep them, which they kindly did even though it couldn’t fit any of the lockers.
We had to queue for a little while at the entrance of the castle and chatted a bit with the guard there. He was very nice and knew some Portuguese words (there are a lot of Japanese immigrants in Brasil and he had family there) and said that Helena’s eyes looked a bit Japanese. So far she’s been told that she looks Turkish, American (someone said it was because of her freckles… go figure) and now Japanese! She’s a citizen of the World for sure, let’s see when they say she looks Swedish or African :)

Hikone Castle was very nice and quick to see but the ticket also gave access to the gardens behind the castle which were very beautiful and relaxing. The town’s mascot is a cute samurai cat called Neko-nyan, be sure to take a picture with it if you go there.

Hikone

Neko-nyan loves taking pictures with Western tourists!

After Hikone, we finally headed to Takayama, the Japanese Alps. I will hopefully not take that long to write about it so stay tuned and enjoy some more pics meanwhile!

to be continued…