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
Monday
Mar042013

"Life after Uni and being a Boss Alien"

image

Lindsay Cox is coming to see us on Wednesday 6th of March and give a Rather Useful Seminar. You might remember Lindsay from the odd Three Thing Game, in fact he and his teams produced some memorable stuff over the years. Lindsay is going to talk about his experiences since graduation. The seminar is at 2:30 pm  on Wednesday 6th of March in Lecture Theatre D (LTD) in the Robert Blackburn Building.

Please note the slightly later start.

Sunday
Mar032013

Surface Pro Paint Repairs

IMG_5990.jpg

If you have been unlucky/daft enough to chip the paint on your lovely new Surface Pro then I have have some good news. Revell enamel paint “32109 Anthracite” (see here) is an absolutely perfect match for the paint on the Surface. I’ve put a tiny amount on the scratches (which, admittedly were pretty tiny to start with) and they have completely vanished.

And, bearing in mind no new scratches have appeared, I think the little tin above (price at one pounds sixty pence) is going to be a lifetime supply as far as I’m concerned.

Saturday
Mar022013

NFC Tag Fun with Windows Phone 8

Near Field Communications is fun. And sometimes even useful. The idea is that you bring your phone close to an NFC tag which contains an antenna and a tiny chip which can store data. The phone reads the data and does something. You can program an NFC tag to trigger one of a variety of different actions, from opening a web page, running a program to sending an email.

Untitled

The Nokia NFC Writer program makes it very easy to program tags. I’ve got a tag in the car that starts the phone playing music. I could also use a tag to configure the phone and even send tweets, as James has done.

image

There are lots of styles and designs of tags out there. I got the Task Launcher Pack from rapidnfc.com above which provides a lot of fun for around 12 pounds. You can get custom printed tags and people like Moo are even planning business cards with tags in.

There is an API that you can use to allow your Windows Phone program to read and write tag information which has all kinds of possible applications. You can find out more from MSDN here and from Nokia here.

If you have an NFC capable phone (the Nokia 820 and 920 are) then you should have a go. Great fun.

Nokia NFC: It looks like some folks are having a problem finding this program via the link above. It works fine in the UK, I'm not sure what regions of the world have access to it. If the link doesn't work try searching your Marketplace for "nfc".

Friday
Mar012013

The Three Faces of Percy Pig

DSCF0066.jpg

The chap at the Sweet Shop told me that there are three different faces on the Percy Pig sweets I seem to bee addicted to at the moment. Sad, happy and surprised. He’s right.

Thursday
Feb282013

Making Sample Data Can Be Fun

image

I’ve just released the first year coursework specification. We are going to be creating a system for a record shop which will track customer orders and suggest new records to buy. I think the only reason I went for a record shop was so I could call it “Vinyl Destination”, but that is by the by.

The program needs to be able to track huge numbers of records and customers, along with their orders. The problem is that, at the start, we don’t have any customers or orders, or anything. And anyone that thinks the way to solve this problem is to sit down and enter some details when the program has been built is very, very wrong.

I make the test data right at the start. I use a program to do it. All it takes is a few loops. Now, I could give the customers names like “Customer1”, “Customer2” and so on. But I can do better than that. All I need are some names to start with:

string [] firstNames = new string [] { "Rob", "Fred", "Jim", 
  "Ethel", "Nigel", "Simon", "Gloria", "Evadne" };
string [] surnames = new string[] { "Bloggs", "Smith", 
 "Jones", "Thompson", "Wooster", "Brown", "Acaster", 
  "Berry", "Ackerman" };

Here we have two arrays, one of first names and the other of surnames. I can now make myself a whole bunch of reasonable looking customers:

foreach (string surname in surnames)
{
    foreach (string firstname in firstNames)
    {
        Customer c = new Customer(firstname + " " 
                                  + surname);
        result.Customers.Add(c);
    }
}

This makes us a whole bunch of customers, from “Rob Bloggs” all the way to “Evadne Ackerman”. We can do something similar with the names for each of the recording artists:

string[] artist1 = new string[] { "Pink", "Flying", "Random", 
    "Singing", "Uptown", "Family", "Floating" };
string[] artist2 = new string[] { "Chicken", "Circus",
    "Banana", "Kitchen", "Groats", "Monkey", "Collective", "Pyjamas" };

I can combine the words to make random artist names.

string artist = artist1[rand.Next(artist1.Length)] + 
    " " + artist2[rand.Next(artist2.Length)];

This picks a random word from the first list and adds it to the second one (rand is just a random number generator that I use to make my test data). So I can have “Pink Pyjamas” and “Singing Groat”, among others. I do something similar for the track names, except that I have three parts. As you can see in the screenshot, this makes for some quite funny combinations, that liven up testing no end.