Cross Origin Headers (CORS), AWS S3, and AWS CloudFront

Let’s talk about cross origin resource sharing (referred to as CORS from here on), what it is, where it is used, and some mistakes I made when configuring this website’s hosting. After reading this you will hopefully never wonder again why that little error about not being ‘CORS-enabled’ shows up in the browser console. ...

June 26, 2021 · Michael Hughes

Creating a sleep loop in JavaScript

Today’s post is a quick tip on how to easily create a sleep-delay loop in JavaScript. ...

October 2, 2017 · Michael Hughes

DNS Round Robin Failures

Round robin DNS records are a technique for distributing load across public facing web servers. As an experiment we tried using them in order to distribute load inside of a cluster. We found this approach didn’t work. In this post I’ll discuss round robin load balancing, how it works at a high level, what we did with DNS, why it didn’t work, and what can be done instead. ...

July 18, 2016 · Michael Hughes

Loading a Cocos Studio scene into cocos2d-x 3.4/3.5

In the last few weeks I have been slowly learning about the cocos2d-x framework. cocos2d-x is a C++ based cross platform game engine. The makers of the engine also produce a UI creation GUI called Cocos Studio. Today’s post is a brief one about loading scenes from Cocos Studio into a cocos2d-x based application. ...

April 25, 2015 · MichaelHughes

The importance of being mindful of operator precedence

Operator precedence determines the order [Operator precedence determines the order]2 and binary operators are executed. In many situations, knowing basic mathematical operator precedence (for +,-,*, etc) is enough. In other situations not knowing the specifics of language can lead to hard to find errors. Quickly, in JavaScript what does 'the boogeyman ' + false ? 'is scary' : 'is not scary' evaluate to? ...

January 21, 2015 · MichaelHughes

Using Olingo ODataJS 4 Beta with AngularJS and Web API OData V4

Recently I started writing a new web application which uses OData V4 as the protocol for passing data to back and forth between the JavaScript client and ASP.Net server. The client is written using AngularJS which doesn’t have any built-in facilities for working in OData APIs. In order to avoid writing my own OData message handler I used the Apache Olingo library to handle the grunt work of sending requests and receiving responses. I wanted to encapsulate the Olingo library in an AngularJS service in order to make using it easier, the following post details how this was done. ...

January 5, 2015 · MichaelHughes

Server-client date time management in web applications

Previously we have discussed one approach and gave some implementing code for providing time zone adjusted date times to client web applications. Within the space of user facing web applications there are few different approaches to handling the storage and transmission of date time information. Today we will look at a couple broader themes for delivery of date times to client applications from servers and some thoughts on how to do it well. ...

July 25, 2014 · MichaelHughes

Gotchas associated with client side date handling

This is short post about a couple issues that end users might run into when using a method of displaying dates I described in a prior post. In short, Microsoft Internet Explorer 9 cannot parse certain types of ISO8601 dates correctly and Google Chrome does not track the system’s time zone correctly. ...

June 11, 2014 · MichaelHughes

Time zone correct client side date and time display

Today’s post one covers one approach for displaying the correct timezone adjusted date and time in a web application. A common example for the problem being addressed is user A located in London, UK uploads a file to a central server located in New York City, US and then user B located in Seoul, SK views the file. When user B attempts to download the file we would like show the user when the file was uploaded in his or her current time zone. ...

May 26, 2014 · MichaelHughes

Create an object based dual list shuttle with Knockoutjs

A quick tip post on using Knockoutjs to create a certain type of common web UI component. The short and sweet summary is that I’ll show how to create a shuttle control using two select boxes that are bound to arrays of Javascript objects (instead of simple value types) using Knockoutjs. Before getting to that though I’ll provide some background on the various component used to create the UI. ...

May 24, 2014 · MichaelHughes