Alcides Fonseca

40.197958, -8.408312

PIL on SnowLeopard

Package Install

Nuno Lourenço created a PIL package for Python 2.6 on OS X.

Compilation

How to install PIL (Python Image Library) in Snow Leopard with freetype2 and libjpg support.

Libjpg

brew install jpeg Or download source and compile.

Freetype2

wget http://mirrors.fe.up.pt/pub/nongnu/freetype/freetype-2.1.10.tar.gz

tar -zxvf freetype-2.1.10.tar.gz && cd freetype-2.1.10

./configure && make && sudo make install

PIL

wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz

tar -zxvf Imaging-1.1.6.tar.gz && cd Imaging-1.1.6/

Open setup.py and change JPEG_ROOT and FREETYPE_ROOT to:

FREETYPE_ROOT = libinclude("/usr/local")

JPEG_ROOT = libinclude("/Users/alcides/Code/Support/homebrew/Cellar/jpeg/7")

Finally, sudo python setup.py install

Shift It

Organizing windows around your desktop is something that breaks you down from your main task. For Mac OS, I used to recommend 2up, which allowed people to make windows use half-screens (right, left, top or bottom).

However it has been discontinued, and I have found a better replacement which has the initial advantage of being opensource: Shift It (a fork of the initial project) allows you to also use quarters of screens, fullscreen and center.

I use this daily, mainly with terminal windows or with documents and editors, for having more than one window at the same time, and still maximize the used screen estate, without having to drag and move windows with the mouse.

I highly suggest it, and I am making available a pre-compiled version of the lastest commit, which has multi-monitor support.

The Desk

Desk – Music and Sound Design from Aaron Trinder Film:Motion:Music on Vimeo, via Nuno Póvoa.

About my desk

The desk itself is light-gray, very plain Fluxograma desk I won on a TV show when I was a kid, together with a top-of-the-line compaq presario and other stuff. The desktop quickly became obsolete, but the desk is the best one I’ve worked on.

I try to have only my computer (+external monitor, keyboard and trackball) on it, but due to this society’s dependence on paper, some documents get some private time with my desk. And once one sheet of paper accommodates, a lot of them start to join. All in one stack.

Outside people may say that stack is a pile of unorganized junk, but it is in fact organized, on a reverse-chronogical structure. I know where things are based on how far away the moment of “archiving” them is on my memory.

But I still hate to have paper. And I don’t have a scanner to process it. Nowadays, I find cameras much more suitable to record printed stuff.

In the future I believe desks will themselves be a multitouch surface, acting as a secondary display for the main screen on the wall, mainly focused on input.

I want a Kindle, but not yet

So I never really got a Kindle myself. I figured I’d like it, but not love it, so I’d wait until I maybe got one for a gift, or the price of a future generation dropped so low that it seemed inconsequential. Since the two major players in the digital reader space are Amazon and Barnes and Noble, both of whom are more interested in selling the books than the hardware, I suspect that the prices on them will keep dropping until one day they’re free if you purchase some number of books. Verizon will give you a phone for free so they can sell you the service for it, and I think Amazon will eventually do the same. They’re already rumored to be selling them below cost, and selling large numbers of books to their owners, and the price of e-ink screens will keep dropping from here. — Matt Maroon: Kindle and iPad

Exactly my thoughts. I don’t want to spend $100+ on them, if in one year they will be around $50. And I want a long-lasting one.

Como a Vodafone me desiludiu

Sou cliente Vodafone desde que tenho telemóvel (9 anos, e sim, na altura era Telecel) e nunca tive qualquer tipo de problemas, e considerava-me um cliente satisfeito. Até ontem.

Desde alguns meses para cá, tenho subscrito o aditivo Internet 100 que custa 5 euros por mês, e eu estou longe de chegar ao limite.

Ora como o meu telemóvel actual é um Blackberry Curve, decidi experimentar o aditivo superior Internet 300 visto que suporta o Serviço BB.

Dia 1 de Setembro, tinha 99.X Mb em 100 por gastar e 5 euros descontados na conta, e telefono para a linha dos aditivos para fazer o upgrade. A resposta que tive foi que tinha de cancelar o aditivo actual, perdendo tudo, e voltar a subscrever o plano 300. ou seja, perdia 5 euros, 100 Mb e ainda tinha de pagar de novo 10.

Isto para mim é inadmissível. O que eu aceitaria (e esperava) era pagar 5 euros de upgrade de aditivo (a diferença) e ficaria com 299.X de tráfego para gastar.

E a resposta da senhora que me atendeu foi bastante categórica. Não era mesmo possível creditar os 5 euros. Perdi o gosto que tinha pela Vodafone e fiquei mesmo desiludido. Eu a querer dar-lhes mais 5 euros e eles querem o triplo.

How to install RPy2 on Mac OS 10.6

How to install the R python bindings library RPy2 on Mac OS 10.6 Snow Leopard using Homebrew.

Install R

In order to install R in your Mac as a framework, make this change in your homebrew/Library/Formula

brew install r

Install RPy2

wget http://pypi.python.org/packages/source/r/rpy2/rpy2-2.1.4.tar.gz#md5=cf4e0d80ba498a6d76f107531966478d
tar xfz rpy2-2.1.4.tar.gz
cd rpy2-2.1.4/
sudo python setup.py build --r-home /usr/local/Cellar/r/2.11.1/R.framework/Resources/ install

Troubleshooting

If you are having a problem related to “-framework vecLib” when installing rpy2, insert a new line after #134 of setup.py with the following:

extra_link_args = extra_link_args[:-1]

Worked for me.

Le Chevalier d'Eon

A simple exercise: read through the real Chevalier d’Eon’Eon wikipedia page, and try to guess if he was a man or a woman.

Now, there is an anime based on this historic character and it’s history which resolves around the King Louis XV, Le Secret du Roi and Robespierre. Although they had introduced magic into the story, the result was quite interesting and made me like very much the show, specially the thought of the duality between the solitude of kings versus how evil/machiavelli/good they are.

Of course it also features some ideas of le Révolution Francaise opposing the existing honor to the King, which lead to a lot of intrigue and betrayals.

Gankutsuou: The Count of Monte Cristo

Besides the usual reading spike, I’ve been trying to watch more anime these holidays. After Monster, which I really enjoyed, I’ve watched Gankutsuou: The Count of Monte Cristo. It’s a adaptation of Dumas’ novel, but set in a distant future with spaceships and The Count being changed by a demon.

This futuristic changes were excused in my opinion (they were only there because of marketing tactics, I guess) but fitted the technique that they used to fill the clothes with static patterns (You really have to check it out!). Luckily they’ve retained the society, fashion and style of the time. There’s even a French spoken intro to every episode. Most of the times you don’t even know it’s set in the future.

Even if the plot is not surprising at all (even though I haven’t read the novel before), the anime is really well done, pursuing a more emotional and dramatic view of things, and I even trembled when one of the characters died (not going to spoil it, but you’ll know when you get there). And just like all the animes I’ve loved, this one also has a lovely soundtrack.

How to Access the Internet (A Guide from 2025)

So good, I had to blog about it: How to Access the Internet.

If the unbelievable decisions that are being taken in courts and in businesses regarding the internet and communication continue to be the way they have been the last years, I sense this amusing article will cease to be fiction very soon.

O Geek UsaIsto.com

Two lumberjacks, a younger one and an older one, raced to see who could cut down the most trees in a single day. At the end of the day the winner was obvious. The older lumberjack had won. The younger man could not believe it!

“How could you have cut down more trees than I did?” he asked. “Every hour you sat down while I kept right on cutting. I don’t understand. How could you have cut more trees while sitting so much?”

“When I sat down, I was sharpening my axe,” the older lumberjack said. “Why didn’t you stop to sharpen your axe?” “I didn’t have time,” the younger man said. “I was too busy cutting!”

Como developer que sou (ou pelo menos penso que sou), gosto de conhecer as ferramentas com que trabalho aprender mais sobre elas, e escolher as melhores para determinado fim. Seja qual for o tipo de ferramentas, e muitas delas são apenas processos.

Muitas das vezes exercito o meu lado voyeur, navegando na net à procura de Office Porn, sendo que uma paragem frequente é o The Setup, entrevistas bastantes simples a várias personalidades baseadas em 4 perguntas: Quem és? Que hardware usas? E que software? Qual é o teu Setup de Sonho?

Nas várias entrevistas é interessante não só saber o que usam, mas também o contexto, o workflow, as razões, que tornam a entrevista não só num show-off de gadgets, mas também numa partilha de processos.

Nesse espírito decidi organizar o mesmo, orientado a Portugal, onde convido pessoas que considero que fazem algo interessante a explicarem-nos como o fazem e que machados usam para o seu trabalho.

Podem encontrar as entrevistas em UsaIsto.com, seguir o RSS ou seguir no Twitter, visto que as entrevistas vão aparecendo com regularidade.

The Disappearance of Haruhi Suzumiya

Been kinda busy with school projects and exams, but took the afternoon to watch The Disappearance of Haruhi Suzumiya. I hadn’t seen the prequel series The Melancholy of Haruhi Suzumiya, but I got the story without a problem and, despite being a bit too long, it was an awesome movie. The slow pace and the time it took for the initial riddle to be solved grabbed me to the screen until everything was clear and explained. (It was so good, I even bared to watch it on CAM quality, and thrust me, I have seen better cams than this one)

When I saw the opening, I recalled the song, but don’t know where from (since i haven’t seen the series). Probably some Best of Anime OSTs or something like that. Cheerful.

I don’t know if it’s for liking animes with girls with “disproportional breasts”, or just because the whole alien + time travel theme is my thing, but I’ll probably give the tv series a go during this holidays.

About Thyme

This post is about as minimal as the app:

If you are looking for a simple way of logging the time you spent doing something, João presents you: Thyme.

Every time you use -f, a kitten dies

I’ve been only using git for little more than two years now, but having using it daily for every project (even those in subversion servers, via git-svn) I’ve learnt a few tricks and developed my own workflow.

During this semester, I have been working on a 13 people project and we are using git (and github) to manage the code. This means a large code-base with two different teams working on different parts of the software, that depend on each other. And I’m the lucky poor bastard who has to keep updated with the whole system and perform the merges of feature and bug branches.

Working on such environment makes weird stuff happen to the repository and when one gets to merge a branch, discovers everything is now broken and some stuff disappeared. Here are some things to avoid, learned from this and many other projects:

  • Developer A commits some stuff. He then pushes to master.
  • Developer B (almost at the same time) commits and pushes to master.
  • Developer A finds out he forgot to include one file, and commit amends the file. He then pushes with -f (because an amended commit requires it) and B changes are lost for ever (not quite, but B may delete that code once pushed).

Another interesting story is about a feature X that was accepted to be merged into master, but since it was based on a really old version and a total refactor of half of the code. Smart as I were, I decided to do a rebase instead of a regular merge, to resolve merges commit by commit. Turned out I needed to undo the rebase and turn it again on a branch without my conflict solving.

As a rule of thumb, avoid at all costs to use -f, because as easy and attractive as it might seem, in the end it might corrupt your repository. Also, merges are a nice way of keeping your history clean and prevent from losing individual codes.

LaTeX

LaTeX is a typesetting tool, the de facto standard for scientific publications.

MacOS Setup

I used to only install BasicTeX and install additional packages using sudo tlmgr install <module_name>. I no longer use, or recommend, that solution.

Instead I install the whole MacTeX system. It takes ~4GB of disk space, but it saves time in the long run.

For editing TeX, I now use Texpad, which is the best editor by far. Even better than emacs or my esteemed Textmate. I just wish it had more user-friendly templates and customizable shortcuts. In other machines (or when working with non-tech people), I use the wonderful web-based Overleaf.

For managing my references, I am now using miscellaneous bib files in my different project and paper folders. I gave up on Papers.app and Mendeley a while ago. To find Bibtex, I prefer DBLP to Google Scholar, as it consistently provides me with better details.

Tools:

  • Texpad The best TeX editor out there, paid and Mac-only.
  • Overleaf A web based editor with Dropbox and git synchronization. My suggestion for non tech-savy people
  • Quiver, a WYSIWYG tool to edit tikz diagrams

Prt.sc, os blogs e os vídeos

Desde pelo menos Agosto de 2008, que mantenho um feed público da minha pasta de feeds de malta portuguesa que escreve sobre tecnologia. Feeds que leio diariamente e me dão uma boa ideia do que a malta por aí faz. Um desses feeds era o antigo planeta asterisco, que entretanto mudou para Prt.sc.

O projecto foi evoluindo, entretanto agregando alguns dos blogs que eu também seguia, até se estagnar à coisa de um ano. Ora o organizador-mor da coisa, falou ontem no twitter que a coisa estava mal e eu já a temer o pior, saquei um arquivo da página de membros1.

Hoje tornou-se oficial, o prt.sc vai acabar como agregador de blogs, e vai-se focar na sua vertente de vídeo. Pessoalmente até gosto, mas é uma coisa que não me traz grande novidade, e depende muito de quem nele intervém.

Agora a parte de blogs faz-me imensa falta, pelo que percorri a lista de membros, e adicionei os blogs de quem me interessou um a um2. E lembrado do meu antigo feed por um dos membros do prtsc, criei uma página dedicada para o efeito, mas estou à espera de uma sugestão para um branding melhor se existir procura.

Espero que sirva de serviço público para alguém, porque isto dos blogs ainda tem algo para dar. Ou assim acredito eu.

1 Se alguém estiver interessado que me peça, mas o VD disse que iria disponibilizar o OPML.

2 Os posts recentes devem estar por uma ordem estranha, devido a estas alterações todas manuais.

Simplicity is the essence of happiness.

…is my new wallpaper. It also describes my approach of minimalism towards my software environment.

My main machine is running Mac OS (although I have a windows box and random-linux-flavored VMs around) and one thing I really enjoy is having most of my computer needs satisfied by the default apps. My mantra is “The less I install, the easier it gets to reset my system”, something that I might have to do in case of emergency (breaking the system, disk failing, etc..) or simply because I like to have my system clean every semester.

There are only three non-default apps in my dock: Adium (only if I could get rid of MSN and just use iChat), Transmission (I don’t see Apple releasing a bittorrent client anytime soon) and Textmate. I do have more apps around for special purposed, but those are wiped in every clean install and installed on a need-basis.

And I get really annoyed when I read twitts about getting “Rucksack for Mac OS X completely free” and about those popular bundles that people buy just because its cheap and not because they really need that software. I won’t install software just because it’s free and cute. I have a nanoBundle2 just because it was free, but I’ve never installed any of the apps, because I don’t feed the need for any of its features.

And regarding Rucksack, OS X unarchives zips, tar, gz and unix stuff out of the box, and I’ve installed unrar via HomeBrew for all the rars that get piled up in my Downloads folder. I even made a simple context-menu service that makes it really easy to use.

And I am really happy with my software real estate. The less I have, the less I will lose, the less will annoy me, and the more I will get from the few really good and useful tools I work with.

Meta Next Step

The last iteration of my online log lasted for around one and half years. Now that time has passed for this version itself and as I write less frequently, I do feel an urge to change it into something different.

I’ve moved out the politics section and I’ve been trying a new thing: TechThatMatters is a collection of the most important news around the web that one must really read, in my opinion of course. It tries to be a public service for those of you without the time to go through all the 613 feeds I subscribe to.

This gives me more freedom to do what I want with this space (my main personal hub, I mean) but I am not really sure in which way I want to take it. This might reflect my position in life right now as I will soon face the choice of an internship that will be the first step to decide how will I get on with my career. Small company, Big enterprise devil, maybe going for a PhD, or even two of them. And with that choice there is another one: deciding if I should stay in my little merry boring town of Coimbra, move to Lisbon or even UK/US or somewhere with a good lifestyle.

Just as I return from the 7 months of holidays that were erasmus, I am still trying to adapt to the old rhythm of working everyday (and night) in my department. So don’t expect much activity until this changes.

Oslo

This was Yet Another Trip we made while in Sweden. We took the train to Oslo (50€ round-trip). We were told that one day would be enough, so we got there at 10 and the train back home would be at 6pm. We walked around, following the river and we found a big touch screen with Google Maps loaded with Points of Interest to visit.

But nothing was better than our analog map, that took us to the University, to the Royal Palace, a couple of Churches and the Parliament, but this time we didn’t enter. And we also visited the National Art History Museum that looked like a miniature of Copenhagen’s. The price was the same: free.

Finally we had time to walk around the downtown of Oslo and also around the city (even went to a cemetery! [1] ) since we had time to kill. I have to say the city is very poor compared to the other I visited, and the most interesting thing I’ve saw were several buildings in irregular shapes, made all of glass. But then again, you also have them around the other cities I visited.

1 In the Nordic countries, graveyards are beautiful gardens open for everyone to visit.

The Picture of Dorian Gray

I first met the Dorian Gray character in The League of Extraordinary Gentlemen and I was intrigued specially by this character. A couple of months ago I saw the book in Sweden, but I already had too much to bring home in my suitcase, so I left it for some other time.

Then I knew about the movie and this week I finally managed to watch it and the result was quite good. Like the cast pretty much and some of the decay scenes turned out quite shocking. Highly recommend it.

Spoiler: What most surprised me was the fact that he lived pretty much what he would have lived if he had not that special ability.