Live data from Hacker News

Pointer Pointer

pointerpointer.com

11–20 of 33 posts

Re: Pointer Pointer

#11

Does anyone know how this was implemented? It's a great example of a case where, as a computer programmer, there are still problem domains which I have absolutely no idea how to approach!

30 seconds guess: Author got hold of a large set of photos, analyzed for raised fingers with computer imagery. Then author probably split the 960x680 px rectangle into a grid of small squares. Located the finger in every photo and assigned each of them to a specific square.

From there on it's a matter of finding the pointer in javascript and a Voronoi search to the matching photo. I'm not seeing an ajax call in the logs so there's probably a bit more magic going on clientside.

Edit: Terminology

Re: Pointer Pointer

#13

Does anyone know how this was implemented? It's a great example of a case where, as a computer programmer, there are still problem domains which I have absolutely no idea how to approach!

It loads a json file [1] that contains the co-ordinates of the tip of each point and the corresponding image. It uses this to create a Voronoi diagram [2] using a "custom Javascript implementation of Steven J. Fortune's algorithm" [3].

[1] http://www.pointerpointer.com/gridPositions.json

[2] http://en.wikipedia.org/wiki/Voronoi_diagram

[3] http://www.pointerpointer.com/js/rhill-voronoi-core.js

Re: Pointer Pointer

#15

I wonder if these images are all in the public domain. Edit: Seriously, these are all personal pictures of people clearly visible. Isn't that question legitimate?

I agree, it's a legitimate question. I tried to search for a bunch of them on TinEye to see if I could find some original source for any of them that might indicate a licence, but none of the ones I tried came up with any results.

Re: Pointer Pointer

#16
post #2

I was expecting something on C dereferencing ....

Actually, I was expecting that too. As I clicked this page, I had a recollection of learning Pascal and C on very early versions of MacOS (like 5.0 and earlier, circa 1985). In those early versions, when you called the MacOS version of malloc(), the OS would give you a double-pointer to the memory you just allocated.

The reason for this is so that the OS could move around memory allocations to make efficient use. (This was obviously before Macs had virtual memory.)

There were some rules in these early versions of MacOS about which MacOS system calls could cause the pointers to change.

If you ALWAYS used the double pointer (and used the 'volatile' keyword or its Pascal equivalent appropriately), you were always safe. But if you kept a single-pointer version of a double-pointer from the OS, and then used certain OS calls, you might find that the OS moved your allocations around you behind your back.

As a seasoned system software engineer, this completely makes sense to me. But as a teenager trying to understand software, this completely blew my mind and I wrote a lot of code that crashed in strange ways.

Re: Pointer Pointer

#17
post #4

Haha, this thing is hilarious. Great job. I wonder if the author manually went through images locating the finger or there was some automated way of doing it. I did notice that if you move the pointer is certain ~20x20 areas the same picture appears. I'm guessing the set of images is small enough to just manually do it.

If the image resolution software isn't good enough, and there's a lot of images, you could mechanical turk it using the reverse site. Show on image and have the user click on the finger (or none).

Re: Pointer Pointer

#18

This is dumb. Why does it entertain me so much?

Look beyond the funny app. Think of the challenge of finding an efficient solution to the original problem regardless of its "unseriousness": finding the optimal picture according to pointer position.

Same solution is also useful for other more serious applications: https://www.youtube.com/watch?v=90NsjKvz9Ns

Edit: Sorry, I missed the "me" in your "entertain me".

Re: Pointer Pointer

#19
Ha. Mostly got fingers pointing at the cursor, except once I got someone doing the Vulcan salute (fingers split), with my cursor in the middle. (Which reminds me of the joke about statisticians going deer hunting: they see a deer and both fire. One shot goes a foot too high and the other goes a foot too low. They shake hands and say "we got him!")

Re: Pointer Pointer

#20
Very cool!

Try the top-right corner: I get an image without a pointer (someone looking at his watch).

Prime example of use-after-free ;)

edit: ignore. just saw the cropped hand pointing.

Post reply on HN