Credit Where Credit Is Due

posted by chip on 2008-04-01 15:17:23
I've been something of an open source fanboy for quite a while now, but I'd like to speak for a moment in defense of the thing OSS fanboys love to hate: Windows. "What?" I hear you say, but this oft-maligned piece of software deserves some praise for the advances they've made in computing technology. Was it so long ago that I sat in front of the TV, pounding out Microsoft BASIC code on a TRS-80? Sure, they've made some bad decisions over the years, but I'm prepared to give them a second chance. To this end, I have (of course!) compiled a list of reasons to love Microsoft Windows.

I've actually been running Windows on another computer I use about half of the time these days. With a few freeware apps, a cygwin install, and TweakUI XP, most of the superficial annoyances evaporate, and I'm left with a system that's just as usable as any other. While their older offerings did have quite a few flaws, their recent stuff has convinced me that MS is actually doing things right, now.

Everybody deserves a second chance, right?

2 comments reply permalink

Hello Again

posted by chip on 2008-03-21 02:45:55
For those of you who didn't see me at the wedding, and who still care, yes, I am still alive. I got sick, then got sick again (Guitar Hero III), and again (Super Smash Bros. Brawl), but things are good now. :)

Oh, right, the wedding. Mike and Chrissy are now officially Mike and Chrissy McLean. The wedding went great — it was the perfect blend of functional tradition and cheeky irreverence. Also, high-school cheerleaders. I got to see a lot of old friends and have a lot of fun. On the whole, I think it was a huge success. Did I mention the cheerleaders? No?

Well, the hotel was largely booked and Mike had trouble getting rooms due to a high-school cheerleading competition that weekend. Everyone staying at the hotel that wasn't invited to the wedding was a high-school cheerleader. During the reception, a group of them were singing along in the hallway, so Mike's dad told them they could come in and dance. It was weird.

Oh, and ladies, I think this is the picture you've been waiting for:

If this post doesn't have 100 comments by the time I wake up tomorrow, I'm going to be very disappointed. :P

2 comments reply permalink

This Is What Happens When You Offer What We Want

posted by chip on 2008-03-03 23:04:48
Sometime in the evening yesterday, I noticed Jay Tamboli's status message mentioned a new Nine Inch Nails album at ghosts.nin.com. "Cool," I thought, so I browsed over to the site. The music itself is good, a broad range of instrumental industrial tracks. The really interesting part is the broad range of ordering options:

Such a wealth of options! There's something for everyone here, from the freeloader to the die-hard audiophile/vinyl freak. At least at first glance, it looked very much like Trent knew exactly what he was doing. I tried to sample Ghosts I, but at that point their CAPTCHA system wasn't working. I went to bed.

Today, I checked the site, and their main page had an apology. Apparently, their best efforts had crumbled under the onslaught of internet fandom:

"We quietly released this album last night without any warning, and without any press. Because we know how devoted our fans are, we planned for an overwhelming response, and expected heavy traffic. To our surprise, the traffic was more than three times what we anticipated, and has only been getting heavier throughout the day."

So instead of abandoning downloads altogether, they linked visitors to Ghosts I available on none other than The Pirate Bay. For those who really, really want to pay for it right now, the album is up for download on Amazon MP3. Notice who's not getting any part of this deal? Heh, thought you would. :)

Oh, and here's the kicker: The album is released under a Attribution-Noncommercial-Share Alike license. You're not even legally obligated to pay money for the album; Trent knows he's awesome enough that you'll pay anyway.

The score right now: Comments on nin.com and TPB have been overwhelmingly positive, even in light of the server failure. Even people who admit to disliking his music are in full support. The fact that their calculated server capacity was blown wide open signals that this has significance on a much greater scale than just NIN fans. Smart money says that every record company exec in the RIAA is shitting bricks right now. Personally, my feelings are summed up by a random user on TPB:

"you're my goddamned hero, trent."

0 comments reply permalink

Precision in Language

posted by chip on 2008-02-26 02:51:21
I will admit to being a huge language nerd. Spelling, grammar, pacing, cadence, and tone are just as important to me as content. Much of this stems from (or leads to, depending on how you want to look at it) working with computers. Computers, being machines, have a very rigid view of the world. If you don't speak their language, they won't have any idea what you're talking about. The most minute subtleties, like using a comma instead of a semicolon, can both be perfectly valid, but have very concrete differences in meaning. An intimate knowledge of programming language, therefore, goes a long way towards being a competent programmer.

Likewise, an intimate knowledge of human language goes a long way towards being a competent human. The reason language exists is because we do not have the ability to transmit our inner thoughts and feelings directly to other people. We must translate these thoughts and feelings to a symbolic form, represented by sounds and scribblings, which are then processed by other humans and then hopefully understood.

The thing about humans, though, is that the image reproduced in another person's mind is never exactly what the first person was thinking. A poem or a song may evoke different emotions in different people, and even the simplest statements can be colored by prejudices and opinions. Because of these transmission errors, it is paramount that humans understand how to effectively translate their thoughts and ideas into common language.

[ASIDE RANT] It is a common mistake to assume that a casual communication environment means that you need not be diligent in your speech. IM and email is easy to write, but that doesn't mean it's easy to read. Capitalization and punctuation are too often omitted, leading to a pile of words that's difficult to decipher. Omitting capitalization isn't as important, but commas, periods, exclamation marks, and question marks exist as a substitute for the subtle nuances that exist in spoken speech. Without them, it is as though a robot is speaking the words in monotone, without pause or variance. By omitting punctuation, the writer saves himself the effort of explicitly defining the meaning of a sentence, and instead places that burden on the reader. In a one-to-one communication, it's an asshole thing to do. In something that will be read by many people, it's simply inexcusable. [END RANT]

At this point, you'd probably expect me to quote a style manual. Honestly, I've never held too much with MLA or APA or other intellectuals who would like to give you an exact prescription for how to write. While I do enjoy precision, it is important to distinguish between men and machines. The point is, after all, not to be correct, but to be understood.

I don't much care where the comma goes next to a quotation mark. It seems just as correct to say "foo," as "foo", but it's a different case when ending a sentence in quotes. "'Hello,' he lied," clearly needs the comma inside the quotation marks because it's standing in for the period.

Likewise, parentheses have always been a bit of unnecessary confusion. If a parenthetical sub-clause has multiple sentences in it, is it necessary to end the last one with punctuation? The best thing to do is to just not put multiple sentences in a parenthetical sub-clause, but it's a literary device that's just too good to pass up sometimes. I personally leave the tailing punctuation out if it's a period, because seeing '.)' just seems wrong somehow, especially if the end parenthesis ends the sentence. Writing '.).' is just too much punctuation in a row.

Of course, the important thing is that the reader knows what you mean. If I see a '.).', I'm going to groan a little bit, but I'll still know what you mean, and that's the key. :)

0 comments reply permalink

A Brief Guide to Fangirls

posted by chip on 2008-02-24 00:36:49
I was reading Tokyopop's "Manga Magazine," a quarterly preview/advertisement for the manga Tokyopop sells. Brian signed up for it a while ago, and it comes in the mail every few months. It features an interesting dual-side format. Read from the right, it contains translated manga from Japan. Read from the left, it contains original english language manga. I try to stick to the J-side, as the A-side tends to contain such editorial horrors as "A Guide to Cosplay," and "What is Gothic Lolita?" No, I'm not going to explain. Trust me, you don't want to know.

The winter issue featured Fruits Basket, a manga from 1999 that most people know because of an anime adaptation that aired in 2001. Apparently the manga lasted far longer than the TV series, and they're still translating them. In a sadistic twist, instead of the normal editorial commentary in the border around the actual manga, the editors decided instead to reprint selections from what must be a mountain of fangirl letters. Every time I read one, I died a little inside.

"I LOVE Fruits Basket. My friends and I at school drool over all the characters. We even started our own Yuki fan club! We call it the Yuki Yakuza, and I am the L.L. (Lovely Leader)." ~Chelsea F., Middletown, DE

*shudder* This is why I don't go to conventions. Appreciating Japanese culture is one thing, but throwing yourself into a pit of people like that? You'd have to be crazy. You can like anime and manga all you like, but dear God, stay away from the fangirls.

If you do happen to come across a pack of fangirls (and they typically travel in packs), DON'T PANIC. Unless you have cat ears or long silver hair, it is likely that they haven't noticed you. DO NOT MAKE EYE CONTACT. Fangirls are easily excitable and will attack as soon as they know they have your attention. When a fangirl begins bearing down on you, you must make a hasty exit. Point behind them and shout, "HEY LOOK, IT'S INUYASHA!" While they are distracted, run like hell.

Now you know — and knowing is half the battle!

0 comments reply permalink

"I mean, c'mon. Who's ever going to put spaces in their filenames?"

posted by chip on 2008-02-16 02:37:21
Browsing my music collection by genre, it's interesting to see what people think is "punk." So far: Flogging Molly, Bomb the Music Industry, Yellowcard, The Offspring, The Pixies, Streetlight Manifesto, Goldfinger... Of those, I only consider one band to be actual punk music. (Hint: It's the one you haven't heard of) It seems that punk is whatever people want it to be, which oddly enough, might be the best definition you can find (but c'mon, people... Yellowcard? The Pixies? You are confusing punk with alternative rock).

Erickson and I had a discussion the other day about music storage. I contend that high quality lossy formats (like, say, quality 10 Ogg Vorbis) are nigh indistinguishable from the originals at half the space or less of even FLAC, so there's no point in using a lossless format for archival storage. He argues that disk space is cheap, and you should use FLAC "in case you need that extra quality." Well, I did some tests.

A Q10 Vorbis file deviates from the original waveform on average of 0.15% (when compared to the full range of the waveform), with a standard deviation of just over 0.15%. That means in the entire range of a 16-bit signed sample (-32767 to 32767), the lossy reproduction is off by about 90. If I'm doing the math right (and somebody please correct me if I'm not), that's noise at a level of about -50dBFS. I'm pretty sure I won't notice that, but there are a couple of factors at play that make all this analysis moot:

  1. Every OGG decoder for the Nintendo DS chokes on a Q10 ogg file, but it has no problem playing FLAC, and...
  2. Erickson's right. Disk space is so ridiculously cheap these days that it's hardly worth bothering.

So I re-ripped the three out of five albums I have that matter, and encoded them in FLAC. But, of course, FLAC is pretty big, and a smaller format would be nice for portable listening. I needed a batch conversion tool. At first, I thought "I'll use make! It will allow me to easily specify rules to convert files, and it can utilize my dual processor machine with the -j flag!", but that was a short-lived idea. Make, as it turns out, doesn't handle spaces in filenames... at all. So what do you do when make isn't up to snuf? Write a perl script, of course. I wrote conv, a simplified make-like tool that handles filenames with spaces in them.

Erickson says, "Congrats, you're now One Of Them. You're now one of those people who go and re-implement make to suit their own evil needs, and thus generating Yet Another Build System." In my defense, conv isn't a build tool, it's much too simple (right now...), and also, it's not my fault make is so terrible. :P

On the other hand, I could be guilty of the old maxim "When all you have is a Camel Book, you tend to see every problem as a text file." :)

0 comments reply permalink

Hearing Things

posted by chip on 2008-02-13 02:47:40
Yesterday I was listening to M83's Dead Cities, Red Seas & Lost Ghosts, and I remarked to myself that what I was listening to sounded mostly like noise. Upon looking at my media player, I found that I was listening to track 7, titled "Noise." Hm. You win this round, M83.

The last birthday gift arrived yesterday, a translated copy of Tatsuhiko Takimoto's Welcome to the N.H.K. It's a semi-autobiographical account of a hikikomori's trials and tribulations. I recommend it, but personally, I liked the anime better.

Other things I got: A T-shirt featuring Grimlock, a pair of leather driving gloves, a set of "Black" Asian food items from Andrea, and a pair of Sony MDR-V6 headphones.

I'm sure you've got a pair of headphones, but unless they cost $100 or more, you've probably never heard anything like the MDR-V6. It's like having 20/20 vision... in your ears. Every detail comes through clearly at any volume. Unfortunately, the abilities of these headphones are putting the rest of my equipment (and music) to shame. Things sound great on neo, a relatively recent desktop machine, but they sound worse on my ThinkPad, and they sound absolutely terrible played on my Nintendo DS.

As far as source material, things like IIDX, CDs, and high-bitrate compressed audio sound great, but at 192kbit, things start to sound fuzzy, and most 128kbit MP3s sound like absolute ass (and even the good ones are lacking somehow). Because of the wonderful frequency response, things like a 440Hz square wave will rattle your teeth. A lot of NES soundtracks, designed to be played on the fuzzy NES sound chip through an even fuzzier TV, are so severe that they will give you a headache.

Overall, though, they're great. Since they're over-ear headphones with plenty of padding, I can wear them for long periods of time without annoyance. And for the things that do sound great, like The Who's Quadrophenia, they sound absolutely amazing. For $60 refurbished, you really can't beat their performance.

2 comments reply permalink

WHOOSH

posted by chip on 2008-02-10 02:12:29
That's the sound of the future arriving, blowing right by you and then becoming the past. I had a birthday ten days ago, but I haven't written anything because I've been hard at work porting (almost) my entire website to Perl. Why? I've learned a lot about Perl in the past few years, and converting an entire website is a great chance to explore what Perl is really capable of. It's also a great excuse to read the highly entertaining Programming Perl, otherwise known to Perl hackers as "The camel book." Mostly, though, and I can't stress this enough...

PHP BLOWS.

(Yes, it's bad enough that I made it blink)

I designed large parts of this site (and its predecessor, bytex64.freeshell.net) as an excuse to learn PHP, which was at the time the hot new web programming language. PHP is easy to learn, simple to use, and makes it nearly impossible to write clear, safe code. In the course of rewriting everything, I found several potential mysql injection attacks, tons of obtuse and obsolete routines, and even a function I'd written twice (with the same thing being done inline in numerous other places). The Perl version, by comparison, is shorter, clearer, and safer. Those of you who know Perl may find this counterintuitive, so an example is in order.

Here's a typical MySQL query to get a list of things, in PHP:

$array = Array();
$result = mysql_query("SELECT id FROM table ...");
while (($row = mysql_fetch_row($result)) !== FALSE) {
    array_push($array, $row[0]);
}
return $array;

And here's the equivalent Perl using DBI:

$array = $dbh->selectcol_arrayref("SELECT id FROM table ...");
return @$array;

The benefits are easy to see. The perl version is shorter, more legible, and as an added bonus, the mysql dependency is abstracted away by using DBI. Of course, in the bits that use regexes, clarity is a bit hard to come by. :)

Some bits (like the freeshell.org story tree) are still PHP, because they require certain... we'll call them features... of PHP. I've also cleaned up the URLs. You shouldn't find anything ending with .php (or even .pl), thanks to the magic of mod_rewrite.

The moral of the story is that if you want to learn a new language, learn Perl (or Python). If you're learning PHP in school, drop the class. If you already know PHP, forget it and learn something more useful, like FORTRAN 77. That's what I did.

0 comments reply permalink

A Quick Lesson on Experimental Interfaces

posted by chip on 2008-01-21 02:17:19
I'm a big fan of the canvas tag. It allows flash-like interactive graphics with free, standard tools like HTML and JavaScript. It won't replace Flash any time soon; it's way too slow, and it's not officially standardized yet. It does, however, exist in a number of different browsers in some form or another. By my count, Firefox, Opera, and Safari all support it to some extent.

The idea was originally thought up by the Safari folks, so that it could be used in OS X's Dashboard widgets. Firefox and Opera adopted it afterwards, and it's up for standardization in HTML5. I've used it in several of my hacks, and I think you'll see it a lot more once there's a viable IE implementation.

A while ago I tried to run some of those hacks in Opera, and they refused to work. No errors, no console messages, nothing. I wrote it off as a bug and moved on. I don't use Opera regularly, and I only know one person who does (and he's dating my sister Andrea, which shows you his judgement skills :P). As it turns out, there's some disagreement on what exactly constitutes a valid canvas tag. When Safari thought it up, it was a standalone tag, much like img:

<canvas />

Which makes sense for a few moments. It is an image, right? Well, other people disagreed, since an image is a pretty standard feature with old, but well-defined alternate representations. A canvas tag is a new beast, not implemented by many browsers, and in those browsers, you may want to specify some alternative content more complex than an alt attribute. So the Firefox, Opera, and HTML 5 version looks like this:

<canvas></canvas>

The idea is that your alternate representation goes inside the tag, where it will be rendered by browsers that don't know about the canvas tag. Now here's where it gets interesting.

While the standard format is the tag pair version, Firefox (and presumably Safari) will happily parse the tag in standalone format. Opera will not. Using the standalone format in Opera causes a canvas area to be constructed, but it is programmatically inaccessible. This is obviously a bug, but not a serious one. Five minutes of code editing, and all my hacks work in Opera... which also means they work on the Wii... which means I can start making games. :)

Now if only Opera's canvas implementation was half as fast as Firefox's. :/

0 comments reply permalink

Fragmentation and You

posted by chip on 2008-01-17 22:02:51
I'm sure you've got some sort of removable storage lying around, be it USB flash, SD, hard drive, Zip disk, or something else entirely. And I can tell you that it's running some sort of FAT filesystem with almost perfect certainty. The FAT filesystem is so simple, and has such a long history, that it's the de-facto choice for removable storage. Everything that can read a disk can understand FAT, and quite a few things can understand its latter-day variant FAT32. But because it's so simple, it's far from ideal.

FAT's biggest weakness is file and directory fragmentation, an artifact of file allocation that causes files to be stored in several locations instead of one contiguous chunk. As a result, disk access to these fragmented files become slower than it should be. Modern filesystems do much better on the fragmentation problem, but they still suffer to some degree.

Fun Fact: The FAT filesystem pre-dates MS-DOS. It was created to manage files in Microsoft Disk Basic, and later, when Tim Patterson created 86-DOS, he used FAT as its filesystem. Later, Microsoft bought 86-DOS, and developed it into PC-DOS and MS-DOS (which are, of course, the same thing — PC-DOS is what it's called on IBM PCs, and MS-DOS on clones).

The fragmentation problem is especially apparent on disks that spend most of their time nearly full. As large files get squeezed into small spaces, further opportunities for fragmentation occur as these small fragments are later deleted and overwritten with other files. Pretty soon, you've got something that looks like this:

For those not familiar with Windows 2000's Disk Defragment utility, that's a graphical representation of the files on the disk. Unfragmented files are in blue, fragmented files are in red, and free space is white. There are also system files in green, but this particular disk (my WD 80GB USB hard drive) doesn't have any. You may also notice that there are fragmented files all the way at the end of the disk. I have filled this thing to the brim once, and yes, it resulted in hellish fragmentation.

So I hit the "Defragment" button, and a few hours later, it looks like this:

Muuuch better. Entirely contiguous, which is very good for the files already on my disk. Unfortunately, this defragmenter isn't very forward-looking. There are still holes there that a decent-sized file could trip over and get fragmented. For example, I copied a ~700MB movie to the drive and this happened:

That's less than optimal, let me tell you. Sitting from up here, it's obvious that what it should have done is put it at the large space at the end, but it doesn't seem like Windows' FAT implementation is that smart. For a comparison, to see if a third-party implementation might fare any better, I removed the file and did the same copy operation in Linux.

From the graph, it looks like Linux shuffled things around a bit, but it's probably just an artifact of Linux's allocation strategy coupled with the fact that this graph crams a lot of data in a very small space. Overall, Linux didn't fare any better, and from the look of it, might actually cause more fragmentation in the long run.

The Windows defragmenter provides no option for defragmenting free space, an option that would prevent this post-defrag fragmentation from happening. There doesn't seem to be a free defragmenter for Windows that can do that, and when I tried to find a FAT-specific defragmenter for Linux, the most common answer parrotted in forums is that you don't need one because (and I quote) "Linux doesn't get fragmented." You can't see it right now, but I am putting on my best "I can't believe society lets you reproduce" face in the direction of everyone who said that.

In reality, FAT gets so little play on Linux that nobody cares. There is a filesystem-agnostic defragmenter for Linux that I haven't personally tried. From what I've researched, the most common defragmentation method in Linux is "Copy all your files elsewhere, reformat the partition/drive, and copy all the files back," which is great, but not everyone has a hard drive's worth of space just lying around.

Oh, and a note to those of you about to defragment your FAT-formatted flash drives: don't. The extra wear and tear on the flash memory is not worth the speed savings. Furthermore, since flash has no moving parts, the speed savings will be minimal at best.

Now wasn't that fun and educational?

0 comments reply permalink

<< 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 >>
All content printed on 100% recycled internet memes.