Great Minds Think Different

Yes they do.

Wednesday, June 28, 2006

Event driven

I gave the last 15-211 lecture today, on infinity and basic computability theory. It went quite well, considering I've never given a formal lecture before. The audience (the front row at least) got suitably excited and confused about the extreme weirdness of the Cantor Set, and that just got me even more worked up than I already was. I got quite animated, just like I knew I would. It was fun, though. I made it last an hour and five minutes - longer than I expected, actually.

Chapter 8 of Megatokyo has begun. Yay.

I spent hours this afternoon watching Wimbledon. I always find it rather sad to watch the hopes of an entire nation dashed year after year as Tim Henman get his ass handed to him. It's a perennial Wimbledon tradition - all Britons get very excited about Tim Henman, this year's going to be the year, etc; and then he either gets knocked out pathetically early or gets easily to the quarterfinals and then gets served by someone who eventually goes on to the finals. This time, he lost to Roger Federer. Come on, that's just terrible luck of the draw.

I'm now reading "The Art of Deception" by Kevin Mitnick. It's about social engineering (the author touts himself as a world-famous social engineer/hacker) and how to protect yourself from it. To me, though, it seems like a ruse to explain how to social engineer to the world. Mitnick was the defendant in a large federal criminal case a few years back, and spent five years in jail and was not allowed to touch a computer for three years after that. He claims he's reformed, but this book seems to show a rather mischievous side of him still remaining. It's also full of typos and spelling mistakes, which of course annoys me to no end.

At the risk of sounding extra-strength pathetic, I must also comment on how much of a masterwork "The C Programming Language" by K&R is. I bought my own copy. It's definitely the best piece of technical writing I've ever read. That an entire programming language, and its standard library, can be described in such a small book is also quite amazing. OK. I just felt the need to get that out.

Monday, June 26, 2006

Riff raff

I think, for a change, I'll talk not about programming but about music. Today's topic is: guitar riffs.

I'm continually amazed by the ingenuity of rock guitarists in how they manage to keep coming up with riffs that are new yet catchy. You'd think eventually every possible riff would have been played and they'd all be stale. There seem to always be more, though. Although maybe not; my most recent contact with the rock scene is in 2001, with Tool's "Lateralus". Or, whenever St. Anger was released, I forget. Anyway, I have no idea what 2000s rock is like, except for Tool. Maybe they've run out of riffs by now.

I'm also continually amazed by the ridiculous simplicity of the greatest riffs ever. Led Zeppelin's "Immigrant Song", for example. The opening riff is one of the most rocking riffs I've ever heard. It consists of two chords. Dun du-du-DAH-duh, du-dun, du-du-DAH-duh... As a side note, the opening seconds of this song make me realize why John Bonham is so awesome. Oh, by the way, would somebody please explain why Robert Plant is supposedly so great? I think he sucks.

Other riffs embody the entire spirit of a song in just a few notes. How their composers know how to do this, I'll never know. Good examples of this are "Enter Sandman", "Hell's Bells", "Back in Black", "Sweet Child o' Mine" and "In-A-Gadda-Da-Vida". With "In-A-Gadda-Da-Vida", for example, just from the way it starts off (little synth intro, bass and drums come in, guitar with the famous riff on top of that) you can sort of tell the song is going to be epic. Was this a goal of whoever composed the riff? Or was it the acid talking? We may never know.

Oh, speaking of originality again. You'd think that shred guitarists, since they play so many notes and thus have more note combinations to choose from than mainstream rock guitarists, would have more room to come up with original stuff. Then why does all of shred guitar sound pretty much the same? I listened to some Chris Impellitteri today, for example, and there's really no way to tell the difference between him and Yngwie Malmsteen. Maybe this is because Yngwie is supposedly the inventor of shred (AND I SAW HIM LIVE! HE WAS TEN FEET AWAY FROM ME!). But still, come on. The average shred track consists of about eight billion notes on the lead guitar. I admit that some note combinations are physically impossible, but given how fast guys like Impellitteri (and Michael Angelo Batio - stunned silence is my only reaction to him) are, I wouldn't think there are too many. Also, some just don't sound good, but I definitely think there are tons of note combinations as yet unexplored.

Oh, hey, I just found this - some NEW shred note combinations! Slight originality! Even though she cites Malmsteen and Batio as influences. Listen to the audio samples. I especially like the first one. There's a very strange but cool-sounding note at 15 seconds. By cool-sounding I mean it's an almost Slash-esque wailing note. In shred guitar, that's unusual. But here it works.

Sunday, June 18, 2006

C--

I think I'm starting to like Perl again. What a very odd language it is.

Anyway, just some stuff book-related I thought I should mention.
  • "Learning Perl" (the Llama Book) is a good way to learn Perl. However, make sure you get either the 3rd or 4th edition.
  • K&R is a good way to learn C if you already know how to program.
  • "The C++ Programming Language" by Stroustrup makes my head hurt. Maybe you're less stupid than me and can actually get through it. I'm looking around for a better way to learn C++.
  • Stay the hell away from all "For Dummies" books. Good God are they terrible.
  • O'Reilly books are generally good. For exceptions, see the next item.
  • Stay the hell away from "Practical C Programming" and "Practical C++ Programming", both O'Reilly, both by the same author (Steve Oualline). They purport to teach good style, and use crap style (not just crap, but inconsistent as well) in code examples. Also, check out this gem (from "C++"):
    Computer scientists have devised many programming styles. These include structured programming, top-down programming, and goto-less programming. Each of these styles has its own following or cult. I use the term "religion" because people are taught to follow the rules blindly without knowing the reasons behind them. For example, followers of the goto-less cult will never use a goto statement, even when it is natural to do so.
    Um...there are totally excellent, convincing reasons for not using goto statements, and most "goto-less programmers" know them. Also, structured programming and goto-less programming are pretty much the same thing. *slow clap*
  • "Secrets and Lies" is scary. If you're already paranoid about computer security, don't read it.
I am teh go now! Latar!

Tuesday, June 13, 2006

Cyclic

I'm starting to hate Perl again. There are approximately eighty billion ways just to iterate through files in a directory, and I'm still a n00b so I tend to mix and match those ways in ways that make Perl unhappy (and, of course, dysfunctional). I guess this just means I have to learn it better. I might try the Camel Book soon. Of course I'll get it from the library.

"Secrets and Lies" is definitely recommended reading. Once I finish it, and the 7th Dark Tower book by Stephen King, I'll read "Beyond Fear" by Schneier, and then probably "Gödel, Escher, Bach". I've been told it's a very fascinating book.

C has finally clicked in my head. I finally had the moment I've been waiting for, the moment when I realize I have fully absorbed pointers and shit. This moment came when I wrote a reasonably complex program that involves shuffling strings around, starting from nothing and only compiling when I was pretty sure everything was functional. I got not a single "omg u misusd pntrz u n00b lol" warning from the compiler. I'll probably be returning K&R to the library pretty soon, but I still want my own copy. I'll get one next time I go to South Hills Village. Dunno when that'll be. Probably in July, once 211 is over. Because now, during 211, I spend n hours every weekend writing Perl scripts to help with grading; however, those scripts eventually end up saving me only about 0.8nhours of work. I justify my stupidity by saying it's helping me learn Perl, which is a good language to have on a résumé.

Saturday, June 10, 2006

Summer of code

I went to the Carnegie Library again today, but this time I didn't get any programming books, though I looked at several. Instead I got Secrets and Lies by Bruce Schneier, which should make for an interesting read, plus two Dave Barry books. I shall spend tomorrow doing leisurely reading...or maybe working on the little project I've set for myself.

To convince myself that I'm proficient in C, I decided to do one of the assignments set out in a C++ textbook I saw today (I tried gamely to wrap my head around C++ but failed yet again), but in C. The assignment is to write an interpreter for a very very very small subset of C. If I succeed, I'll rewrite the same interpreter in as many other languages as I can. Actually, even as I read the assignment I realized I was thinking about how to do it in Perl. I am turning this into a summer of code.

I saw another assignment that looked interesting, in the same book: implement symbolic differentation. I think that one's for next weekend.

In the course of writing this interpreter, I've realized why C-like language require that variable names do not start with a number. It makes parsing orders of magnitude easier.

Well, I am off to go not have a life some more. I'm going to go to Squirrel Hill for dinner and there read one of my borrowed Dave Barry books as I eat.

Tuesday, June 06, 2006

Plug and chug

Today I completed my Java program and companion Perl script for grading 211 assignments. The Java program is a homemade mutation of JUnit. The Perl script recurses through folders, looking for the appropriate .java files, compiles them and sics the Java program on them. I am such a haxor. All I have to do is enter ./grade.pl and watch it chug away, then read the resulting text files. I have a long way to go before I can say I'm proficient with Perl, but I'll get there.

Here are my programming-related goals this summer:
  • Master C, including the most commonly used libraries
  • Become fluent in Perl (i.e. able to write programs of medium complexity without having to look stuff up all the time)
  • Master AppleScript
  • Re-acquaint myself with Objective-C
  • Perhaps take steps towards become permanently fluent in JavaScript (every time I have to do something in JavaScript, I learn it to the point of fluency, then promptly forget it)

Wow, I just realized I know way too many programming languages.

I have 585 Wikipedia edits.

I am publishing sad pathetic facts about myself on the Internet.

I'm going to go curl up in a corner in shame now.

Saturday, June 03, 2006

Watery grave

An eventful day. I went to Hunt and checked out a DVD for watching tonight, then moseyed on down to the Carnegie Library of PIttsburgh. It is amazing. I think I'll be spending most of my spare time from now on either down there, or reading a book from there. I got three books today. One Stephen King, one on Perl, and K&R (the C book). I also read Hoot by Carl Hiaasen in one sitting while I was there. It's pretty much the best book ever because it involves a group of kids saving a vacant lot, which happens to be the habitat of three pairs of BURROWING OWLS, from property developers. The burrowing owls are what make it awesome. As well as the fact that it ends well for the owls.

Then I hung out in Squirrel Hill for a while. I witnessed a very amusing sight there. On the corner of Forbes and Murray, there was a group of either middle or high school kids, doing flashy tricks on bikes. I've actually seen them there before, several times. They were just sort of standing around, chilling, when they spotted some girls coming down Forbes towards them. They hurriedly got on their bikes and started doing tricks again. It was quite plain what their motivation was. However, their show of skill and prowess was somewhat ruined by one of them attempting a trick that required more room than he had, and thus plowing into one of the girls (who were just walking by pretending not to see the guys) and almost knocking her into Forbes Avenue. I believe I actually laughed out loud at that. Those punks amuse me.

I should have been coding today. Oops. However, I don't think I've ever been in less of a coding mood. But I'm getting paid for it, so I really should. Dilemma.

Just as I got on the bus to come back from Squirrel Hill, the skies opened in a biblical downpour. I've seen worse downpours, but not in Pittsburgh. By the time the bus was down to Margaret Morrison, Forbes had turned into a river. Honestly, the first step I took into Forbes to cross it (about a 3-yard step; I was trying to avoid the gutter), my foot sank into an inch and a half of water. In the MIDDLE of Forbes. I sprinted up to my house, and I was utterly soaked by the time I got in (it's all of 50 feet from the bus stop to my front door). I had to change clothes (and hope fervently that the library books in my backpack were OK - they were).

I am going to do stuff now. I really want a couch so I could lie down on it and read my Stephen King book. But I must make do with what I have - a crappy futon that's currently occupied, and a folding metal chair. Bleh.

Friday, June 02, 2006

Two more songs I listen to a lot


  • Beyond the Wheel - Soundgarden It's a very strange-sounding song...but within the space of two seconds (a minute into the song), Chris Cornell shoots from somewhere near the low end of his range to somewhere near the very top, so suddenly that at first the high stuff doesn't even sound like a voice. I am a musical ignoramus, so I can't tell you how many octaves this comprises, but my guess is: a lot. It honestly makes my throat hurt just listening to it. No joke.

  • Mary Had a Little Lamb - Stevie Ray Vaughan Yep, SRV. I might not seem like the type of person who would enjoy electric blues, but when it's SRV I do. This song has a solo that sounds like it must be a lot of fun to perform. It sounds cool too. The lyrics are hilariously bad, but that hardly matters.