Log et al – Peter Curd

An irreverent peek into the inner rumblings of Peter Curd

Jul

25

Twitter Weekly Updates for 2010-07-25

By pcurd

Powered by Twitter Tools

Jul

18

Twitter Weekly Updates for 2010-07-18

By pcurd

Powered by Twitter Tools

Jul

11

Twitter Weekly Updates for 2010-07-11

By pcurd

Powered by Twitter Tools

Jul

4

Twitter Weekly Updates for 2010-07-04

By pcurd

  • Watching the #worldcup so I'll have something to talk about tomorrow… Come on #eng – show the foreigners why we invented the game. #
  • You're not supposed to take the bloody corner flags out! #eng #worldcup #
  • Noooooooo! #eng #worldcup #
  • Why the hell are #eng not watching the bloody ball! Get in the middle and STAY THERE! #worldcup #
  • Why are #eng letting strikers in front of them?! This is a dreadful match #worldcup #
  • Yes! Yes! Yes! #eng #worldcup #
  • That was in?!?!?!?! WHAT!?!?! #eng #worldcup #
  • That was so far in it had to go through Zim customs! FFS FIFA! #eng #worldcup #
  • #Eng should boycott ALL FIFA membership and matches until they put in goal line technology. Bastards. #
  • That's a lot of well deserved booing #eng #worldcup #
  • RT @NeilRobbins: @seppblatter you should resign. You are bad for football & your decision over goal line technology has been proven wrong #
  • That was too close for my blood pressure #eng #worldcup #
  • What the hell are #eng playing at – they can't even keep 1 player from the goal?! Fools! #worldcup #
  • #eng should be ashamed of their playing – this is not how professionals play. #worldcup #
  • #Eng aren't even trying – there was NOBODY in defense. #worldcup #
  • Much like @beautifulvenice I just caught up on #DrWho All I can say is wow – if contrived. This Doctor is a little too unbelievable. #
  • Good job I didn't go out tonight – got called out onto site to sort something out. Just think of the money.. Think of the money… #
  • RT @simon_sabin: How awesome is this http://bit.ly/czVEBL Why can't the SQL team give us great usability features like this <- IIS Express! #
  • The lesser seen sluttipuss. / @shibbygem http://twitpic.com/211iva #
  • It's not a tweetup but I'm hungry :) (@ Burger King) http://4sq.com/cYHkXn #
  • RT @TheEscapistMag Rumor: Johnny Depp Starring in Doctor Who Movie http://bit.ly/c0GBwh <- Erm.. @shibbygem #
  • RT @shibbygem: Ladies, La Senza is currently like a sweet shop pick n mix, but ya know…with knickers. £1 a pair and only fat bum sizes … #
  • RT @shanselman: LOL RT @InnyVinny start your day off right: http://img13.imageshack.us/img13/8619/2204355.swf #
  • TV business kisses HDMI goodbye – http://bit.ly/cGxWjy @THINQtech #
  • W/ @carocat @saqibs (@ Giraffe Reading) http://4sq.com/5OfoyL #
  • Excellent meal at @giraffetweet #rdg with @saqibs and @carocat. Staff amazing as always! #
  • RT @jephjacques Thanks to computer modeling, scientists have determined that giraffes "could probably swim if they wanted to." @giraffetweet #
  • Plans for a BBQ at my house tomorrow if anyone is interested? @carocat @lukesmith @jhomerston @amykate @fringley etc BYOB/food after 12pm :) #

Powered by Twitter Tools

Jul

1

The FizzBuzz problem

By pcurd

Amy Kimber posted an article today referring to a post from Nick Telford on twitter:

Will The Real Programmers Please Stand Up? http://retwt.me/1NEBw // another example of how diluted our industry really is (link)

This interests me as I often find job interviews to be very generic and after about four in a row you get to know all the answers and appear much cleverer than you perhaps are.  I like a problem that makes you think and although FizzBuzz is a trivial problem, I wanted to answer it with a little bit of real world thinking.

To quote Amy, the FizzBuzz problem is “The idea is simple, all you have to do is write a program that prints out the numbers 1 to 100, but for multiples of 3, print Fizz instead of the number and for multiples of 5 print Buzz. If the number is a multiple of both, FizzBuzz should be printed.”

In the real world, specs change. Today it’s 3 and 5 and tomorrow it’s 4 and 9 and we need to add an extra one “Bibble” for 11.  I decided to solve the problem with a list of number and word pairs so that changing it would be easy.  .Net provides a nice KeyValuePair generic which I used as Int,String.

Originally I had this implemented using a Dictionary but as FizzBuzz must be implemented the correct way around (not BuzzFizz) I needed to change this to a SortedDictionary to ensure order of execution.

Code is as below:

using System;
using System.Collections.Generic;

namespace FizzBuzz
{
    class Program
    {
        static ICollection<KeyValuePair<int, string>> wordlist;
        static void Main(string[] args)
        {
            wordlist = new SortedDictionary<int, string>();
            wordlist.Add(new KeyValuePair<int, string>(3, "Fizz"));
            wordlist.Add(new KeyValuePair<int, string>(5, "Buzz"));
            PrintFizzBuzz(1, 100);
            Console.ReadKey();
        }

        static void PrintFizzBuzz(int start, int finish)
        {
            for (int i = start; i <= finish; i++)
            {
                Console.WriteLine(CalculateFizzBuzz(i));
            }
        }

        static object CalculateFizzBuzz(int i)
        {
            string CalculateFizzBuzz = "";
            foreach (KeyValuePair<int, string> word in wordlist)
            {
                if (i % word.Key == 0)
                    CalculateFizzBuzz += word.Value;
            }
            if (CalculateFizzBuzz.Length == 0)
                CalculateFizzBuzz = i.ToString();

            return CalculateFizzBuzz;
        }
    }
}

Jun

27

Twitter Weekly Updates for 2010-06-27

By pcurd

Powered by Twitter Tools

Jun

20

Twitter Weekly Updates for 2010-06-20

By pcurd

  • One of the cats I'm babysitting just pounced on a moth and gave it such a good talking too it needed to be eaten #awesomecatisawesome #
  • RT @phil_crabtree: @PCurd Thought you might like this. http://twitpic.com/1wppg5 <- haha brilliant! #
  • RT @LeMencs: Blood, cuts and broken bones – from the kitchen cupboard. I meet a group of trauma make-up experts –> http://bit.ly/9NSHA2 #
  • Jack Johnson's new album is great – love the use of electric guitar http://open.spotify.com/album/3XshNzZ4orKbbcWy6zZkw3 #
  • I have a camembert, gruyere and hotdog sandwich for lunch. I think I win at mixing foods. #
  • Looking forward to COD Black Ops! Hope it's a little longer than MW2 #e3 #
  • RT @JRichD93: Incredible violence mixed with watermelons. Cool. #XboxE3 #
  • OK so Kenetic Adventures is much better than I was expecting. Still not hardcore but looks fun! Remember fun? #e3 #xboxe3 #
  • Fitness Evolved also looks quite cool – Better than Wii Fit anyway. Also the scanner at the beginning is AWESOME. #e3 #xboxe3 #
  • RT @majornelson: We've just announced the new Xbox 360. Wireless and 250 GB for same price <- Want! #
  • Oh dear. Just realised I have 10 days of training to take this year too so that's 34 days 'off' I need in ~169 working days. #
  • Sounds like a reunion @giraffetweet trip is being planned with @TheForster @fringley @SnowdanX @lukesmith and @Banoop Any deals for Friday? #
  • I'm leaving work! Yay! #rdggeek #
  • #awesomecat is hunting something http://twitpic.com/1×3utt #
  • Last night in my second home and it was an #rdggeek night too into the bargain. Sleep now, good night all. #
  • Three copies of Visual Studio (2×2008, 1×2005) just died on me at once – never seen that before.. #weirdbugs #
  • Today is a Default day http://open.spotify.com/album/7IUXXDlKqqLRkJLXrrhXCo #
  • .@deepwire just added you on Xbox Live (I'm Lord Warfire) #
  • About to leave work at last! Long day! #
  • The inside of my car smells of Camembert… #notaeuphamism #
  • Awesome thing about driving a Rover – police pull me over leaving work and then wave me on when they see the ship :) #
  • Good LORD Notepad is slow at Find/Replace #
  • And did you know you can't have GO in a comment block in SQL or it ignores the comment? No, neither did I **rage** #sqlserver2008 #sql #rage #
  • Wow it only costs $1,250 to register a /21 IPv4 block – thats 2048 IPs for $1.6 per year each. I thought it would be much more #
  • OK.. just updated one of my @wordpress 2.8 installs to 3.0 in 10 seconds. Literally. Good Job! #
  • Having a great meal at @giraffetweet with @TheForster @fringley @Banoop @SnowdanX and a non tweeter :) #
  • If you don't already, you could follow my new side project @SWDevelopments ? OK then :) #
  • Listening to The Who makes me want to watch CSI. #fact #
  • Just ordered a Sardar Palace takeaway for myself and @XaosWolf – very nice woman called me "My darling" :-D #
  • I am now entirely convinced that the issue I've been chasing all evening is in fact a bug in the library, not my code so now it's bed time! #
  • People of twitter – do I buy Red Dead Redemption today? #
  • A dev question now – how do you build functions that may fail? I usually return bool and use ref parameters – other ideas? #
  • Right, going out to buy Red Dead Redemption for 360 – Argos is cheapest so I don't even have to pay to park #win #

Powered by Twitter Tools

Jun

19

SWDevelopments Website launched

By pcurd

For the last few months I have been rebranding my personal projects and side work to “SW Developments” and today I have launched a website for this venture – http://swdevelopments.co.uk.

I will be developing this website and the venture with more details in the coming months.

SW Developments will consider any project and can produce cost effective, modern Content Management System driven websites,  more powerful custom development driven websites or any IT consultancy services for local companies.

Jun

13

Twitter Weekly Updates for 2010-06-13

By pcurd

  • Only opened yesterday! Smells great :) £6.99 any pizza any size. (@ Milano Pizza) http://4sq.com/9TRrdk #
  • I just received some spam from Armando Crabtree, what are you up to @phil_crabtree? Is he related to Cooker? #
  • Football or CSI on five… CSI wins! #

Powered by Twitter Tools

May

30

Twitter Weekly Updates for 2010-06-10

By pcurd

  • Falling asleep after salad and bread and sangria. #sundayactivities #
  • Twitter Poll – do I buy Immersion on iTunes for £7.99 or Play.com for £8.95? both give electronic music, only Play gives physical CD.. #
  • Tesco has Immersion at £3.97! http://bit.ly/aj2zLz and 2% quidco cashback! Might be a deal! #
  • 15% off code on Quidco for Tesco too! Becomes £3.37 for the album and 2% cashback still! cheaper than eBay! #
  • Wow, no love at all for digital music on my twitter feed! And no one told me to buy the vinyl, I'm shocked! #
  • Alarm system at work won't arm so I'm stuck here until the engineer calls. Could be hours :( #
  • Engineer called. (5 minutes late, so much for priority) can't be fixed remotely so engineer on their way. Up to 4 hours wait :( #
  • I'm finally home to be greeted by the dawn chorus. Very relaxing if slightly off putting. #
  • gah my inbox is a mess… too many busy days recently. Even I (he of the messy inbox by nature) am ashamed #
  • Quite impressed with this getting to work at 9:30 thing.. get to go home at 18:00 and I had a lunch break.. almost civilised. #
  • One of the accounts team just brought in a Root Beer sweet. Oh My God. I might move to the US just for this sweet… #
  • RT @mediasuicide: #ZOMG #zombie jerky: it's blue! http://trunc.it/8cmdg (via @bizarremagazine) @xaoswolf Awesome! #
  • RT @amykate: @amykate #makemethis http://bit.ly/adf3YR <- Me too! #
  • I'm going home! Woo! I can almost feel sleepy time! #
  • RT @Cranialstrain: "@timallenphoto: Anyone know where I can get my web site redesigned to look like this one? http://bit.ly/KPBuQ”&lt;&lt;*shudder #
  • RT @m4rko: Cool iPad app for you new iPad owners – Air Display http://www.youtube.com/watch?v=alOxsYmTel0 <- I want it! #
  • RT @Plip: Give me strength. http://twitpic.com/1rj919 <- Beautiful. Is there an array for 1-2000 in denary too? Or are they numberist? #
  • http://tinyurl.com/339pbw5 yay! My Rage Against The Machine #TheRageFactor ticket is here! #
  • Has anyone else received their Joggler? I'm still waiting after 11 days :( #o2fail #
  • OMG #Graze are adding Flapjacks!!!!! #
  • Just had my first whiff of LeWhif and it was amazing. Like breathing in chocolate! http://twitpic.com/1rx3lq #
  • Right, long day tomorrow. Night all. Those of you who are already asleep are excused from comment. #

Powered by Twitter Tools