Friday, May 29, 2009

Riyadh's Temperature Tales



Temperatures are going nuts here, even by Riyadh's hellish standards. Temperature readings are displayed all over the city (there is a law that when it hits 500 celcius, all outside work must stop). This was May 29th, 2009!



Sunday, May 17, 2009

Jeddah: Beauty and Beastliness




...side by side. The town, the city centre of Jeddah, is lovely, if a little crowded: it reminds one of Mombasa's Old Town.
The roads are just as narrow (compared to the wide lanes filled with large American cars moving at frightening speeds, in Riyadh), but the cars are not quite as large: you dont see so many GMCs or Fords as you do in Riyadh. Perhaps it is the age of the town and the nature of those settled here: Jeddah is an old trading port, and the kaleidoscope of faces one sees in the streets is testimony to the city's age and its cosmopolitan nature.

Unlike Riyadh, too, it has had the time to mature, and the social sediments are clearly visible in Jeddah's neighbourhoods, from the wealthy suburbs up North to the slums south of the city, closer to the port.
There is an unhurried elegance about doing things, perhaps a consequence (and characteristic?) of being a seaside town: at the airport, there is only one check-in clerk serving hundreds of harassed passengers. His attitude to queues is interesting: if your flight is nearly due, you move to the front of the queue!

There is also lots of poverty in Jeddah. To the South of the town, paperless immigrants - mainly from Somalia, Sudan and Yemen - perster everyone for alms. In a society with a notorious affinity for officialdom and the attendant need for papers of all sorts, they are invisible to the government, if not quite non-existent. They sleep under the enormous road interchanges or in rundown buildings, and defecate on the pavements at night: you will see the unwelcome results of such an existence should you drive past these places early in the morning, before the municipal council trucks arrive to clean up the mess.

But there is little doubt that one is in Saudi Arabia: examples of centrally-planned extravagance abound, from the Jeddah Fountain - a gigantic articifial geyser in the sea, just off the coast - to the Jeddah Corniche, a lovely stretch of beach where people mingle freely and lovers even have the temerity to hold hands and share a meal in public - in Saudi Arabia!


While prayer times are generally observed, there isn't the stultifying compulsion to close businesses when the Muezzin calls, as one finds in Riyadh: I wandered into a restaurant on the Corniche at prayer time, and no one seemed to care. It remained open throughout the prayer.

The beaches are absolutely astonishing: mile after mile of pristine public sand where anyone can go anytime. None of the "this is a private beach" notices one runs into all over the "free" world: here, the beach belongs to everyone. Sure, they get dirty in the evenings, when everyone comes over for a drink and a meal, but who cares when vistas like these are the reward?

I love Jeddah!



















Wednesday, April 29, 2009

The Evolution of a Programmer!

From the folks at Ariel, by way of Stumbleupon:

First year in College

  program Hello(input, output)
begin
writeln('Hello World')
end.

Senior year in College

  (defun hello
(print
(cons 'Hello (list 'World))))

New professional

  #include <stdio.h>
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;

for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}

Seasoned professional

  #include <iostream.h>
#include <string.h>

class string
{
private:
int size;
char *ptr;

string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}

~string()
{
delete [] ptr;
}

friend ostream &operator <<(ostream &, const string &);
string &operator=(const char *);
};

ostream &operator<<(ostream &stream, const string &s)
{
return(stream << s.ptr);
}

string &string::operator=(const char *chrs)
{
if (this != &chrs)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
}
return(*this);
}

int main()
{
string str;

str = "Hello World";
cout << str << endl;

return(0);
}

Master Programmer

  [
uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
]
library LHello
{
// bring in the master library
importlib("actimp.tlb");
importlib("actexp.tlb");

// bring in my interfaces
#include "pshlo.idl"

[
uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
]
cotype THello
{
interface IHello;
interface IPersistFile;
};
};

[
exe,
uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
]
module CHelloLib
{

// some code related header files
importheader(<windows.h>);
importheader(<ole2.h>);
importheader(<except.hxx>);
importheader("pshlo.h");
importheader("shlo.hxx");
importheader("mycls.hxx");

// needed typelibs
importlib("actimp.tlb");
importlib("actexp.tlb");
importlib("thlo.tlb");

[
uuid(2573F891-CFEE-101A-9A9F-00AA00342820),
aggregatable
]
coclass CHello
{
cotype THello;
};
};


#include "ipfix.hxx"

extern HANDLE hEvent;

class CHello : public CHelloBase
{
public:
IPFIX(CLSID_CHello);

CHello(IUnknown *pUnk);
~CHello();

HRESULT __stdcall PrintSz(LPWSTR pwszString);

private:
static int cObjRef;
};


#include <windows.h>
#include <ole2.h>
#include <stdio.h>
#include <stdlib.h>
#include "thlo.h"
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"

int CHello::cObjRef = 0;

CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk)
{
cObjRef++;
return;
}

HRESULT __stdcall CHello::PrintSz(LPWSTR pwszString)
{
printf("%ws
", pwszString);
return(ResultFromScode(S_OK));
}


CHello::~CHello(void)
{

// when the object count goes to zero, stop the server
cObjRef--;
if( cObjRef == 0 )
PulseEvent(hEvent);

return;
}

#include <windows.h>
#include <ole2.h>
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"

HANDLE hEvent;

int _cdecl main(
int argc,
char * argv[]
) {
ULONG ulRef;
DWORD dwRegistration;
CHelloCF *pCF = new CHelloCF();

hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

// Initialize the OLE libraries
CoInitializeEx(NULL, COINIT_MULTITHREADED);

CoRegisterClassObject(CLSID_CHello, pCF, CLSCTX_LOCAL_SERVER,
REGCLS_MULTIPLEUSE, &dwRegistration);

// wait on an event to stop
WaitForSingleObject(hEvent, INFINITE);

// revoke and release the class object
CoRevokeClassObject(dwRegistration);
ulRef = pCF->Release();

// Tell OLE we are going away.
CoUninitialize();

return(0); }

extern CLSID CLSID_CHello;
extern UUID LIBID_CHelloLib;

CLSID CLSID_CHello = { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */
0x2573F891,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};

UUID LIBID_CHelloLib = { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */
0x2573F890,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};

#include <windows.h>
#include <ole2.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "pshlo.h"
#include "shlo.hxx"
#include "clsid.h"

int _cdecl main(
int argc,
char * argv[]
) {
HRESULT hRslt;
IHello *pHello;
ULONG ulCnt;
IMoniker * pmk;
WCHAR wcsT[_MAX_PATH];
WCHAR wcsPath[2 * _MAX_PATH];

// get object path
wcsPath[0] = '\0';
wcsT[0] = '\0';
if( argc > 1) {
mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
wcsupr(wcsPath);
}
else {
fprintf(stderr, "Object path must be specified\n");
return(1);
}

// get print string
if(argc > 2)
mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
else
wcscpy(wcsT, L"Hello World");

printf("Linking to object %ws\n", wcsPath);
printf("Text String %ws\n", wcsT);

// Initialize the OLE libraries
hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);

if(SUCCEEDED(hRslt)) {


hRslt = CreateFileMoniker(wcsPath, &pmk);
if(SUCCEEDED(hRslt))
hRslt = BindMoniker(pmk, 0, IID_IHello, (void **)&pHello);

if(SUCCEEDED(hRslt)) {

// print a string out
pHello->PrintSz(wcsT);

Sleep(2000);
ulCnt = pHello->Release();
}
else
printf("Failure to connect, status: %lx", hRslt);

// Tell OLE we are going away.
CoUninitialize();
}

return(0);
}

Apprentice Hacker

  #!/usr/local/bin/perl
$msg="Hello, world.\n";
if ($#ARGV >= 0) {
while(defined($arg=shift(@ARGV))) {
$outfilename = $arg;
open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n";
print (FILE $msg);
close(FILE) || die "Can't close $arg: $!\n";
}
} else {
print ($msg);
}
1;

Experienced Hacker

  #include <stdio.h>
#define S "Hello, World\n"
main(){exit(printf(S) == strlen(S) ? 0 : 1);}

Seasoned Hacker

  % cc -o a.out ~/src/misc/hw/hw.c
% a.out

Guru Hacker

  % echo "Hello, world."

New Manager

  10 PRINT "HELLO WORLD"
20 END

Middle Manager

  mail -s "Hello, world." bob@b12
Bob, could you please write me a program that prints "Hello, world."?
I need it by tomorrow.
^D

Senior Manager

  % zmail jim
I need a "Hello, world." program by this afternoon.

Chief Executive

  % letter
letter: Command not found.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout


Tuesday, April 28, 2009

God wears number 11

...and lives at Old Trafford! 



Manchester United
Premier League (10): 1992–93, 1993–94, 1995–96, 1996–97, 1998–99, 1999–2000, 2000–01, 2002–03, 2006–07, 2007–08
FA Community Shield (7): 1993, 1994, 1996, 1997, 2003, 2007, 2008
FA Cup (4): 1993–94, 1995–96, 1998–99, 2003–04
Football League Cup (3): 1991–92, 2005–06, 2008–09
UEFA Champions League (2): 1998–99, 2007–08
UEFA Super Cup (1): 1991
Intercontinental Cup (1): 1999
FIFA Club World Cup (1): 2008

Individual
PFA Player of the Year: 2009
PFA Young Player of the Year: 1992, 1993
Bravo Award: 1993
BBC Wales Sports Personality of the Year: 1996
Sir Matt Busby Player of the Year Award: 1997–98
Intercontinental Cup Man of the Match: 1999
Premier League Team of the Decade: 2003
English Football Hall of Fame: 2005
Wales Player of the Year Award: 1996, 2006
FA Premier League Player of the Month: September 1993, August 2006, February 2007
PFA Team Of The Century: 2007
PFA Team of the Year: 1993, 1994, 1995, 1996, 1998, 2001, 2007, 2009
Only Manchester United player to have played in all ten Premier League-winning teams and only player to win 10 league titles
Only Manchester United player to have played in all three League Cup-winning teams
Only player to have scored in eleven consecutive Champions League tournaments
Only player to have scored in thirteen different Champions League tournaments
Only player to have scored in every Premier League campaign since its inception

Orders and special awards
OBE for services to football.
Awarded an honorary Master of Arts degree from Salford University on 15 July 2008 for contributions to football and charity work in developing countries.

Tuesday, April 7, 2009

Cairo!!

The plane banks steeply, and the river Nile comes into full view from my little pothole of a window. It is a massive plane – there is an upstairs cabin, and I was unlucky not to go up there. I wanted to go upstairs and perhaps see the world – at least that in a modern airliner – from a slightly different perspective to that I am used to.
The picture below is an interesting and contrasting one: there are signs of a Marxist, command-and-control planning system – perhaps a left over from the days of Gamal Abdel Nasser and his dalliance with the Soviets back in the 1960s, after the West stymied him over the Aswan Dam in the wake of Suez – as well as indications of a modern, free-market city. The uniform, soviet-style flats contrast sharply with the modern skyscrapers that reach for the sky and proclaim that this is a modern reincarnation of Cairo, that most ancient and significant of African settlements.
As we descent into Cairo, relief floods into the plane – the ride from Riyadh has been a slightly harrowing one. Riyadh has recently been buffeted by alternating rain and dust storms, and the corollary of these is a generally bumpy flight, made all the worse by the lady in the seat in front of me – or rather, her very audible fear of flying.
I first noticed her at take-off. As the plane’s wheels left the ground and the familiar, giddy pit-of-the-stomach feeling went all around, she screamed. And then she screamed again. I could see that everyone in the plane was taken aback at that: while extreme reactions to flight are common, a cabin-renting scream from an adult is not your usual expression of air-sickness.
It turned out to be a serious fear: every time we hit turbulence or the plane descended too swiftly, she would let out a piercing, agonising wail. Anger at her behaviour turned first to pity, then to sympathy. I imagined what she must be going through, and thought she must be really brave to fly despite all that fear. And so when we land in Cairo, I am relieved for myself as much as for her. For both of us, the ordeal is over.
Cairo International Airport is a surprise – and is not a surprise. For an African used to colonial infrastructural left-overs, the airport is home territory. It is designed around a huge, circular centre, and the yellow neon signs that point out the various departments and desks are old and falling apart. As we enter the airport building, I am surprised to see the sheer number of police and security personnel: they are everywhere. There is a pervasive sense of being watched, of being under the eye of something, someone, everywhere. The policemen are nice and indulgent, however, and some of them lean against the airport walls, smoking out of sheer boredom. Everyone says hello, and a proffered “Salaam Aleikum” is responded to with enthusiasm. It feels just like Riyadh, in that sense.
The airport has lots of disused facilities on the inside: padlocked doors line the corridors, all painted a drab grey. This is not Dubai or Qatar, evidently: the emphasis here is very much on a lack of emphasis on anything, on a nondescript presence, on a vagueness of being. Egypt might be a regional powerhouse, but they do their best to make this fact unnoticeable.
And the airport staff are underpaid and openly corrupt. Mohammed, the guy at the transit waiting area, affects a bored glance at my papers. “Wen visa, Sheikh?” he asks me, without even looking at my papers – which declare that I do not need the transit visa he is asking about. He smiles and points to a seat next to him – there is no one else around, just me. I take the seat, and the monumental task that has long puzzled cryptographers and linguists alike immediately makes itself felt: how to communicate effectively without extensive knowledge, on both sides, of a common language?
But we somehow get by – and along. I quickly gather that Mohammed is a fan of Zamalek, does not like the idea of Gamal Mubarak taking over from his father, Hosni, as president, and is underpaid p0 earning a mere US$ 200 a month working as an airport desk attendant. “I hear Riyadh is better”, he says wistfully. I have no reply.
A few minutes into our conversation, a suave young dude in a suit and gelled hair drops by. He speaks excellent English – and lets me know that a bus driver is on the way to pick me up and deliver me to the Egypt Air terminal, where my connecting flight awaits. Sure enough, within a few minutes, Kamal drops by and grabs one of my bags. Shortly, we are on the bus – just me and Kamal – and headed for Terminal One.
Which is VERY far away from the arrivals terminal! On the bus, Kamal informs me that he has a few daughters, and cannot find husbands for them. That times are hard in Egypt. Can I spare him a few Riyals?
I can. Mogy has sent me some airtime, so I can afford the odd Riyal – I pass him a small tip, and he appreciates. But what really captures my attention is the wastage around the airport. Broken-down buses and general mechanical carnage litters the airport. This is Africa! It is like a ministry compound somewhere anywhere between Lagos and Nairobi: the same wastefulness, the same little regard for assets, the same don’t-care attitude. It never falls very far from the tree, does it?
Terminal One is a relaxed affair. There is a noisy group of Nigerians waiting for a Kano flight, and one is indignant. “Ich liebe in Vienna”he shouts to no one in particular. Who gives a rat’s? In a breeze, I am through the formalities, and am seated at this table, writing this rant. A cop watches over everyone all the time, moving a few paces left and right but generally staying put. Who wants to mess with Egypt?
In the lounge, the same uneasy modern/ancient juxtaposition assails you. There are half-hearted souvenir shops selling Nefertiri heads and fake Anubis statues. One man urges me to buy a King Tut statuette for my kid. When I ask him about the Curse of King Tut, he looks at me blankly. That’s Egypt for you...
There are lots of Asian tourists – mainly Chinese and Japs – around the terminal. This is their first experience of Africa, likely. A lady from Egypt’s Ministry of Tourism ambles by, and asks me if I am interested in filling out a survey about her country. I decline, and she waddles off, disappointed. I turn to my cappuccino and take a long, hard sip. Just a few hours more to home!

Thursday, February 19, 2009

Big Up Kubwa - Wahu's Sweet Love is rather Special...

Yeah, you guessed it - niko homesick. Enjoy...


Tuesday, February 10, 2009

Fog of the season's end?


The Riyadh winter was behaving rather well - temperatures were up to 22 celcius. Then a deluge, a few days ago. And now a freezing fog this morning. Weird.