Wednesday, July 9, 2008

NaNoWriMo

For the past 3 years, I've been attempting National Novel Writing Month, which is an event where you're supposed to write a 50,000 word novel in November. Unfortunately, I've never 'won' NaNoWriMo, because each year I realize that 20 pages is only about 6000 words and I've finished the story already. I suppose my creative writing prowess has been crushed by the labor of writing school papers as quickly as possible. My brain just can't bring itself to produce

I pray you bear me henceforth from the noise and rumour of the field, where I may think the remnant of my thoughts in peace, and part of this body and my soul with contemplation and devout desires.

when "Listen up!" conveys nearly the same message. That's the problem with non-Creative-Writing English classes - they teach you how to read, but never how to write. Sure, you do write in class, but is the forced, awkward style of the research paper really a useful skill? In fact, almost all English classes up until you get to take Creative Writing in college actually fuck your shit up. They make you less skilled in expressing your ideas. What you learn to do instead is how to use quotes, paraphrases, and more quotes to fill space on the page. All they ask is that you know enough words to mortar the research together. It's a travesty, really. But I digress.

Anyway, this year for NaNoWriMo, I'm planning to write about three guys who start their own country. It should last more than my usual 20 or so pages, as I intend for the new country to have a veritable cornucopia of troubles. For instance, the US is going to invade. If you're good, you might see some snippets of my work come November.

Tuesday, July 8, 2008

rm *$*

So today I was harshly reminded that in UNIX (and by extension, in Mac OS X Terminal), the "*" and "$" symbols do not mean "asterisk" and "dollars", they mean "HAHAHA FUCK YOU, ASSWIPE".

I wanted to get rid of some files named "CollatzSieveUnthreaded$1.class", "FermatChecker$1.class", "FermatChecker$2.class", etc; these are backup class files created by the Java compiler. I figured doing rm *$* would do the trick, because Java uses the "$.class" convention to mean "useless backup in the same directory as the original", and none of my other files have a "$" in them. I foolishly assumed that "*" worked like it does everywhere other than in regex parsers.

Of course, all you holier-than-me UNIX geeks already see the problem with that command. The asterisk wildcard character in regular expressions means "the preceding element zero or more times", and the dollar symbol stands for "the ending position of the string or the position just before a string-ending newline" (thanks, Wikipedia). So "*$*" basically means "any string at all". Awesome.

Thankfully, Time Machine had come to the rescue 18 minutes prior, and my data was safe and sound on Themistocles, my external drive. So I didn't actually lose anything. But it's the principle of the thing!

Summer Jobs

I'll be interviewing for some summer internship positions over the next week or so, and I figured I'd share some advice with the loving public about how to land your dream internship. These steps more or less outline the process I've gone through so far:

1. Don't really try that hard.
2. Apply at the last possible second; do so online, not in person.
3. Don't bother with a cover letter.
4. Your CV should be an almost-empty Word (or Pages, I'm not here to judge) template.
4. Leave your phone under your bed and off, for two weeks, so you don't get any calls.
5. Don't call back for another week after listening to those voicemails.
6. Forget what company you're interviewing at.

I know this sounds tough, but I believe* in you. You can** do it.

* don't believe
** can't

The Student's Sorrows: C

Welcome to the first edition of The Student's Sorrows, where I lament over everything I find to be just plain intolerable.

I hate C and all who push it upon me. I don't want to know C, but it's a requirement for the CS major at my school. I like Java. I like knowing when, where, and why errors occur in my code. "Segmentation Fault", "Memory clobbered before allocated block", "Bus error" - these are not helpful to me. Sure, I could use gdb and step through every line until I find an error, but that's just not effective when I've got a pointer set one less than it should be, 200 lines before anything goes wrong. Ugh, pointers. Listen, kids: never get involved with pointers. They're just bad people.

Also, I love creating and declaring objects. I like being able to call methods on those objects. I love everything about object-oriented programming. Structs and unions just don't... do it for me.

Of course, this hatred of procedural languages has a lot to do with my CS teachers being insolent puppy-kicking bastards. All our C projects were horrible. We had arbitrary deadlines and constantly changing (not to mention overly verbose) project descriptions, a testing server which wasn't fully compatible with the development servers, tests which weren't available until a few days before the due date, and only one good TA.

Not a good experience.

Exams

It's exam season! Wheeeeeeeeeblegh. Nobody loves exams, but damnit, we have to take them every semester. We study and we study and then the bloody teachers put random impossible questions and we fail and drop out and get in with the wrong crowd and spend two years in prison for posession... what?

So here's how you should study for exams: cheatsheets. "But Mr. Snuffalupagus," you say, "that's CHEATING!"

Damnit, you. Listen for two seconds. You don't bring them with you to the exam. You just make them. "But Mr. Snuffalupagus," you say, "that's STUPID!"

Stupid? Yes. Idiotic? Yes. But it works. Personally, I learn more making the cheatsheets than I do paying attention to the teacher in class. Granted, I'm practically a superhero when it comes to making cheatsheets, but whose problem is that? Yours, that's whose.

"But Mr. Snuffalupagus," you say, "why cheatsheets?"

"Well, whorebag, you'll find out a couple lines down."

"Oh, ok, sorry."

You see, cheatsheets are basically the most efficient method of storing information modern students are capable of. The process of cramming all that text onto a little tiny 2"x2" piece of paper really forces your brain to sift out all the irrelevant information and leave you with just the points you'll need to know on the exam. Also, in making a cheat sheet, you kind of have to at least look at some sort of notes, or the book, or lecture slides online, or something.

So here's what you do, anytime before the exam: take a standard 3"x5" index card, find all the notes you can from the class in question, and (optionally) a list of all the topics that will be on the exam. Then - this is the tricky part - get everything you'll need for the exam onto that eensy-weensy card. Lists of things, tables, vocabulary, events, people, places - all of these can be compacted into very small formats. Also, put everything in boxes. Here's an examples of a computer science cheat sheet (note: I will NOT be bringing this to the exam - I'm not even being facetious or sarcastic, cheating is wrong):

See that? That's how you do it. That's good stuff. See that highlighting? It's beautiful. That's everything we learned in 4 months, compressed into a miniscule space in about half an hour.

Sherlock Holmes

I've recently bought a copy of The Complete Sherlock Holmes, and as a result I am very, very angry.

Angry that no one ever told me how awesome Sir Arthur Conan Doyle was. I mean, I should have guessed: how can you not be awesome with a name like "Sir Arthur Ignatius Conan Doyle"?

I'm about 200 pages in, which leaves me near the end of the fourth story, "The Red-Headed League", and it's just splendid. It's like having all the awesomeness of Dr. Gregory House in one convenient, easy-to-carry 1,122-page tome. Get it? Holmes = Homes = Houses = House. OH SNAP.

I can't even be rude about this. There's nothing at all negative to say about these stories. I could read them forever, and at this rate, I will be. That's one problem with fantastic authors who are also very prolific writers - as soon as I start, I have to read everything they have ever written, and then everything ever written about them, and then everything ever written by anybody who even looks like them. Did William Howard Taft ever write anything?

William Howard TaftSir Arthur Conan Doyle

Separated at birth? You be the judge.

Writing Research Papers

I'm pretty good with writing research papers. Pages comes with an MLA format template, which I use regularly; it lets me focus on content rather than margins and headers and such.

I have a method for dealing with sources. I go to the library (or sites like Project Gutenberg and Google Book Search if I'm pressed for time) and grab a bunch of random books and magazines that are at least tangentially connected to the subject. It really doesn't matter, as long as they contain at least one quote somewhere in them that you can take out of context to further your own interests. Nobody's going to check, unless this is a doctoral thesis. I always put as many quotes as I can - it helps if you can use them as part of a sentence:

Kyle was 'a fat blubbering idiot'.

rather than as just quotations:

Smith said, 'Kyle is a fat blubbering idiot'.

This allows you to put in much longer quotes. I don't know why, but teachers like it when you express your ideas with the words of others. Also, if your teacher doesn't care about MLA formatting, use footnotes instead of those ridiculous parenthetical citations - footnotes take up tons of page real estate if you use enough quotes.

The key to my writing style is that I refuse to believe I cannot include any given topic in my paper. If I want to connect the War of 1812 to the Red Rain of Kerala, then so be it. I'll figure a way.

Also, never, ever, say the word "I" in a research paper. We know it's you. You're writing the paper. Get on with it.

Math Class

I've been doing math my whole life - I love the stuff. When I get a problem I can't do, I keep working on until I run out of mathematical rules to try against it. Like the Collatz conjecture. I love the Collatz conjecture - I've got a whole folder of programs I've written to try billions and billions of numbers, hoping against hope to find a counterexample. The version I wrote in C can calculate the sequences for about a range of half a trillion numbers, mainly because it doesn't look at even numbers - it can easily be proven that no even number the lowest counterexample to the Collatz conjecture. The same is true for numbers equal to 1 mod 4, 3 mod 16, 11 or 23 mod 32, and several others. But that's all very boring stuff to people who have no idea what I'm talking about. This is the internet, there's no room for intelligent discussions of heavy mathematics. The people want entertainment! The people demand cats playing piano!

Anyway, math class. Here's a problem even the best of calculus teachers would have trouble with:

Question: Find the line A given by the equation y = mx + b such that A is tangent to these two curves:

f(x) = 2x2 + 3

g(x) = (-1/2)x2 - 2

Answer: I have to admit, I got different answers every time I did this problem. I eventually got it right, and checked it on my graphing calculator.

Let one such tangent line intersect y = 2x2+3 at (a,b)
in the first quadrant and intersect y = (-1/2)x2 - 2 at (c,d)
in the third quadrant.

Taking derivatives gives the slope at (a,b) to be y' = 4x = 4a,
and at (c,d) the slope is y' = -x = -c. So 4a = -c and c = -4a.

Substitution gives b = 2a2 + 3
and d = (-1/2)c2 - 2 = (-1/2)(-4a)2 - 2 = -8a2 - 2.

The slope of the line also equals (b-d)/(a-c),
or (2a2+3 +8a2+2)/(a-(-4a)) or (10a2+5)/5a or 2a+1/a

Thus equating values for the slope gives 4a = 2a + 1/a,
or 2a = 1/a, or 2a2 = 1, or a = (1/2) * sqrt(2).

This means b = 2a2 + 3 = 2((1/2) * sqrt(2))2 + 3 = 2 * (1/2) + 3 = 4.

Also c = -4a = -2 * sqrt(2).
And d = (-1/2)(-2 * sqrt(2))2 - 2 = -6.

The equation of this line through ((1/2)sqrt(2),4)
with slope = 4a = 2 * sqrt(2) is

y = (2 * sqrt(2))x + b' (b' is the y-intercept).

But when x = a = (1/2)sqrt(2), y = b = 4,
so b' = 4 - (2 * sqrt(2) * 1/2 * sqrt(2)) = 4 - 2 = 2.

So the line is

y = (2 * sqrt(2))x + 2.

The other symmetric tangent line has the same y-intercept
but the negative of this slope, so:

y = (-2 * sqrt(2))x + 2.

If you graph all this, it looks like so:

Tangent Curves

You like that? Made that in Grapher. Pretty sweet, if I must say so myself.

Anyway, you only get one good one for Math Class today. But wow, what a problem. I mean, damn.

Philosophy Class

Philosophy is probably the easiest class in which one can mess with the teacher. Math, History, the sciences - those are all subjects that require you to know things. But philosophy, there's a subject that doesn't require anybody to know anything. Hell, some of these nutjobs try to prove that you can't know things. Sounds like an excuse to never study to me, but I digress. Anyway, to mess with a philosophy teacher is a simple task. Here are some questions that'll usually throw them:

Question 1: If you have two things, say, A and B, and A is a necessary and sufficient condition for B, is B a necessary and sufficient condition for A?

Question 2: Doesn't the fact that bothered to write this paper, about how life is meaningless and all pursuits are equivalent to Sisyphus's plight, necessarily mean that he doesn't actually believe what he's writing?

Question 3: How can we try to define evil, when it exists only in relation to good, and vice versa? Isn't this like trying to define "left" and "right" without reference to the physical world?

Teacher: Socrates said "All that I know, is that I know nothing."
Question 4: Did anybody ask him how he figured that out? If that's the
only thing you know, there are no premises on which to base the
argument, right?

Answers after the break.

Answer 1: Yes. "Necessary and sufficient" is equivalent to the mathematical term "if and only if", which works both ways.

Answer 2: Yep. Anybody who thought life was actually meaningless would just, you know, not live. The salvation from this belief is the ability, unique to mankind, to say "Eh, screw it" and keep on living without bothering oneself with these trifling thoughts.

Answer 3: We can't. It's impossible to define explicitly terms like "good" and "evil" without referring to either observations (like saying "left is over there" while waving your arm) or the opposite term (like saying "left is like right, but the other way").

Answer 4: This is actually kind of a trick question. What Socrates meant was that he knew very little for certain - like, he couldn't ever know that there wasn't an invisible, silent duck following him. I mean, one assumes, but you can't prove it.

Of course, you should wait until you get to the relevant part of the class before you ask these questions - don't go on about left and right while you're discussing the form of a philosophical argument. If timed correctly, and if the teacher isn't that great, these questions should trip him up a little while making you seem smart. Asking questions like this works better if you don't stay in the same seat for every lecture, because otherwise the teacher will tend to ignore you.

About

We all know that for every class, there is a row of idiots in the back. This back row is a magical place, where dreams come true and unicorns and butterflies roam freely. I like to think of myself as lord and master of that back row. I mean, I'm probably not, but screw you guys. I'm the one at the keyboard, so damnit I am your lord and master!

So that's it. The point of the blog is to relay my experiences as an idiot who likes to sit in the back of things.

Actually, that doesn't sound interesting at all. But it is, I think.