Alcides Fonseca

40.197958, -8.408312

git-pull-hook

I’ve been using redmine for a while now. And it rocks! I use it for bug and feature tracker together with time tracking, and also for viewing my repositories. It supports svn, bzr, hg and git. But only works with git local repositories. So if you have your repository somewhere on the web (say GitHub), you have to clone it to your webserver and keep it updated.

Of course one could run hourly crons, but that would be a waste of CPU when github provides something called webhooks. Now something we need is a simple webapp that provides the endpoint for the webhook to connect to. I decided sinatra would be perfect for this and wrote git-pull-hook.

It has some simple instructions if you aren’t sure what to do. And I’d really appreciate feedback on this, specially in security issues. And you’ve got two ways of doing this. the first (and nicer) is to fork the project and send a pull-request; the second is to email me (or comment right here) and hope someday I’ll look at this ever again.

SoundCloud

Back in this year’s Codebits we presented an idea of having your music online, in the cloud. Well, I found out this cool web application that is somewhat similar, and has a great UI based on iTunes. it’s the SoudCloud Player and it’s opensource.

.NET apps are now scriptable

Well, I believe all applications should be scriptable so anyone can improve its behaviour to adapt to each one’s usage.

Crack.NET is a kind of inspector for .NET-based apps (Winforms and WPF) that also allows you to write IronPython code, scripting any application. Both IronPython and IronRuby are perfect for this kind of job, and if you are doing .NET development, please consider providing a scripting interface in any of these languages. I’m sure your advanced users will improve their workflow, and even give you ideas for some new features!

By the way, IronRuby official repo is now on GitHub!

When your central repo is offline

When github was down this week, a lot of people complained. Specially those who are paying clients. I understand this, since I experience downtimes in my SVN server (that has some git repos now too) some times.

There is however a big diference between the two: git is decentralized, that means that you (a) can commit offline, and then push changes into github when it’s up again and (b) you can just use the git daemon like Github’s Chris suggest or just push the repo into some other server you have available in your local network (or even the web).

Last week, I found out we had a corrupted svn repo that I couldn’t commit to. After some issues migrating to a new svn repo I decided to move it to git, and just work offline (the three of us were working in the same room) so converted the SVN into a git repo and pushed to the USB pen I brought from codebits (thank you!) and that worked pretty fine :)

Always remember that this kind of workflows are also possible, and you can even have some repos in external disks as a backup (which I do!). Really rocks comparing to svn.

Coldfingers

In this last week temperature dropped a lot around here. Although I like Winter more than Summer, this cold is really freezing my fingers and keeping me from doing any real programming work.

@meisenshi suggested a cool glove that not only keeps my hand warm, but also allows me to type. So if you have some bucks to spend, I can give you my address :)

And no, Luís, I don’t think a PowerGlove would make me more productive ;)

Viva La Vida

I never liked Coldplay that much. I’ve never been a fan of semi-depressed-looking gloomy fellows and music to match (Travis, Manic Street Preachers, and so on). Which is a big part in why I was stunned when a particular iTunes ad got my attention this May. That song was Viva la Vida, the title track from the album “Viva la Vida or Death and All His Friends“.

In a way, Viva la Vida is my kind of music. It is a powerful song that’s got a solid beat and rhythm, sounds like real music and sends shivers down your spine. I’ve heard enough Coldplay to know that it is in many ways an un-Coldplay kind of song; yet it’s something that Coldplay would be the most likely candidate out of their genre to rush out to make.

I had exactly the same impression! I always felt that Coldplay were to depressing to hear, but this last single of their is somehow different from the others and a great song! Read the whole review in waffle’s.

Lebedev's Pyramid

The proportion shown below is true of any company, organization or community.

This is so fucking true.

Nokia gives up on Japan

So Nokia is giving up on the Japanese market. This supports my theory that we are not going to follow Japan’s example in the mobile phone usage. They have their own niche with super advanced features that are really supported by the network and content providers. No such thing exists in Europe nor in the US (nor anywhere else, maybe China in a couple of years, if they can manage the infrastructure required for such large numbers).

My fascination for Japan increases and someday I’ll get to live there only if for a short period of time.

MSN now supports multiple locations

Looks like the beta version of MSN Messenger now supports multiple connections from different locations at the same time, something that has bothered me a lot and made me switch to Jabber that had that feature since the beginning (circa 2000).

It’s sad that only now Microsoft realised people want to be logged in different devices at the same time, say you desktop computer, your notebook right next to it, and your mobile phone when you want to make a break in the sofa.

On the other hand this may be the first step to make MSN more XMPP-like so they start supporting it later on. Or this is just me dreaming?

UserScripts

UserScripts are site-specific javascript snippets that the browser executes after the page is loaded. It works in the following browsers:

Here’s a list of useful UserScripts:

Codebits 2008

Passei estes últimos três dias pela LXFactory, em Lisboa, a participar no Sapo Codebits 2008. Para uma visão geral, poderão ver a reportagem da sic.

Gostaria também de agradecer ao departamento onde estudo que patrocinou a minha ida e a de mais 4 colegas ao evento.1

Apresentações/Workshops

A primeira tarde e a primeira manhã estavam cheias de apresentações interessantes, mas eu só consegui ver duas:

Serverside Javascript: Hope and Opportunity

O Mário Valente apresentou a sua ideia para uma framework de desenvolvimento web totalmente em javascript chamada Starbucks. Mas o mais importante foram os motivos que o levaram a optar por server-side javascript:

  • linguagem de scripting mais deployed (todos os browsers desktop e mobile).
  • quem desenvolve para a web, seja programador ou designer, já tem algumas bases por onde começar2
  • é uma linguagem funcional, e parece que essas estão para ficar
  • implementa o Universal Design Pattern
  • Tem diversas máquinas virtuais (TraceMonkey, V8, SquirrelFish) que batem em diversas situações Perl, Python, Ruby, PHP, etc…

Eu levantei dois problemas que vejo na solução apresentada por ele:

  • Javascript puro pode não ser a solução mais mainstream, porque o corporate world pode facilmente adoptar Rhino (ou JScript) e usar todas as 1001 bibliotecas já desenvolvidas em java (ou C#).
*Eu valorizo a pluralidade de linguagens possíveis para o server-side. Perl tem as suas vantagens relativamente a Python, que em alguns casos é melhor que Ruby e que também tem situações onde ganha ao Perl. Ou podemos simplesmente falar de gostos. Penso que a solução poderá passar por ter mais máquinas virtuais no cliente, para álem da de JavaScript. Mas vou escrever mais sobre isto brevemente.

Mão na Coisa

O Pedro Melo deu uma excelente apresentação sobre XMPP, mas totalmente prática. Como nem todos podem ser perfeitos, o código estava em Perl, mas deu para perceber perfeitamente. Exemplos desde um Bot controlado por HTTP, como o uso de chatrooms para soluções de sincronização, quer seja controlar servidores remotos à lá vertebra, quer mesmo para transferir informação entre pcs (think Open LiveMesh/MobileMe XMPP based).

O uso disto é ilimitado (até porque o protocolo pode ser extensível) e deu ideias para vários projectos do codebits, do qual saliento o ComputerBot.

Os projectos

CloudStream

Video da Apresentação

Ao contrário do que tinha previsto, acabei por ficar com a malta que veio comigo de Coimbra, e dedicamo-nos a uma ideia que tinha nascido na viagem para a Shift: Criar um serviço que faça o streaming de música alojada em serviços AlojamentoInTheCloud. Nos próximos anos, vamos estar a mover a computação, storage e software para a nuvem3. Ora eu não vou querer estar a sacar a música uma a uma para a ouvir. Vou querer apenas um endereço de streaming, e de um controlo remoto do servidor. Especialmente no meu telemóvel. E poder sair de casa e continuar a ouvir no caminho a mesma música onde parou.

E este modelo é diferente do Last.fm. Aqui a música é vossa, simplesmente não está alojada na vossa máquina, mas num servidor vosso, ou em serviços como o box.net (usado na demo), s3, dropbox, ou outro. No Last.fm simplesmente alugam a música.

TechStuff: Java for streaming server, PHP for the web interface, VLC for transcoding (Obrigado Sérgio!), VLC ActiveX component for web-streaming ( the audio tag didn’t work) and TCP MP in Windows Mobile.

Onde está o Alcides?

Video da Apresentação

Sempre que era preciso trabalhar, parece que eu nunca estava disponível, e isto foi o mote para o resto do grupo desenvolver uma aplicação que dissesse onde andava eu escondido (Ou qualquer outra pessoa que não tenha escondido o RFID) sem ter de tocar no teclado ou olhar para o monitor, graças à apresentação do Pedro Santos do MLDC.

As actividades

Outro dos pontos chave do evento foram as duas actividades durante a directa. O Mário Valente conduziu o concurso de RockBand, que eu adoraria se conseguisse tocar música, mas que deu para me divertir um bocadinho a desafinar e a meter a tocar Tokio Hotel no PalcoPrincipal.

Gostaria de dar também os parabéns ao João Pedro do Sapo pelo Quiz. Não só pela parte técnica, que envolveu luzes, controlos do buzz e quase fritar o portátil, mas também pela imaginação nas perguntas que realmente proporcionou um momento bastante divertido.

Os outros projectos

Pessoalmente não concordei com a classificação final. Só para dar como exemplo, o primeiro vencedor de usar o OpenMoko como rato, já tinha sido feito com o Wiimote, e sinceramente não é muito dificil, visto que fiz uma coisa parecida em meia hora. Não é mau perder, até porque nem acreditava que nenhum dos nossos projectos ganhasse, tendo em conta outros que vi.

O meu top seria:

  1. Cena dos Recibos Verdes do Pedro Sousa
  2. Cena do last.fm -> músicas interessantes -> trackers “legais” -> RSS do Pedro Freitas # JS de Elite (controlar o helicópetro por JS) do Cláudio Gamboa

Assim que os videos estiverem up, recomendo que vejam especialmente estas. Ficam também a sugestão para a organização de tentar criar algumas categorias. Eu percebo que não as tenham feito de propósito, para não impedir a criatividade, mas tendo em conta os tipos de projectos apresentados, poderiam fazer do género: Hardware, Jogos, Produtividade, Mashups, Multimédia, Libraries/Middleware, Categoria Especial 1, 2, 3 e 4. Assim haveria sempre uma folga para meter aqueles mesmo originais e bons, e também dar algum crédito a quem fizer coisas que não são produto final, mas possam facilitar o trabalho dos developers, ou à malta de design que não sabe programar.

Overview

O evento foi exceptional, parabéns ao Sapo, por fazer a malta corporate da PT confiar neles para lhes deixar investir tanto dinheiro na malta jovem e inovadora, com um óptimo formato.

Foi bom reencontrar a malta “Hoo-hoo”4 e conhecer pessoas que já seguia como a Paula Valença ou o Jack Moffitt.

Em 2009 estou lá coladinho! E agora nos tempos mortos até aos próximos eventos, não vejo a malta do Porto organizar nada ;-)

1 O DEI paga a viagem ao Codebits, o Sapo paga a entrada na Shift, a Microsoft leva-me ao Techdays e Teched. Como sou concorrido, começo a aceitar propostas para mais eventos :)

2 E os quarentões não têm de aprender uma nova linguagem

3 E depois vamos voltar a querer tudo no nosso equipamento e iremos estar sempre nesse ciclo, right?

4 Expressão do Alex, se a transcrição estiver errada, avisa ;)

BBC and XMPP

So Duncan Robertson, from BBC, made a XMPP bot as an interface for their API. I’d love to see this love for web stuff from the Portuguese TV Channels…

Thoughts on PDC

Some may accuse me of being a Microsoft guy, but using a mac in the past or so, I can’t really say that about me. Nevertheless, I keep an eye on Microsoft Conferences ( and I even got to attend one or two) because really cool stuff come from them. I’m not kidding about this. Let’s see PDC 2008:

Windows 7

I’ve been following Engineering Windows 7 blog, so I was pretty up to date with this stuff, but seeing real screenshots was pretty impressive. I have mixed feelings about the taskbar redesign. While I really liked the old one, I understand that this way it’s more usable in smaller resolutions (say notebooks or even mobile phones, think Shift or Advantage). But in bigger displays, that are cheaper and cheaper each day, the old style was pretty cool.

The vista style of the windows was predictable, but I really hate it. I do! I hope they get a real theming engine, and not make us use some third party software to make them more macish.

One cool surprise was to see that they fixed the horrible wifi icon in the traybar. Linux and Mac did it right years ago, and in Windows up to Vista and even in Windows Mobile it’s a pain to connect to networks.

About the multi-touch? Well, they had it all along with Surface (and Surface SDK), so no big surprise. We’ll see MS release the iTablet before Apple does.

The Cloud Stuff

a.k.a. Windows Azure

Well, startups are going the Cloud way. Amazon Web Services and Google App Engine are just a first step. Microsoft wants Entreprise costumers to join this trend, and be able to have their business in the cloud. I don’t know if this is going to be such as a success and they think. a) real small business don’t want their data on the clould. They want it in their small server in their intranet. b) Large companies that have the need for a cloud server probably can support having their own infrastructure and not relying on Microsoft. Maybe I’m mistaken, but we’ll see.

James Governor has written a really interesting post on this matter and even mentions OpenID in Azure Services.

More Cloud Stuff

a.k.a. Live Mesh

Live Mesh is the Mobile Me for the rest of us. It syncs files P2P or through the cloud and for those, like me, with several computers rocks.

Since the Mac and Windows Mobile clients came out, I guess I’ll have to give it a try some day.

Dale Lane writes about the transition from USB syncing to Cloud syncing. It’s true Google doesn’t provide a offline sync out of the box in the Android, but I like to have the oldschool method available when needed.

Yet More Cloud Stuff

a.k.a. Live Services

Angus got extra points for the shirt and for spreading the social word among the entreprise developers there.

It’s true that Microsoft has a different view form Google and Yahoo that are embracing the OpenID+OAuth way, but this might change in the future. You can already see some little steps being made.

Dynamic Languages

Oddly, the first dynamic language I noticed in PDC was C#. Really! C# is now lightyears away from Java, and is evolving continuously. Version 4 brings a lot of new features and one of them is the ability to integrate dynamic languages directly in C# using the dynamic type. I believe C# is becoming more of a glue language (LINQ, Dynamic Languages, F#) that allows programmers to switch smoothly to other languages.

As usual, I love John Lam’s talk on IronRuby that besides the usual C#, Silverlight and Testing/Mocking stuff, demoed a Visual Studio Plugin in Ruby and Web Services using Sinatra. You should really take a look at it.

Oslo Modeling tools

DSLs are becoming popular in the several business software. and is something Microsoft was looking at a while ago. While I’d say IronRuby was the way to go (see RSpec examples), they took it further and made their own toolkit, Oslo, to develop both visually and textually Models The language they created to achieve that purpose is called M, and right now is supported through the IntelliPad editor.

In fact this editor was what got my interest in this area, since it’s codename was Emacs.NET, and since I’m in the quest for the perfect editor I wanted to take a look. Well, right now it supports the M language, but “you can extend it using IronPython”:hhttp://www.masteringbiztalk.com/blogs/jon/PermaLink,guid,92ec6f1f-45e5-4b7d-b675-548be5131a07.aspx. I’ll wait to see the first plugins to support different languages in the IntelliPad.

In the meanwhile, take a look at the different Oslo sessions at PDC

Mono

Yeah, Mono gets to be one of the main points of this post, as it should also be very important to Microsoft. The work Miguel and the team is doing gives much more value to .NET and Microsoft, than any other technology they presented in my opinion. Since the Mac and Linux worlds are raising their share, it’s important to let developers target those platforms too. And their doing interesting new stuff too, like the C# compiler service, the C# interpreter and even running .NET apps in the iPhone!

So take a look at his talk, one of the best in the whole PDC.

Of course this wasn’t everything PDC was about, but the stuff that I really care about. And I really liked some of this stuff!

Scala

Scala is a functional and OO hibrid language targeting the JVM. Performance is not far from Java’s since it is a statically typed language, but you have type inference that Java doesn’t.

Scala compiles to .class files, so you can just replace your .java files with scala without greater problems because scala was designed to the JVM. This also means you can access everything in your Java code from Scala and vice-versa.

Resources

Some Examples

Towards headless IDEs

During my programming life I have used a lot of different editors and IDEs just like everyone else. I’ve started with Notepad. 4 years programming in black and white, but it was the only editor I had in every computer I used1. Then I was introduced to Visual Studio (VB6 at the time) and it was a really different world! Not as fancy as today’s VS, but pretty cool at the time, and the Winforms editor made me fall in love with Visual Studio.

My main work was web programming (yeah… PHP, sorry guys) and not desktop apps, so I start using Notepad++ that I still advocate as a wonderful editor for Windows. You can even make your own plugins in C++, just like João did.

After a while, I went back to using Visual Studio with the .NET platform, and it still rocked. I also gave a try to Eclipse for Java development, but Visual Studio was faster and more suitable for my taste. Still, the startup time and memory footprint could have been much better. And these IDEs only worked with staticly typed languages, with aren’t my favourite, so I sticked to notepad++ and other IDEs. Among those, I tried intype, a textmate clone for windows still in dev, editra which is my current editor for Python in windows, with project manager and svn/git support and obviously Textmate since I bought my mac. Oh, and yesterday I found out about Smultron.

So where I go next? Full-featured IDEs like Eclipse, Netbeans and Visual Studio have started to support dynamic languages like Python, Ruby, Javascript, etc… andplugins for editors are growing too.

So, there’s a new fashion today: headless IDEs as plugins for editors. Orestis Markou writes about this new trend and gives you some examples working right now.

As for me, I guess I’ll try emacs in a near future, just for the sake of having some experience with an hardcore editor. But I keep always in mind, that not everyone in the software industry should use one of those. IDEs exist for a reason. In a big software project, there are those who do the interface, others who only work with Databases, others who do the Network stuff, others who are Code Monkeys (sorry), and those who glue all of this together into a product. And they need to share information/code between then, and while one will see the UML view of the code, other would be viewing the GUI view instead. All of them using the same IDE.

1 I couldn’t install stuff in those computers, and we hadn’t the concept of portable apps, only msdos executables in floppy disks.

Smultron

Yesterday I found Smultron, an opensource editor in Cocoa that with a few tweaks could be at the level of Textmate. Those tweaks would be:

Theme system

I like to use a dark background, but in some presentations I need a white one, so I’d like to switch between a few color schemes with a click. And I know that’s something really simple to implement.

Plugin System

Well, you have Commands and Snippets, but I like the way textmate organizes it. And make them easy to download and install, and even remove.

VCS support.

You know, git, svn, bzr, hg those cool things people use to control their code. Oh, and what about some deployment stuff? Like some SFTP coda-style?

If I hadn’t bought Textmate, I would be using Smultron for sure in Mac OS!

Balsamiq Mockups

Balsamiq Mockups is a nice application to easily design mockups for you applications. There’s on little difference to the majority of similar tools I’ve seen: it doesn’t try to come out with a realistic image. That always makes the client think that you’re almost done, when It’s not always true. So it sticks to a rather sketchy design while representing the same thing.

Take a look at the Web preview, and you’ll see how it works.