News for hackers. Stuff that matters.

mdd

(author here)

danielh was pretty much spot-on... The lyrics are stored with a time offset and indentation level (sort of like a player-piano roll) and the list of tweets is updated periodically by the server.

On the browser side, I'm using jQuery and the YouTube chromeless player (http://code.google.com/apis/youtube/js_api_reference.html)

When the page is loaded, I take the lyrics information and generate a sparse array where each index represents a tenth of a second. Then I start an interval timer that runs an update function once every 100 milliseconds. That updater gets the current video time from the YouTube player, converts that time value from milliseconds to deciseconds, grabs all entries from the sparse array between its last run and the current time, and inserts them onto the page (with a 200 ms fadeIn animation).

To be perfectly honest, there really isn't much code involved at all. Most of the development time was spent figuring out the time offset of each word. There was no fancy technology used there... it was just a brute force effort (though perhaps the Mechanical Turk could have been of use?)

I haven't had any coffee yet this morning so please let me know if my explanation was incoherent or if you'd like more info.

Ha! Me too... and I built the site :)

I actually had to triple check with the various lyrics sites when I was coding it. I kept thinking there was no way these were the correct lyrics.

Re:Blame Drew's Cancer on Sunday June 07, 2009 @09:45PM (#646657)
Thanks for all the feedback, Dave.

I just deployed a bunch of updates that address the bugs you found -- yeah... I'll confess... they were bugs :)

Re:Blame Drew's Cancer on Saturday June 06, 2009 @03:26PM (#645042)
Hi Dave,

The bug you noticed is a little perplexing since I developed the site on a 13" MacBook. If you have a moment, I'd love to know more about the system where you saw this behavior: Browser, OS, Screen Res, Browser Window Size... (If you'd like you can email me at: [email protected]) Thanks for the feedback.

you can't stop the viral spread of something like this.

Ha! Ain't that the truth :)

Re:Blame Drew's Cancer on Saturday June 06, 2009 @03:06PM (#645025)
That's a great idea. We're talking with some potential sponsors now so perhaps this could be an avenue for a matching-funds type of fundraiser... I'll follow up with email. Thanks!
Re:Blame Drew's Cancer on Friday June 05, 2009 @09:41PM (#644330)
Thanks!

It's for a good cause too. We were expecting a softer launch but once Lance Armstrong mentioned us, we were off to the races.

Fortunately our little xen instance has held up and the exposure has sure made the search for sponsors a lot easier.

Now vote this story up or I'll have to #BlameDrewsCancer for it not making it to the front page!

Re:How we can learn from a baby's brain on Monday April 27, 2009 @11:28AM (#581462)
This research seems to indicate that ADHD is actually a feature of childhood, rather than a bug to be fixed.
Re:Your eyes suck at blue (neat image compression trick) on Wednesday April 22, 2009 @12:05PM (#574074)
No, You're spot on.

The author states that this is "an unmodified picture, straight off the digicam". Unfortunately for his test, this means the light passed through a Bayer filter, which uses a pattern of "50% green, 25% red and 25% blue": http://en.wikipedia.org/wiki/Bayer_filter

Re:If we cloned Neanderthals, what rights would they have? on Tuesday April 21, 2009 @10:27AM (#572353)
Obviously, we'd have to consult an Unfrozen Caveman Constitutional Lawyer: http://en.wikipedia.org/wiki/Unfrozen_Caveman_Lawyer
We've been hearing lately that "the kids" prefer the degraded sound quality of MP3 files: http://news.ycombinator.com/item?id=511615

Anyone want to bet that, a year or two from now, we'll be reading that "the kids" prefer listening to sped-up music?

Also, I object to The Waitresses being labelled "one hit wonders". The author apparently forgot about the ubiquitous holiday song "Christmas Wrapping".

Re:SEC charges E*Trade, 5 others, for front running on Friday March 06, 2009 @01:32AM (#505249)
The article doesn't fully explain "front running", so here's Wikipedia's take: (http://en.wikipedia.org/wiki/Front_running)

Front running is the illegal practice of a stock broker executing orders on a security for its own account while taking advantage of advance knowledge of pending orders from its customers. When orders previously submitted by its customers will predictably affect the price of the security, purchasing first for its own account gives the broker an unfair advantage, since it can expect to close out its position at a profit based on the new price level. Front running may involve either buying (where the broker buys for their account, driving up the price before filling customer buy orders) or selling (where the broker sells for its own account, driving down the price before filling customer sell orders).

Re:Battery, RAM, and HD access on new 17-inch Macbook Pro on Tuesday February 17, 2009 @10:46PM (#485343)
The problem, really, is that Apple no longer sells a professional laptop

Unless your profession is laptop tinkering, this statement is absurd.

Clearly Apple believes that more "pro" users would rather have more power in their lone battery than the opportunity to swap (and carry) multiple batteries.

This certainly matches my experience. I'm a developer who uses my Mac both at home and at work and I'm on my third Apple laptop at the moment. I spend 8-10 hrs a day on my laptop and I have never needed to use a second battery.

if you can't swap out the battery on the go and replace its hard drive with minimal hassle, it's definitely not "pro"

I have upgraded the memory and hard drive in every one of my laptops so I can understand this reaction but it really needs to be thought of as a cost-benefit problem.

A lighter and stronger case benefits me over the entire life of the laptop whereas easier access to the upgradable components saves me 45 minutes on the one or two occasions I am upgrading them.

That seems like a good trade-off to me.

The glossy, low-gamut, sub-HD LCD panels on most Apple laptops, however, continue to disappoint.

Re:Why so many minds think alike on Monday January 19, 2009 @06:45PM (#441077)
The research calls into question decision-making bodies that operate by consensus, Berns said. For example, in the U.S. legal system, many cases are decided by the unanimous judgment of the members of a jury.

"You can't separate those judgments from the fact that you have 12 people who have to come to a unanimous decision, and have to conform their opinion to each other, so of course it will distort how they view evidence," he said.

I wish the article expanded a little more on that point... It's both interesting and terrifying.

Re:Google's API is Back on Thursday April 10, 2008 @04:03PM (#160267)
Their terms of service still seem to forbid any interesting uses of the search results:

"You agree that you will not, and you will not permit your users or other third parties to: (a) modify or replace the text, images, or other content of the Google Search Results, including by (i) changing the order in which the Google Search Results appear, (ii) intermixing Search Results from sources other than Google, or (iii) intermixing other content such that it appears to be part of the Google Search Results; or (b) modify, replace or otherwise disable the functioning of links to Google or third party websites provided in the Google Search Results."

With those restrictions, it's really more of a widget than an API...