Gran Turismo 7

Taking a BMW i3 through the field..

I’ve been playing the new Gran Turismo game for a couple of hours this morning. So of course I can now write the definitive review. Actually, I’ve been playing the game since version one on the original PlayStation, when we took a lowly Nissan to dizzying heights of success by a combination of a lot of tuning and bashing all the other cars off the road in the corners.

The new game is very true to the heritage of the older ones, even to the point of being a bit “up itself” with slow motion videos of the Wright Brothers and Einstein at the start. You even get to do qualifying races. Remember them? When the game first came out it was as if it was testing you to see if you were worthy to play it. It still feels like that.

Anyhoo, there are some new flourishes. There’s this strange music mode thing which you seem to have to do for a while before you get to the main game. There’s also a café where you can go and get menus of things to do. Everything loads pretty much instantly. This is literally a game changer. It means that you are tempted to have a go at shaving a few fractions of a second off that time, just because you know that you will be put back into the driving seat instantly when you retry. The graphics are better than real. I don’t think you could get these images with a camera.

Stopping for a coffee.

There are lots of races, hundreds of cars (including my beloved BMW i3) and tuning and detailing options galore. The driving experience is sublime with a special shoutout for the weather effects. There are lots and lots of things to do. You could go and live in this game. And with the state of the world today, I reckon it would be a pretty good option.

If you like Gran Turismo you’ll love it. If you’ve played a lot of Forza Horizons you might wonder what all the fuss is about, and ask why you can only race around tracks and not just drive anywhere. You might also question why the soundtrack is so bland and ask about missions. But these things are kind of beside the point. Gran Turismo really is about the driving and cars, not about narratives. And in that it succeeds brilliantly.

Saving money on Gran Turismo 7

If you’re trying to find the cheapest possible way of getting hold of the latest version of Gran Turismo you might like to know that Shopto.net are selling PlayStation network Gift Cards at around 12% off. This means that you can pick up a copy of the game for around 60 pounds rather than 70. This is of particular interest to people like me, who have the version of the PS5 without a disk drive.

Playing with analogue film

The Canon EOS 650 is a landmark camera. It launched the Canon EOS (Electro-Optical System) lens fitting which persists to this day. I acquired one by accident when I bought a second-hand Canon outfit a while back. I really wanted the lenses, which worked on my newly acquired Canon digital SLR.

What with analogue film being currently trendy I thought I’d take the camera out and put it through its paces. The auto focus is as snappy as any modern camera and the exposure seems sensible. Everything works fine, including the automatic wind and rewind. I find it amazing that this camera works so well, bearing in mind it is well over 30 years old. You can pick up a camera like this for around 20 quid on ebay. Kits with lenses start at around twice that. If you want to get into film photography this seems a very nice place to start.

Of course, I don’t really know how well the camera works just yet. I’ve got to get the film developed…

Crypto Currencies and NFTs explained

I got asked today what Bitcoins and NFT (Non-Fungible Tokens) are all about. So I thought I’d write something.

Banking on blockchains

Let's start with your bank. Whenever you receive some money (yay!) or pay a bill (boo!) your bank adds a transaction record to a list held in your account records. If I was running the bank, I'd be very worried about someone messing with this transaction list. I wouldn’t want a cunning programmer who works for me giving themselves extra cash, deleting their spending records or fiddling with their transactions.

One way to stop such tampering is to turn a transaction list into a blockchain. Each bank transaction is now stored in a block which is linked to the ones before and after it. Each block contains a cryptographic hash of the block before it in the chain.

What's a cryptographic hash? I hear you ask. It's a way of validating the contents of a block of data. What does that mean? Well, assume that I want to store my name, "Rob Miles", and I want you to be able to prove that the stored name is correct.

I could store my name along with a value that proves the name is correct. A bad way to do this would be to store "Rob Miles" and the number 829. The value 829 is the result of adding the character codes for my name together. The letter R has the value 82, o is 111 and, b is 98 and so on. When you read back the name you calculate the check value from the data and compare it with the stored value. If they are different either the hash or the data are wrong. This validation mechanism is called a checksum and it is used throughout computer networks to detect data corruption caused by transmission noise.

We don't use checksums to validate the data in a block because it is too easy to fool. You could use 829 to prove a name was "Rob Miles", but this value would also work for the name of my strange cousin "Rpa Miles" because character code for p is one greater than o, and the character code for a is one less than b. A cryptographic hash is a transformation created to produce a different value for every unique lump of data that it receives. Of course, this is not really possible. If the hash value is of finite size (say perhaps 10 digits) and the block of data being hashed is very large (say perhaps a megabyte) there must be lots of blocks of data that would generate the same hash, but the chances of this happening are sufficiently small for us not to have to worry about this. A cryptographic hash has one other feature, it is designed to be non-reversible. In other words, it should be very hard to work out the data contents of a block given the hash value.

If a block contains the cryptographic hash of the one before it in the chain it makes it impossible to modify a block without breaking the chain, since the hash value in the following block would now be wrong. It is also impossible to add or remove blocks in the chain because his would also corrupt the hash values.

Block chains are actually a great way to store data. Consider hospital patient records. You could store details of each patient in a huge data structure and then modify the contents of that structure each time something about the patient changes. If they change their name your program would have to find the patient record, modify the name in the record and store the record again, which would be quite hard work. It would be much better to hold each patient record as a blockchain. Rather than change the properties of the patient record you just add another block to the chain that describes the change you have made. The disadvantage is that to get the up-to-date status of a patient you have to scan down the blockchain, but the advantage is that you get a complete history of changes to the record for free, because all changes are stored in the chain.

Manage your own money

So, blockchains provide a great way to store structured data, but what about cash? Lets assume that you want to start your own currency. You don't want to tie it to any particular bank or organisation. Instead, you want the currency to be as open and useable as possible. Well, it turns out that a blockchain can help here.

You create a library of software that allows anyone to use their computer to host and manage account blockchains. Transactions are inherently secure because they are stored as blocks in the chain. The account storage is robust because the blockchains are stored on lots of machines which talk amongst themselves and make sure that all the chain stores are synchronised. The only problem that you have now is persuading people to run your currency server code on their machines. Enter our digital currency.

Up until now humanity has based its currencies on something physical, starting with things like lumps of gold but more recently coins and bank notes. We manage our money using phones and computers but underpinning it is the principle that you can walk into a bank and ask for your cash in physical form to take home and hide under your mattress (don't do this). The bank just holds a number that specifies how much cash you have, not the money itself.

A digital currency replaces the gold or bank notes with the solution to a digital puzzle. This solution must be calculated by a powerful computer and once it has been obtained and verified it can be used in transactions. The process of creating these solutions is called "mining". Around the world (usually where the electricity is cheap) you can find buildings full of computers working on solving these puzzles and adding solutions to the blockchains of their owners. They are literally making money. The mining computers also host the blockchain servers that underpin the currency, recording the movement of the digital cash using blocks in account blockchains.

It's possible for you to start with no digital money, run your computer for a while, generate some currency of your own and start spending it but a quicker way to get started is create an account with a broker who will exchange your digital currency into old-style cash and back. You use a program that acts as your "digital wallet". Once you have signed into the program you can use it to give other people your digital cash or ask your broker to move your money in and out of the digital domain.

No visible supports

The problem with a digital currency is that it is not underpinned by anything. If you look carefully at a British banknote, you will see that written on it is the phrase "I promise to pay the bearer on demand the sum of x pounds", where x is the value of the bank note. In olden times each banknote was backed by gold. You could go into the Bank of England and ask them to exchange your pound notes for lumps of gold from the treasury. We moved off the "gold standard" a long time ago but the principle remains. The UK government stands behind your wallet. The Bank of England works to make sure that the pound has a particular value of itself and in relation to other currencies. It is unlikely that all our pounds will suddenly become worth a lot more or a lot less. It has to be like this otherwise nobody could do any business.

No such safeguards exist for digital currencies. Massive speculation can (and does) cause their value to skyrocket and then plummet. Digital brokers can vanish taking their customer's money with them. If someone finds a bug in the software that implements the currency the whole thing could disappear overnight. Investing in a digital currency is not without risk, to put it mildly.

Bitcoin is the most popular digital currency. It's been going since 2008. You can buy bitcoins, or parts of them and use them to pay for stuff or as an investment. They are never going to replace proper money though. One issue is that the time it takes to complete a transaction (create a block, add it to the blockchain and replicate it over multiple servers) is around 10 minutes. So, by the time you'd managed to pay for your cup of coffee using a bitcoin it would be rather cold.

Another popular digital currency is Ether. This currency is underpinned by an open-source framework called Etherium. Blockchains stored in Etherium can also hold transactions managing Non-Fungible tokens or NFTs. So, what is a non-fungible token?

Non-fungible fun and games

The word fungible means "interchangeable". If I buy a batch of bricks to build a wall all the bricks will be the same size and shape and I can use any one brick in place of any other. My bricks are fungible. If I want to make unique bricks (perhaps for a wall of remembrance) I could carve a different message on each one. Now I can't swap one brick for another without changing the wall. So, a non-fungible token is one that can be proved to be unique.

If you think about it, it would be quite easy to copy a "non-fungible" brick. You'd just have to create a new brick with an identical message on it. However, when the Etherium system creates a non-fungible token it makes sure that the new token is unique within the Etherium universe. The token can then be moved between owners using transactions that are stored in a block chain by the Etherium system. I can purchase a non-fungible token by using a broker to get some Ether funds and use them to buy it. The transaction is stored in an Etherium blockchain and I can use this as proof that I own that non-fungible token.

Owning a non-fungible token sounds like it might be fun, but it gets real when we link the token to something else. One of the problems with the digital universe is that it is very difficult to maintain and manage "ownership" of an asset. You might have created a photograph or piece of music but once you put it into the digital domain it is very hard to stop people taking copies for free. And when you do find someone who has copied your work it is also hard to prove that you're the original owner.

The Etehrium system lets you bind a non-fungible token to a digital asset (which could be a document, a picture, a music track or any other data file). The binding process generates a transaction in a block chain managed by Etherium linking the non-fungible token with the asset. We can then create another transaction that records the purchase of the non-fungible token by the “owner” of the asset. This allows the owner to say "I own this". The digital asset can still be copied, but at least the owner has a a way of proving they have been wronged and claiming some recompense. An owner of a non-fungible token can sell it to someone else, which generates another transaction which is added to a blockchain.

Brave new world

So, at this point we have currency system which operates outside the "normal" banking space and a way of digitally conferring "uniqueness" on things and proving ownership of them - at least within the Etherium system itself. And now human nature can take over. The first thing that happens is that a lot of people pile into the digital currency arena and push up the value of everything. This does not mean that the digital currency has any inherent value, it just means that lots of people think it has. The second thing that happens is that people start assigning non-fungible tokens to anything and everything and an industry springs up generating things that have no value except for the fact that they have unique non-fungible tokens assigned to them. Remember that owning a non-fungible token that represents an item doesn't give you any control over that item, it just means that you can brag about what you’ve got and raises the vague possibility that in a perfect world you might be able to get some royalties or perhaps sell the "ownership" to another person in the future. Someone compared the whole thing to "selling plots of land on the moon" and I can see their point.

And here we are. Apparently, London tube stations are full of adverts offering the chance to join this new revolution. I can see why people might be interested in getting involved. In a world where if you play by the rules, work hard, save and do all the right things you still can't afford to buy the house that you want (even though your parents and grandparents managed to get theirs quite handily) you might feel that you deserve a short-cut of some kind. And perhaps the early adopters will do quite well out of it. But I worry that time has already passed.

It might be fun to buy non-fungible tokens directly from an artists who’s work you really admire, but to be honest I’d rather go down to the Ferens Art Gallery open exhibition and buy something physical to hang on the wall.

The Old Lamp Room in Cottingham

You know you’re getting old when your blog starts to fill up with recommendations for coffee shops.

Anyhoo, The Old Lamp Room in Cottingham is lovely. It is right by Cottingham station. In the building where they used to prepare lamps for steam trains. We had a drink and a scone and were able to sit outside and watch the trains go by. Great place. The food menu looks good too.

C# Console app template changes

I've spent a lot of my time teaching C#. And the starting point for my students was always an empty console application. Something like this:

using System;

namespace OldSchoolConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

This is what you used to get when you created an empty console application in Visual Studio. It brings in the System namespace so that you can interact with the user and then creates a namespace and a class containing the Main method that makes everything happen. (in this case print "Hello World!")

However, if you use Visual Studio 2022 and .NET 6.0 to create an empty console application you will get this:

// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

The link in the code gets you to a description of what has been done and the C# features that make it possible. I can understand the reasons for the change. You can run a Python or JavaScript program from a single statement and so someone must have thought that C# needed that feature too. However, I'm not convinced that the change is a good one.

I really liked the way that the old arrangement forced the reader to consider the way C# programs are structured and managed. My C# Yellow Book makes a big feature of going through all the statements in a complete program right at the start, so readers appreciate how C# programs fit together. The new single line arrangement might give the impression that I'm doing stuff that is unnecessary and making things complicated when I'm really paving the way for understanding of how everything works. The new design doesn't really make it easier to construct programs. If you want to use classes in your simple one-line program it all falls apart with build errors that make little sense to the beginner.

The good news is that you can just delete the one line solution and go back to the old program if you want to. Which is what I plan to tell people to do.

Update

I’ve just decided I’m wrong here. If I think about the issue properly (something that only ever seems to happen after I’ve posted an article) I reckon that the new console format is a good idea, especially from the point of view of teaching programming. When I wrote Begin to Code with C# I invented a framework (called Snaps) that makes it trivially easy to create a universal windows application with a minimum of surrounding code. This change is doing exactly the same thing for console apps.

My argument above doesn’t point up a flaw in the new design, it points up a desire on my part to keep my teaching sequence the same, rather than look at simplifying the learning process.

I’m now going to re-write the first part of the C# Yellow Book to make use of this new feature and make it easier to focus on what programs do before moving into the features that make solutions easier to manage. My apologies to the .NET 6 team, you’ve actually done something really nice.

Staying between the lines at Trinity Market

Trinity Market in Hull is a wonderful place to visit. Lots of very interesting things to buy and great places to eat and drink. And all indoors and heated. Plus a nicely set up meeting space they use for all kinds of things. Including half-term crafting events for little people. Lovely. Count us in.

The event was organised by Hull Libraries who do some lovely stuff around the city. And in the library. They had coloured paper, feathers, stickers, glue, pipe cleaners and all the crafting stuff that kids (and me) like playing with. Thanks very much for organising it and making one little lady a very happy bunny. Whose happiness only increased when we swung by Dinsdales in Hepworth’s Arcade to buy a joke on the way home.

We also grabbed a coffee in the market from these folks which was excellent and extremely good value. They do very nice de-caffeinated too.

Pokemon Legends Arceus here we come

No wonder I look worried

The original Pokemon games kind of passed me by. Perhaps I was a bit too busy with other things when they first came out, or maybe I was anxious not to be seen to be taking over the games that my kids were playing at the time. Well, that ship has well and truly sailed now… So when Pokemon Legends Arceus came along I was tempted. The game seems to have a nice exploration angle and although the graphics didn’t look the best they looked good enough to build a solid atmosphere. So I stumped up the cash and downloaded a copy.

I’ve not done much yet. Just the training missions. But I am having fun, and it looks like there is a lot of depth to the whole thing.

Red Nose Day How the web works agenda released

I’ve spent the day sharpening my pencils (no idea why) choosing font types, rearranging my desktop shortcuts, emptying my wastebasket, and tidying my desk very slightly. Then I finally got around to writing the agenda slide for my Red Nose Day presentation in rhyme. I hope you like it. It took a long time to write……

You can sponsor me here. And the best part is that if you sponsor me you don’t have to remember to watch the session at 7:00 pm on Friday 18th March (link here)

Hull Looks Excellent

I was up town yesterday for the hardware meetup and the lighting was rather good. So I took a few pictures of the place. Above is City Hall, where I used to help with degree ceremonies back in the day.

This is part of Hull Maritime Museum, which is just undergoing a massive refurbishment.

This is an awesome mosaic which is now being preserved.

The design looks even more impressive close up.

Red faces at the hardware meetup

We had our first in-person hardware meetup of the year tonight and it was a roaring success. The theme for the evening was “Thermal cameras” and Brian had brought along his thermal camera equipped Pi which has a really nifty screen. You can see it action above. Faces show up as bright red, with windows and other cold things dark blue.

Pretty much everyone had brought along some stuff to talk about. Ion had brought along some amazing creations, including a super accurate crystal controlled clock which he had built from scratch, including a custom designed four-layer printed circuit board.

Richard had brought his beautifully built “Completely Useless Machine”. To find out what it does you have to flick the switch.

I was going around making tiny printed portraits of people using the Kidizoom camera. You can just see one of Richard underneath his device above. It turns out that if you take a photo with the camera and then convert it in to a “colouring in” picture you get some nice looking line art printed out.

We’re going to try and meet up in person once a month from now on. If you’re in Hull and you fancy coming along it would be lovely to see you. I’ll be posting the details of the next meetup soon.

Twenty years of .NET - Yay!

Blimey. Twenty years eh? The .NET framework has been part of nearly a third of my life. Highlights for me:

  • Going to amazing sessions at Cambridge University and learning all about the new framework from the people that built it.

  • Launching the first ever .NET Masters Course at Hull University and delivering a couple of modules for it, including one where we modified the razor open source .NET compiler to make broken programs and then got the students to try and debug their code with it.

  • Switching to C# as our teaching language in the department and creating the world famous (in my world) C# Yellow Book.

  • Getting into mobile development with the .NET Compact Framework and revelling in being able to create C# code for a mobile platform.

  • Exploring the XNA Framework and making the immortal “Cheese Lander” game. Running it on a Zune (because I could).

  • Putting .NET programs into teeny, tiny devices using the .NET Micro Framework.

  • Running Sliverlight and XNA in a Windows Phone on what is still the most beautiful user interface there has ever been for a mobile platform.

  • Using .NET Gadgeteer to make amazing embedded devices, even down to their circuit diagrams. All in Visual Studio with in-device debugging.

  • Using ASP.NET to create a web controlled multi-player robot fighting game for Three Thing Game.

  • Writing the first Begin to Code book for C# and building an entire UWP environment called Snaps to make it easier to make useful applications quickly.

Here’s to the next 20 years.