Café Tortoni

Café Tortoni - Inside Café Tortoni at Av. de Mayo 825 is well written about on the web, they have absolutely amazing chocolate. They serve churros too, but frankly, the churros are not as good as they are in México and are cold and more salty than sweet. On the back of the menu they claim churro is a national pastry - but this was the only place in Buenos Aires that I found serving it.

The chocolate drink is very delicious, thick, feels like it is just melted chocolate with some magical transformation so that there is no watery taste, but is still flowing liquid. This comes with a small pot of hot milk, and of course, three packets of sugar - everywhere in Buenos Aires, sugar is always available. In this case, skip the sugar, the chocolate is great just as is, and if needed, dilute it with the hot milk. This is definitely something not to be missed if visiting Buenos Aires. And then alternate between dunking the churro in the chocolate, and drinking the chocolate. This is good living!

While the cholocate is excellent, this place also has a lot of history, it has been open since 1858, visit the Café Tortoni web site for more info. The downside is that it is now on every tourists itinerary so there is a line to get in in the evening but it was never full in mid- to late-afternoon.

Drupal MySQL Performance Problem

A very small site started running into performance problems - some pages taking too long to load, and certain MySQL queries taking over 5000 to 6000 milliseconds, and being killed because of resource limits set on the hosting computer. The pages affected were the watchdog log display pages - one of which is the Menu -> administer page when logged in as the adminstrator, and it displays data from the watchdog table.

This seemed odd - for a site with less than 200 nodes, and very low traffic, there should be no performance issue, and no single database query should be taking as long as 6000 milliseconds.

So the options were to increase the time limit for queries, or to spend the time debugging the problem.

Drupal is very feature rich, and this may have negative impact on performance, but in this case, it turned out to be a database issue. The Drupal site has many performance related tips, including a subsection on Tuning MySQL for Drupal.

After looking around in the database for the site, it was discovered that the overhead for the watchdog table was over 40 times its actual size! So, the size was 176MiB, and the overhead was 172MiB. Running optimize on this table got the size down to under 4MiB, overhead to 0, and got the queries to be much faster - way below the 6000 millisecond time limit, and the administer and log display pages now rendered much faster, way below the old times.

One question remains - why did removing overhead fix the query times?

Buenos Aires

One more city to add to the amazing list - so much to see in Buenos Aires, great food (beef, beef, and beef), incredibly clean city, lots of green spaces, and good transportation.

Short takes and tips for travelers to Buenos Aires. There are many web sites with information, so this is only the list of things I did not find at other web sites after a web search, or things that were really interesting.

Click here for: Buenos Aires Photo Album

You can get by with English, but note that most people will only be able to speak in Spanish, so knowing a bit of Spanish is recommended.

Arrival: After a long flight from the US, you want to get to your room with least amount of trouble - take the taxi if you are in a hurry, or take the Manuel Tienda Leon bus. The bus is air-conditioned and quite comfortable, but requires a transfer to another bus to get to your final destination. The bus is half the price of the taxis, so if there are two or more people, taxi is a better option. There are many stalls selling taxi/remis services, but the best option is at the Taxi Ezeiza's blue/white circular, stand-alone booth, just outside the exit from the customs area. For the return trip, call their number (+54 11) 5480-0066 to reserve a taxi. Airport to the City costs under AR$65, while City to the Airport is under AR$55 (this includes tolls). [2007 Prices - factor in 10%-20% inflation! In 2008, the prices were AR$88 and AR$60 respectively!]. They also respond very quickly to email at their info@taxiezeiza.com.ar address, you have to communicate in Spanish - use the free translation services available on the web if you need it!

Eating - Buenos Aires

The Buenos Aires Photo Album pages include some restaurant and food photos.

Buenos Aires has its unique food style - anything you want as long as it is some cut of beef, and grilled. Cut of beef may be a restrictive definition, you can get any body part of cow grilled! The range and taste is not as good as one might find in New York, Montreal, or Chicago, so prepare accordingly. There was a period between 2002 and 2007 when prices in US$ were quite good, but inflation is very high in Argentina and by 2008, the mid-range restaurants would range around US$15 to US$20 (not including wine) for lunch and higher for dinner. This type of food would be a minimum for good eating as far as tourists may be concerned. And just like Europe, no restaurant serves plain water for free so have to order water for around US$2-3 per bottle.

These external links are great guides to refer to:
Guía de Restaurantes de Buenos Aires which seems to be a popular local site, with many customer comments. Even if you don't understand Spanish, they have great summaries that rate the food, the service, and provide an indication of the cost of one meal (without drinks).
Asado Argentina » Beef has pictures, explanations of different cuts of meat. Given the amount of beef you might eat in Buenos Aires, this is a good site to read about what you may be eating!

Food: Yes, grilled food is only thing they eat here in Buenos Aires! Seriously, the beef at any parrilla is excellent, Bife de lomo or bife de chorizo were good at all price points - even at under US$15. They do have better beef down in Argenttina, grass-fed cattle make better beef than US grain-fed cattle! French Fries are common side dish, but if you need ketchup, must ask for it, it is not normally served here.

strftime in Python

Time has never been easy to work with, and while it is best to use UTC to store time, it is necessary to use local time zones when displaying time to the user.

With regards to displaying local timezones using strftime and the format specifications %Z for timezone name and %z for the RFC-2822 conformant [+-]hhmm displays, Perl and PHP work fine, at least on Fedora FC5. Python 2.4 does not yet have support for %z, and the best support in Python for timezone is using the basic time module; the enhanced datetime module has no built-in support for time zones.

That takes care of strftime, what about strptime? Unfortunately, that is a topic that is even more convoluted, so try all variations out before you use it on any system.

Here's a strftime support summary for Python date/time users:

  • Use the datetime module if you don't need any timezone handling. The standard library comes with no support for any timezones, not even local timezones, so datetime module is useless for those who need to use time zone information. This can be done of course, but requires coding up your own timezone routines.
  • Use the time module if you can live with just %Z and don't need %z. Python 2.4 time module always prints wrong value +0000 for %z, even while it gets %Z correct.
  • Need %z, the RFC-2822 conformant time display? This requires writing your own code, Python does not support this. Using the basic time module, here's example code on how to get these values:
    lt = localtime(t)
    if lt.tm_isdst > 0 and time.daylight:
        tz = time.tzname[1]
        utc_offset_minutes = - int(time.altzone/60)
    else:
        tz = time.tzname[0]
        utc_offset_minutes = - int(time.timezone/60)
    utc_offset_str = "%+03d%02d" % (utc_offset_minutes/60.0, utc_offset_minutes % 60)

    Note: in the utc_offset_str computation, the use of 60.0 float in the / operation is necessary to get a value rounded to 0 instead of negative infinity, for example, -90 minutes offset should be -0130 and not -0230.

Here's the sample code and the output from Perl, Php, and Python, for two example strftime calls:

Updating Drupal

Updating drupal using the standard instructions is very time consuming - have to turn off modules/themes, update settings, reinstall modules/themes.

But many users find that for many updates to the same major release, for example, 4.7.x series, simpler upgrades can work - official Drupal install instructions do not allow this, nor is the structure of Drupal folder structure a help, since user installed modules/themes are in the same folder as the drupal files (would be good to have these separate), and no easy way exists to try out a new release before switching to it on a running site.

Given all that, here's how an update can be done fast - very important to read the UPGRADE.txt Drupal document first, and do all backups, and be ready to restore quickly if things don't work.
No guarantees on this method, but it has been known to work.

Assume that old drupal install is in current/ and new one is new/

  1. extract the new drupal release, into the new/ directory.
  2. copy over all the new files and directories from your current install, to this new/ directory. See script "update.sh" below which does this.
  3. update the config files - sites/default
  4. login to current drupal as admin
  5. backup: rename current/ to current.backup/
  6. rename new/ dir to current/
  7. run current/update.php from drupal and on success, log off the admin user. and test it out

And here's the update.sh script - edit $OLD variable, run this from inside the new/ directory, and redirect output to update.run, take a look at the update.run commands, and then run the commands in update.run:

#!/bin/sh
OLD="current/"

echo "# Current Directory: " `pwd`

for i in `cd $OLD; find . -print`
do
    if [ ! -e "$i" ]
    then
        if [ -d "$OLD/$i" ]
        then
            echo mkdir -p -v "$i"
        fi
        if [ -f "$OLD/$i" ]
        then
            echo cp -p -v -i --reply=no "$OLD/$i"  `dirname "$i"`
        fi
    fi
done

Steve Jobs on DRM - the third alternative

A canny business tycoon promoting an option that says the music industry may be better off without DRM? Finally! Someone of this stature saying this, this is big news - someday, consumers will gain back the rights they always had, and DRM will be relegated to the industry's dust-bins, where it belongs. May take decades, but one step at a time, this will eventually happen.

Here's the article at Apple's web site - Thoughts on Music by Steve Jobs.

As some commentators have suggested, that article may have been prompted by legal troubles, but it is still worth reading, for promoting what it calls the "third alternative" - the music industry may be hurting itself, and that Apple itself is open to supporting a world where music does not have to be restricted by being wrapped in DRM locks. A DRM-free world is not only important to consumers, but could be good for business too, which is the main group supporting DRM.

Apple's iTunes is certainly the world's largest music store in terms of volume - and it uses DRM. eMusic.com is the second-largest online music store, and it does not use digital rights management - here's how they describe their service on their web site [January 2007]:
eMusic is the world’s largest retailer of independent music and the world’s second-largest digital music retailer overall, offering more than 2 million tracks from more than 13,000 independent labels spanning every genre of music. A subscription-based service that allows consumers to own, not rent their music, eMusic is the largest service to sell tracks in the popular MP3 format – the only digital music format that is compatible with all digital music devices ...

Chase Credit Card - Good Cash Rebate

The Grapevine at Credit Card Goodies is a good source of information for getting the low down on credit card offerings.

The best cards are of course those that pay cash back - all other stuff like airline tickets, hotel rooms, can be bought with cash, so why look for anything else? And of course, use credit cards as a substitute for money you already have, using credit cards to get credit is really not a good idea - too high a cost to get credit this way.

Right now, end of 2006/early 2007, the best cash back card for those spending less than around $20,000 per year, seems to the Chase Freedom Visa Credit Card - from 1% to 1.25% back on all purchases, increasing to 3% for eligible Gas, Grocery and Quick Service Restaurant purchases.

Web provider changes umask, Gallery stops working

So, I maintain a few web sites and one site uses Gallery software. This worked fine until recently - when a user tried to create a new album, it failed with an error about being unable to create lock files [ Error: Could not open lock file (/..../public_html/albums/album01/photos.dat.lock) for writing! ]

That was a somewhat misleading error, but - in the end, this turned out to be a hosting provider issue, and not a Gallery issue.

Turns out the hosting provider advertently or inadvertently set the default umask for process under Apache to 0111. This umask removes all execute permissions from new files and directories created by scripts run under Apache.

Gallery keeps the default umask, so it inherited the 0111 umask, and when it tried to create a directory with permissions 0700, it in fact got a directory with a permission of 0600 - read, write, but no execute. Of course, without execute permission, a directory is not of much use - cannot move into that directory, cannot create files in that directory, basically, things will start erroring out from that point out. Software could be written to handle this - maybe always do a chmod after a mkdir? But that is a different discussion.

It did not take too long to find this out, but getting this resolved at the hosting provider took a while - explaining umask, mkdir, and directory behavior. I guess that is the first reaction of technical support - they must get too many false reports, that when a real problem comes up, they have to take some time! [Though I am happy with the provider - they were at least engaged and responded fast with questions, and in the end, they resolved this pretty quickly.] Add to this, all morning today the Gallery site was inaccessible - so I could not search the forums for this issue. In any case, this was a new problem, not previously posted on the Web, nor mentioned at the Gallery site.

GoDaddy heavy handed in shutting down domains

nodaddy.com tells a scary story of how Go Daddy went in and disabled a site, for what seems to be totally unjustified reasons, and totally insufficient attempts made to

What is worse, is that Go Daddy continues to insist they did they right thing, compounding the significance of this issue.

My domains are registered with Go Daddy, I was hoping for a better response from them - maybe say it was a mistake and that they now have a new process in place to handle this, but looks like that is not going to happen.

Need to think hard if this is a good domain registrar - though looks like it is not that is easy to find any registrar that is good in this respect, at least in the US.