Zone38 Presents...
Letters to the World


A glorious example of NLP gone wrong

Filed under: General — codeman38 @ 11:04 pm

I was just checking Zap2it’s page on Doctor Who to see if that show was going to be running on anything other than BBC America, which isn’t on the cable tier I have… and found out it wasn’t going to be, alas. However, I did find this hilarious example of natural language processing gone horribly wrong:

Screenshot from Zap2it's "Doctor Who" show page.

(Description: A screenshot of a listing of Doctor Who-related news, in which the first story is “Elvis Presley’s doctor, who was accused after the legendary singer’s death of over-prescribing barbiturates, sleeping pills, hormones, narcotics to his famous patient, now says that Elvis died from chronic constipation.”)

It took me a while to figure out even how this was relevant, and then I realized it was a naïve keyword-matching algorithm that even ignores punctuation. ::facepalm::

Though I do admit, an episode in which the Doctor and his companion go to visit Elvis could definitely be entertaining!



Filed under: Spam — codeman38 @ 2:32 pm

The full text of a spam that I received:

From: “and” <ujarofoje1817@[redacted]>
Subject: Gesamtschule Finnish For White Development

There vehicles of capability Literature enough criteria katydids native

Yep. That’s it. That was the entire message.

Wonder if there’s any sort of hidden meaning I should be searching for? Bah, probably not, it’s probably just someone with their spam software misconfigured…


Irony via spam: or, the anti-scam scam

Filed under: Spam — codeman38 @ 11:19 am

Actual text of an e-mail scam that I received today, with no comment on my part whatsoever as the irony here should be blatantly obvious:


This is to bring to your notice that our bank (ECOBANK INTL. PLC) is
delegated by the ECOWAS/UNITED NATIONS in Central Bank to pay victims
of scam $500,000 (Five Hundred Thousand Dollars Only).



Yeah, that’s really CAN-SPAM compliant

Filed under: Spam — codeman38 @ 10:20 am

So I just received this spam from some sort of extermination service. Well, at least that’s what I think it is judging from the subject line, since none of the images in it are ALT-tagged (click to enlarge):

Screenshot of pest control spam.

But wait, what’s this? There’s a link at the top to “report this message as S P A M”! Let’s see what happens if I click on it, since I’ve already got SpamAssassin installed anyway to take care of these people when they’re finally blacklisted:

Screenshot of a browser window with an AOL logo and text reading "Thank you! Please click the link to the right to return to your AOL Webmail."

That’s funny, I thought I received this on my Zone38 address, not my AOL one. In fact, I’d wager that most of the people getting this spam probably aren’t getting it via AOL.

(And no, in case you were curious, the link on the right doesn’t lead to an AOL phishing page, nor to the actual AOL mail site – it just closes the window.)


Subtitles for Netflix, à la Python

Filed under: Programming — codeman38 @ 10:29 pm

So I just read this post by Josh Erickson in which he discovered a super-secret feature of Netflix’s web player: the ability to load an external subtitle file for any streaming video. This is huge— basically, after converting them to the proper format, you’re able to overlay subtitles from a site like OpenSubtitles over any of the many uncaptioned videos from Netflix.

Here’s the trick: Press Ctrl+Shift+Alt+M to display a secret diagnostic menu. One of the options shown there is “Load Custom DFXP File”, from which you can load a custom subtitle script in W3C Timed Text format.

But how do we get subtitles into this DFXP format? Well, in the link above, Josh Erickson took the time to write a Windows PowerShell script to convert SubRip files to that format, with all of the necessary quirks to make Netflix’s player recognize it (a harder task than one would think, as the parser is about as finicky as I sometimes can be).

That’s great… if you’re using Windows. But there’s a certain other platform that Netflix fully supports which isn’t able to run that script— at least not without installing Windows in a dual-boot partition or VM, anyway.

Thankfully, I’m also somewhat experienced in Python, which is natively supported in Mac OS X. And so, I decided to port the script to Python.

Here’s the Python version of srt2dfxp.

It’s a command-line-only script for now, much like Erickson’s original; run it without any parameters and it will let you know the syntax. For creating files for use with the Netflix player, the -n option is most important; this is the one that forces the output to use Netflix-specific formatting quirks. The -t option is also useful; it will add a delay of whatever number of seconds comes after -t, to allow for differences in starting time due to things like the Starz logo.

Here’s an example of how to use the program:

./ -n -t15 holygrail.dfxp

will convert to holygrail.dfxp in Netflix-compatible format, with a delay of 15 seconds added to all time stamps.

(And yes, I used that filename in the example for a reason. This is a Python script, after all! ^_~)

I’ve tested it, and it seems to work with streaming on my MacBook. Let me know if you experience any issues with it!

Edited to add: Two minor bug fixes that I’ve already worked in: convert & to &amp; so Netflix doesn’t choke on ampersands in the output, and don’t crash on the UTF-8 byte order marker if it’s present.

Edited 2010/08/26: Updated to version 1.3. Fixed another stupid mistake– time offsets are no longer rounded to the nearest integer.

Edited 2010/09/30 to add: As David points out in comment #14 below, the XML output from Jubler works perfectly well with Netflix! I’ve just tested this, and confirmed it. This is extremely helpful for having to deal with subtitles with incorrect frame rates or non-SubRip subtitle formats, though you can use it as to convert correctly timed SRT files just as easily.


Fun with 64-bit Windows and Boot Camp

Filed under: General — codeman38 @ 4:20 pm

So, on a whim, I decided to try installing a 64-bit version of Windows 7 onto my MacBook. And as soon as I tried to load the Boot Camp drivers, I immediately got an error message claiming that “Boot Camp x64 is unsupported on this computer model.”

Turns out that 64-bit Windows is only supported on the latest generation of Macs. Which my year-old white MacBook, quite obviously, isn’t.

But as I discovered, it also turns out there’s a way to manually install the drivers, which I present here for anyone else curious to try 64-bit Windows on an older MacBook:

  1. Make sure your Snow Leopard DVD is inserted. (You did get Snow Leopard, right?)
  2. Go to the Start menu and type cmd — then press Ctrl+Shift+Enter.
  3. Answer “yes” to the UAC prompt.
  4. Type "d:\Boot Camp\Drivers\Apple\BootCamp64.msi" (with quotes).
  5. Go through the installer!

The only driver that seemed to produce any sort of error at all after doing this on my MacBook was the Bluetooth driver, and that still appears to work; I got my Bluetooth mouse and keyboard working under Windows.

Just putting this out there for anyone else who wanted to see whether they could get 64-bit Windows running.


Bee-lated congratulations…

Filed under: General — codeman38 @ 12:34 am

I know, I know, I’m a couple days late with this, but anyway… as a former spelling bee geek (it’s been 12 years, believe it or not), I have to post this…

Belated congrats to Kavya Shivashankar, winner of the 2009 National Spelling Bee— and, for that matter, to everyone else who made it into the Bee, as that alone is a major achievement. You all definitely weren’t Laodicean about spelling, that’s for sure!

And since I forgot to post this after the 2008 bee, extremely belated congrats to Sameer Mishra for winning a great guerdon in that year’s bee.

Edited to add: Oh, yeah, I forgot! Special thanks to the Spelling Bee staff for throwing in “blancmange” as a word this year. As a fan of Monty Python’s Science Fiction Sketch, I salute you; indeed, I even suggested the word on my blog three years ago.


Yet another random administrative note

Filed under: General — codeman38 @ 8:31 pm

For those who’ve come here looking for the Forums section that used to be on my site, I’ve closed it— there wasn’t enough interest in it; the one section that did get posts (“Music in Commercials”) served the same purpose as, which I also participate in; and besides, I’ve been so busy with grad school and side projects that I haven’t had much time for moderating/keeping up the forum.

I may be opening a new one in the future, but for now, I feel it’s best to close it while keeping the archives up in a read-only form for browsing. Those can be found here, for those who need it.

Sorry for anyone who was actually interested in this section of my site, but honestly, it’d grown too old and crufty and felt like the section needed a reboot anyway…


Scammy Facebook Ad Fail

Filed under: General — codeman38 @ 11:55 pm

I was just checking up on Facebook, and this ad turned up on the margin:

[Facebook ad showing a newscaster with poorly pasted-in hands holding money, with the caption: 'I got fired. But thanks to Google I ended up making more money than my old boss.']

The first thing I noticed was the badly Photoshopped hands. (MY HANDS R PASTEDE ON YAY?)

But then I looked closer. I’m not very good at recognizing faces, but having watched SNL’s Weekend Update quite a bit, I thought that the set in the background looked awfully familiar. And then I realized, hey, that does resemble Seth Meyers…

Google Image Search, and yep. That is, in fact, Seth Meyers. The un-Photoshopped original frame from Weekend Update even shows up in the search results.



How bad UI design caused me to withdraw an extra $80

Filed under: General — codeman38 @ 7:01 pm

So I was at the ATM today, wanting to withdraw $20 for a quick lunch. I went up to the ATM, inserted my card, and, as usual, saw the following screen.

Enter PIN Screen


© 2001-2024 codeman38. Powered by WordPress.