What I did on my vacation from reality

Home About RTL8187B Laptop Cam Quotes Login

October 4, 2008

Fun with Javascript

3:03 pm — Code, Main, Misc

I made a few improvements to the site. (Yes, I know those Javascript popups from you people trying to download the RTL8187B drivers while I was trying to debug were probably pretty god damn annoying. Sorry. I set up a testbed on my laptop so I won’t have to debug here any more.)

One of the neater things I came across was Lightbox, which is a really spiffy image viewer. The real fun came when I decided that I didn’t want the image actually rendering anywhere on the page. :-) Easy enough, and two ways to do it. The first is to write an anchor tag (with foo = document.createElement(’a')) and setting its style.display to “none”. (Make sure you set all the other attributes, also. The most important are rel="lightbox" and href="whatever image you’re displaying.) Then just have your script call myLightbox.start(foo) when your conditions are met and you want it to display the image.

The other way to do it is to actually write out all the HTML manually: e.g., <a href="/~cuervo/goatse/goatse/hello.jpg" rel="lightbox" id="goatseLink" style="display: none;"></a> <a href="javascript:myLightbox.start('goatseLink')">Open wide!</a>

Obviously, you can use whatever you want instead of an anchor tag pointing to myLightbox.start().

Another thing I was playing around with (mostly for the sake of relieving boredom, and because I hadn’t done it in a while) was AJAX, loading HTML into the page with another HTTP request after the page had already loaded. While I was doing that, it occured to me that it would make a good anti-spam technique: if you’ll notice, spam bots tend not to know about Javascript. It’s a pretty commonly proposed way to obfuscate addresses (although I’ve never seen it done, but I might have just not been paying close enough attention).

Anyway, here’s some Javascript to make life easy, mostly the usual muck with a few extra lines. Just load it in, create an HTML element with id="divName, then call ajaxSetDiv('divName‘, ‘some URL‘); and the rest takes care of itself.

[ Edited 2009-01-28 for typos. ]




August 11, 2008

Good news, more good news, and bad news.

10:59 pm — Geek, Linux, laptop, rtl8187b

First, the good news.

I’ve been told by a few people that the stock 2.6.2527 kernel will support the RTL8187B natively. (Much more likely than not, this has nothing at all to do with my temporary patch.) I haven’t tried it out yet, especially since the fan on my Satellite failed miserably and the damned thing overheats every 10 minutes (those little laptop fan-pads really do work wonders, btw, I’ll have to pick another one up), but I’m crossing my fingers.

The good news is that the further bad news doesn’t really have anything to do with anything any of you need to worry about. :-) It has mostly to do with my spare time, or lack thereof.

In any case, here’s what’s going on in my drafts: Linux on the Wii, how to disassemble my particular model of Toshiba Satellite and unfuck its cooling system once the fan burns out (once I disassemble my particular model of Toshiba Satellite and unfuck its cooling system), a bit of Marine stuff, and some more miscellaneous Perl.

[EDIT: Updated the FAQ.]




July 22, 2008

New toy: Wifi-finding watch

4:35 pm — Geek, Stuff

I finally broke down and bought something off Thinkgeek: the Wi-Fi Detecting Watch.

[EDIT] Wait, I lied, I also have a “got root?” sweatshirt.

Funny thing: it’s listed as $9.99, but shipping and handling kicked it up to $27-something for DHL next-day.

Anyway. The watch itself, as a watch, is pretty slick. I had a Casio that I picked up during MCT that didn’t do half the shit this watch does. World time, date with year! woot!, 15-lap stopwatch with memory, 3 countdown timers, 3 daily alarms, 5 single-date alarms, and normal time is displayed below everything but the memory. The thing is more high-speed than the watches I’ve seen around without the damn wireless detector.

Which brings us to the damn wireless detector.

You push a button on the front panel, and it gives you a little LCD animation for about five seconds, then tells you… not much of anything. It basically just tells you whether or not there’s a network out there and what the signal strength is — on a scale of 1 to 8, whoever the fuck came up with that. No encryption status (not that it matters much nowadays), and, sitting on the other side of a wall from my wireless router, it gives me a “4″ for signal strength (though there are other networks in the area… does it just pick one?).

Oh, yeah, and it’s got a decent backlight. (Yeah, I’ve had watches that had no light whatsoever. WTF.)

The manual also mentions “Do not operate push buttons below the surface of the water while swimming or diving”, though the back is stamped “WATER RESISTANT 100M”.

All in all: it’s a slightly useful toy, and a useful watch. Maybe, if you’re sitting at a coffee place you’ve never been to before, you can check real quick if they have wireless. I found one at work, where I wouldn’t have expected one if I didn’t know there was one; I did use the watch to triangulate it to a certain office. Also, the light won’t turn on when you’re scanning, so no checking for 802.11 in the dark.

[EDIT] I forgot to mention there was a glitch with PayPal when I bought the thing. PayPal registered it, but ThinkGeek didn’t, so I had to email TG. They were quick to respond, and I got my watch only a day late. (I’ve dealt with PayPal’s Instant Payment Notification before, and I can attest to how much of a pain in the ass it is.)