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".