RGB/BGR CUDA Template Swizzle

Courtesy of the OpenCV 2.3 GPU code comes a neat snippet of code for using a template parameter for reading RGB or BGR ordered components when dealing with RGB triplets.

The Code ∞ 1 2 3 4 5 template <int blueIndex> float rgb2grey(const float *src) {    return 0.114f*src[blueIndex^2] + 0.587f*src[1] + 0.299f*src[blueIndex]; }

Then [...]

Good looking equations in a web browser?

Displaying equations in webpages has always been a headache. The fallback of using images was always there, but in the age of blogs and other content creation tools editing, updating and maintaining images for equations is tedious.

MathML was an effort to standardise support in browsers, but the reality of it is that it only [...]

Moving to Google Apps with imapsync

For 2.5 yrs work has made use of a Kolab server I set up, but recently it has been taking up too much of my time to maintain. Google Apps was chosen as the replacement, so the problem then became how to get 39GB of data uploaded to Google over a fairly slow ADSL link, [...]

string::npos, integers and 64-bit applications

At work we are getting a 64-bit version of our software up and running at the moment. Most of the usual culprits reared their head - assuming that a pointer and integer had the same size etc etc.

One more interesting one, which I've not come across before is related to using STL string::find and [...]