Stupid C# Language Decision

In C#, many years ago, some stupid person decided it would be a good idea to allow the use of the keyword var to define a variable without explicitly identifying its type, as type can many times be inferred from the RHS of the assignment.

So instead of defining code as in the old olden days below:

foreach (string mask in someList) {
  // Do something
}
Full Article

Christmas Macarons

Seems like I am getting slightly better at this. Peppermint and eggnog flavoured macarons.

Eggnog and peppermint macarons #1
Eggnog and peppermint macarons #1
Eggnog and peppermint macarons #1
Eggnog and peppermint macarons #1

Visual Studio Crashes When Designing Form

Ever had the problem where Visual Studio keeps on crashing when trying to open a Windows Form to design it? Well, I am building an Excel VSTO add-in that uses Windows Forms and an embedded User Control written in WPF to work around mixed HDPI and standard DPI monitor scaling issues. All went well until one day seemingly randomly Visual Studio refused to load the form. It had no issue loading the visual designer for the user control though.

Eventually I found this article, written 14 years ago. I am embarrassed that I did not think to do this myself. It turns our, I had combobox control in my user control that had a Grid_Loaded event attached. In the Grid_Loaded event handler I had code like this:

if (Globals.ThisAddIn.Credentials != null)
{
    textBoxURL.Text = Globals.ThisAddIn.Credentials.URL;
}
Full Article

Fast Mac Pro

So this website claims this puzzle cannot be solved by a modern chess engine like Stockfish:

https://www.youtube.com/watch?v=8wCJalNkTEI

I let Stockfish 12 lose on my Mac Pro and after 43 minutes it found the solution:

Full Article

Apple Watch Unlock Distance

Apple watch allows you to unlock your mac if you are close to it and touch the keyboard, to wake it from sleep. This is a very useful feature. as you do not have to type your password every time you unlock it. In addition to the security features built in to the Bluetooth / WiFi signalling protocol, you have to be "nearby" your mac for this to work.

The problem here is the definition of "nearby". Most articles on the internet will have you believe it is "within a couple of feet, usually less than ~2 feet". Unfortunately that is not my experience. With both series 5 and series 6 watches, I have had the mac unlock when I was about 8 meters away, four rooms from my office and one floor separated. How do I know? My kid tapped a key on the keyboard while I was that far away and the watch played the unlock notification sequence. I just tested it again - my office is on the first floor, when I am on the ground floor 4.5m away from the office (vertically), the mac unlocks. That is 4.5 meters through hardwood floors...

Needless to say this is a major security issue. I do not want the mac to unlock unless I am in the same room as the mac.