Plusnet
Sunday 22nd November 2009 Login | Register

End of Day: 6th October

October 6th, 2008 at 17:43 by Tamlyn Rhodes

Sorry, we’ve only really got two departmental reports today. But to make up there’s a special challenge at the end.

Colin was in late and is leaving early to go to bed. But while he was here he did some roll-outs and other bits and bobs. Mark’s been continuing his work on the text for the upgrade process and Grzegorz has been making banners for the forthcoming My Account beta trial. James had a nightmare this morning when his graphics card melted and spent much of the day sorting that out. Then he spent the rest of the day bragging about how superior his new jet black dual core box is. Meh. Dan and I have been working on improvements to our intranet and everyone else has already gone home!

Richard from the Customer Support Centre:

A busy day as usual on a Monday, especially so as everyone has gone back to work, including MPs after the summer recess. I’m definitely in the wrong job!

We’ve had our usual number of new fault reports, advising customers on the initial checks to ensure that the fault requires further investigation here, and also updates on existing fault reports. We are still catching up on the recent delays in getting our new Thomson routers out to new and existing customers, but we seem to be over the worst, and the CSC are starting to get used to supporting the new models. We have had quite a few sales calls from prospective new customers, and also those who are ready to go through the sign-up process – the fun starts when helping to choose the new username and password! Quite a few billing queries, mostly related to expired credit or debit cards – our system is good but it’s not psychic – it needs to be told the new card details.

Ryszardfrom Development:

Mmmm, I’m on holiday (ish) for a week as of tomorrow, so this’ll be the last Dev EOD from me until then. To help you celebrate, I won’t regale you with tales of departmental happenings. Instead, wired on the sugar from yet another bag of Haribo sat dangerously close to my desk, let me set you all a programming challenge.

Extract the list of countries from this page in Wikipedia into a text file, one line per country, starting with Abkhazia and finishing with Zimbabwe. Call it countries.txt.

Then, in one line in whatever programming or scripting language you want, parse countries.txt and print out the countries in the list where the uppercase version of the name is comprised entirely of characters with no enclosing loops. So no Bs, Ps and so on. CHILE would be one.

Best solution wins a bag of Haribo, and you have until I get back from holiday. Enjoy (or not!)

Tamlyn

This entry was posted by Tamlyn Rhodes on Monday, October 6th, 2008 at 5:43 pm and is tagged with and is posted in the category EOD. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


7 comments on "End of Day: 6th October"

Ben

Ok, as nobody has attempted it yet.. My solution (which doesn't require you extract the website into countries.txt) is...

curl -s http://en.wikipedia.org/wiki/List_of_countries | grep 'flagicon' | perl -lne 'if($_ =~ /<a href=".+" rel="nofollow">([^ABDOPQR1-9]+)/i) { print $1; }'

Running it gives:

Chile
Fiji
Liechtenstein
Niue
Seychelles
Yemen

:-)

Ben

Revised attempt:

curl -s http://en.wikipedia.org/wiki/List_of_countries | grep 'flagicon' | perl -lpe '$_ =~ s/.*<a href=".+" rel="nofollow">([^ABDOPQR1-9]+).*/$1/i' | grep -v 'flagicon'

That's a true one liner now (doesn't require what is TECHNICALLY multiple lines of perl!)

simonw

Ok, I'll bite. I've not pulled the data down from wikipedia, but here's my simple solution for parsing the file,

$ cat countries.txt | tr '[:lower:]' '[:upper:]' | egrep -v 'A|B|D|O|P|Q'

If your sed/awk skills are better than mine you can do the whole task inc the screen scrape in one line.

simonw

Neither of Ben's submissions work for me, I just get a empty response :/

... and I missed 'R'. Fail.

Kelly

There was a problem with him posting anchor tags where wordpress ate them a bit. I tidied them, but I'm not 100% sure that I didn't break them...

MuppetGrinder

erm...just idle curiosity, but is the objective to print to screen or print to printer?

Kelly

the examples above print to the screen, but it probably wouldn't be very hard to get to them to print to the printer.

Add a Comment




Photos

photo photo photo photo photo photo

View More

Forums

Users online: 79

  • Total Topics: 80032
  • Total Posts: 658585
  • Total Members: 11768

Visit the Forums

Plusnet

Force9

Metronet

Free-Online

Madasafish

PAYH

Just The Name

Related Sites

Community Apps

Here at Plusnet we're always trying to use clever open source things to make our lives easier. Sometimes we write our own and make other people's lives easier too!

View the Plusnet Open Source applications page

About Plusnet

We sell broadband, phone, VoIP and more to homes and businesses in the UK. Winner of 9 out of 11 Categories in the 2008 USwitch survey. Winner of "Best Consumer ISP" at 2008 ISPA awards. Voted number 1 in the Broadband Choices 2008 survey.

© Plusnet plc All Rights Reserved. E&OE

Community Site News is powered by WordPress

Add to Technorati Favourites