Tuesday, September 20, 2011

Crossing Third Bridge in Moremi, Botswana

Thank you Roger Beeckman for shooting and sending me this great picture of our Third Bridge crossing!
A while later Roger had to help out another self-driving couple who got stuck in the sand.

As a first timer, I'm proud that we never got stuck ourselves (at least not in the sand, but that's a different story) ...

Bridge washed away in Botswana

This is why we couldn't travel from Toteng to Maun, on the 'normal' road:

For the local pedestrians, some people had improvised a ferry:

Tuesday, August 23, 2011

Preparing for our Safari in Botswana

Busy entering waypoints into the Garmin GPS, here's where we're going: 
 
With a tented 4x4 that Bushlore is going to deliver to us in Kasane, we're going camping during our two week safari in and aroung the Okavango Delta. Hans (owner of Come Along Safaries) provided excellent help in organizing our trip, and was so kind to make the Garmin available to us.Without his help, I would never have been able to organize all this myself. If ever you have plans yourself go and use him, serious.

Here's some video (sorry for the google ad):


Will be posting more once we're back... (and we're back!)

Wednesday, July 6, 2011

Wie zit ernaast, NOS of CBS? Of misschien ikzelf?

Beste NOS,

Bij het lezen van een bericht op nos.nl (dit bericht: http://nos.nl/artikel/253897-bevolking-groeit-naar-166-miljoen.html) kreeg ik spontaan de neiging even de StatLine toepassing op het CBS te gebruiken. Ik vind StatLine (en hun gelijknamige iPhone app) een geweldige toepassing.

Tot mijn verbazing lukte het mij niet om de cijfers van het NOS artikel te matchen met die uit de StatLine toepassing van het CBS (http://statline.cbs.nl).

Ik zal proberen het punt voor punt toe te lichten.

Punt 1:
De NOS zegt: "De Nederlandse bevolking is de eerste 10 jaar van de eeuw met 700.000 mensen gegroeid tot 16,6 miljoen inwoners. Dat blijkt uit cijfers van het Centraal Bureau voor de Statistiek (CBS)." Dit is volgens mij onjuist.

In mijn beleving omvat de periode "de eerste 10 jaar van de eeuw" de volgende jaartallen: 2000,2001,2002,2003,2004,2005,2006,2007,2008 en 2009). Op 31-dec-1999 bedroeg de totale bevolking 15,865,950 mensen. Op 31-dec-2009 waren dat er 16,574,989. Het verschil is 711,039, niet 700,000.

Enfin, wellicht is 700 gemakkelijker om te lezen dan 711. Ook is het mogelijk dat de NOS per ongeluk 2001 t/m 2010 hebben genomen als periode, maar in dat geval is de groei 667,904 en dus niet 700,000.

Punt 2:
De NOS zegt: "Migratie speelde in Nederland relatief een kleine rol: 22 procent van de groei komt door migratie...". Dit is volgens mij ook onjuist, want de rol is beperkt tot 15%. In de totale periode zijn 1,077,974 mensen ge-emigreerd en 1,186,197 mensen ge-immigreerd. Totale saldo bedraagt dus 108,223 mensen (meer immigratie dan emigratie dus),  Op een totale bevolkingsgroei van 711,039 is dat 15.2% en niet 22%.

Waarschijnlijk maakt de NOS een denkfout want als we kijken naar het aandeel van geboorteoverschot t.o.v. de bevolkingsgroei, dan kom ik uit op 78%. De NOS concludeert dat de rest dan maar toegeschreven moet worden aan migratie, maar dat klopt niet. Als ik de cijfers voor migratie-saldi en geboorteoverschot bij elkaar optel, kom ik namelijk niet uit op de groeicijfers die het CBS publiceert. Gemiddeld mis ik een paar duizend mensen per jaar, en een totaal van 49,270 over de gehele periode 2000 tot en met 2009.

Ik zet het maar even op een rijtje:
                                   Aantal       Percentage
Migratie Saldo            108,223         15.2%
Geboorteoverschot      553,546         77.9%
Missende cijfers           49,270           6.9%

Totale Groei                711,039        100.0%




De spreadsheet met raw data is hier: https://spreadsheets.google.com/spreadsheet/ccc?key=0ArbwWe2DZHaNdGxnZUlVZmk4Unc3VENHbURkMTBzaEE&hl=en_US 



Ik ben werkelijk benieuwd wie mij kan uitleggen waarom 6.9% van de groeicijfers lijkt te ontbreken.









Friday, June 17, 2011

Fixing a complex corruption in PostgreSQL

Since many years, we have been using PostgreSQL as the backend to our DNA Analysis solution. And very successfully so; we now have approximately 10TB of statistics in almost 500 schema's.

In order to backup a particular schema or table, we use pg_dump. However, this week it started to produce a nasty error, see below:


THE PROBLEM:
C:\Program Files\PostgreSQL\8.3\bin
>pg_dump -f c:\tmp\out.back -i -F p -v -a -h d2host -t ibmmat0001_sta.sta_db d2dna
pg_dump: reading schemas
pg_dump: reading user-defined functions
pg_dump: reading user-defined types
pg_dump: schema with OID 2613175388 does not exist
pg_dump: *** aborted because of error

With the help of google, I soon discovered we may have a corruption in one of the vital tables: pg_class.
Analyzing the problem, I first identified which tableor schema we have an issue with:
executing "select oid, * from pg_class where oid = 2613175388" shows we're dealing with a table named ls_tmp1. I know we have some of these tables in several schema's.

Next, I executed "select * from pg_tables where tablename = 'ls_tmp1'". The result is shown in the screendump below:
Notice how the troubled table does not belong to a schema (it should!). Hence the trouble reported in the pg_dump.

THE SOLUTION:
In order to repair this corruption, I created a new schema named "for_corrupt_table."
I then looked up the OID for this newly created schema.
create schema for_corrupt_table;  -- its oid became: 2613195672
Next I updated the relnamespace column to make this troubled table point to the new schema:
update pg_class set relnamespace = 2613195672 where relnamespace = 2613175388

Refreshing my pgadmin window revealed the new schema and the existing table.