Programming

Bing Image Search API

Bing Image Search API The Image Search API lets you query the Bing search engine for a list of relevant images, in order to access it you need a cognitive services API key obtained from the Azure portal. The API endpoint can be accessed directly by structuring queries using the Read more…

Programming

Upper Case the First Letter of a String

Upper Case the First Letter of a String This is a simple string extension for upper casing the first letter of a string, the code originally came from here. public static class StringExtensions { public static string FirstLetterToUpperCase(this string s) { if (string.IsNullOrEmpty(s)) throw new ArgumentException(“There is no first letter”); Read more…

Programming

ASP.NET Core API Routing

ASP.NET Core API Routing When creating a new API controller in a Web Application the template code created if you choose to include read/write actions provides a good overview of how to pass values through to the API methods and return results. The template assumes that the controller only has Read more…

Programming

Cryptographically Secure Random Number

Cryptographically Secure Random Number In a similar vein to my attempt to generate a cryptographically secure random string I also wanted to be able to create cryptographically secure random numbers. The below function is based on the answer from Markus Olsson to the stackoverflow question here. public static int GetRandomInteger(int Read more…

Programming

Pre-Populating Social Sharing Messages

Pre-Populating Social Sharing Messages Sharing buttons on a site can be configured to pre-populate content through various sharing channels such as email, Facebook and Twitter, though unfortunately this doesn’t seem to be that well documented. The below examples show how to pre-compose a message to be sent by Outlook.com, Yahoo, Read more…