Arquivo da categoria: Geral

OSX Dependency walker

It is not as nice as Windows “depends” but does the job:

#!/usr/bin/env ruby
paths = [ARGV[0]]
libs = { ARGV[0] => 1 }
while paths.size > 0 do
    path = paths.pop
    lines = `otool -L '#{path}'`.split("\n")[2..-1]
    new_libs = lines.collect do |line|
    line =~ /\s+(.*)\s+\(.*\)\s*/
    new_libs.each do |lib|
        if libs[lib] then
            libs[lib] += 1
            libs[lib] = 1
            paths < < lib
puts libs.keys.sort.join("\n")

Credit for finding this at idevappsgoes to Armindo

iPhone MMS

An application that sends and receives MMS messages is now available for you’re iPhone. There is no need to have a Jailbroken iPhone as the application is available from Apple Store. Right now the application only works for clients of Vodafone Portugal. More info is available at the producers web site.

A video that shows the application working is also available:

Telephone Regular Expressions

Designing a regular expression to find phone numbers is some string are not trivial. The rules of what is a valid number are strange, and the phone itself can be present with any number of artifacts, like spaces, dashes and parentheses.

This last morning I have been trying to design a good regular expression but I’m still a bit far. So far I managed to do:

But it sill misses things like: +351 (21) 1111111

iPhone to thunderbird+lightning

Apple should add thunderbird+lightning support to at least iTunes on Windows. Not every windows user has Outlook installed.

Right now almost all options to do this include some extra softwares (jailbroken iPhone) or thunderbird plugins and Google accounts. And I may not want my data in Google.
If you do not mind having data in Google read on. Right now I just want to sync Calendar events.

As I need to have data synced I’ll post my findings were. So stay tunned.
[UPDATE 2009-02-10]
All this syncing is dangerous. The iPhone will delete all contacts and/or calendar events on the phone when adding a external sync.

Two solutions so far for Contacts and Calendar:

1- Get your company to install Exchange or one of the Free Software alternatives. And then just add the account on the iPhone and search for info on how to get Lightning to get the data from there.

[New Update 2009-02-15 15:17] There is no need to use the Nuevasync Service
2- This is the one I use. It involves having a Google Calendar account and Sync the iPhone and Lightning there. In the iPhone follow the instructions in the Google Mobile Sync page. To have Lightning use the calendar just add a new Calendar of type CalDAV and in the url put: .

There is no “Sync now” and events will be propagated auto-magically. In my case if I have calendar open on the iPhone and add events in Lightning they propagate in 3 to 5 seconds.


Ontem à noite a Laura resolveu pregar um susto a mim e à mãe. A dois meses da data prevista de chegada ela achou que já estava presa à demasiado tempo e que a hora de nascer tinha chegado.
A Raquel está neste momento na Maternidade Dr Daniel de Matos e parece já estar controlada a situação. Mas agora terá de repousar para que não haja mais sustos.

Laura: Tem calma filha e espera mais um pouco.

[UPDATE 17:45]: Parece que já está tudo mais calmo. A Raquel deve voltar para casa amanhã, mas terá de ficar por casa até a Laura nascer.

Sometimes the Music Industry goes nuts

A few weeks ago I talked about a new MTV service that would let us see all the videos in MTVs archive. Right now if I try to play the video it tells me that I cannot play it outside the United States.
A few minutes ago I was on trying to play some videos and the ones that were presented being hosted on youtube gave the same type of error as MTV.

This is just STUPID!!!!! If I’m not in the right country I cannot listen to the music? What can possibly be the reasoning?

Music Meme

A funny music meme

Go ask Alice
When she’s ten feet tall

in White Rabbit by the Jefferson Airplane

Rules for this Meme:

  • Search for the lyrics for the song that you are listening now.
  • If music is purely instrumental use the last music with lyrics
  • Copy the 5th and 6th verses
  • Post the text of the verses in your journal along with these instructions.
  • Don’t dig for your favorite music or the cool alternative musics: use the one you are listening to now.

Book Meme

Book Meme Floating around, so mine is:

Save the file and reboot the system for the settings to take effect.

in Asterisk, The Future of Telephony

The Rules for this meme are:

  • Grab the nearest book.
  • Open it to page 56.
  • Find the fifth sentence.
  • Post the text of the sentence in your journal along with these instructions.
  • Don’t dig for your favorite book, the cool book, or the intellectual one: pick the CLOSEST.

Struts 2 under IntelliJ IDEA 8.0M1

If you like IDEA and use Struts 2 you can be happy to know that 8.0 release comes with a new Struts 2 plugin. There is a small tutorial on how to use it but it has some errors.
First the Action class should extend ActionSupport hand have proper setter methods:

package hello;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {
    private String username;
    private String message;
    public String getMessage(){
        return message;
    public String execute(){
        message = "Hello, " + username + ".";
        return SUCCESS;
    public String getUsername() {
        return username;
    public void setUsername(String username) {
        this.username = username;

Second the JSP file can have a proper action:

< %@ page contentType="text/html;charset=UTF-8" language="java" %>
< %@ taglib prefix="s" uri="/struts-tags" %>
  <head><title>Simple jsp page</title></head>
		Struts 2 Message: <s :property value="message" default="Guest." />
		<s :form method="GET" action="HelloWorld">
			Enter your name:<s :textfield name="username" />
			<s :submit value="Submit" />

And finally struts.xml can have the Action declared without the ugly unRESTFUL .action:

< ?xml version="1.0" encoding="UTF-8"?>
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    <package name="/" extends="struts-default">
		<action name="HelloWorld" class="hello.HelloWorld">
			<result name="success">/index.jsp</result>

I really like IDEA when it comes to Java codding, and I can live with the quirks of the Struts 2 support. But one thing that makes me steam is the fact that I have to un-deploy and deploy the application for each change I make. That steals me hours every week.

New Life

A new life is in the process. The joy of looking at a small paper with a tiny bean that is part of me is overwhelming.

Raquel told me that even with this small size she could hear the tiny human being hearts beating fast. Next time I’ll go and no matter what I’ll get to listen to it to.

Ecografia 7 Semanas

Ecografia 7 Semanas

42 ? 42 is not the answer. Life is the answer.

One small step.

Dia 14 de Junho de 2008. É meio dia. Estou na Sé Nova de Coimbra à tua espera. Estamos a preparar este momento há dois anos e meio. Desde que nos vimos que soubemos que aqui iríamos chegar.

Estou junto ao altar de uma igreja, estou aqui à espera de pé. Estão centenas de pessoas a olhar para mim. Estão todos a pensar: “Olha para a carinha dele, está tão nervoso a pensar que ela não vem!” – Não estou nada! Claro que ela vem. Se estou assim com cara estranha é de estar toda a gente a olhar para mim.

Estamos a dar um passo. Estamos a dar o passo. Estamos a formar uma família.

Sim aceito.

Desculpa o clichê que se segue Raquel. Fazes de mim um homem melhor. Espero que sintas o mesmo e que possamos continuar assim.