Fog Creek Software
Discussion Board




Estimation Amusement

Hi all,

Task: create a SQL Server table containing all iso codes and country names. How much time would this take? I have no idea. Don't know if I will find a script that already does this online. Or will have to input it manually/automagically.
I completed the task in 10 minutes and was amused! I sincerely never thought it could be so fast. My solution:
- search on google for country iso codes
- read the third result,  a table from the ISO itself
  http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html
- from IE, choose to edit the page in MS Word
- from Word, copy the table columns to Excel
- write a simple Excel formula to create the query commands

Hereby lies the trouble of estimation. It depends on the skills, knowledge and even luck of the person responsable for the task...

Have you guys experienced such a thing? Having a task that you thought would take hours or even days to solve, completed in minutes?

Mauricio Macedo
Tuesday, May 18, 2004

Absolutely, then I have a task I think is short that takes a week :).

That's part of the point behind fine grained estimation.  The more detailed you get, the more those things are likely to balance out.

Chris Kessel
Tuesday, May 18, 2004

Even easier: choose 'edit in Excel' from the toolbar (from the dropdown). Excel 2003 lets you pick the table to import. (I think older versions did a cruder but still functional job.)

BTW, there's also a fair bit of data in XML done by the UN. The ISO country codes are there.

http://www.unece.org/etrades/unedocs/codelist.htm

On estimation... the problem with fine grained estimation is that it's expensive. Often valuable, but if your SWAG estimates end up averaging out to correct, all is well. The problem is if the whole task is estimated at 2 weeks, and one item blows up to 3 weeks, even if the rest drop to 1 day you've blown the estimate.

mb
Tuesday, May 18, 2004

Yep, I had to modify a device driver that two people had looked at before (for months) but had gotten nowhere with. This was the first time I looked at a device driver (hadn't even compiled one before), yet I had the problem solved within an hour or two of first looking at the source code.

My boss was very happy. :)

sid6581
Tuesday, May 18, 2004

Of course, that's the right job for perl. Oh, how I love perl!

use warnings;
use strict;

use LWP::Simple;

my $h = get("http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html");

my @lines = split "\n", $h;

my $flip_flop = 0;

my $country = "";
my $abbr    = "";

my $d = 0;

foreach my $line (@lines) {

  my ($word) = $line =~ m/contentBody">([^<]*)/;

  $word =~ s/ *$// if $word;

  if ($word) {
    $flip_flop = 1 - $flip_flop;
    $abbr    = $word if    $flip_flop;
    $country = $word unless $flip_flop;

    print "insert into t_a_b_l_e (country, abbr) values ('$country', '$abbr');\n" if $flip_flop and $d++ >= 2;
  }
}

René Nyffenegger
Tuesday, May 18, 2004

Bah!

I want to see a one-liner...

Rob VH
Tuesday, May 18, 2004

10 frigging minutes and all that work? :-)

All you had to do was follow the link :

http://27.org/isocountrylist/iso_country_list.sql

Code Monkey
Tuesday, May 18, 2004

*  Recent Topics

*  Fog Creek Home