Saturday 21 November 2020

Running Windows 10 in Developer Mode

This can be switched on from the screen accessible by typing "developer settings" in the Windows Search Bar. Some details on developer mode features can be found here.

Tuesday 27 October 2020

Programming Computers to Work Backwards from a Goal

 This is known as backward chaining. This technique is used by automated theorem provers and inference engines. It was used in the expert system Mycin, a famous AI case study.

Monday 26 October 2020

Scope to View in Solution Explorer to Simplify and Focus

 If you want to focus on a specific file in Solution Explorer, you can right-click and select "Scope to View". To disengage, either click the Back button in Solution Explorer, or the Home icon.

Build does Not Support Previewing in WinForms in Visual Studio 2019 (MMDG Response)

This error can cause a form to disappear from the main viewport. The fix is to right-click and select "Move to Main Document Group".

Friday 23 October 2020

Eliminating the Need For Escape Sequences with @

Prefixing a string with @ in .NET resolves the need for using backslash to denote an escape sequence. In other words it says: "interpret the string literally".

If you need to include speech marks in the @-prefixed string you can use double speech marks.

Where are we with .NET Core?

For .NET Core we are on version 3.1.9 (released October 13, 2020).

3.1.9 contains only non-security fixes.

VS Compatibility requirement is VS2019 16.4.

It is being deployed to Azure App Services with availability end October 2020.

Saturday 3 October 2020

ToolStrip Replaces ToolBar in Windows Forms

 This is true for .NET Core 3.1 and later versions.  

Saturday 29 August 2020

Sony's Authoring Tools Framework (ATF)

 ATF has been in development since 2005.

Monday 10 August 2020

Control.BackgroundImageLayout in Windows Forms

 This property of a control takes its values from the ImageLayout enum which is WinForms specific. Its values are Center, None, Stretch, Tile and Zoom.  Tile is the default setting but can be memory-intensive. This property was in .NET 2.0 and remains true in .NET 5 preview 7.

Sunday 9 August 2020

Static Single Assignment-Based Compilation Explained

 SSA refers to Static Single Assignment.

It is a naming convention for storage locations such that the value of a variable is independent of its location in the program. This is known as referential transparency.

An example of an SSA-based compilation toolchain is LLVM which has an associated Project Blog here.

Sunday 12 July 2020

Understanding Ampere Hours and Milliampere Hours (mAh) in Battery Technology

The ampere-hour or Amp hour is a unit of electrical charge (denoted Ah).  The milli-ampere hour (abbreviated mAh) is one thousandth of an ampere-hour. 

1 Ah is equal to 3,600 coulombs so 1 mAh is equal to 3.6 coulombs. The coulomb is the SI unit of electrical charge ("quantity of electricity"). Coulombs are another "view" on the same data.

A coulomb the charge transferred by a constant electric current of 1 ampere in 1 second.

Tuesday 30 June 2020

Windows 10 ARM Strategy

Microsoft is putting Windows 10 on ARM, and .NET 5 will include Windows Forms support on ARM. In short, plus points of using ARM vs Intel x86 components (microprocessors) include built-in LTE cellular connectivity, better battery life and cheaper hardware.

Monday 8 June 2020

Order files by Time

What did I last edit?

dir /o:d is the way to sort by date - oldest first. Newest appear at the end.

If you add a prefix "minus sign" you can reverse the sort order.

dir /o:-d

Tuesday 2 June 2020

Output of ildasm == CIL (directives, opcodes et al).

Reading the output of ildasm (IL disassembler) after giving it a .NET DLL as an example, produces MSIL / CIL (see footnote 1) worthy of further explanation.

CIL (Common Intermediate Language) is the "mother tongue" of the .NET platform.

The first types of tokens present in a CIL program are directives e.g. .class, .method, .assembly etc. They convey structural information.  Next are various opcodes, such as loadstr which is short for LoadString.

Footnote 1)

Strictly speaking, MSIL has been renamed CIL (Common Intermediate Language), which is the instruction set defined by the Common Language Infrastructure (CLI) specification.

However, MSIL is still colloquially commonly used.

Fun Fact 1)

System.Reflection.Emit allows you to generate in-memory .NET assemblies in CIL.

Monday 1 June 2020

What is a ProcessModule? Ans: An Abstraction of a DLL or EXE file.

.NET uses the term "ProcessModule" to refer to a DLL or EXE file.  

Noting that this "term" is represented by a corresponding "type" we drop the speech marks henceforth.

ProcessModule 
- is defined in System.Diagnostics
- implements IDisposable interface (which means it can be disposed using Dispose within a try-catch or implicitly destroyed within a using block (using in C#, Using in VB.NET)).
- Has interesting properties including BaseAddress which returns an IntPtr (representing the memory address where the pointer was loaded).

IntPtr is defined in System.Runtime dll.

Thursday 21 May 2020

Camera Application in Windows 10

In Windows 10 the Camera application won't work if another application is using the camera.  You will see the error code "AllCamerasAreReserved". You can look in Task Manager to see if there are processes which may be using the camera e.g. Skype. It may also be possible that Privacy Settings prevent access to the camera from the Camera app. These can be altered by typing "Privacy Settings" in the Windows Search Bar, looking under "App Permissions" (below "Windows Permissions") and selecting Camera.

Tuesday 19 May 2020

CPU Pinning for Multicore Champions

CPU pinning is a practise also discussed under the byword of  "processor affinity".  The idea is to execute a thread or process only a designated CPU. Another less frequent term for the phenomenon is "predestination". 

The King of Microsoft Compiler Flags - /std:c++latest

Use this flag if you want to utilise the latest C++ standard features, including some not yet finalized.

Monday 18 May 2020

Concepts have come to C++ 20

Concepts are an extension to templates. They are compile-time-evaluated predicates on template parameters. Their origins lie in discussions around C++11 and are now a required part of C++20. MSVS 2019 version 16.3 supports concepts and links to their formal description. Stroustrop has also blogged on this topic.

Sunday 10 May 2020

F# on Azure

F# is being built for the cloudAzure Functions supports functions-as-a-service.

Haskell Vs Erlang

Haskell and Erlang are both functional programming languages. Erlang has multithreading built in and has been historically more industry focused with its roots in the telecoms industry. F# is another functional language that supports concurrency through the async computation expression.

Thursday 16 April 2020

Windows 10 Rotation

Control-Alt-Left   - anticlockwise rotation 90 degrees
Control-Alt-Right   - clockwise rotation 90 degrees
Control-Alt-Up - upright
Control-Alt-Down - upside down

Friday 10 April 2020

System.Windows.Forms.Splitter

This Windows Forms Splitter control is a legacy component and has been replaced by the SplitContainer class. It can be safely ignored except for compatibility reasons. The SplitContainer is more intuitive to use than Splitter.

Monday 20 January 2020

Am I up to date with Windows Update? How do I check?

Update History

Type "Windows Update" in the Windows Search Bar and then click on "View your Update history".

Quality versus Feature Updates

There are a wide variety of updates, examples being Feature updates (rare) and Quality updates (common). Quality updates tend to be security fixes. Occasionally you will see Driver Updates as well as Definition updates, that relate to antivirus definitions (Windows Defender).

CVEs

Clicking into specific Quality updates will give details on any CVEs (Common Vulnerabilities and Exposures) which the update is trying to fix.