Blog

Below are some of my recent blog articles.

 

2018-03-08

Get Substring by text in SQL

In Microsoft SQL, the SUBSTRING allows you extract part of a string using a start index and length. For example: SELECT SUBSTRING(‘hello world’, 2, 3)   Results in an output of ‘ell’. However, there is no ability to select the start and end of the sub-string using known letters or words. The SQL example shown below […]

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-09-21

HttpClient Performance Issues

As developers, we all have to write software at some point to talk to various RESTful APIs and end points, this usually involves using the HttpClient, WebRequest or WebClient. Each of these have their advantages and disadvantages depending on your requirements. HttpClient (System.Net.Http) was introduced in .NET 4.5 and provides the simplicity of WebClient whilst […]

Read More…

2017-08-16

YubiKey OTP Implementation

In this article, I will be focussing on YubiKeys that are made by a Company called Yubico. Yubico offer a number of different styles of hardware based on two-factor authentication devices. In my case, I have been implementing the YubiKey 4, using their OTP (one time password) authentication API. Firstly, it is important to understand […]

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…