Live data from Hacker News

Reverse-Engineering Xkcd's 'Frequency'

notebooks.jsvine.com

11–20 of 55 posts

Re: Reverse-Engineering Xkcd's 'Frequency'

#11
post #7

Does anyone know the answer to the "turn signal problem" he poses? Why does the beat frequency he observes match what he calculated?

Assuming you meant "doesn't", it's explained in the next section, the Zero-Delay Problem. edit: The frequency equation solved for time, using the adjusted values from the table: https://www.google.com/search?q=1%2F%281%2F1-1%2F1.04%29

[deleted]

Re: Reverse-Engineering Xkcd's 'Frequency'

#13
post #12
post #10

I'm still trying to understand where the frequency is stored? Is it a value that can be embedded into the gif?

Gifs don't have a constant FPS. You can specify with some precision how long they should display each frame.

That's right. The Graphic Control Extension blocks preceding each frame let you specify a "delay" in hundreths of a second.

More info here: http://www.matthewflickinger.com/lab/whatsinagif/animation_a...

And more info on the zero-delay problem here: http://nullsleep.tumblr.com/post/16524517190/animated-gif-mi...

Re: Reverse-Engineering Xkcd's 'Frequency'

#14
For anyone wondering how to dump gif loop time.

    curl -s http://imgs.xkcd.com/comics/frequency/turnsignal1.gif | 
        giftext | grep DelayTime | cut -d':' -f 2 | awk '{s+=$1} END {print s/100}'
The results seem to correspond with authors table.

Re: Reverse-Engineering Xkcd's 'Frequency'

#15
post #14

For anyone wondering how to dump gif loop time. curl -s http://imgs.xkcd.com/comics/frequency/turnsignal1.gif | giftext | grep DelayTime | cut -d':' -f 2 | awk '{s+=$1} END {print s/100}' The results seem to correspond with authors table.

Click the show code button at the bottom. They did dump the values (but they wrote their own gif parser...).

Re: Reverse-Engineering Xkcd's 'Frequency'

#16
post #8

Not super related to the content, but I love the "Show Code" button at the bottom of the article. So often sites either show code inline and break up my reading, or just dump the whole thing into a github repo, which loses context. That button is awesome, because I can read the whole thing to understand the problem, then review the code the next time through with better context. Awesome!

I agree that having a "Show code" button only at the end prevents disrupting the reading flow. In terms of "code with explanation" layout, I really like todos.js' approach: http://backbonejs.org/docs/todos.html It also works with images: http://www.ifixit.com/Teardown/Mac+Pro+Late+2013+Teardown/20... Most layouts nowadays fail to take advantage of the horizontal space available. It's just 2 colums in the end, but it…

ifixit's layouts are actually a product of: http://www.dozuki.com/

Re: Reverse-Engineering Xkcd's 'Frequency'

#17
post #4

Not super related to the content, but I love the "Show Code" button at the bottom of the article. So often sites either show code inline and break up my reading, or just dump the whole thing into a github repo, which loses context. That button is awesome, because I can read the whole thing to understand the problem, then review the code the next time through with better context. Awesome!

It would be nice to have Show Code at the top, along with a note that some of the code has been hidden. I like seeing code examples as I'm reading through.

I'm the guy who built that, and I agree. I tinkered with having another "Show Code" button at the top, but my attempts looked bulky and distracting. Still trying to figure out a better way.

In the meantime, pull requests quite welcome: https://github.com/jsvine/reporter

Re: Reverse-Engineering Xkcd's 'Frequency'

#18
Awesome, this is one of my favorite XKCDs. I've been mulling over a plan in my mind to make a physical version of it, looking similar to a deep picture frame or display case. It would use white acrylic with the text somehow printed or transferred on, backlit by white LEDs (maybe incandescent lamps would look nicer?). Each cell would be separated by thin black wood or plastic strips. It should be pretty easy to control the whole thing with an arduino, and I think it would make an awesome wall display.

Re: Reverse-Engineering Xkcd's 'Frequency'

#20
post #14

For anyone wondering how to dump gif loop time. curl -s http://imgs.xkcd.com/comics/frequency/turnsignal1.gif | giftext | grep DelayTime | cut -d':' -f 2 | awk '{s+=$1} END {print s/100}' The results seem to correspond with authors table.

Click the show code button at the bottom. They did dump the values (but they wrote their own gif parser...).

Ah thanks, I completely missed that button. I just typed 'gif' in to my terminal and hit tab to see what I had installed, then read the manpage for the most favourable looking binary
Post reply on HN