Thursday, 16 May 2019

Enable function lock for F1-F12 on HP ZBook mobile workstations

When you press the function keys on a HP ZBook mobile workstation you may find that they don't operate as expected.

This is because of function lock, if you hold the fn key the function keys work as expected.

You can lock the function keys on as described in this document.

However there are two things to note

Firstly following a BIOS upgrade (which occurs automatically if you have the preinstalled HP software still installed) you may lose your locked function keys and have to reapply.
Secondly the HP documentation states you press the fn lock and fn keys at the same time as per the image below from the page.

Enabling the Action Key mode

This is not the case, you need to press and hold the fn key, and then tap the fn lock key to toggle function lock, not an obvious thing when you start work first thing in the morning and are hammering the function keys trying to get F5 to work.

Monday, 15 April 2019

Unwrapped overflowed integer values in C# where large negative integers overflow and appear as negative values.

You may find that when working with large integer values that these numbers suddenly become negative numbers.

This can be seen in the PowerShell registry editor and also in some SNMP MIBs. The reason why this happens is simple.

The last bit of a signed integer determines whether the number is negative or positive, whereas on an unsigned integer this bit is part of the number and therefore the number can be twice as big.

UInt32.MaxValue = 4294967295

Int32.MaxValue = 2147483647


The problem of wrapping occurs when you exceed 2147483647 - lets say 2147483648 which converts in bits as the following


This works fine in a UInt32, however if you just take these bits and stick them in an Int32 the bits fit (there are still 32 bits available) however the value returns as -2147483648 because the negative values are working backwards this is the "highest" negative value.

If we put the highest UInt32 value 4294967295 the Int32 interprets this as negative but because all the flags are set it returns the "lowest" number it can before zero which is -1.

Simply converting the number from the wrapped signed integer will cause an overflow exception
UInt32 value = Convert.ToUInt32(-1);
System.OverflowException: 'Value was either too large or too small for a UInt32.'

Instead transfer the bits to a byte array and them convert the bits to an unsigned integer and they will remain in the correct places.

/// <summary>
/// Unwraps the specified integer value.
/// </summary>
/// <param name="value">The integer value to unwrap - for example 36, or -1.</param>
/// <returns>The unwrapped unsigned integer from the specified integer value.</returns>
public static UInt32 UnwrapInteger(Int32 value)
    return BitConverter.ToUInt32(BitConverter.GetBytes(value), 0);

Tuesday, 26 March 2019

Creating shortcuts to Windows 10 Modern Applications

Modern applications in Windows 10 do not have executable files so are more complex to create an application for in XIA Links.

You are able to drag and drop a shortcut to the desktop for a modern application, however it is difficult to read the package family name from the properties as they are read-only.

It is easier to perform this task in PowerShell. Firstly open a PowerShell prompt and run the following command

Get-AppxPackage | SELECT Name, PackageFamilyName | Sort-Object Name

This lists the application name and the package family name

This can be started in the command line in the following format with an exclamation mark between the package family name and the application name
%windir%\explorer.exe shell:appsFolder\package-family-name!application-name

For example
%windir%\explorer.exe shell:appsFolder\Microsoft.MSPaint_8wekyb3d8bbwe!Microsoft.MSPaint

In XIA Links this can be entered in the following format

Wednesday, 6 March 2019

Bug in QuickBooks custom template converting from estimate to invoice

In QuickBooks we have the master template, and an Estimate and Invoice template created from a .docx file

They preview correctly and creating an estimate or an invoice uses the expected template

However when you click the Create Invoice action next to an existing Estimate it uses the Master template

Clicking the Customise link shows that the expected invoice template is selected. Changing the template to Standard and back again has no effect.

Monday, 11 February 2019

Data roaming doesn't work with EE in Costa Rica

If you are using your EE mobile in Costa Rica you may find that you do not get an E, 3G or 4G symbol though your phone connects to the Kolbi ICE network.

Calling EE technical support is an issue as they'll run through standard troubleshooting. There is only one solution.


You must call EE and demand that they unlock your phone and purchase a local SIM card and pay as you go data. It can take upto 72 hours to unlock your phone (it really takes on a few hours if you put them under pressure).

You can then purchase a Kolbi ICE (the local provider) SIM card and install it in your phone.

Please note that

  • You'll have a new number
  • WhatsApp will work with as perviously as long as you tell it to use your old number when you start the app

Data roaming doesn't work abroad with EE

If you're abroad with EE and you find that data roaming doesn't work you can try one of the following on your iPhone

  • Goto Settings > General > About and check your Carrier Version. If you update your iOS to the latest version you'll get a new carrier update if one is available.
  • Goto Settings > Mobile Data and check that Mobile Data and Roaming is enabled.

  • Login to the My EE web site and goto devices, you can see these checkboxes.
    • If roaming abroad is disabled nothing will work.
    • If call abroad and premium rate is unchecked then you can't call back home from abroad. This should be abled for business but isn't. You'll notice that you can't change the check yourself. You have to call EE.

  • Goto Settings > General > Reset > Reset Network Settings. WARNING this will reset your Wifi settings too and you'll lose things like your Wifi passwords. It's a good idea to do a phone backup before doing this.

  • Check with EE to see if the country you are roaming to supports roaming data. I was roaming in Costa Rica and EE does not support data roaming here. You must call EE and demand they unlock your phone so that you can buy and install a local SIM card from the country you are in.

Tuesday, 15 January 2019

BREXIT and democracy: A thought experiment

A thought experiment...
The democratically elected government says diesel cars are bad, but put under pressure by lobbying groups a referendum is created that says

"Do you want Britain to move to entirely Diesel cars"
[ X ]  Yes
[     ]  No

The politicians and unelected bureaucrats like Nigel Farage run a campaign that says with diesel we can have cleaner air. Don't you want cleaner air? The slogan MAKE BRITAIN CLEAN AGAIN is everywhere.

People vote YES to diesel. There is nothing in the referendum to promise that diesel will make the air cleaner.

The government now has a problem, it either says this is a terrible idea and puts a stop to it, or supports the will of the people knowing it will cost billions of £ and in the end you will not have clean air, in fact probably dirtier air.

What's the democratic thing to do?

Diesel Cars
You are supporting the "will of the people" but you are not operating in their best interest.

No Diesel Cars
You are no supporting the "will of the people" but you are operating in their best interest.

Another Vote
You are effectively not supporting change, or the original vote. The second vote is effectively as worthless as the first because it's just the whim (not the will) of the people and is subject to change.

Referendums are useful for one thing only and that is for the people to rubber stamp a full plan and promise that a democratically elected government has made in effect saying "the people want cleaner air, here is our plan to ban diesel cars, it will cost you money to get rid of them, but the benefits will be x% cleaner air in 4 years" the full details of the plan are provided.

The people can then confirm that they agree to execute this plan, complex open questions with no facts should not be put in a referendum.