2020-02-23

Improving MVVM INotifyPropertyChanged

With a project that uses MVVM (Model-View-View Model) design pattern, INotifyPropertyChanged is often used to detect a property value change in an object. This is particularly pertinent as far as creating a two-way data binding. Typical Implementation Normally, the INotifyPropertyChanged is implemented in a similar pattern to the code below. This is something that makes […]

Read More…

2020-02-23

Time-based One Time Password

A nice easy-to-use RFC-6238 based algorithm, that provides a HMAC-based One-Time Password authentication. The algorithm is based on one outlined in this article here. The interval is in seconds. It dictates how long before a TOTP expires. For example, if a TOTP is generated at 14:20 and the interval is 120 seconds. The TOTP will […]

Read More…

2018-10-16

UK National Holidays API

The UK Government have a useful web page for all of the UK’s National Holidays, such as Easter and Christmas. This can be found with the link here https://www.gov.uk/bank-holidays. In addition to this, there is also a really handy public API, which is the JSON representation of the web page (Just add .json to the […]

Read More…

2018-02-18

Random AlphaNumeric Generator

Recently I needed to write a simple¬†token¬†generator for a project. In order to make it print-friendly and easy to read, I decided to make it an uppercase alphanumeric string. The code uses the ASCII (American Standard Code for Information Interchange) numeric representation of the character. A-Z (uppercase) is any number between 65 and 90. To […]

Read More…

2017-07-30

Determining Colour Contrast

I was recently working on one of my home projects that required colour coded drop down list items according to the option they related to. In my project, it was going to be colour coded categories. I wanted to implement colour coding to act as a visual aid for the user interface. Rather than store […]

Read More…