Collapsing Regions in Visual Studio

I like using regions in Visual Studio. They make it much easier to move around code. I’m writing C++ at the moment and functions and code blocks are automatically tuned into regions, which is nice.

If you want to collapse and open them quickly there are a couple of control sequences that you might find useful.

CTRL+M CTRL+O

This collapses all the regions. You can hold down the control key and press M followed by O.

CTRL+M CTRL+L

This collapses all the regions recursively. So if you have regions inside regions you might end up with just one line in the editor if you use this..

These sequences are toggles, so pressing them again will open all the regions. I find them especially useful when copying or moving code, in that you can select the collapsed region and it will select all the code in the region.

Snaps and Visual Studio 2019

It turned out that the hardest part of installing Visual Studio 2019 was freeing up the 18 GB or so of space that was required. If you are installing it for use with Snaps from my wonderful Begin To Code with C# book you can do a very ordinary installation, but you do need to select to two options that I’ve marked in red above.

If you do this you should find that the Snaps you can download from GitHub here should just work.

If it doesn’t work please let me know. It might work just for me because I have some libraries already on my machine. I’m going to try with an “empty” machine, but I need to set it up.

Update: If you are finding the image hard to read, make sure that you select Universal Windows Platform Development and Windows 10 SDK 10.0.18632

Mowing blind

Every now and again I do a good turn for someone. At least once a year.

Earlier this week I was out cutting grass for a neighbour, navigating a mower and strimmer around his lovely garden. When I’d finished I looked across the road at our house and I noticed that it seemed a bit blurred around the edges. Turns out that I’d done the entire job wearing my “close up” glasses (the ones that I only ever use with the computer). These turn everything more than two feet away into a mildly pleasing blur.

I’d been replying to an urgent email (yes I still get the occasional urgent email) before I left the house and forgotten to change back to my proper spectacles.

I think I'll leave it a while before I go back and look at the damage….

Pokémon Detective Pikachu is not a bad film

I’m not a huge fan of Pokémon. But I am a fan of nights out and popcorn. So last night we went to see Pokémon Detective Pikachu. It’s fair to say that films of video games don’t have a great history. My favourite ever video game film has got to be the original “Tomb Raider” movie. Mainly because it contains this line.

“The letter’s from my father. He must have written it before he died.”

Anyhoo, expectations appropriately managed we set out to the cinema last night. And we were both pleasantly surprised. The story is a bit wonky, as are some of the special effects and the dialog. Bill Nighy was along for the ride and probably to pay off a sizeable chunk of his mortgage. Ryan Reynolds does a fantastic job of voicing the title character and things burble along in an amiable manner to a satisfying (if not terribly well explained) end.

Worth a trip. Particularly if there is popcorn.

Day tripper

If you want to get a good response when you are on the phone to an electrician, mention the smell of burning. It wasn’t very pronounced, but it was definitely there….

It all started when the charge for the car failed half way through. The earth drip on the charge box had triggered. I reset it and tried again. And that’s when it tripped again and I smelled the fateful smell.

I think this is a known fault with the charge box that I bought. Anyhoo, they are coming in a week or so to replace the faulty unit. And I’ve turned everything off.

Always put a hole in the bottom

Note that this is not our air quality sensor. This is a nuclear warhead. Almost as complicated….

Had a great meeting with John today about the Air Quality sensors that we are going to fit on lampposts around the city. He had a couple of pieces of very sensible advice.

  • don’t make holes in the top where the water can get in

  • make a hole in the bottom where water that gets in can drain out

Surfing memory lane

Making a meme in 2006….

Someone is interested in publishing an eBook based on a text that I wrote over twenty years ago. This is scary. Particularly if you’ve lost the original file.

For many years my backup approach was always to copy the files from the old desktop into a folder on the drive of the new one. This worked until I stopped using desktops and started using laptops. Laptop drives are much smaller and so I was forced to suspend this practice.

My backup policy changed to “put an external hard drive in the loft and forget about it”.

This turned out not to be a good ploy. But today, after a couple of hours treading nervously around the loft looking in boxes (we have a lot of boxes) I managed to find a drive that had all my missing files on.

The word documents are there along with lots of other stuff that has completely brought all work to a standstill while I spend some time marvelling at how much better I was at every kind of thing twenty years ago….

Writing about Chatbots

One of the things on my list of things to do is “Write the presentation for the Barclays AI Frenzy event”. Which is tomorrow…..

I reckon that it can take up to a day to write a good one-hour presentation. So it’s a good thing I’m starting now.

I’m talking about chatbots, which I’m quite familiar with. But pesky Microsoft keep making the bot framework different and better. This means that while the fundamentals stay broadly the same, but way you use them is different. Which means that all the slides and demos need to be reworked.

The good news is that I’m becoming rather inspired by just what you can do with this technology now.

American Museum in Bath

Sunday sees us at the American Museum in Bath. A favourite of mine. Inside a lovely English country house are a whole set of rooms imported whole from America. It’s fascinating to see the transition from the simplicity of the early rooms to the intricate decadence of the more recent ones. The story of the origins of America is very well told and we had the added bonus of a couple of really good exhibitions. If you’ve not been, go. If you have been, you won’t need me to tell you to go again.

Buy Nintendo Labo VR

This is awesome. I’ve stayed away from buying any of the Nintendo Labo kits because, after all, they are only cardboard. However I couldn’t resist the purchase of the Labo VR kit above. And I allow myself one silly purchase after giving a course (thanks GSK). And I get to play Zelda in VR.

So today we tracked down a copy of the game and starting folding things together. The game comes in a box around the size of a large pizza and is made of similar cardboard (to the pizza box, not the pizza). The instructions are an object lesson in how to tell you how to assemble something. They even have funny names for the cut-out parts. One was referred to as “two pandas holding hands”. If you follow the directions you’ll have no problems, and great fun putting the things together.

We started with the 3D visor. This is very reminiscent of Google cardboard. The lenses are supplied pre-mounted and are of good quality. The Nintendo Switch is not really a 3D device, but it works really well in the role. Just remember to clean the screen before you put it into the goggles. The biggest problem is that you have to hold the goggles up to your face while operating the controls, so you’d probably not want to spend too much time using them. But you do get a convincing 3D experience.

Then we moved on to the rocket launcher. There is only one word for this. Fantastic. The construction is properly long, with lots of different elements to be fitted together. When it’s complete you really feel that you’ve built something. And it works. The Switch “goggles” fit into the end of the launcher and you have a positive slide reload action that you can see in the game. Then a press of the trigger launches a rocket with a solid “thwack”. I was a bit worried about the strength and durability of the cardboard construction but it seems pretty solid and works really well.

I reckon if you have a Switch you should get this. The whole thing is such fun.

Building Robots at GSK

We’ve taken “Build a robot in a day” on the road and today we spent a lovely day today down at GSK in Weybridge. Things went so well that at one point we thought we might have to rename the course “Build a robot before lunch”. Everyone got their robot moving around and interacting with them.

If you were on the course (or are just interested) you can find all sample programs here.

If you want to work further with the Arduino I’d recommend that you search Amazon or ebay for “Arduino Kit” and buy something that costs around 25 pounds or so.

Update:

I’m back home now and I’ve put a few pictures of the event on Flickr here.