« March 2005 | Main | May 2005 »

April 30, 2005

XMPP and Perl

I'm writing an external component in POE::Component::Jabber. It's a custom development that will link to a XMPP server.

POE::Component::Jabber is nice, but it seems to me that I'm investing in something that I won't be able to reuse.

There is no clear way to create a standalone module or plugin to hide the details of a certain protocol (like the jabber:iq:register).

I have some old code, XMPP::Session, that should solve this problem. The module is network agnostic: you can use STDIN/STDOUT, POE::Component::Client::TCP or even a Socket. I really need to clean it up and share it to see if there is any interest in it.

Tiger notes

As I said before, I'm not upgrading to Tiger until sometime next month. Yet, I need to keep some links to things that I need to test or fix in my Tiger setup.

The good news in Tiger for scripting fans like me, is that Perl and Ruby have decent and recent versions. The bad news is that at least Ruby has a bad configuration file. From what I could understand, it seems that they left a CFLAGS=-arch i386 in a config file... I can't wait the rumor sites to get this one... A fix is available.

One thing I want to test is the new CoreData framework. Cocoa Dev Central has two articles entitled "Core Data Class Overview" and "Build a Core Data App" that seem very nice.

I'll keep this post updated with all my things-to-see in Tiger-land.

Johannes Ernst's Blog

Johannes Ernst's Blog:

I'd like to suggest that some of the world's most successful distributed software architectures are neither client-server nor peer-to-peer when you look at them closely. They follow an architectural pattern that I'd like to call the 4-Point Architecture.

I like his point of view. Yet, I don't think that all of the rules make sense. In particular:

No dark point ever interacts directly with another dark point, they always go through their respective bright points first.

That's not right. I mean it does not scale. Imagine VoIP or other stream-oriented medium to high-bandwidth protocol. It just doesn't scale unless you throw huge amount of bandwidth to the problem.

Most of the architecture presented seems right, but the bright points should also allow for point-of-meeting to the dark points so that they can agree on a direct connection if at all possible due to NAT/Firewall restrictions.

Update: Johannes comment (thanks, btw) below that it's true that dark points can talk to each other due to performance issues. He's right, that should be the only reason. Of course, my comment about his architecture was just a minor pet peeve. I do agree with him about the rest.

Upgrade time for my powerbook

So, it's upgrade time to update my powerbook.

No, I'm not installing Tiger yet, I need my powerbook in working order. I'll wait until 1 week after 10.4.1 to install that one.

I'm upgrading to 10.3.9 only because I want to upgrade to Quicktime 7 and try some H.264 goodness (see also this impressive report).

Right now, I have 11 items in my Software Update Window. So, I'll see you all (three of you) in 20 minutes or so.

Updated: 11 done, 2 to go. The Java fix and Quicktime 7 are installing now. Quicktime still needs a reboot after it finnish "optimizing" my performance...

Update 2: all seems ok. Audible.com is flaky with Safari, but I always have problems with them. It's probably the worst site I need to visit on a regular basis.

Back from the dead

Ok, so we're back!

Simplicidade was down for a couple of days. The good news is that it wasn't a hardware problem. When I got to the data-center where we are hosted, the machine was powered down (!!).

Nuno looked at the logs and apparently the kernel was upgraded and at the end it automagically rebooted. The problem is that after the reboot, it did a halt. We'll have to figure this one out.

The bad news is that it took too long to get the server back up. There where two problems: the procedure to get access to the data-center was not clear to me, I'm fixing this. The second problem is that I didn't have the time, and unfortunately I hadn't put Nuno and Rui as authorized persons also. They will be now.

The second problem has also some personal implications to me. I don't like stress factors that can be solved by technology (well, price conscious technology...), so I was looking around for some solution to reboot and look at the console remotely. This is a job for IP KVM stuff.

The problem with those setups is that the lowest price I found for a single port IP KVM switch starts at $500 US. I should be able to get one in portugal for €400, but it's still expensive. I'm looking at the MegaRAC K1 from AMI.

While at their site I came across this other board, the MegaRAC G3 that seems very nice also. And best of all, my usual hardware dealer has one in stock (he was not sure if it was a G3 or a G2) and he will lend it to me for testing. If the price is right, I think we'll have a remote KVM in no time.

April 26, 2005

If you have kids, and you love your Mac

BabySafe. Pay the gentlemen. It's really the only safe way to put your laptop in the hands of the kid. It protects your data (although your screen is still a bit exposed).

And why you want to put the mac in the hands of your kid? Well, it's warfare. My wife prefers Windows, and I prefer UNIX and Mac in particular. So we have to win the kid when he's young.

April 24, 2005

Del.ic.us for code snippets

Nice: Snippets allows you to upload small snippets of code in several languages and tag them in a del.ici.us/flickr way.

Very nice.

Clarification about last post

The fact that I had to write so little code is a tribute to two things: the design of Apple APIs is very clean; and Ruby integration with ObjectiveC runtime is almost perfect.

Doing a web browser with XCode is equivalent to the early 90's 'Hello world'.

One interesting thing. I'm almost sure that I can reuse the same NIB file with a CamelBones project. I'll try it next week and write the same app with it.

Ruby and Cocoa

I woke up around 6:00 am (very early for Portuguese standards) and couldn't get back to sleep.

I had been reading about Ruby on Rails and I was thinking about it, how it could affect some of my projects.

Yet, for some reason, I started thinking about Cocoa. I knew that there was a Ruby/Cocoa framework, and I have some experience with CamelBones, the Perl/Cocoa framework. How easy is to create a small Cocoa app in Ruby?

Well, check it out: a Web browser made in Ruby and Cocoa. It works for me, but I don't know if all the frameworks where included.

It was my first Ruby program. Ever. An it was not a very big one:

require 'osx/cocoa'
require 'osx/webkit'

class AppController < OSX::NSObject
  include OSX

  ib_outlets :inputText, :previewWindow;

  def previewBtnClicked (sender)
    urlText = @inputText.stringValue
    url = NSURL.URLWithString(urlText);
    request = NSURLRequest.requestWithURL(url)
    @previewWindow.mainFrame.loadRequest(request)
  end
end

Anyway, I'll do a short movie next week: How to build a web browser with Ruby in 20 minutes.

April 23, 2005

Burn and distribute

First, grab a couple of blank CD-R discs, one for each manager of a tech company you know. Put an extra for you. Make a list.

Then, go to http://www.itconversations.com/shows/detail188.html and download the best quality audio file of the "Great Hackers" presentation by Paul Graham, OSCON 2004.

After you have burned all the CDs send them to each manager on the list.

The best presentation I ever listen to from IT Conversations.

Go figure

I know Rui since 97 or 98 (can't remember) but only yesterday we noticed that we almost have line-of-sight between our homes in Lisbon (!!).

As he said, we should try to link our wireless networks some day, if not for listening to each other iTunes playlist, to have two different internet links. My 2Mb ADSL should be up and running sometime next month (I hope...), and his link is from a different provider.

Good connectivity... hums...

1984 is now?

I know who you are. Do you?

Check it out: http://www.digpeople.com/.

I'm hit number 2 on Online Communities.

April 19, 2005

I'm having an affair at work

I've been married for 13 years now. We have our ups and downs, but I kept faithful all this years, and my other-half as been always there for me.

Even when the stress levels are high, you could always count on finding a almost-ready solution at hand.

I've done quite a lot of stuff with my partner... I shouldn't feel this way... But I do.

I'm married for 13 years now, with Perl, but I'm having an affair with Ruby.

Learning Ruby

I needed something new to do, to learn, and I decided to learn a new language. That was 2 months ago more or less.

I though about learning OCaml or Haskell but I don't have the correct mental model to learn something like that just now. So I went with something easy, given my background.

I picked up Programming Ruby a month or so ago, and I just finished my first reading of it. I must say that I was very impressed. The language is very clean, very simple and seems extremely powerful.

I was browsing some Ruby sites and I went to Ruby on Rails website. I had heard about it from several places, the latest on was Tada lists.

Let me put it this way: if you want to get hooked, download this 47Mb video and watch the full 30 minutes of it. It's something short of a revelation.

I've been a perl programmer the last 13 or 14 years, but this small video made a small place for Ruby in my toolbox. will see how this small place grows in the next months. Now, I must find a small project to try Ruby on Rails...

April 15, 2005

Psi nightly builds

So I'm a lazy bastard, so far nothing new. But I also want to look at the latest Psi, ze mozt powerfull Jabber client out there, releases for Mac, and lo and behold they have nightly builds...

This is the script I ended up with to update my Psi every day:

melo@RoadRunner(~/Desktop/psi-night-build)$ cat update_psi.sh
#!/bin/sh
#
# Updates Psi with latest nightly build
#

today=`date +%Y%m%d`

if [ -d "psi-mac-$today" ] ; then
  echo "You already have build $today, restart your Psi to use it, maybe?"
  exit 1
fi

curl -O http://spike.ulyssis.org/psi/mac/psi-mac-$today.zip

unzip psi-mac-$today.zip
rm psi-mac-$today.zip
rsync -a into_frameworks/ psi-mac-$today/Psi.app/Contents/Frameworks
rm -f psi-latest
ln -s psi-mac-$today psi-latest
growlnotify -n "Psi Nightly build updater" -s -a Psi 'Psi is updated!' <<EOF
You Psi was updated with the latest nightly build, $today. Please Quit and restart you Psi.
EOF

Make sure you chmod 755 update_psi.sh.

Now you just need to restart you Psi every morning after the nice growl notification appears. I keep ~Desktop/psi-night-build/psi-latest/Psi.app on my Dock.

Couple of notes: on the directory where you run update_psi.sh, you must have a directory into_frameworks. Inside you need to put all the Frameworks required to run Psi. Right now, you need to have the libqt-mt.3.dylib (found on the same directory where you can find Psi nightly builds), and the Growl framework.

I used the copy of the Growl framework that comes with Ecto. Use locate Growl.framework to find a copy on your system, and copy it into into_frameworks.

My into_frameworks looks like this:

melo@RoadRunner(~/Desktop/psi-night-build)$ ls -la into_frameworks/
total 18376
drwxrwxr-x  4 melo  melo      136 15 Apr 11:01 .
drwxrwxr-x  9 melo  melo      306 15 Apr 11:29 ..
drwxr-xr-x  7 melo  melo      238  4 Apr 04:17 Growl.framework
-rw-r--r--  1 melo  melo  9404804 16 Aug  2004 libqt-mt.3.dylib

The main directory where I keep update_psi.sh looks like this:

melo@RoadRunner(~/Desktop/psi-night-build)$ ls -la
total 128
drwxrwxr-x   9 melo  melo    306 15 Apr 11:29 .
drwx------  23 melo  melo    782 15 Apr 11:21 ..
drwxrwxr-x   4 melo  melo    136 15 Apr 11:01 into_frameworks
lrwxrwxr-x   1 melo  melo     16 15 Apr 11:12 psi-latest -> psi-mac-20050415
drwxr-xr-x   5 melo  melo    170 15 Apr 02:25 psi-mac-20050415
-rwxr-xr-x   1 melo  melo    598 15 Apr 11:27 update_psi.sh

Although the Growl framework is required in latest builds, I cannot seem to get it working. If you know how, xmpp me at melo funnychar simplicidade.org.

Update: Growl works very well if you use the Remko versions. See his Psi page.

Update 2: small bug in the if [ -d ... in the script, change '' to "". Thanks go to rebarbado.

April 09, 2005

We are moooving...

I'm switching servers in the next couple of days. The Shuttle that powers this site has not been stable enough. I think that the memory is still bad.

I had two 512M DIMMs and I found memory errors on one of them. It seems that the other one might have problems to.

Anyway, expect some downtime. I'm disabling comments and trackbacks in the meantime.

Update: mostly done, this site is now on a new server. Let's see how it goes.

Powerbooks

My TiBook is nearing it's third year of life. He's been very good to me, but it's 800Mhz G4 is starting to show its age.

Sometime back, I talked about my next Powerbook, what choices and what would make me switch. So far, none of the new ones have a feature that makes me lust. They are neither dual core G4 nor G5.

I have my mind made up about three issues though: if both models, a dual core G4 and a G5, are available at the same time, I'll most likely go with the dual core. I'm not CPU intensive, but I am multitask intensive. Also, the earlier G5 will be even hotter than my TiBook, I imagine. First generation G5 Powerbook is probably something I don't want to try.

The other thing I've decided is the size. I'm going with the biggest screen they've got. If that means the 17", so be it, but I'll choose the model by the screen resolution. After using dual-head for almost 3 years, I've noticed that screen real-estate is the biggest influence on my productivity. My earlier problems about changing backpacks are not an issue anymore, I found a good one for a 17" Powerbook.

The third thing I've decided: I'm not going to sell my current TiBook. I'm keeping it, in case I need to travel light, and the 17" isn't practical. Let's call it a backup Powerbook. The only thing I truly miss in my current TiBook is internal bluetooth.

Meanwhile, until we get a decent Powerbook upgrade, and seeing that I'm not going to sell it, I decided to upgrade it. I have 1Gb of RAM, the maximum it takes, and I have a 80Gb disk drive waiting for me at my local crack^H^H^H^H^Happle dealer. The current 40Gb drive is just not enough anymore (I'm a victim of iCrack and pictures of my kid).

I'm not going to install Panther on the 80Gb drive. I'm waiting for Tiger to make the move. Recently I made a booboo and totally trashed my Panther install and I had to do a total reinstall of Panther and all my stuff. I keep good backups, but even with that, it took me 3 days to get back to my feet. Ok, maybe I didn't keep very good backups, I didn't have a boot-able mirror drive in my backup plan. I have one now, though.

Another upgrade I already did was buying an external firewire DVD recorder. My internal combo drive was starting to fail on me, and I had problems with it during the reinstall. With this external drive, I can avoid buying internal SuperDrives and save some Euros.

So, upgrades are almost done, and now I sit here waiting to see what Apple will bring us regarding Powerbook updates in the near future. I'm hoping for a dual core G4 17" HD display, but that's just me.

Get perpendicular

Get perpendicular is a great flash-based demonstration of a new disk drive recording technology.

Kudos to Hitachi, it's probably the best presentation I ever saw about the subject.

Now, can I have one? :)

Do you know your friends?

I was looking at the demo video of Locus and talking with Rui.

Locus analyses your chats (Jabber-based but you could use over anything, even multi-protocol) and creates a bayesian profile of your friends. It's then able to create connections between friends sharing the same interests.

The interesting part of the idea is that you could extend it beyond chat, into mail. You could link all your own friends interactions (mails, chats) to find hidden links between people.

That would be.... interesting.

An extreme example from my chat with Rui: "Locus wants to know if you'd like to meet Mandy. Mandy is an air hostess that enjoys Macs, scuba diving, raw photography and bayesian filtering".

A dream come true to a special common friend of ours.

April 08, 2005

First post is so 90's

When Slashdot first appeared and started getting some attention, we had a deluge of "First Post"-nerds.

Their sole objective in life would seem to be the first one to post a comment on each story appearing on Slash.

Now fast forward to 2005 and we start a new game: First link.

If you are the first link on a Wikipedia node, in the External links section, you are a "First link" person :).

I'm saying this because Rui is the first one I know personally. Go check what a Bliki is.

The next step is to create a "First Link Number". I'm a 2.

April 01, 2005

POE and Rendezvous

You can find on CPAN my recent itch. I wanted to add discovery to some POE servers I have running on my laptop and on local servers at the office.

Enter POE::Component::Rendezvous::Publish. It's now super-easy to make all those nice web-interfaces to your own POE servers available in the local network.

It's alpha for now, I haven't decided the final API yet.

POE and Rendezvous

You can find on CPAN my recent itch. I wanted to add discovery to some POE servers I have running on my laptop and on local servers at the office.

Enter POE::Component::Rendezvous::Publish. It's now super-easy to make all those nice web-interfaces to your own POE servers available in the local network.

It's alpha for now, I haven't decided the final API yet.

New job

Today is my first day at the new job mentioned earlier.

I'm now at Sapo to work on XMPP. I'll be working on the server-side, mainly.

The long period of silence is a direct result of a lot of work. Leaving my previous job requires documentation, 8 years worth in certain areas.

BTW, the documentation was mostly done in Kiwi, so I'll be publishing some of it in the near future. Also, I asked to bring with me some tools I wrote (or co-wrote in some cases) with me. I'll be cleaning them up and putting them on CPAN.