« June 2007 | Main | August 2007 »

July 29, 2007

Script to deal with multiple VCSs

I work at 8 different projects now (5 consulting, 3 personal business), and between them, I use 4 different version control systems: cvs, svn, git and darcs.

To keep myself sane, I developed a set of front-end scripts to deal with the most common operations: diff, commit, add files, and update.

Starting today and during the next week I'll post all of those scripts online, and eventually I'll also repackage them in a repository that people can pull from if interested. All the scripts are licensed in the Artistic License, and the usual disclaimer applies: they work for me, if they burn down your computer or any surrounding environment (like your house, for example), you get to deal with the fire department yourself.

The base of all the other scripts is the x-vcs-discover that basically will tell you which of those systems the current directory is in.

The script takes no parameters, and will output to the stdout a single line with the VCS that was detected.

#!/bin/sh
#
# Discover the VCS that is being used in the current dir if any
#
# (c) Pedro Melo, 2007 - Artistic License, same as Perl
#

vcs=
found=

while [ -z "$found" -a -z "$vcs" ] ; do 
  cwd=`pwd`
  if [ "$cwd" == "/" -o "$cwd" == "$HOME" ] ; then
    found='give up'
  elif [ -d CVS ] ; then
    vcs=cvs
  elif [ -d .svn ] ; then
    vcs=svn
  elif [ -d .git ] ; then
    vcs=git
  elif [ -d "_darcs" ] ; then
    vcs=darcs
  else
    cd ..
  fi
done

if [ -n "$vcs" ] ; then
  echo $vcs
fi

July 26, 2007

Chair dance

In a Ars.Technica article:

Portugal's meeting was even more interesting. In what can only be described as a comedic farce, representatives from Microsoft attempted to argue that Sun Microsystems, the creators and supporters of the competing ODF document standard, could not be given a seat at the conference table because there was a lack of chairs. In the debate, representatives brought up many of the standard criticisms of Office Open XML, such as the infamous "AutoSpaceLikeWord95" tags. Microsoft confirmed that such tags would never be included in a new document, and were only there for backwards compatibility with older applications, and had been added only at the request of organizations such as the US Library of Congress and the British Library. Microsoft was also asked why it couldn't simply extend ODF to include its backwards compatibility needs, and the company representative said that the OASIS group "rejected Microsoft's proposals and expelled/excluded the Microsoft representative because the proposed changes would add backward compatibility to legacy documents."

Emphasis mine. I'm speechless... I mean, I really think that Microsoft people would be smarter than this, right? Not enough chairs?

Update: IBM is offering to bring chairs! Thanks Bob!

July 25, 2007

Californication

There is a episode 1 of Californication floating around, I just finished watching it.

The first four minutes are the kind of thing you want to have lying around to show your best christian friends when you want them to leave. It should most definitively do the trick.

The rest is also very good. Lets see if they can keep it up (literally). David Duchovny really has to work hard in his bed this time.

The number of excellent series coming out of Showtime is impressive: Dexter, Meadowlands, Weeds, Brotherhood in the fall is also looking good. Nice set.

July 23, 2007

Priorities

Over at The Unofficial Apple Weblog:

So what does this mean? Well, once you've got ssh installed on your iPhone and active, you can access your iPhone from a shell on your Mac. You can send and retrieve files using scp or sftp. And you can use the compilation toolchain to build other Unix utils or even your own software. It's just a short matter of time until perl and other command-line utilities are iPhone-ready.

Emphasis mine. At least they got their priorities straight.

July 21, 2007

Amazon.com Harry Potter logistics

via All Things Distributed:

2.223 million pre-orders on our sites world-wide. 1.4 million on Amazom.com alone. These orders trickled in over the period of 5.5 months, but from a distributed systems perspective today is the day as these orders go en-masse from pre-orders to orders, being charged and delivered. It is one smooth operation. The planning for single day delivery is truly impressive, especially on the supply-chain, transportation and fulfillment side where we need to do this without impacting the regular delivery flow. 1.3M books are being delivered today weighing close to 1700 tons. The excitement that our customers have for this book absolutely rubs off on anyone involved with the process and it was absolutely marvelous to see the kids run out of their houses when the UPS truck arrived in our street.

I pre-ordered mine January 5th. I got my email earlier today, it should be here early next week.

My Audible collection

Well, pfig fell asleep while listening to a Audible book. I could tell you some nice stories about pfig falling a sleep... But I wont.

Anyway, he seems to thing that I drink my Harry Potter cool aid via Audible, and its not true. Although I do have book 6 in audio, it was the first Harry Potter I did listen to, because its the only one there. BTW, it is very well done, recommended.

But I did start thinking about my Audible collection. What have I been listening to this past 5+ years?

My Audiobooks group in iTunes has about 180 items, for a total of 8.88Gb of data (around 35.8 days). My most listened to book (yes, I do listen some of them more than once) is Ender's Game by Orson Scott Card.

I have all the Ender books, plus all the Bean books. I prefer these last ones. The sort-of Risk-like action of the Giant series is very cool to read.

I have 15 books of the Discworld series, by Terry Pratchet, including all of the Guards theme, my favorite. I also have about 6 Agatha Christie books, a couple of Al Franken, 3 or 4 about the last War on Iraq (including all of Bob Woodward), C.S. Lewis, some Dan Brown (I listen to the DaVinci Code about 8 months before he hit the stores in Portugal, and read two more before that one. I still think he is a mediocre writer with a amazing capability to dump facts; read/listen to the Digital Fortress to see what I mean).

Douglas Adams is also present, with 5 books. The Bourne saga racks in 3 books, and it would be more if the production of The Bourne Ultimatum, which is pretty bad. Avoid.

John Le Carré is there, being one of my favorite writers. Neal Stephenson make an appearance with three more books. We also see J.R.Tolkien, with the Hobbit.

Then I have about 30 books of several authors. Two stand out: The World is Flat by Thomas L. Friedman, and Moneyball by Michael Lewis.

Finally I have a lot of Robin Williams interviews with some other Hollywood actors/actress, and a lot of radio shows of Your Mac Life.

I commute about 8 to 14 hours weekly, driving between Figureira da Foz and Lisboa (about 200km), two to three times each week, and this is the only way to make it sane.

July 19, 2007

Man of the world, unite!

Some of my best girl friends are lesbians, but as I told one of them, it would be a terrible waste to let her move to the other side.

:)

In the meantime, lets add Bionic Women to the set of TV series to follow this season.

July 14, 2007

Love porcelain

I just love the porcelain around git, in particular cogito. They have great error messages:

cg-commit: unable to revert the original patch;
the original patch is available in /tmp/gitci.tWnPNq/patch.diff,
your edited patch is available in  /tmp/gitci.tWnPNq/patch2.diff,
your log message is in /tmp/gitci.tWnPNq/logmsg.diff,
your working copy is in undefined state now
and the world is about to end in ten minutes, have a nice day

Any software written by Douglas Adams fans is a good software.

July 09, 2007

Tip: Comment selection in Texmate and Skitch

If you use TextMate and Skitch, you might have found that the excelent ''Comment selection'' command from the Source bundle will no longer work with the ⌘/ shortcut.

The problem is that one of the hot-keys of Skitch is exactly that key combination and for something that I don't use that much (Capture Frame).

So go into Skitch Preferences and change it.

iPod Reset Utility

Between me and my brother, we had three iPod Shuffle that iTunes wouldn't see, nor the previous iPod reset utility. They where pretty much dead.

Apple released a new version of the iPod Reset Utility, and this latest version (1.0.2) was able to recover all of our iPod's.

So if your Shuffle is not recognized by your iTunes, check out this latest version. It worked for us.

July 04, 2007

TV

I bought my TV 1 or two months ago, but I've only been using it in the last 3 weeks or so. I was expecting to connect it to my standard definition TV but I made a big confusion between component video and video by components. Somehow I was expecting to plug the box into a standard s-video...

Anyway, now that I got it connected to an HDMI TV (a Samsung LE32R32B if you must know) and stuffed it with video content, I can tell you a bit about my experience.

I love it.

You can buy or build a much feature-complete PVR with MythTV and others and comparing with a TV, the latter lacks a lot of features. But I've seen my mother and my mother-in-law sitting in front of the TV with the remote in their hands navigating successfully over all my iPhoto albums searching and looking at photos of the kids. Without my help. That in itself is already a big win for me. I probably could have the same thing with MythTV, but not without more effort from me than what I had with this.

I haven't hacked the box yet, I waiting a little bit more to see if a legal patch stick appears so that I don't have to open it. I only want to put the Perian Quicktime components and some sort of plugin that allows me to use network disk drives for storage of video files (I'll probably find something in the plugin category of the AwkwardTV or in the plugins directory).

And that brings us to my only gripe with it: the disk inside is very small.

Usage of my TV

And that is with only the kids videos inside, no content from me and my wife...

So I need to expand the storage and there are two ways: swap the disk inside, or use a NAS.

I've decided to use the second one. And to that end, I also got a Airport Extreme Base Station. You can plug several USB devices into it (printers and USB drives supported) and share them over the network. I had a 500Gb Western Digital Book external drive, I plugged it in to the base station, and I can now see the drive from my Mac and from the wife PC laptop.

The second part is to get the TV to see that device and the video files inside. Let see how the patch stick goes. It if takes more than a couple of weeks, I'll open up the box, enable SSHd, and install some plugins.

Now seriously, iPhone SDK

I'm not a indie Mac developer but I buy a lot of their wares and it has been a major factor making my Mac experience more pleasant than any other previously had.

And as some of them, I was disappointed about them not getting the iPhone SDK they all wanted. It would spur a flurry of applications for sure.

But bottom line: the iPhone is a very restricted platform. Low memory, battery operated, and very different user interaction than your keyboard/mouse combo. Those set of restrictions raise the trust level we must put on applications and their developers before pushing some software out of Apple Downloads site into my phone, a device I like to have always available.

I think that the smart developer will rapidly work around the low memory and the new user interaction. But the battery usage problems are harder. Your applications must be written with low power consumption in mind, in a very big way. I would naively say that minimizing network traffic and CPU intensive work is just the beginning, the are bound to be subtle issues.

So expecting your smart but used to multi-megabte RAM devices, with big disks and lot of power to develop power-saving-oriented applications without help is a bit to much.

On the other hand, this is the place I can see Apple giving them something very cool in a future. I could tell you how good and fun XRay is, but then I would have to kill you. I will say that it is an amazing piece of GUI on top of DTrace stuff, much much better than I was expecting.

The tool I see that the iPhone SDK must have to be a real SDK is just that: a XRay for power consumption. Developers need, more than frameworks and guidelines about UI design, tools to check power consumption of their apps. And I would expect that sort of tool to take some time to develop.

Bottom line, I really would like to see a iPhone SDK, but I don't mind waiting a bit to make sure that it comes with the tools that help developers not break my phone.

iPhone

There. I did a iPhone post. I'm cool.

Not.

July 03, 2007

You’re a liability to civilization

Great read to start the day.

Don't you just love hyped-up releases?