David's blog

This seems to make Cappuccino faster...

December 19, 2012 00:00

My lack of knowledge about Cappuccino's implementation details may play a role, but

window.setTimeout = window.setNativeTimeout;

Seems to make my Cappuccino apps more responsive. ...

Read post

The Identity of an Array

December 12, 2012 00:00

Given two arrays of integers: a and b, what does (a == b) mean?

Most of us will say, it depends on the programming language you are using, and that is true. In the case of C, it means a and b are the pointers to the start of the same array. In Java and C# it means the arrays are Reference Equal, b...

Read post

Exceptionless Programming

November 28, 2012 00:00

I am a big fan of writing code that generates no runtime errors. This is an implementation of a function that takes the first element of an array.

template<typename T>
T first(std::vector<T> array)
{
    if (array.size() == 0) { throw EmptyArrayException(); }
    return array[0];
}

This is ...

Read post

Nice Visualization of a Cross Product

November 18, 2012 00:00

[This] is a very nice Java applet that allows you to see what a cross product is. The applet shows A x B = C (i.e. C is the cross product of A and B) in 3 dimensions. You can drag A and B around to see the effects on C.

This UI ...

Read post

Blurred Text Effect

August 13, 2012 00:00

I came across a strange site that blurred the text of answers and asked the reader to sign up to see it. It was strange because the text was already there, just blurred via css. I thought it was an interesting little snippet so I decided to record it.

<span style="color:transparent; text-shadow:0 ...

Read post