Author

You are here: Home - Author: luke

  • FizzBuzz Test!

    FizzBuzz Test!

    I recently came across the concept of a “Fizzbuzz test”. Having never heard of it,  I have of course done a little bit of googling on it. It’s not a test to see if you’re a malfunctioning robot like you might imagine, instead the concept is that too many people going for programming jobs, don’t in fact know how to program. The idea is to have a very simple program which candidates are asked to write out, on paper to see if they are able to think of a solution to a basic, but nonsensical and useless requirement. This helps weed out candidates that go for programmer roles, at the very start of interviews, that are unfit for the task. I have been told that it works and catches some people out, and other reports on the interwebz report the same.

    Anyway, this is the requirement.

    “Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.”

    Sounds stupid huh?

    But not that hard for us code monkeys.

    I whacked out the following as a javascript example.

    for (var i = 1; i <= 100; i++){
        if (i%3 == 0 && i%5==0){
            document.write ("fizzbuzz!</br>");
        }
        else if (i%3 == 0){
            document.write ("fizz!</br>");
        }
        else if (i%5==0){
            document.write ("buzz!</br>");
        }
        else {
            document.write (i+"</br>");
        }
    }

    It seems to work.

    PHP, being quite similar in syntax to Javascript in a lot of ways, can be done as follows.

    for ($a = 1; $a <= 100; $a++){
        if ($a % 5 == 0 && $a % 3 == 0){
            echo "Fizzbuzz!</br>";
        }
        else if ($a % 5 == 0){
            echo "Buzz!</br>";
        }
        else if ($a % 3 == 0){
            echo "Fizz!</br>";
        }
        else{
            echo $a."</br>";
        }
    }

    The idea is that you can use any language you are comfortable with, and it doesn’t actually get compiled to make sure you get everything absolutely syntactically correct, but it shows someone with a programming mind, that you think similar and can take on challenges.

    You can check out the results of both here.

    I think the concept is solid. I’ve had to deal with people before that claim to be programmers and couldn’t complete this test, let alone the task given to them. I am likely to use the concept however I think when I do I will think of my own little problem rather than use the existing one, just in case someone stumbles across a page such as this before their interview.

  • Mega Vs Dropbox

    Mega Vs Dropbox

    I’ve been watching the reemergence of Kim Dotcom’s new Mega service with much anticipation. The re-entrance of Dotcom to the online storage market is sure to be making a few of the bigger cloud companies nervous. In the first week alone they reached over 1 million users signing up for the service. And how could you blame people with a very generous 50GB of storage absolutely free. Even the paid services are more than most people could want with a piddly $10 for 500GB. This blows Dropbox’s pricing out of the water.

    As part of my day to day computer use, I run 4 separate Dropbox accounts. One is personal files, two are for separate partnership businesses and a fourth is for my holiday rental business. There are all very good reasons that I want to separate these accounts out, but the guys at Dropbox simply don’t want to cater to multi account users like myself. Three of the four accounts are paid accounts and I am prepared to pay for the last one once I have the need over the 2GB of storage space that comes with it.

    These run very nicely together, however it takes a bit of setup work to get this working right. You need to run 4 instances of the program, under 4 separate windows user accounts. You need to set a shortcut in your startup folder to run when windows boots, and then hide the extra accounts from your login screen as well. Each instance of dropbox will tell you when a  file has changed, but the ‘Open Dropbox Folder’ option from the system tray icon wont work for those running as a different user. The three extra account sometimes randomly shut down and stop the syncing.

    Apart from the difficulties of setting up such a system, and the flaws mentioned above, it is a great tool to have. The syncing is fantastic and the safety of using it gives a warm and fuzzy feeling whenever you encounter a computer issue that threatens your computer system.

    It is also these issues along with the pricing structue that could see Dropbox losing even more of its market share to Mega, if Mega can provide an app which handles multiple accounts. I look forward to seeing what turns up on this front.

  • Removing text selection functionality…

    Removing text selection functionality…

    I came across a little issue with a site that I was working on tonight where I couldn’t select any text on the page. It’s proven to be one of the more obscure CSS rules and in was extremely hard to find in the thousands of lines of CSS code.

    The offending rules are as follows

    ::-moz-selection { text-shadow: none; } 
    ::selection { text-shadow: none; }

    Remove these and Bam! Problem fixed. Or, you could go out of your way to add these to remove usability. Your choice….

  • Has new Website. Woot.

    Has new Website. Woot.

    I have always found that the majority of people have no idea how to start off their blog posts… and it turns out I am no exception. For someone that has been in the web development game for over 10 years, it is kinda funny that I’ve never had a truly personal website of my very own. But now I do!

    I hope you enjoy the site, so check out the portfolio page for some of the projects I have worked on. If you are interested in having some programming work done, then shoot me an email via the contact page and ill get back to you.

Back to top