HNHacker News
TopNewBestAskShowJobs

dhotson

8,324 karma · joined March 18, 2008

Dennis Hotson

https://dn.ht

http://dhotson.tumblr.com

https://twitter.com/dennishotson

dennis.hotson@gmail.com

submissionscomments
dhotson··on Redis new data structure: the HyperLogLog
So I think this is roughly what antirez is talking about with 'registers' for a counter.

From the article:

The standard error of HyperLogLog is 1.04/sqrt(m), where “m” is the number of registers used. Redis uses 16384 registers, so the standard error is 0.81%.

My understanding is that the error is very small because you're averaging over 16,000 registers.

Edit: also, I think you want the mean because it'll give you back a precise/fractional power of 2 that is pretty close to the actual count. The median would give you the nearest integer power of two, which is probably not a good estimate of the real count.

Double edit: looks like there's some research around improving averaging by throwing away outliers: http://blog.notdot.net/2012/09/Dam-Cool-Algorithms-Cardinali...

dhotson··on Redis new data structure: the HyperLogLog
To be honest, I'm not an expert at this stuff—merely enthusiastic about it. I could have some details wrong.

My intuition says that a straight average should give you fairly good results.. although antirez talks a bit about bias in HyperLogLog counts that he's trying to adjust for.

So maybe an average + some bias correction gives you better results?

dhotson··on Redis new data structure: the HyperLogLog
HyperLogLog counters are one of my favourite things. They're incredibly clever.

So also, you can combine this idea with the idea of bloom filters (another probabilistic data structure) in a really interesting way. The goal is to have a _lot_ of counters in a fixed amount of space.

First part is to encode your HyperLogLog counter in unary. So each counter generally only takes up a few bits.

Quick unary tutorial: in unary you count with a sequence of 1's (followed by 0 to signify the end of the number). 3 is encoded as 1110. 5 is 111110. 7 is 11111110. You get the idea.

So also, we're just estimating cardinality, not an exact count. We're estimating if we've seen 2^n things... not n things. Counting to a billion is going to be: 1 billion ~= 2^30 ~= 31 bits.

So you can store all these counters in a big array of bits (a bitmap) and index into it using a hash function. As you probably guessed, all these unary counters will end up overlapping each other in weird ways.

But! The cool thing is if you use a bloom filter to insert and retrieve multiple counters using different hash functions.. and then average the results. The more of these probabilistic and messed up counters you average .. the better the results get!

It's kind of opposite of the usual programmer "junk in, junk out" problem. In this case, the more junk you combine, the better the results. Pretty neat huh? :)

I don't have links to the papers behind these ideas sorry. I learnt most of this from a presentation by Alex Sharp at PyCon Au. Edit: found link to talk - http://pyvideo.org/video/1621/big-data-with-python

This article explains some of this stuff a bit better: http://highscalability.com/blog/2012/4/5/big-data-counting-h...

dhotson··on 0x5f3759df — Fast inverse square root explained in detail
The appendix of this article has a slightly more intuitive explanation: http://blog.quenta.org/2012/09/0x5f3759df-appendix.html
dhotson··on Show HN: faces.io – ridiculously simple video chat
Hey cool, I didn't know about this. Thank you!
dhotson··on Show HN: faces.io – ridiculously simple video chat
Isn't there a rule about if you're not embarassed about your 1.0 then you're not shipping fast enough? ;-)

Basically I just wanted to try out some ideas using WebRTC peer-to-peer video with some clever layout algorithms.

When I started this I was looking into libraries like Packery that are good at arranging rectangles in the smallest possible space. But I found what I really wanted was something to expand to fill all available space.

I ended up using D3's treemaps to arrange videos. Normally they're used for visualising things like diskspace, but I'm using it to fill the screen with videos.

https://github.com/mbostock/d3/wiki/Treemap-Layout

dhotson··on Show HN: faces.io – ridiculously simple video chat
Screenshot: http://24.media.tumblr.com/07de3da18d8a5587d9480f42e87da8c4/...

Bonus pro tip, add a hash target in the url to have a more private conversation.

eg http://faces.io/#hn

dhotson··on Nanocubes: Fast Visualization of Large Spatiotemporal Datasets
Kind of related, I recently made a similar style of visualisation for 99designs.com - http://a.tiles.mapbox.com/v3/dhotson.d2013/page.html

Once I got the data into PostGIS and aggregated into hexes (slightly harder than it sounds) it wasn't that big a deal to visualise using Tilemill and MapBox.

I haven't read the nanocubes paper yet, but it sounds much much faster than my approach using PostGIS. It took me many hours to import and process tens of millions of points in my visualisation. It'd be great to be able to turn something like this around in <10 mins.

Would this nanocubes approach work with hexes? (they look cooler IMO)

Offtopic: After all this, all I can think about—is making a Settlers of Catan MMO. ;-)

dhotson··on Falsehoods programmers believe about geography
Also, pretty subtle thing.. but places are constantly moving due to plate tectonics and continental drift.

A GPS position describing a location will slowly go out of date over time.

http://en.wikipedia.org/wiki/File:Global_plate_motion_2008-0...

dhotson··on Microsoft TerraServer (1998)
Check out MapBox if you haven't already. There's still some room for competition. :-)
dhotson··on The First Few Milliseconds of an HTTPS Connection (2009)
Yep, sorry for the repost.

I figured that enough time had passed since the last time since it's such an excellent article. ;-)

dhotson··on Open Sourcers Pitch Secure Email in Dark Age of PRISM
I'd also add that you want to encrypt the metadata of the message. As we've seen, the from/to address metadata is often as revealing as the content.

How can you build a messaging system where the delivery service doesn't know where to deliver something?

dhotson··on Marelle: logic-based devops with Prolog
That was the quickstart version—it's just being pragmatic. The alternative is to audit the setup script yourself, which is easy enough to do. You'd do the same for a tarball right?

If you trust the author and want to get started quicky it makes a lot of sense to simplify the install process to a one liner.

dhotson··on Test-driven design
Yep, this is how I think about TDD too.

Testing is a good tool for QA, but I find it's even better as a tool for design.

Writing code that's designed to be testable helps clarify responsibilities, dependencies, interfaces, and relationships.

The bit where you actually run the tests is less interesting to me. :-P

dhotson··on Show HN: I built color search for iTunes
Semi offtopic, have you ever noticed on Chrome's new tab page.. the "most visited" section uses the dominant color of each page as a highlight?
dhotson··on Show HN: I built color search for iTunes
There are a few approaches for extracting colors from an image.

Shameless plug: I helped write a library called colorific to do it: https://github.com/99designs/colorific

More about how it works here: http://99designs.com/tech-blog/blog/2012/05/11/color-analysi...

Clustering techniques can also work quite well: http://charlesleifer.com/blog/using-python-and-k-means-to-fi...

dhotson··on Show HN: I built color search for iTunes
Very cool! :-)

I built a similar search by color tool at 99designs and wrote a bit about how it works here: http://99designs.com/tech-blog/blog/2012/08/02/color-explore...

TL;DR I'm using R-trees to do fast perceptual nearest neighbour color search.

OP, how are you doing it in this?

dhotson··on Ask HN: How do you apply for a tech job?
Steve Yegge made some excellent points about writing a resume:

http://steve-yegge.blogspot.com.au/2007/09/ten-tips-for-slig...

dhotson··on Effeckt.css
Very cool!

I've been playing around with an animation concept for submitting a note: http://dhotson.github.io/envelope/ .. is it too much? :-)

dhotson··on Set up an email server in two hours
Is this really going to protect you? I get the feeling it'll just give you a false sense of security.

They will still know who you are sending email to and receiving from.

The recipient metadata is unencrypted correct? As we've seen recently—the metadata often reveals more than the message content.

dhotson··on Poll: Do you encrypt your email?
That's really interesting. I wonder though if signing would have a negative effect in terms of privacy?

i.e with message signing, a third party can prove that a message was sent by you. Whereas with an unsigned email, you'd at least be able to plausibly deny that you sent it. You could claim it was forged.

But then again, with secret and silent data collection systems you're not really in a position to deny anything anyway. I have a feeling you'd have a hard time denying an unsigned email with your name on it to a court if it came to that.

dhotson··on Poll: Do you encrypt your email?
Encrypting the message content sounds sensible. But as far as I'm aware you can't encrypt the to/from fields.

As we've seen recently, this kind of metadata is often just as revealing as the content.

Encryption for email is probably giving you a false sense of security. If you care about privacy, email feels inappropriate to me.

So then the question is, what is the alternative? Honest question—I feel kind of helpless about it.

dhotson··on Final Term - Terminal Emulator
Looks like iTerm2 is adding 24bit color support soon too: https://github.com/gnachman/iTerm2/pull/133

Pull request is from less than 12 hours ago, so I'm not sure how long it'll take to get into a release.

dhotson··on “A Dark Room” game open-sourced
Maybe something like roflbalt?

http://www.youtube.com/watch?v=VoHmJfXqwbM

https://github.com/pda/roflbalt

:-P

dhotson··on CSS filters, GIFs, and performance
Love this. Cool hack!
dhotson··on [dead]
We're hiring designers/programmers/UXers at 99designs in Melbourne.

http://99designs.com.au/about/jobs

We're looking for a frontend engineer in particular at the moment, which might be a good fit. Let me know if you have any questions: dennis@99designs.com

dhotson··on Ask HN: Alternatives to HN
Also, the network feature works great when you subscribe to people who bookmark interesting stuff.
dhotson··on Ask HN: Alternatives to HN
https://pinboard.in/popular/

I'm being serious.

If you're looking for a raw source of interesting material—you can often find some really interesting stuff.

dhotson··on JavaScript motion blur demo
I've been testing out some motion blur effects in the browser.

Something that's kind of cool is that it’s simulating a camera’s shutter opening and closing. ie the shutter doesn’t open instantaneously—it takes some time to fully open.

Pixar uses a similar technique in their RenderMan renderer: http://renderman.pixar.com/products/whats_renderman/3.html

dhotson··on Yahoo aquires Tumblr
“We promise not to screw it up.”
← PreviousPage 4 of 15Next →