Tottenham: January 2016

Just back from seeing my Mum in Tottenham (London,England). A couple of pictures close to where she lives. I was struck by the OverGround legend on the logo we normally associate with… the UnderGround. Interesting to see the word make its way into er print, when previously it was just something we said to differentiate from┬áthe Tube.

Recording sound from your sound card

On another PC, the SoundMix option in Windows sound options was a reasonable way of recording soundcard (Realtek) output to a wav file. However, that option is not there on my current laptop, which has an NVidia soundcard. Sure I could code something myself… but it looked like the effort was greater than the reward. In the end, I used the combination of 2 pieces of paid-for software, to get a working audio file that I can put on SoundCloud to demo my musical intervals app. Those 2 software packages are:

Soundcast-o-matic, which despite the cheesy name, works great for screen recording, and has a very reasonable subscription model. This allows me to save to .avi, which is recognised by..

Sony Sound Forge Audio Studio 10.0, which though old, works fine on Windows 10… as long as you haven’t lost that precious license key. I can extract the sound from the .avi, and save it as .mp3

In ITunes, I can then add the file, attach to a playlist, specifically for the purpose of burning that to a CD.

SoundForge02

 

Windows Speech Synthesis

I’ve been away from this area for a bit. I’m watching this video from Microsoft Visual Academy.

cortana01

Supporting MSDN stuff here. Here is the Speech SDK.

cortana02

So anyway, just diving in…

VSFF*: XUnit and related

VSFF* – Visual Studio Full Fat. Just to make an obvious distinction with VSCode.

VSCode: richer snippets

Summary: I want to be able to use or define a constructor snippet in Visual Studio Code for C#. However it achieves it, that means when I press a reserved (by me, if I’m defining it) set of keystrokes, then it has to determine the class name, which at that point is only in memory? And therefore needs to be reflected over? In fact the last question is supposition and pointless.. but it’s staying there. ­čÖé Regardless, I feel a bit frustrated that I have burned 3 hours and got nowhere. Diddums.

Like the ones in fullfat Visual Studio, that’s what I need. e.g. ctor. Means nothing in VSCode evidently.
This is the ctor snippet in VS-speak:

 

snippetvs01

I thought I read that VSCode supported a richer syntax, so time to put that to the test.

Firstly there is this link:

snippetvs02

Not a lot right now then. And what is there just uses the lean syntax I have used before. So no use.

Then we have the tutorial here, which contains this promising thang…

So first try

npm install -g yo

Which in my case gives me:

Your npm version is outdated.

Upgrade to the latest version by running:
npm install -g npm

OK…Getting annoyed now:

snippetvs04

Maybe it was my own fault for doing it through PowerShell – now trying cmd/Node:

snippetvs05

snippetvs06

Seems better:

snippetvs07

Now try
npm install -g generator-code

snippetvs08

Now

yo code

snippetvs09

snippetvs10

Do a find for folders with .tmSnippet…

snippetvs11

C:\Users\Dennis\AppData\Roaming\npm\node_modules\generator-code\test\fixtures\tmsnippets

Plug that in:

snippetvs12

snippetvs13

snippetvs14

Really unhelpful. Exactly where have you installed it? Can’t find it using Windows Search, so let’s try PowerShell:

gci -Recurse -Path . -Filter “vsc-extension-quickstart.md” -ErrorAction SilentlyContinue

snippetvs15

snippetvs16

snippetvs17
# Welcome to your VS Code Extension

## What’s in the folder
* This folder contains all of the files necessary for your extension
* `package.json` – this is the manifest file that defines the location of the snippet file
and specifies the language of the snippets
* `snippets/snippets.json` – the file containing all snippets

## Get up and running straight away
* press `F5` to open a new window with your extension loaded
* create a new file with a file name suffix matching your language
* verify that your snippets are proposed on intellisense

## Make changes
* you can relaunch the extension from the debug toolbar after making changes to the files listed above
* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes

## Install your extension
* To start using your extension with Visual Studio Code copy it into the /.vscode/extensions folder and restart Code.
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.

https://code.visualstudio.com/docs/tools/yocode

https://code.visualstudio.com/docs/tools/samples

 

https://code.visualstudio.com/docs/editor/extension-gallery

Let’s try this route for an example:

snippetvs18

 

snippetvs19

So the C# XML docs extension clearly works… I just have to work out how now, and then I can use that for ctor. Another night:

snippetvs21

In fact as is often the way, now I am out of time, I’ve found possibly the most useful entries:

https://code.visualstudio.com/docs/customization/userdefinedsnippets

https://code.visualstudio.com/docs/editor/editingevolved