2009-11-03

LCDProc and the PCIDEA 20×4 LCD display

Posted in Geek Stuff at 1:49

A couple of weeks ago, I got it into my head that the death of Blinkenlights was a bad thing. My primary PC already has a little LCD on the keyboard (I got a deal on a first-generation Logitech G15 gaming keyboard… not just useful for gamers) and, combined with LCDProc, it makes a great diagnostic display for figuring out why your newest creation is freezing up the GUI before you kill it.

…so I went on eBay and ordered an inexpensive Chinese LCD display for my experimentation machine. The PCIDEA 20×4 USB drive-bay LCD. As the manufacturer claims, it IS fully compatible with the CrystalFontz driver in LCDProc… but they neglect to tell you which of the three CrystalFontz drivers to use and how to configure it. Here is your answer in the form of an LCDd.conf snippet:

The key elements which aren’t default and aren’t immediately obvious to the layperson seem to be the use of the CFontzPacket driver, Model=631, /dev/ttyUSB0, and a 19200 bitrate.

2009-10-19

Fic Reviews Status Update

Posted in Fanfiction at 5:39

As most people who read this will probably have noticed, I haven’t had the time or will to post full-fledged fanfiction reviews in quite a while. However, I have been amassing simple out-of-five numerical ratings in a private collection for some time. I’m not sure when I’ll be able to share said collection, but I didn’t want to leave people without reviews of some kind.

As such, I have now created accounts on Identi.ca and Twitter and fanfiction reviews are tagged with the #fic_rating hashtag. (The above links point to the hashtag timelines rather than my profiles for added convenience)

Also, In the interest of making useful fic ratings a more common thing, I’ve laid out a suggested standard format for #fic_rating notices/tweets (which also gets embedded in the Identi.ca sidebar for the hashtag). Hopefully, if anyone who wants to use the hashtag listens, it’ll also make machine-parsing of ratings feasible.

2009-07-01

Gender-Bending List back up… more or less

Posted in Otaku Stuff, Site Updates at 3:52

Gender-Bending Fiction Index

Well, things are looking up. On a whim, I re-implemented most of the old gender-bending list’s functionality on the new database-backed platform I’ve been meaning to write for years.

I’m not sure how steadily I’ll work on getting the rest done, but at least it’s somewhat usable now. (I still have to hook in display of and filtering by types of gender-bending and the sorting can be a bit finicky, but it is possible to browse by category, see the degree of gender-bending in each work, and click them to see what used to be footnotes.)

2009-06-24

Good News and Bad News

Posted in Site Updates at 22:11

The bad news is, my main site is down and I’m too busy to update my blog.

The good news is, I’ve finally cooked up a tool which prevents me from procrastinating or getting distracted for days on end, so it’s only a matter of time before I’ve caught up to my real-life obligations.

The main site should be renovated and back online some time within the next month or two and, while I don’t want to promise anything, I’ll probably resume reviewing fanfics and commenting on interesting geeky stuff shortly afterwards.

2008-12-17

More Programming Humor

Posted in Geek Stuff at 8:00

2008-12-03

Getting The Selected Text as HTML Using Javascript

Posted in Geek Stuff at 1:54

I’m not really on top of my time management yet, but this was hard enough to find that I think it warrants a blog post anyway…

Have you ever tried looking up how to use Javascript to get the selected HTML in a browser window in a form that can then be sent via XMLHTTPRequest or fed into an ordinary form field? (eg. for POSTing to a quote-collector tool) It’s a surprisingly difficult piece of info to find. (Hence why I’m partly writing this as a reminder to myself)

First, you’ll probably end up visiting the QuirksMode Range Intro to learn about window.getSelection() in browsers like Gecko/Firefox and the equivalent Internet Explorer scripting, but all you’ll learn there is how to get the selection as plain text… and that’s no secret.

Once you’ve got the selection/range, things become a little trickier because, once again, Internet Explorer and everyone else do things differently. In Internet Explorer, it’s as simple as range.htmlText but in other browsers, it’s a little less obvious.

First, you call range.cloneContents() to get a DocumentFragment object. This is more or less equivalent to Copy (Ctrl+C) when copying and pasting things. Then you create a <div> element, use div.appendChild(clonedSelection), and then grab the HTML as text from div.innerHTML. Don’t go looking for ways to serialize DOM nodes to XML. It’s non-portable and a bit of a red herring.

Here’s the complete code fragment I eventually found on a thread on the FCKEditor forums:


Now that you know, why not create some interesting bookmarklets?

Bad Behavior has blocked 209 access attempts in the last 7 days.