More Than Nothing

“You mean you can't take less; it's very easy to take more than nothing.”

Archive for the ‘Programming’ Category

Introducing Cordia

Posted on December 5, 2009 by [ICR] under Javascript, Programming, Web

From time to time I have the opportunity to look over the latest developments on a friends website and pass comment. The comments usually take the form of “Add more whitespace” and “Remove more clutter”. One of the major cause of clutter are the settings, which have slowly built up over many user feature requests [...]

No Comments | Read the rest of this entry »

A high resolution timer in C

Posted on April 4, 2009 by [ICR] under Programming

For the Computer Graphics and Visualisation module of my course we have to be able to use C and OpenGL to render and animate scenes. As part of the animation a timer is required to be able to scale the animation based on the time elapsed since the last update. Without this animation would be [...]

No Comments | Read the rest of this entry »

Decoupling data structure from presentation using MVC and events

Posted on March 12, 2009 by [ICR] under Programming

Disclaimer: I am not an expert on software architecture , MVC or designing components. The following is what I have picked up from my research. I have tried to be as accurate and helpful as I can, but some information may be incorrect or sub-par. If it is, my apologies. A discussion came up on [...]

3 Comments | Read the rest of this entry »

Why partial function evaluation is useful for more than just doubling lists

Posted on March 10, 2009 by [ICR] under Programming

I have been working on a project in C recently. It is a small engine written on top of OpenGL for rendering 3D scenes and handling animation, particles and other simple 3D effects. It’s actually been quite refreshing working in such a comparatively small language (though not Scheme small). I have missed several features though. [...]

No Comments | Read the rest of this entry »

Stream Data Structure

Posted on February 25, 2009 by [ICR] under .NET, C#, Programming

Recently I’ve had need of a stream data structure – a queue of a certain size that you can keep adding items too and, if the queue gets full, it removes the oldest item. It took me far too long to work it out, so I decided to post the code in case I ever [...]

1 Comment | Read the rest of this entry »

Object initialisation in rose

Posted on February 24, 2009 by [ICR] under Languages, Programming, Rose

Recently I’ve been thinking more about a toy language I have created called rose. It’s largely an exercise to teach myself about some of the difficulties of language design, giving me a greater understanding and apreciation of the languages I work in. Some of the guiding features of rose are immutable-by-default fields and as few [...]

No Comments | Read the rest of this entry »

Using VkKeyScanEx to find out what keys should be pressed to produce a character

Posted on February 21, 2009 by [ICR] under Programming

In a misguided attempt to solve a StackOverflow question I came up with the following code that checks whether the key combination represented by a KeyEventArgs would produce a given character on the current keyboard layout. The actual solution was a lot simpler, but I thought I’d post the code here for prosperity: public static [...]

1 Comment | Read the rest of this entry »

Adding hints to HTML fields

Posted on February 15, 2009 by [ICR] under Interface Design, Javascript, Programming, Web

There have been a lot of UI innovations since HTML forms, some of them big and some of them small. One of the smaller innovations is the addition of hints to text fields. These are basically placeholder text in the fields that describe the sort of input that should go in them that disappear when [...]

2 Comments | Read the rest of this entry »

Make sure you know what you're measuring

Posted on December 15, 2008 by [ICR] under .NET, C#, Programming

Over on StackOverflow someone posted a comment with a micro-benchmark on the speed of fields vs. properties. One would expect because the getters and setters of the properties are very small (3-4 IL instructions) that they would be inlined by the JITer and it would make no difference. However, running the following test (modified from [...]

No Comments | Read the rest of this entry »

A case for depreciating the decrement operator (oh, and increment too)

Posted on November 27, 2008 by [ICR] under Languages, Programming, Rants

If you ever read any of my code you’re probably likely to come across something like this, and equally likely to find it a little bizarre. for (int i = 0; i < length; i += 1) { // Some code } I have issues with the standard increment and decrement operators in C style [...]

1 Comment | Read the rest of this entry »