Older blog entries for pjf (starting at number 574)

These events happened during my recent trip to Saudi Arabia.

Saudi Arabian Adventures - Days 3-4
On the third day of teaching my class swapped over to new students at lunchtime. Included in this group was Abdulaziz, who I had spoken to on the phone a few times, and who formally introduced me to the class on the first day. Abdulaziz spoke English with an American accent, and I was later to learn that he gone to college in America.

Lunch on the second last day Abdulaziz took me to the golf course. Saudi Aramco has a huge golf course, with beautifully kept grass, and is in stark contrast to the surrounding desert. Here they serve a variety of meals, cooked to order. Since it was the middle of a business day, nobody was actually playing golf.

There have been a few things that I've noticed over here. Business attire is very much traditional western or traditional Arabic, with both being very common. Teenage girls can be often seen wearing flowing black over-robes that were very Harry Potter-esque. Lawns and garden beds are covered with a huge number of very fine mist sprinklers, and they run during the day. These sorts of sprinklers are practically outlawed in Australia, with most states suffering from severe water shortages.

At the food hall, I learnt an important lesson. If I was asked if I wanted something to "take away", then that actually meant the food serving would feed a football team, and my answer to such questions should always be in the affirmative. The first time I foolishly said no, and found myself wondering what to do with the incredible amount of food in front of me.

Having wireless access in my room is a real blessing. I don't know where I'd get it otherwise.

Saudi Arabian Adventures - Day 5
Today was my second-last day of teaching, and Abdulaziz informed me that I needed to make sure the class finished early (3pm) as a meeting had been arranged between myself and management.

To make my day more interesting, we had a trainer who wanted to install software for her course next week. Her name was Tina, and her opening line was "Hi, you're a software developer, aren't you?" When I asked how she knew, she claimed "It's the look. You're all trendy, with long hair." That's the first time I've ever heard developers get called trendy, so I can only assume that I mis-heard.

At 3pm we finished early so that I could meet with EDMD management. For some reason, whenever anyone said "EDMD" I would hear "AD&D", my mind would fill with images of dungeon-crawling geologists in flowing black robes fighting an onslaught of umber hulks.

The meeting with management was made more interesting because I didn't have my Aramco ID, which meant Abdulaziz had to make a couple of bluff checks at the security checkpoints to get me through.

The meeting itself was very management-focused. What does Perl do, who uses it, what's its future, and so on? I honestly don't know how I fared with these questions, and in hindsight I fear my answers may have been a little too much on the technical side, but everyone seemed happy.

Afterwards I met Omar, who I had spoken to on the phone a number of times before my trip, but who wasn't enrolled in the course. Omar is a dual-classed geo/developer, and already knows Perl. It also rapidly became apparent that he was very open-source friendly. "We have a program that parses $horrible_file_format, and would like to bundle it into a module and release it to the CPAN. Is that something you can help with?"

That night, Fuad, Abdulaziz, Omar and Mohammed took me out to a traditional Arabic restaurant. The trip getting there was an adventure in itself. Saudi Arabia seemed to lack anything resembling road rules, or if they existed, they were ignored by most of the drivers on the road. Lane-changes happened at random, and cars would speed down the road at breakneck velocity. The primary form of communication between drivers was a brief flash of high-beams, which meant "I am going 40km/hr faster than you, and I'm not changing lanes. You should." This was in stark contrast to driving inside the Aramco campus, where everyone was slow, careful, and polite. Somehow, Omar drove through all this without breaking a sweat or losing his cool.

In the car we talked about content management systems, web technologies, AJAX, Catalyst, Jifty, PHP, package management and deployment, virtual worlds, and a variety of other FOSS-oriented technical subjects. This was good, as it distracted me from the traffic around us.

At the restaurant I was treated to Arabic coffee, which apparently is made from the unroasted beans, and is very good. It also rapidly became apparent that this was a restaurant/museum, with many historical photos and items on the upper floors. There was a large water feature in the middle of the building, and a large lantern feature. It was explained to me that these sorts of lanterns were traditionally lit and placed outside houses at the start of the month of Ramadan.

After a tour of the historical section, we were given quite a banquet of food, some items which I have had before (such as the dips), and some which I had not. One of the most memorable (and most tasty) dishes was a thick paste made of a variety of grains. This was eaten with a thin broth, and stuck to one's teeth almost immediately.

After dinner, and tea, and dates, and more talking, we drove back to the camp, with discussions mostly focusing around virtual worlds, 3D web interfaces, and tunnelling procedure calls from Second Life to Perl.

Sleep was an immediate priority when I returned to my room, as it had become quite late, and I was certain I'd need an extra cup of coffee to get me up in the morning.

Autodie 2.00 released
This weekend the long awaited autodie 2.00 for Perl was released to the CPAN, which was almost immediately replaced by 2.02, which fixes some oopsed tests and which adds a couple more features to give us a really sweet experience. This blog entry assumes you're using 2.02.

Observant viewers will notice that the major version number has changed. I've taken the great leap from 1.999 to 2.00. Clearly, something is different, and you might be wondering what.

Well, autodie 2.0 now supports a hinting interface for user-defined subroutines. Put simply, if you have a user-defined subroutine that does something funny to signify failure, you can now tell autodie about that. Once it knows, it can Do The Right Thing when checking your subroutine. You can even put the hints into the same file as those subs, and if someone is using autodie 2.00, it will find the hints and use them.

This may not sound very exciting, but it is. It means that a lot of really ugly error-checking code, both on the CPAN and the DarkPAN, can go away. Lexically. Still not convinced this will change your life? Let's look a little more closely; trust me, you'll like it.

Let's pretend you're working on a piece of legacy code. For some reason, the people who wrote this code decided the best way to signal errors is by returning the list (undef, "Error message"). I don't know why, but I've seen this anti-pattern emerge independently in three 100k+ line projects I've been involved in.

sub some_sub {
    if ( not batteries_full() ) {
        return ( undef, "insufficient energy" );
    }

    if ( not coin_inserted() ) {
        return ( undef, "insufficient credit" );
    }

    my @results = some_calculation();

    return @results;
}

If you want to check to see if some_sub() returns an error, you need to capture its return values, look at the first one to see if it's undefined, and if it's not, use the second one as your error. At least, that's what you're supposed to do.

What actually happens is most developers decide that's way too hard, and don't bother checking for errors. Then one day, the batteries on your doomsday-asteroid-destroying-satellite go flat, nobody notices, and through an ironic twist of fate you're left as the last known human survivor, and there are zombie hordes and walking killer plants outside.

So, how can autodie help us? Well, before version 2.00, it couldn't. But now, with autodie::hints, it can! We can give autodie hints about how the return values are checked. They look like this:

use autodie::hints;

autodie::hints->set_hints_for(
    'Some::Package::some_sub' => {
        scalar => sub { 1 },
        list   => sub { @_ == 2 and not defined $_[0] },
    },
);

Our hints here are simple subroutines. If they return true, our subroutine has failed. If they return false, it's executed successfully. Notice that our scalar hint always returns true. That's because we consider any call of our subroutine in scalar context to be a mistake. It's returning a list of values, and you should be checking that list.

Once we've set our hints, we can then use autodie to automatically check if we're successful:

use Some::Module qw(some_sub);

sub target_asteroid {

    use autodie qw( ! some_sub );

    # autodie has lexical scope, so only calls to some_sub inside
    # the target_asteroid subroutine are affected.

    my @results = some_sub();     # Succeeds or dies
}

sub target_ufo {
    my @results = some_sub();

    # autodie is out of lexical scope, so we have to manually
    # process @results here.
}

If you're wondering what that exclamation mark means, it means "insist on hints", and is a new piece of syntax with autodie 2.00. If for any reason autodie can't find the hints for some_sub, our code won't compile. That's a very good thing, and avoids us having a false sense of security if we use autodie on an unhinted sub.

However the error messages from autodie aren't really that useful. They're going to be things like "Can't some_sub() at space_defense.pl line 53". There's a noticable lack of explanation as to why some_sub() failed.

Luckily, since the way early versions of autodie, we've been able to register message handlers. And with the new features in autodie 2.02, we can produce very rich messages. Let's see how!

use autodie::exception;

autodie::exception->register(
    'Some::Module::some_sub' => sub {
        my ($error) = @_;

        if ($error->context eq "scalar") {
             return "some_sub() can't be called in a scalar context";
        }

        # $error->return gives a list of everything our failed sub
        # returned.  We know this particular sub puts the error
        # message the second argument (index 1).

        my $error_msg = $error->return->[1];

        return "some_sub() failed: $error_msg";
    }
);

Now, whenever some_sub() fails, it'll print a genuinely useful message, like "some_sub() failed: Insufficient energy at space_defense.pl line 53". Yes, autodie automatically adds the file and line number for you. Nice!

But wait, there's more! We don't want to see this sort of code floating around in your programs. You may be dealing with other people's modules that you can't modify, so we can't hide all this configuration in there. So, we can write our own pragma that contains all this info. Here's the full code for a theoretical my::autodie pragma, and is the exact same code used by the t/blog_hints.t file in autodie's test suite.

package my::autodie;
use strict;
use warnings;

use base qw(autodie);
use autodie::exception;
use autodie::hints;

autodie::hints->set_hints_for(
    'Some::Module::some_sub' => {
        scalar => sub { 1 },
        list   => sub { @_ == 2 and not defined $_[0] }
    },
);

autodie::exception->register(
    'Some::Module::some_sub' => sub {
        my ($E) = @_;

        if ($E->context eq "scalar") {
            return "some_sub() can't be called in scalar context";
        }

        my $error = $E->return->[1];

        return "some_sub() failed: $error";
    }
);

1;

It works exactly the same as regular autodie, except it also knows how to handle some_sub(), and display good looking error messages. Here's how we'd use it:

use Some::Module qw(some_sub);
use my::autodie qw( ! some_sub );

my @results = some_sub();  # Succeeds or dies with a useful error!

There's a lot more you can do with autodie, and if you want to learn more, I'd suggest coming to my talk at OSCON or YAPC::EU, where I'll be covering all this and more, with a distinctive Star Trek twist. ;)

Note: Pictures of my trip to the Middle East are now available.
The events in this entry happened on 12-13th June

Saudi Arabian Adventures - Day 1
My first true day in Saudi Arabia was one of rest. After 30+ hours of travel, being able to sleep in a bed was truly lovely. I woke up fairly late in the day, caught up on e-mail, and then decided to go exploring. There was a food hall just around the corner from the hotel, and while I gawked at the sign displaying opening times, (I was concerned I had missed lunch), and worried about the wording that said the hall was for Saudi Aramco staff only, one of the staff members waved me in with a smile.

What I discovered is that the food hall has both very good and very affordable food. Cans of drink, bottles of water, and cups of coffee were almost universally 1 riyal (about $0.30 AUD). Some basic meals were available for about 4-5 riyals (under $2.00 AUD), with the best value for money undoubtedly being the "budget meal", which provided soup, vegetables, rice/potatoes, a generous main meal serving, and a dessert, all for 11.5 riyals (about $4 AUD).

I got myself a salad (which were excellent), some soup, and some coffee, and felt very thankful that I had changed myself some 300 riyals (about $100 AUD) while in Dubai, since I hadn't spotted any way of doing money exchange at the Dammam airport.

The rest of my travels included a walk around the camp, the most interesting part of which was a fenced area that seemed to include a library and a bowling alley. Here also a large sign proclaimed the facilities were for Aramco employees only, and passes will be checked on entry. I was getting the feeling that having an employee pass would be a good idea.

Saudi Arabian Adventures - Day 2
Today was my first day of teaching. Fuad, my contact at Aramco, had arranged to meet me at 7am at the hotel, and I had noted from my trip to the food hall yesterday that it opened for breakfast at 5am. Collectively, these were hints that Saudis were morning people. I set my alarm for 5am, which in my jet-lagged state would feel like waking up at noon in Australia.

Going to the food hall for breakfast once again had me feel like I was in America; the most popular food that people ordered were waffles! Of course, I didn't fly half-way around the world just to have waffles for breakfast, so I ordered a generous bowl of ful medames... and waffles.

Of the two breakfast foods, ful was the clear winner. It tasted good, and unlike the waffles, it had actual nutritional content. I finished breakfast with plenty of time to meet Fuad back at the hotel at 7am.

Fuad chuckled at my attempts at an Arabic greeting, and asked in perfect English "where are you learning this stuff, a phrase book?". I think that means my Arabic has some ways to go. ;)

Fuad asked about my flight here, explained that the Aramco camp was generally divided into zones, the general business hours (7:30am-3:30pm), and helped me get set up with my lab. I was also glad to hear he would be attending my first course.

At this point, I should explain a little about what I was teaching. My class consisted primarily of people with job titles that started with "Geo-", and who regularly had to deal with data that was in formats different to what they would prefer. Unsurprisingly, they'd like to use Perl to help solve these problems. That's an increasingly common story with the courses I teach.

What made this interesting is that rather than having a good four or five days (which is what I'd prefer), I was teaching two classes, a dozen students in each, with only 2.5 days per class. To top that off, I was in a different country, and I had no idea how comprehensible my Australian accent would be. I'd put together a plan that covered the basics (syntax, variables, and control structures) a tour of the CPAN, and as much regexp content as I could squeeze in.

When we were doing introductions, it became clear that my class had a good sense of my humour. My favourite introduction was from one student who said "my name is very hard to remember... it's Mohammed".

The first day of teaching went well, and from the bountiful, well-thought out questions, it was clear that I was being understood.

Dubai Adventures - Day 3
Today I decided to travel to Jumeirah beach and surrounds, a decision I made purely based upon the number of tags and photographs in the area for Google Earth. Since I'd be doing this during the day, I decided to take a practical approach. I left the laptop and most electronics back in the hotel, and packed lots of water and sunscreen. I wore my most breathable cotton top, a linux.con f.au hat, and what Jacinta calls my "pirate pants". These pants are very loose, and very breezy, and very comfortable. But as a result, I didn't look like a local, and I didn't look like a typical tourist, either. I was, however, protected from the sun and reasonably cool.

I caught a taxi to Jumeirah mosque, for just a little over 10 AED (about $3.50). I didn't expect to find the mosque open (and indeed, it wasn't), but I got some nice photographs. The main reason I wanted to visit the mosque is that it was walking distance to the beach, and (if you're me) Sheik Zayed Road. While two days ago I had discovered that walking around the old souks resulted in someone trying to sell me a fake rolex every few minutes, today I discovered that walking around Jumeirah had a taxi beep at me every few minutes, hoping that I would need a lift somewhere.

Jumeirah beach is very pretty, and very hot. There weren't many people out, and a lifeguard watched lazily from a tower. The beach came with lots of rules, one of which was "strictly no cameras", so I had to be a little more discreet with my photographs. The water looked extremely inviting, and I relished the idea of hopping in for a swim. Unfortunately (and accidentally), I had left my swimming gear back in the hotel, and my mask and snorkel back in Australia.

At the beach I got some great photographs of the skyline of Sheik Zayed Road, especially of the Burj Dubai, which distinctly reminds me of the Combine Citadel in Half-Life 2. Having looked around the beach, I decided to head off toward Sheik Zayed road, which I was certainly would be filled with marvels.

The walk was a lot harder than my previous wanderings around Bur Dubai, even though the distance was shorter. I was walking through a residential distract, and as such there was a lot less cover, and fewer amenitities. It was clear that Jumeirah was home to the rich, with magnificent mansions and expensive cars.

After about 1.5km of walking from the beach, I was finding that the heat and exposure was making me a little uncomfortable, and that while I had packed a lot of water, I'd probably need to think about looking for more. Luckily, I had just chanced upon a park. It was beautiful, green, lush, and immaculately maintained. For some reason, the gate was shut, with a large padlock, and it looked as if this gate had been shut for some time. Perplexed, I went to a second gate, and it was also closed. I noticed a person in the park, but he appeared to be a groundskeeper, who was distracted by talking on his mobile phone. This had me even more perplexed; why spend water, and money, and high-value property on creating a park that nobody can get into? This wasn't marked as a private park, and it even had a playground in the middle of it. Maybe it closed during the middle of the day, and re-opened later on?

A climbing check, and two stealth checks later, I found myself a section of soft grass and a shady tree under which to snooze. I woke after about half an hour, a little surprised that the groundskeeper hadn't woken me. Refreshed, I continued on my way, and discovered much to my delight that Dubai has public refrigerated drinking founains. With my water bottles refilled, and my face and arms splashed with blissfully cold water, I continued onwards.

The region I was walking through seemed to be filled with houses that were universally big. However one house in particular stood out. It was on the corner of two streets and was unfinished. That in itself is nothing special; Dubai seems to be in a constant state of construction, but it was clear this building had been unfinished for quite some time. The shell was made, but that's all which was there. Amusingly, a sign on the side said "For Sale or Rent".

After walking past another park (also beautiful, closed, and deserted), I eventually reached Sheik Zayed Road. This is the home to many of the tallest buildings in Dubai, and is a spectacular sight from the air, but amazingly dull on the ground. These were hotels, and office blocks, and the odd food outlet here and there. It was also completely impossible to cross on foot. It looked like some footbridges were under construction, but they were nowhere near finished, and they were so big I suspect they were for yet another road link, and not meant for pedestrian traffic at all.

I walked down the street, and got some decent photographs. My plan was to walk across to the Dubai Mall, take a look around, and then walk up the other side of Sheik Zayed Road to the Emerites Towers. As it happened, try as I might, I couldn't find a way to get across the street, which has twelve lanes, and cars travelling at considerable speed.

Hot, disappointed, and tired, I decided to try and find someplace cool, and preferably with restrooms. Being Dubai, there was a small mall not too far away, and I made my way toward it. It had a supermarket, and an electronics superstore, and in a rare moment of impulse purchasing, I grabbed a copy of EA Sports Active (which apparently sucks less than Wii Fit), after carefully checking it for any signs that indicated that perhaps it would only work in certain regions.

If I had my laptop with me, I would have pulled out my maps and looked for interesting activities, but since it was not available, and since I had gone all this way to discover that Sheik Zayed road sucked, I hailed a taxi to get back to town. This was one of the best parts of the day, since the driver was very talkative. He was from Pakistan, to which he'd love to return, but apparently there are no jobs there. He had worked previously in the Ukraine, and had moved to Dubai eight months ago.

My driver commented that Dubai is an artificial city. It's got artificial islands, artificial buildings, artificial snow, and artificial parks. People are here because Dubai has done an amazing job of marketing itself to the rich, but due to the global financial crisis, the rich aren't rich anymore, and they're flying back overseas. Tourism is down, jobs are more scarce, and so many of the not-so-rich who have come here for work are also going back overseas. Apparently all this was great reducing traffic congestion and getting me back to my hotel, but it sucked for the city as a whole.

Back at the hotel I had a bite to eat, and wrote this blog. My plane leaves at 9:35am, which means I want to be at the airport at 7:35am, which means I want to be leaving the hotel at 7am, which means waking before that. If I want to avoid too much jet-lag I should be going to bed now, and waking super-early in the morning. Instead I'm here posting blog entries, and discovering that the the UAE censors flickr, so there won't be any photographs until I get home.

Dubai Adventures - Day 2
I'm never going to be awake early in the morning so I can visit the museum if I keep getting back to my hotel at 12:30am, and blogging about my day. And yet that's what I'm doing right now.

Today was my second day in Dubai, and I discovered that Dubai has westerners, women, and arabs; they all hang out in the malls. After sleeping in again (goodness, I was tired), I decided to go to the Mall of the Emirates (the one with indoor skiing in middle of the desert), and then make my way by foot to the Burj Al Arab area, which I estimated was a 2.5 km walk, and hence pretty easy.

I caught a taxi, as the distance was much too far to walk, and I had no idea which bus to catch. I had a great chat with the taxi driver; he was from Nepal, had moved to Saudi to work (not far from where I was working), and was now in Dubai. I asked if he had any family here, and he laughed. Apparently Dubai is so expensive, especially with rent, there's no way he could support a second person; the plan is to work here as long as he can stand it, and take his savings back home.

It seems that with the global financial crisis (GFC), while Dubai still has lots of taxis, it's lacking the tourists who normally use those taxis. The GFC and the drop in tourism is something I'd heard from a few sources now, and it's clear that a lot of Dubai depends upon the tourist trade.

When I stepped into the Mall, it felt like stepping into America. It had American shops, American food, and American people. Actually, as I was to discover after talking to a few of them; the majority of the westerners were from the UK. Almost everything in the mall had prices similar to what I'd pay back home, and like most malls, most of it were things I had absolutely no interest in at all.

Luckily, I found one of my objectives for the day, and that was a free wireless hotspot. I eventually found the access point, it's just outside the cinema, and the SSID is "yournetworkname". I used it to call home (again, hurray for VoIP), and after a good chat ran down my laptop battery. Unfortunately, I didn't bring my external battery (it's heavy!), so any remaining communication had to be done via a hand-held.

The other discovery I found in the mall was an arabic gift shop, which was filled with local wares and tourists. Amazingly, I actually enjoyed browsing here; this certainly wasn't stuff I'd see in Australia (or anywhere else), and the prices were extremely affordable. There was also a hilarious collection of art-work out the front of the door. Words can't do these justice, so you'll just have to look at the photos (coming soon) and see.

I purchased a selection of gifts and while often it was easy for me to say "$x will like this", I discovered that was very hard when $x = 'jarich'. Eventually I went for the shotgun approach, and got her one of everything.

Somehow, after two calls home, some IM chats with friends, a selection of gifts, some photographs of the ski slopes, and some chats with the locals, it had got rather late, so I decided to set out on my walk. This was made more challenging by the fact that my laptop had a flat battery, and that's where my maps were located, but since the Burj Al Arab is the world's tallest building, it's not hard to spot and walk toward it.

I should correct myself there, it's not hard to spot. Walking toward it was hard, since there were huge multi-lane highways, and construction work, and no obvious way to actually walk there. I could (and in hindsight, should) have got a taxi there. It would have cost AED 10 (about $3.50), which would have been a bargain for the XP I would have gained visiting it and the nearby Souq Madinat.

As it was, I ended up walking fruitlessly in what was essentially the wrong direction. Eventually I stopped for some food outside the Lulu Hypermarket, where the serving staff of the fast-food place I frequented were delighted that I was from Australia, and gave me detailed information about the busses in the area, and were generally awesome. They were from the Phillipines, and collectively were the nicest people I've met all trip. It's just a shame the food wasn't.

Having found the bus (AED 2 rather than AED 45 for a taxi), I looked forward to being able to see all the huge towers along Sheikh Zayed Road, which is the home of some of the most opulent hotels and establishments. Consequently, I was dreadfully disappointed when it decided to go down Al Wasl Rd instead, which doesn't have much sightseeing at all. Eventually the bus pulled into the Bur Dubai bus station, which I had never been to before, but which I knew was walking distance from my hotel.

Unfortunately for me, I didn't know in which direction my hotel lay, and due to an inefficient hashing algorithm being used in my brain, I couldn't recall the name of the street with my hotel, either. I knew I was staying in the Ramee Apartments, but apparently Ramee is a chain with a number of Dubai hotels. Plus, my laptop battery was dead, so no checking maps for me.

Luckily for me, I was in Dubai, so I just walked across the road to the mall (Dubai has plenty), plugged in my laptop, and fired up Google Earth with all my cached maps. The bus stop was only 600m from my hotel as the crow flies.

On walk to my residence, down a surprisingly deserted street, a man approached me from an alleyway. From experience I figured this probably meant he wants to sell me a 100% genuine fake rolex, although for a moment where I wondered if people get mugged in these parts, and there was a reason nobody else was walking down this street.

"Excuse me, but do you speak French?" Okay, I really didn't expect that. I admitted I didn't, and wondered where this conversation would go. "Oh. Then do you have a hotel?" I started to wonder if French-speaking, homeless tourists were common in these parts. "Yes, I have a hotel. I'm walking there now." "Oh. Are you sure? Because if you need a room, I have a room you can rent. It's very nice." "No, really, I do have a hotel." "Oh, okay, where are you from?" "Me? Australia. How about you?" "I'm from France."

Suddently, the conversation made sense. My new acquaintance was over here working, and with rent prices being so high, he was looking for a room-mate. He would have been most happy with someone who could speak French, but I'd do. If I was unhappy with my hotel, or sticking around in Dubai, he'd be happy to split the room costs with me, 50-50.

We had an interesting chat, and I pointed that I could see my hotel and was about to turn down one of the streets toward it. We wished each other a good night, and I dropped past the 24 hour Super Happy Mart to replenish some supplies for breakfast.

Tomorrow I should try to wake up early and visit the museum, but based on prior experience I'm not sure if I will. Failing that, my plan is to catch a bus or taxi to Jumeirah Mosque, check out the beach, and then walk through the back-streets of Al Bada to Sheikh Zayed Road, which should put me in the heart of the "down-town district". I'm sure I can find myself some trouble from there. ;)

Dubai Adventures - Day 1
I'm posting my adventures out-of-order, apologies for any chronological confusion caused. The events in this blog post happened yesterday.

Last night I flew back to Dubai after my stint teaching Perl in Saudi Arabia. On the flight one of the Emirates stewards recognised me from my Australian flight, and we shared a few friendly words. Another seemed to take a shine to me and somehow produced the best coffee I've had all week; I suspect they have an espresso machine hidden away somewhere that they only bring out for special occasions. As such, even though my flight arrived at 2am, I was awake and happy.

Dubai airport has free wireless, which is something I am deeply grateful for. Using the amazing power of VoIP I called home (where it was a sensible time), and had a lovely chat with Jacinta. Amusingly, the call cost me much less than if I were in Australia making the same call from a mobile.

Eventually, with my e-mail updated and my social meter refilled, I caught a taxi to my hotel. It's a three-star apartment hotel in the Bur Dubai district, which I had picked because it was cheap, and looked like it was close to busses, souks, and the museum. I arrived, and pretty much collapsed into bed.

The hotel is right next to a mosque, and I had heard from a few reviews that one can expect to be woken up with the call to prayer. Sure enough, a few hours after I had gone to sleep, I could hear soft, dulcet tones calling the faithful to awake with the first light and gather for prayer. I stirred only a little and smiled; the call was very soft, and very musical, this wouldn't cause me to lose any sleep at all. Then the mosque outside my window started its call to prayer, with the volume cranked to eleven.

Looks like I'll be waking at first light tomorrow.

The hotel itself been really good. Being an apartment-hotel, I have cooking facilities, the most important for me are a kettle and microwave. It also has a washing machine, and I've taken the opportunity to wash some of my clothes. My biggest complaint is that like many hotels, it does have in-room Internet access, and it costs a fortune. There also seems to be an expectation that guests leave their keys at reception when leaving the hotel (maybe people have lost or disappeared with them?), but since nobody has taken the time to explain that to me, I've been taking my keys with me.

Today I woke reasonably late, enjoyed a long hot shower, and prepared myself some maps to help me get around. I'd figured that on my first day I'd explore the local district (old Dubai), and on the second day I'd explore further away (new Dubai). A few people had mentioned that walking in Dubai in the middle of the day is unwise, but I like walking, and I like hot weather, so how bad can it be?

About 45'C (113'F) and humid is the answer. I had packed plenty of water, and stuck to the shade, so I got a few good hours of walking in before I decided to find a bus-stop for a rest. Bus-stops in Dubai are wonderfully civilized, since they're air-conditioned. Unfortunately mine didn't have wireless access.

The main problem with trying to see Bur Dubai during the middle of the day is that everyone else is smart enough to go and do something else when it's that hot, and so with the exception of lunch venues and supermarkets, eveything was closed, even the malls! This was a bit of a disappointment as I had found the museum, but it was also closed. I hope to get in early tomorrow.

While I was in Saudi Arabia, my colleagues there told me that more foreigners live in Dubai than locals. I now believe them! Exploring Bur Dubai felt more like exploring India. I too was obviously something peculiar; I was a westerner, I had long hair, and I was walking in the middle of the day in Dubai. Any one of those attributes was out-of-the-ordinary, so at times I felt that I was positively head-turning.

To be honest, I enjoyed the attention. Most of what I was were smiles; a few people asked where I was from, and what it was like in Australia, and why I was walking in the middle of the day when everyone sensible was out of the sun and having a rest.

Walking through Bur Dubai took me to the fabric souk, but most of it was closed. I'm not much of a clothing/fabrics person, so that didn't bother me too much. It also took me to Dubai Creek, which is a fascinating and enchanting throng of activity. Water taxis dart back and forth, larger dhows and other vessels travel up and down, and somehow nobody collides with anyone else.

From here I returned to my room and had a snooze, but my evening walk took me back to the creek. I took a water taxi across for the standard fare of 1 dirham (about $0.30), and set out to explore Deira, the old parts of Dubai north of the creek.

In Bur Dubai, there were an endless number of shops. I walked along "Computer Street" and past "Bank Street" in my travels. I found streets that were filled with eateries, and filled with clothing stores. In Deira, the streets were also filled with shops, but it felt like they had been randomly generated. There's be stores selling mobile phones, car tyres, bedding, motorcycles, computers, food, movies, whitegoods, furniture, electronics, beauty products, and fish, all next to each other. Many seemed to have equally random names, my favourite of which was "Moist Flower Electronics". The streets were twisty-turvy little things, and I soon found myself lost, and not for the first (nor the last) time that day.

I don't really mind being lost in other cities. It means I get to see things I didn't plan, and in Dubai in particular, I can always hail a taxi to take me back to my hotel. So I continued onwards, hoping to find the Gold Souk that I had marked on my map, but really happy with anything.

I eventually found myself at the Hyatt hotel and its attached mall, because I wanted a break from the heat, and I had discovered my map of Dubai had lacked public toilets. Inside the mall was an ice-skating rink, and while I didn't skate, it sure was nice to be in a cool environment again. Most other things were closed, so after I had made myself more comfortable, I decided to go exploring again.

Without too much travel, I found myself at the Dubai fish market, a place which I was able to discover by its unique scent alone. In Australia, I'm used to fish markets generally being indoors, and air-conditioned. I think the market had one air-conditioned building, and that was filled with people in the process of preparing the fish for sale (sorting, gutting, filleting, etc). Most of the other stalls had generous amounts of ice to keep the fish cold.

I honestly can't do the fish market justice with words. There are people everywhere. There are fish, everywhere. The quantity of fish and people dwarfed anything I've seen in Australia.

The most striking image of the market was outside, where a huge line of sharks were lined up outside; I can only assume for transport, since nobody seemed to be buying them. While it appeared that were once on ice, the ice had since melted, so it felt like I had walked out into some strange land where dead sharks are a natural feature on the pavement. I couldn't help but snapping a few photographs, and some of the locals (who had also been photographing them) started a conversation with me. Apparently it's this busy every day, and that if I think it's hot now, I should try coming back in August!

From the fish market I wandered along the foreshore, which seems to be an extremely popular location if you're male and from south asia. I got to see the port and some large cargo vessels, but it wasn't particularly scenic. I crossed the road and visited "Gold Mart", since Dubai is renowned for its gold markets.

Gold Mart, as I was to discover, was not the Gold Souk, but a collection of jewellery stores. At this point I would discover that a great many store owners thought I might like to buy a watch, or a belt, or sunglasses, or numerous other items that I wasn't interested in.

I left the Gold Mart, and a guy by the door assured me that he had the greatest collection of pirated and counterfeit goods I could wish for. I walked down the street, and at every corner I was offered a fake rolex for sale. I eventually found the Gold Souk, which really is awesome, but I could hardly move without someone approaching me with offers of counterfeit merchandise. To the vendors' credit, they were always very up-front about the lack of authenticity.

The Gold Souk is home to the world's "heaviest gold ring", which is a glittering monstronsity that weighs about as much as I do. It also really does have a massive amount of gold on sale, in the form of ingots, chains, rings, bracelets, necklaces, earrings, and many other forms. It was very sparkly.

From the Gold Souk, I made my way back to the creek, and discovered a stall specialising in perfumes and incenses. As my mother-in-law put in a special request to bring her back some frankincense, I took the opportunity to investigate. I could get a small amount for 5 dirhams, a reasonable amount (100g) for 15, or a huge amount (500g) for 55. I opted for huge, and haggling, and got the price down to 45 dirhams, about $15 for 500g. I actually have no idea if that's a good price, and probably should have haggled more.

With the frankincense in my inventory, and the hope that I can bring it through customs in my head, I caught another water taxi across the river, and walked back to my hotel. On the way, I discovered an Internet cafe close to my hotel that assured me I could plug in my laptop, at the rate of 10 AED/hr (about AUD $3.30/hr). While that's more expensive than downtown Bur Dubai (2 AED/hr, or 4 AED/hr if you want a seat), it's a lot less expensive than the paid hotspots (15 AED/hr), and considerably cheaper than the hotel (35 AED/hr). I suspect I'll be visiting that cafe a lot.

My day ends with blogging, coffee, and a soak in the bath. With Day 1 of Dubai over, I've walked somewhere in the realm of 15km, and spent about 100 dirhams (about $35 AUD), excluding the hotel. Tomorrow, I plan to visit the museum early, and then head south to new Dubai.

Saudi Arabian Adventures - Day 0
The events in this entry occurred on the 11th/12th June

At the start of this year, Kirrily "Skud" Robert made a remark about new year resolutions that are easy and fun to keep. As an example, she included "never turn down an adventure".

While I'm not one to make (or keep) new year resolutions, this one stuck in my mind as a particularly good one to have. While it's certainly been a fun resolution, I disagree about it being easy to keep. It's this particular resolution that had me stripping off to go swimming in waters of unknown depth, quality, and temperature when travelling around Tasmania with Peter, Donna and Jacinta after Linux.conf.au this year.

The same resolution of "never turn down an adventure" now has me in Saudi Arabia, giving a Perl course to the world's largest oil company. It would have been easy for me not to be here. As it happens, I arrived only a day before my entry visa expired. The amount of legwork required to set up a trip like this for the first time is quite considerable, and actually started back in Feburary! So far, it certainly has been an adventure.

It started with my flight from Dubai to Dammam. Emirates was kind enough to upgrade me to business class, which was nice, and meant a very comfortable flight. At the end of the flight I leisurely strolled off the plane and through the airport, looking at the scenery and taking my time. When I rounded the last corner, I immediately realised I had made a terrible mistake. Despite the flight having lasted only an hour, I had flown internationally, with hundreds of other people. There would be passport control and customs. These things are rarely quick, and one really wants to be at the front.

I found myself about three-quarters down the back of a queue, with only a small number of passport control officers. I noticed that processing each person took a long time, maybe five minutes or more, as they needed document checks, and fingerprints, and photographs, and sometimes a short interview, and (if they looked unwell) a check by doctors concerned about swine flu. It was about 10pm at night, and after counting the people in front of me, and doing some maths, I estimated I would be through passport control at approximately 2am!

As luck would have it, another passport control officer was put on duty, and I managed to get through customs after only a three-and-a-half hour wait. There was then a rather ominous moment of me realising that while there were lots of drivers waiting with signs and people's names, none of them held my name. Luckily, my driver had only gone to get a cup of tea (quite understandable after 3.5 hrs waiting!), and we met after only a few minutes of me wandering about looking lost.

After chatting a bit with the driver, I must admit that I slept most of the trip to the hotel. It seemed to involve the single longest stretch of road possible; I woke up a few times, and we were still on the same highway. It also had what I could only describe as christmas-tree lights strung along the edges (so one didn't drive off into the desert), and all the electronic signs (eg, roadwork ahead) were animated in such a way that if one ever appeared in my web-browser, I would immediately add it to my block-list.

After going through a number of security checkpoints (which I would later learn are required for all entry and exits to the Aramco campus), I finally arrived at my hotel. This felt like being in America; it had American power points, all the light-switches were the wrong way around, and the lamps have these funny knobs that I keep turning the wrong way.

At this point, most people would fall asleep, exhausted. However I'm equipped with the geek version of Maslow's hierarchy of needs, so the first thing I did upon arriving was wake up the poor reception staff so I could be connected to the wireless network, and dent/tweet that I had arrived.

Dubai stopover
I'm in Dubai for a 10 hour stopover between flights, and I'm loving it already. Having come from a very cold, very wet, and very dark Melbourne, having a world that's bright and warm and humid is just fantastic. I'm itching to get to the beach, or walk across the desert, or just go exploring generally. I've already done some of that in my local area, but I can't go too far as I still need to get back in time to catch my flight.

Of course, getting into Dubai wasn't all fun and puppies. The flight was fourteen hours long, and while I had brought along sleeping tablets, they seemed to work better at dulling my thinking while awake rather than helping me sleep. I don't remember sleeping on planes being anywhere near this bad for my trips to the USA, but then again those trips were done without me sleeping the night before.

Besides trouble sleeping, my biggest oops was forgetting that I had brought two bags with me, rather than one. Luckily, the helpful Emirates staff were able to find my errant luggage, and since Dubai airport has free wifi, I was happy to wait.

Customs seemed very relaxed, and while I was selected for 'additional screening', that mostly consisted of chatting to the friendly guard about how much extra battery life my laptop can get from my external battery. The best part was after the security guard asked me to "step this way", he acknowledged that I had been on a flight for 14 hours, and so if I wanted to duck out for a smoke, that would be perfectly okay. He looked very disappointed when I said that I didn't smoke, and in hindsight he may have been looking for an excuse to go to the smoking area. ;)

Currency conversion rates at the airport are nowhere near as bad as they are in Australia, at least when converting from Aussie Dollars to Saudi Riyals and UAE Dirhams. Overall about 5% of my money went on currency conversion, whereas in Australia it was hard to find anyone who'd sell Riyals for less than 10%, plus waiting times.

The food so far has been excellent. The aircraft food was tasty (for aircraft food) and bountiful. Emirates has given me a hotel (quite spacious) at which to stay between my flights, and the hotel comes with lunch (a huge buffet), dinner (an even bigger buffet), and a "snack" (which looks like it's really "second lunch"). The food is really good, there's a fantastic vegetarian selection, and the service is excellent. I can wholeheartedly say that I like the airport hotel. ;)

My only problem with the hotel is that there are no tea or coffee making facilities. That's not a big downside, since I can always walk downstairs with my "snack" voucher and be given a half dozen cups of coffee, a pudding, a huge slice of cake, some very nice freshly made creme caramels, and assorted morsels to "fill in the edges".

Prices in touristy places seem about on-par with prices in Australia. Prices outside of touristy places vary in my short experience with them. I went to a supermarket to refresh a few supplies, and found fresh fruit and vegies at about the same prices in Australia. However the cans of coke and associated soft-drinks in the "impulse buy fridge" were only 1 AED each, which is about $0.33 AUD. Coffee at the airport is the most surprisingly expensive, at the equivalent of $7 AUD per cup!

Most ironic experience today was one of the locals pulling up in his car and asking me for directions to the hospital. Oddly enough, I could give them, as I'd walked past the hospital on the way from my hotel.

I'm now just about to hop on a flight to Saudi for my assignment teaching Perl. I may be out of Internet range for a while.

Teaching Perl in Saudi Arabia After what seems like an almost endless amount of paperwork, visa applications, immunisations, negotiations, contracts, travel agents, and administrivia, I'm about to fly to Saudi Arabia, to teach Perl to the world's biggest oil company.

Why are they learning Perl? Well, as best I can tell, they're using it for data munging of geological data. That's got a familiar ring to it, in fact I've been seeing a big growth of Perl in Geoscience recently.

On the way back I'm planning to spend a couple of days in Dubai, just because it sounds like such a bizarrely opulent part of the world. World's biggest hotel. World's biggest indoor ski slope. World's biggest shopping mall, and certainly the closest thing we have to Magrathea, with Dubai creating artificial islands in the shapes of palm trees and the world itself. I also hear the diving is pretty good.

My strange working habits
After far too long on the road, I've been in Melbourne for a whole week. In theory, I get to spend at least another 10 days here before my next flight, which (provided the last piece of paperwork gets signed) will be to Saudi Arabia.

This week, when it comes to interesting FOSS stuff, I've done absolutely nothing. What I've discovered is that when I'm on the road, I keep squeezing in bits of work around the edges. A lot of my coding gets done in departure lounges, and for my last trips to Canberra, on a bus. However when I'm home, I can relax. I can sleep in, be comfortable, and have long, drawn-out breakfasts. I have friends, real ones, that I can see and spend time with. In short, I have all the things of which I've been completely deprived while travelling.

While this is great for recharging my batteries, it's not great in terms of deliverable productivity. If you're waiting on me to complete or review a piece of code, you have my most sincere apologies. Feel free to keep nudging me, it does help.

565 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!