Friday, April 30, 2010

In the spotlight

Hi,

recently I noticed that spotlight on my MacBook kept responding with very long delays. A friend recommended to only index what you really need. For me the most important feature of spotlight is to start applications, so I decided to change the settings. But how do I trigger a re-index? A little googling and I found several tips which recommend to change the index configuration in the preferences pane and then after a few minutes change it back. The idea being "trick spotlight into indexing". Even though this approach probably works it just felt wrong and I decided to dig deeper. Here is what I found:
sudo mdutil -E /
This command will immediately force spotlight into a re-indexing your main disc.
Once on the right track I found out that there is a whole range of spotlight related tools - mdfind, mdimport, mdls and mdutil. Now that's more like it. If you want to know more about these tools check out this Spotlight tips article.

Enjoy,
Hardy

Wednesday, April 21, 2010

Seaside - next level web development

Ruby on Rails may be the best 'normal' web framework out there but if you want to take web development to a new level it may be worth looking at Seaside - a web framework built on Smalltalk - the mother of all object oriented languages. This morning I attended a breakfast seminar at Stockholm consultants MSC held by Göran Krampe about Seaside. I have read some about it earlier and put it on the huge list of things to try later (together with erlang, haskell, an infinite number of javascript frameworks not excluding node.js, python with django etc etc ). But when Mikael Kindborgs colleague at MSC is holding a seminar on the topic it sure is interesting to attend and I must admit that I now feel that Seaside probably will be the technology used for the next hobby project for me. Why? I will paraphrase some of what Göran said and add some of my own so here goes:
  • no templates - you don't have to touch HTML at all. This means that (1) method calls for a tag makes sure that tag is properly rendered so no problem with nonclosing tags etc. (2) the kind of mess where tags are intermingled with "normal" code is gone, (3) the HTML looks really good and (4) no risk of using messy techniques for styling - you have to put it all in the global CSS file.
  • the server is not stateless. This may be a problem in extremely large applications but for most cases a bit of load balancing with sticky sessions will solve it with no problem. Session state is communicated with a request parameter so no cookies are involved. And the other parameter is for identifying the continuation.
  • Smalltalk is a really nice language. It has the simplest syntax possible and all and everything is objects. It would be nice to get more hands on experience with the language. Lots of the good stuff in software development comes from the smalltalk community. It is probably because the barriers for accomplishing things is much lower than in other languages.
  • no XML and no configuration files. You write it all in Smalltalk. This is - of course - similar to Rails where everything is Ruby. A very nice and reasonable approach.
  • no builds. Smalltalk runs in its own virtual machine with something called an image that holds the current object state of everything. Kind of like EJB stateful session beans but good.... Code changes in the development environment is runnable at once. This is no news for Smalltalk developers but for a Java web developer it may sound too good to be true. Seaside adds a nice debug environment to your web pages where you can inspect and change the code from within the browser. Imagine doing that with a JSP-based framework in the J2EE stack.
  • Seaside is 'just a web framework'. Unlike Rails and django it doesn't solve all your problems. For persistence you have to hook into other Smalltalk solutions. For the enterprise - Gemstone may be interesting with its powerful object database.

So - many thanks to Göran Krampe for awakening my interest in Seaside (and Smalltalk).

Sunday, April 18, 2010

iconv to the rescue

Inspired by this Rands blog I gave Ommwriter a go. Opening an existing text file I was surprised though to be greeted by something like this:

Unfortunately, I must have accidentally saved the file before I was able to exit the Ommwriter, because when I tried to reopen the file in TextEdit I got the same result. I was pretty sure I was encountering an encoding problem. Time for iconv. The default encoding on my Mac is UTF-8 so I tried something like:
iconv -f UTF-8 -t UTF-16 foo.txt
And lo and behold I got my text back. After investigating the problem for a little bit I found out that the problem occurs when the text contains characters outside the [A-Z] and [a-z] range, for example an ö.

Anyways, after this initial hiccup, I have to admit I am positively surprised about Ommwriter. The fact that all distractions are removed from the screen really helps focusing on the actual task of writing. I also like that there is no spell checker. You are actually focusing on writing and not proof reading. Most surprised I was, however, by the fact that audible keyboard strokes actually really help the writing process.

Saturday, April 17, 2010

Isla Martin Garcia

Tigris, The Paraná Delta & Isla Martin Garcia,

A great trip while in Buenos Aires is a visit to the Paraná Delta. The Delta is a 14000 km2 area of islands, inlets, water channels, rivers and backwaters. It's a great area to explore and you get away from the hustle and bustle of Buenos Aires. On weekends legions of people flock to Tigre, the gateway to the Delta and you will see massive queues infront of the shuttle boats taking you out onto the many waterways.

Tigre is about a 1 1/2 hour bus ride (number 60) from the city. Alternatively you can take the train from Retiro or the Tren de la Costa. However,  the latter is definitely overpriced and it charges tourist prices! I find Tigre itself quite boring. There is the Puerto De Frutos, a major tourist market, but that's about it. There is also the Tigre Casino, but that's a rather sad than exiting place. Worst of all, there does not to be a decent restaurant in town. The best recommodation I can give is a grilled chicken take away called Super Pollo.

A great day excursion you can do from Tigre is to visit Isla Martin Garcia. It's a three hours boat ride to this island. The boat leaves at 9 am, so if you are coming from Buenos Aires you will have an early start. Alternatively you sleep over in Tigre and start the day in a less stressful way.

Isla Martin Garcia is not really part of the Paraná Delta, but rather lies in the Rio de la Plata closer to Uruguy than to Argentina. The highlight of the whole trip is the 3 hour boat ride itself. The first 1 1/2 hours take you through the Delta and afterwards you are crusing up the Rio de la Plata. If you are lucky you can sit outside on the roof of the boat and let the secenery pass by. Once you turn into the Rio de la Plata it is worth to have a look back. You will be rewarded with a view of the Buenos Aires skyline in the distance.

On Martin Garcia you get a one hour guided tour around the inhabited  part of the Island. There are some interesting details about the island. Juan Perón was once imprisoned on the island and one of the first practisioners of blood transfusions - Luis Agote - was living and working there. Today the island is owned by the government and the people living there only lease there homes from the government. Bird watchers will love the island since it offers excellent bird watching oppertunities and if you like other wild life you can try to spot one of the many lizards inhabiting the island. And in case the local bakery is open make sure to get a pan dulce. The pan dulce from Martin Garcia is renowned in whole Buenos Aires.

Here are some pictures from our trip to Martin Garcia.

Enjoy!