Cool Link Stash, October 2012

JavaScript & Web Development

Understanding JavaScript OOP is a great article on, well, understanding how OOP works in JavaScript. It's interesting because it's very different from how OOP is implemented in languages like C++, C#, or Java. JavaScript implements prototypical OOP similarly to Self.

pixleJET is a nifty online, in-browser development environment for HTML, CSS, and JavaScript.

The State of JavaScript is a good presentation on current developments in JavaScript, in particular with regards to ECMAScript 6.

Since I've been recently dabbling with the MVVM pattern in WPF, I was looking for ways to do MVVM in the web browser with JavaScript as well. There are quite a few libraries out there, but one that struck me as quite nice is Knockout. The project's site has really good online tutorials where you develop small websites using Knockout directly in the browser, kind of like how pixelJET works.

If Knockout.js is not your thing, there are plenty of other libraries that help implement any kind of MV* pattern you can imagine. A good way to choose between them is to read Journey Through the JavaScript MVC Jungle. The article references TodoMVC, which is a small todo web application implemented in a large number of MV* libraries.

C++ is a great site that is a reference of the all variants of standard C/C++ and their respective standard libraries, in particular C++98, C++03, C++11, C89, C99, and C11.

Scott Myers has a good article on rvalue references and how they can be something else in certain cases where the type gets deduced, as is the case in templates or when using the auto keyword. He proposes the term universal references for these cases. Read his interesting article in Overload 111.
He gave a presentation on the same topic and a video of it is available here.

There has been some interesting discussion on various C++ blogs lately on how to best pass parameters to functions in C++11 that is worth following. Here are the relevant links in order:

While I appreciate these discussions as a programming language nerd, it definitely shows that C++11 makes C++ a much more complicated language in many regards, especially if you want to use all of its features to maximum effect. Even in these early days of C++11 usage, we already notice some loopholes or missing pieces with the latest language features, such as rvalue references and perfect forwarding. I'm glad I don't have to teach C++11. That sounds like a nightmare.

Christian Plesner Hansen posted an excellent article explaining in-depth how the inverse square root hack works. That hack was made famous by its use in the Quake C code base. He not only shows how and why the hack works but also demonstrates how it can be modified to work for 64-bit floating point types (or really any arbitrary number of bits) and how it can be extended to not just work for the inverse square root (i.e. a power of -0.5) but for any power between -1 and 1.


The Journal of Computer Graphics Techniques posted a new article on compressing the frame buffer called The Compact YCoCg Frame Buffer. The idea is to basically reduce the frame buffer storage requirements by converting fragments into the YCoCg color space (which is a luminance/chrominance color space) and then store the chrominance channels at a lower resolution since the human eye isn't as sensitive to chrominance variations as it is to luminance variations. There is also a WebGL demo and a video on the paper's web site.

Simon Yeung posted a nice article on his implementation of angle-based SSAO over at #AltDevBlogADay. You can find the same article on his personal blog.

Ben Weston posted a nice blog article dealing with optimizing Perlin noise evaluation by using 3D texture hardware. As opposed to doing multiple texture lookups that get lerped, this technique uses a single 3D texture lookup and uses hardware trilinear filtering to effectively get the same result as if multiple lookups had been done.

MeshLab is a nice, open source tool for doing various mesh simplification and cleanup tasks. It builds on the VCG Library and is available for Windows, Linux, Mac, and even phones.

John Chapman posted a great tutorial on pseudo lens flares last month that I missed.

I was looking for some more info on Poisson disk sampling recently and I stumbled upon an old article from 2008 on the topic that is really good.


Tim Cooper posted a must-read article on serialization in Unity. I really wish this was part of the docs because I had to find out all of this the hard way, and some of it is not immediately obvious.