A Geeky Weekend 1

A few weeks ago a couple of friends of mine (myself included) decided to go to a friend’s beach house in pajama party style for the weekend. There were 7 computer scientists, 1 mathematician and a chemist. We had a pretty good time that weekend: we cooked at a barbecue, shot pellets at empty beer ...

How We Do It 1

In my years of hanging around computer scientists (and looking one in the mirror every morning) I’ve formed a theory about how their diverse personalities can be unified and explained under a single formalism. My theory is based on a vectorial representation of the computer scientist mind, in a 3D dimensional vectorial space enclosed in ...

Fast Math with DirectX

Recently I’ve been playing around DirectX 11, trying to implement some well-known CPU algorithms in GPU, with a clever use (at least I like to think so) of vertex and pixel shaders, and the new read-write buffers. I’m writing a path-tracing algorithm, and hitting some walls while at it, mainly because doing hit-testing on GPU ...

Blogging on Email!

The new WordPress Jetpack bundle includes a tiny but useful feature to post by email. They simply give you a secret email address at , and post anything you send there in your blog. It is really useful for us people living in underdeveloped countries with little to none Internet connectivity. They have a lot ...

Hello Brave New World!

I’ve been offline for a while, mostly dealing with Christmas, family stuff, and a lot of delayed projects. I waited expectantly for the end of the world, hoping to see some aliens, budist monks or antichrists take over the world, but sadly, nothing interesting happened that evening. Well, actually there was something: we were having ...

Breaking .NET’s QuickSort 2

In a previous post I discussed about how .NET’s QuickSort beats my own implementation of QuickSort in terms of performance. Now it’s payback time! It turns out that the reflected implementation I found in .NET’s core actually selects the partition pivot in a deterministic manner: the middle element. As you may know, for every deterministic ...

Comparison with .NET’s QuickSort 1

In a previous post I talked about a simple implementation of the QuickSort algorithm. I also noted that my implementation ran a lot slower than .NET’s Array.Sort. I wanted to understand if there was something better in their implementation, or if it was just that their code ran with a lot more privileges and less ...

Algorithm: QuickSort

This is a classic, but I added it here because it deserves a place in all our hearts. Must people know QuickSort, or at least know that it is the fastest of the classic sorting algorithms based only on comparisons. The idea is pretty simple: you first partition the array in two subarrays separated by ...

10 features of next generation video games

The industry of video games has been pulling the edge of hardware and software since the early beginnings of personal computing. In the past few years we’ve seen a huge leap in video games quality, which seems to accelerate every year. The recent rise of high-tech video consoles and the increase in the number of ...

Data Structure: Randomized Heap

A randomized heap is binary heap that maintains expected logarithmic depth via a randomized merging operation. It is one of the easiest heaps to implement, and it behaves fairly well in practice. Like all random things, its a bit strange the fact that it works. In this post I’ll cover a C# implementation of a ...