Thought for the Dazed

I've had to give up that Distance Learning course as I was having trouble seeing the teacher.

Flickr
www.flickr.com
RobMiles' items Go to RobMiles' photostream
Twitter
C# Yellow Book

Search entire site
Friday
Sep282012

Sneaky First Year Programming Lab Fun

IMG_4899_900_901.jpg

We had all the First Year students in for their first lab today. As part of the fun we ask the students to find the bug in this piece of C# code, which is supposed to add two numbers together.

   1:  static void Main()
   2:  {
   3:      Console.WriteLine("This program adds two numbers together");
   4:      Console.Write("First Number : ");
   5:      string number1Text = Console.ReadLine();
   6:      int number1 = int.Parse(number1Text);
   7:      Console.Write("Second Number : ");
   8:      string number2Text = Console.ReadLine();
   9:      int number2 = int.Parse(number2Text);
  10:      int result = number1 * number2;
  11:      Console.WriteLine("Sum is : " + result );
  12:  }

Lots of people found the error straight away. But some people (usually the more advanced programmers) didn’t. I had reports describing problems with number parsing, the range of the input values, crashes caused by entering text instead of numbers, and all sorts of things like that. But the real problem is much, much simpler.

The program says it adds two numbers. But the statement at line 10 which works out the result actually does a multiplication rather than an addition. Which means that the program is completely correct, runs fine, but does the wrong thing. This is a surprisingly common problem with programs. You can write a program that is perfect, works a treat, but doesn’t do what the customer wants. And you will not get paid/get fired as a result.

The nice thing about this “sneaky” lab for me is that it worked on two levels. Those learning how to program can see how the computer follows a sequence of statements, executing each in turn. If the statement is wrong, the output is wrong. Those who can program a bit have hopefully learnt that it is a good idea to read the specification when you start writing code…..

Thursday
Sep272012

Undergraduate Welcome Party

IMG_4987.jpg

It’s amazing what people do when you say “Act happy”.

Today we had the Welcome Party for the new undergraduate students. Great fun. I took the big camera and grab some snaps. As an experiment I’m taking the tiny camera to the one next week, to see what difference it makes to the pictures.

IMG_5021.jpg

We had a new toy this time. a six car digital Scalectrix. We had a computer timing laps and running quick races to find the fastest drivers. Went rather well, although the cars took a bit of a pasting. By the end all but one were still running though. We had some blankets around the corner bits to hopefully reduce the damage.

IMG_5016.jpg

Something bad in the process of happening…

IMG_5019.jpg

This is photographic evidence of the first sub-three second lap…

IMG_5026.jpg

These guys won the quiz.IMG_5028.jpg

These folks came secondIMG_5030.jpg

And the Malteasers go to these folksIMG_4995.jpg

Thanks to Freeside for bringing their multi-player game along. Worked really well.

We are actually going to use the Scalectrix in the teaching this semester. We will be interfacing Gadgeteer devices to the data stream that it produces and trying to make some embedded code that reads the controllers and drives the cars. Should be fun.

Thanks to everyone for coming along, sorry about some of the questions in the quiz….

There are some more pictures on Flickr. Click through any image to find the Photostream.

Wednesday
Sep262012

Raspberry Pi Game Table Bits

IMG_4979_80_81.jpg

The joystick and interface for the game table have turned up. Next stop is a trip to Ikea (yay) to buy the woodwork…

Tuesday
Sep252012

Project Deliverables

IMG_0558-Edit.jpg

I really like having the students back on campus. I was talking to Cameron about Seed projects. He is on the fourth year of our MEng course and he will be developing a project for a proper customer as part of his course this year. He was asking for any tips about project management. I told him that the best way to regard a project like this is to consider that the outcome of the work should not be a product, it should be a happy customer. If you think you are making a Stock Control System then you will focus on the technical deliverables and probably get them working, but you might not provide what the customer wants. If you think about the problem in terms of making “Wonder Widgets” happy about the way they are now able to manage their stock that puts a different perspective on the job.

This doesn’t mean that you have to do everything the customer wants, including washing their car. What it means is that you should engage with the customer as much as you can (or they will let you) when you are building the solution. We have found that the best Seed projects are the ones where the customer really gets involved with the team making their solution. The best way to do this is to make it easy for the customer to work with you. Bring things to meetings to talk about and leave with lists of things to do. And keep the cycle as short as the customer will let you. Thinking “We’re OK, we saw the customer last month” is kind of dangerous, in that this is the way you end up with a half working solution to the wrong problem.

Monday
Sep242012

Welcome To Hull 2012

IMG_4917_8_9.jpg 

That reminds me, must get down there and stock up before my first lecture…

Welcome to Hull for new students. And welcome back to everyone else. Firstly I must apologise for the horrible weather. My fault entirely. I washed both cars yesterday. Fool.

Anyhoo, each year I put up a bunch of tips for new students, so here goes for 2012:

  1. Make sure that you have all your updates installed on your system. It doesn’t matter whether it is a Windows PC, a Mac or a Linux netbook. Find out how to check for updates and get everything up to date. At some point you will want to connect your machine up to a campus network of some kind, and if you don’t have all the latest security patches you may be vulnerable to infection.
  2. Do something about viruses. At the very least make sure that your Windows PC has Microsoft Security Essentials installed and running, that the databases are up to date and that you run scans at regular intervals. If you really want to install an anti-virus program don’t feel obliged to spend a lot of money, the AVG free anti-virus program is good and will cost you nothing. Get it from http://free.avg.com/. Please don’t spend huge amounts on some of the more expensive ones. The benefits are dubious and they also have annual renewal charges too.
  3. Take a backup of your machine and leave it somewhere safe (perhaps even at home). Find out how to use the backup software on your machine and take a copy of everything. Use one of these cheap external hard disks that you can pick up for around 35 pounds or so from places like http://www.ebuyer.com/ or Staples, or even Tesco. That way if it all goes horribly wrong when you get to university you can recover your precious music, videos and other stuff. Once you have the backup habit, take a full one one every month or so.
  4. Don’t spend huge amounts on software just yet. Most universities (including ours at Hull) have deals that get you some programs that you need cheaply. Take a look at https://www.dreamspark.com/ for free Microsoft stuff and http://students.autodesk.com/ for free Autodesk stuff (great for 3D design).
  5. The same goes for books. In the computing field they are rather expensive, and you don’t want to pay a lot for a book and then find out that it is only used for a small part of the course. You can check the books out in the library, and you might also find that there is a second hand book sale on your campus where you can pick up the required volumes from other students quite quickly. You might also want to form a little cartel with fellow students to share books between each other and spread the expense (this is also neat because it can also give you a ready made study group). Hull students will get a printed copy of my C# Yellow Book (daffodil edition). Anyone else can get it free from http://www.csharpcourse.com/
  6. Get a usb memory stick (actually, if you are a Hull Computer Science student we’ll be giving you one of these later this week) . Keep backups of all your work on it. You can also use it to take files into the university to work on. You will get some filespace on the university network, but it will not be an enormous amount, and having your files always with you is useful. Put a file on the drive with your contact details (just your name and phone number) so that if you lose the drive people can find out who to return it to.
  7. Get some free on line storage. I like Windows Live Skydrive: http://skydrive.live.com/. This gives you 7 GBytes of space which you can access from anywhere on the web via a browser. You’ll need a Windows Live account to use this. Skydrive will also sync files across multiple computers, although I’ve found that that DropBox has better multi-platform support and also keeps track of file generations. Take a look at DropBox at http://www.getdropbox.com/. Unfortunately you only get 2G of Dropbox space for free. You can also use Google Drive: https://drive.google.com
  8. Make sure you have insurance for all your nice toys. It would be terrible if they got stolen or damaged before they were insured. Take a look at cover from student specialists like Endsleigh: http://www.endsleigh.co.uk/Student/Pages/student-insurance.aspx (if anyone knows any cheaper deals feel free to let me know and I’ll update this post)
  9. Start blogging. Good writing skillz, like wot I have, are very valuable and make you a much more employable person. Sign up at Hull Computer Science Blogs: http://hullcompsciblogs.com/ and start putting your word out and building your brand.
  10. Don’t worry. Really. You’ll be fine. And it will stop raining. Probably in April.