Print with a Brim

Three pigs and a crocodile. (sounds like the name of a musical). 

I'm keeping the 3D printer busy printing tiny 3D animals They are all going to fit into a puzzle design that I found on Thingiverse.  I'm going to use different colours, including a rather nice pink that I've got for the pig. 

One thing I'm doing to massively improve my prints is to print with a brim. This is printed as part of the base of the item you're printing. After the print you trim it off. This is known as a brim trim.

Anyhoo, brims make a big difference to quality. They are printed from the outside in, and give your printer plenty of time to sort itself out before the actual model is printed. They also provide a bigger sticking area, greatly reducing the amount of "curl" that you get on the corners of prints when they lift up from the print bed as they cool. 

I use Cura to do my printing and the Brim is one of the platform adhesion options. The other one is Raft, which I don't use much. You can set the size of the Brim too. 

This is what the Brim looks like in print preview. I suppose I'm using a tiny amount more filament than before, but I'm much, much happier with the prints I'm getting.

The Magic of CallerMemberName

Oh my goodness. The things you find when you are searching for something else. While I was looking up some stuff on Model View View Model I came across a C# feature I've not seen before. It's called [CallerMemberName] and it is awesome. It has some  useful siblings too, which I'll get to in a moment. I'm dashing off a quick blog post about it now so that I can tell everyone, and also so I can remind myself how it works in the future.

CallerMemberName lives in the System.Runtime.CompilerServices namespace and it has one simple behaviour. It lets a method know the method or property it was called from. You use it as a parameter to the method, like so:

void Demo([CallerMemberName] string name = "")
{
    Console.WriteLine(name);
}

The method Demo has a single parameter which is called name. All it does is print the name out. The parameter has a default value of "" and the strange [CallerMemberName] attribute thingy in front of it. When the method runs it prints the contents of  name. So, if we make a call to Demo from within another method - like this:

public void DoSomething()
{
    Demo();
}

- the program would print "DoSomething", because that is the name of the method that called Demo. It gets better. I can also do things like this:

private int aProperty = 0;

public int AProperty
{
    get
    {
        return aProperty;
    }
    set
    {
        Demo();
        aProperty = value;
    }
}

This time I'm calling Demo from within AProperty. And it prints "AProperty".  So far, so good.  Might be fun for code instrumentation. But why do I like it so much?

Answer, if you've not figured it out already, is that one of the more painful things about creating ViewModel classes for your applications is that when you set a property you have to call a method to tell the system that the value of that particular property has changed. And you have to give the method call the name of the property that has changed. As a string. If you get the name wrong (it has been known) a whole heap of nothing happens and your display is not updated properly. If you've done any MVVM in C# you'll be nodding around now.

If we use [CallerMemberName] we can get the name of the property being updated straight from the property itself, which means that we can make a generic notifier method that works for all the properties in the ViewModel class. No more errors caused by mistyping. There's a nice description of that part here

There are a couple of other "Caller" features you can use that work in exactly the same way, and might be fun to play with:

[CallerFilePath]
[CallerLineNumber]

They are fairly self-explanatory. 

Great fun. 

Careers and Internships Events at Hull

Gaming: 27th January 2016 12:30 pm - 4:30 pm

Development: 24th February 2016 12:30 pm - 4:30 pm

There is still time to register for the two events we are holding this year. The Gaming one is next week  and the Development one runs in around a month or so. 

These events are for students at Hull University who want to find out just what software development is going on and meet up with the folks doing it. If you are a First or Second Year you should be looking for internships and summer placements. If you are a Third or Fourth year you should be talking to people with a view to employment. There is a lot going on in the development space and this is how you can become part of it. Everyone who attends as a conference delegate will get a set of business cards and some other conference goodies. We'll have talks from industry and stands from companies. And maybe some free pens.

Register here by 12:00 on Monday 25th of January to take part. 

Bluetooth Manager for Windows 10 Universal Apps now on Nuget

BluetoothManager.PNG

I've been playing with nuget

It's awesome. 

It is fantastically easy to package up an assembly and make it available for just anyone to use in their applications. It is beautifully integrated into Visual Studio and I reckon it is actually easier to download a package from the other side of the world and make it part of your solution than it is to add one that you have written yourself on your own machine. 

To practice I've packaged up my Bluetooth Manager library. This is a little wrapper class that makes it really easy to use Bluetooth on Windows 10 applications. I've not tried it on Windows 10 on Raspberry Pi (but I've tried it on lots of other systems and it works fine). You can find out a bit more about it here.  I use it so that I can print message on my little home made Bluetooth printer, but you can use it anywhere you want to talk over a Bluetooth serial connection. 

Oh, and in case you are wondering why it is version 1.0.1 and not version 1.0.0 I found an interesting quirk in nuget. If your library class doesn't have a public constructor the package will fail to work because Visual Studio will complain that the class is "Inaccessible due to its protection level.". That's what happens when you try to use version 1.0.0

Sending Money the Scary Way

 Mobile banking is wonderful. The way that you can send money to a distant account by just tapping a button is really nice (once you've done the shenanigans with the card reader thingy and set up the account first of course).

However, I always fret that one wayward digit might result in me sending the plumber's payment to some other lucky person. I wonder what the legal situation is if this happens?

Anyhoo, no worries, and all is paid for. I am now the certified owner of a properly shiny boiler. 

A Couple of Good Books

This is a great book if you like Japanese food, or if you want to find out if you will like Japanese food (you will). There are lots things that are quick and easy to prepare, with some nice looking cakes. Some of the ingredients might take a bit of searching out, but my experiences in Japan make me think it will be worth the effort. 


Space Dumplins
By Craig Thompson

This is a great book if you like well drawn and imaginative comic strips. 

And yes, I've just figured out how to add Amazon links to my blog. Go me. 

Going bananas with passwords

We had our big First Year exam this morning. Around 250 students took the exam at the same time. Thanks to Septa, Amadou, Kevin, Nicholas, Xinhui and David for helping to run the affair. 

Before the exam I carefully wrote a briefing document and made sure that everyone knew the username and password to unlock the test. Bearing in mind the Yellow Book theme this year I thought a username of "bananas" and a password of "custard" would work well. 

Thing is, that's not what I typed in the briefing document. I missed the s off bananas, and so people were tying to start the exam with a single banana. Which didn't work. Fortunately I'd also put my phone number in the briefing document, so as soon as the exam started my phone lit up with folks ringing through from the exam locations around camps. We sorted out the problem in double quick time and everyone was able to get on and answer the 50 questions. 

Amazing Everything Meter

Amazing, even with the odd spelling mistake..

Amazing, even with the odd spelling mistake..

James thinks I should get one of these. It is a kind of "everything meter". The idea is that you can just connect an electronic device and it will tell you what kind of device it is. It can detect and measure resistors, capacitors, coils, diodes and a few different types of transistor. For around fourteen pounds I reckon it is a bit of a steal. Very tempting. If you've not already got yourself a multimeter I reckon one of these would be at least as useful.

Boiler Busted

Pretty much all of these parts are worn out in our boiler

Pretty much all of these parts are worn out in our boiler

What is it with gas boilers? You buy one and then, twenty years later, you have to buy one again. The plumber who was kind enough to turn out today took one look at the bits of bent metal stuck on the wall of our garage and, after a sharp intake of breath (always an expensive sound in my experience) told us that it was pretty much worn out. We could replace the bit that might be broken and then find that it either works for a while or something else, that can't be replaced, is also broken. It looks like it might be new boiler time. This could put on hold any camera upgrades for a while. 

Hull at alt.ctrl.gdc

Game Developers Conference, or GDC, is probably the biggest gathering of game developers in the world. I've been lucky enough to go a couple of times and it is a fantastic conference. 

One of the attractions of the conference is the side-exhibitions that they organise. One is called alt.ctrl.gdc and it is a showcase for wacky game controllers and games with novel gameplay. 

It just so happens that a couple of years ago I was part of the Spooky Elephant - Beard Bandit team taking part in Global GameJam and we created a novel game with wacky game controllers. As you do.

I've not got particularly fond memories of the actual competition to be honest. I was the single point of failure who's dodgy hardware design caused the project to falter. However, we did win an award for Most Ambitious Failure

But we are not ones to give up. Simon and Jon continued to work on the software and I did some modifications to the hardware, ending up with a working configurable joystick and a game to go with it.

The great news is that last year Simon submitted the game and the joystick to the GDC organisers and the game has been selected for showcasing at GDC 2016. This of course means that someone from Hull has the chore of going to San Francisco and showing it off, but Jon has manfully stepped up to the mark and will be taking the hardware and the game to show off. You can find out a bit more about the game here

Things To Remember not to Forget

Don't forget there are a couple of things coming up soon....

Global Gamejam and Platform Expo: The next Global GameJam is at the end of this month. Sign up at the registration site. This is a great way to get experience coding and is also part of the Platform Expo running in Hull.

FameLab: Famelab is a chance to get noticed, and also a chance to practice speaking in front of an audience. The pitches are very short - what could go wrong in Five Minutes? Find out more here

For Hull students we've had a meeting today (I do love meetings) to sort out the Seminar plans for the next semester. There's some interesting things coming down the tracks....