Search This Blog

Sunday, March 26, 2006

Kids (and Computers) Say the Darndest Things

The last day or two I've been working on the successor to Trans-Roman Alpha (I should blog about this, sometime...): Trans-Roman Beta. Well, so far all I've done is play around with algorithms some; one algorithm in particular reads in an amount of text in some actual language, learns the rules of how that language constructs words to the best of its ability, and then generates random gibberish that imitates the language it was fed.

In addition to the practical value of this algorithm, it's also good for laughs. Initially I fed it the English translation of War and Peace, but it often ended up in infinite loops, using that as its data set. So I decided to feed it an English dictionary, instead. That allowed it to generate a wide variety of gibberish, sometimes actual English words, sometimes humorous words, and sometimes neither of those. Below is a list of some of the ones I found amusing, from a total of 50,000 characters it generated (keep in mind that this is random with regard to each character generated):

goatempts curvaccidatodgy zeppasmo almly zookelpful quinedibly votrepinabitized czarskiing qweryphs zuccon xercococcur forkplay fruckage beepfat qualmly wussyfoo gluejew qwerbage weenie feelworldvic vyingfishpad squettled jarfed clatchfin owlywed xylorying frazziest pornumb bromsdam sunkyard fryingpie menhand xersnigget twirlifted gyroite yowlywed zomboide gagiosex knivie runtnest fobbyhoe dogey glasmanly ptoriery

I've also noticed that this thing suffers from occasional dictionary poisoning. That is, it'll see some odd word once ('qwerty' comes readily to mind) and it'll start using structures from that word all over the place, even if no other word in the dictionary uses said structures (for example, it became quite fond of starting words with 'qwer', despite the fact that 'qwerty' is the ONLY word in the dictionary that has this). So, I guess in a way this is like having a little kid :P

Incidentally, 'xersnigget' might be my all-time favorite "word".

Saturday, March 25, 2006

My Program Is Mocking Me...

FusionReactorII says:
Ah crap
FusionReactorII says:
That won't work
FusionReactorII says:
Well, it works for generating random text. But it won't work for Trans-Roman Beta, because it needs to be reversible
Josh says:
FusionReactorII says:
I wonder what would happen if...
FusionReactorII says:
FusionReactorII says:
That totally broke it
FusionReactorII says:
You've got to come see what it generated (because it broke)! That's absolutely hysterical!
Josh says:

Thursday, March 23, 2006

Windows Internals Curriculum Resource Kit

I've just found something godly: the Windows Operating System Internals Curriculum Resource Kit by Microsoft. It's basically a university course on Windows internals, complete with lectures, labs, quizzes, homework, etc. The material seems to be derived from a number of wildly popular Windows system and internals books, and adapted into a university course by a pair of professors; Microsoft then licensed the material and is distributing it free.

There's even a lecture comparing and contrasting the Windows and Linux kernels.

Now go! Fetch!

Wednesday, March 22, 2006

It's a Wonderful Life

So, I've now had midterms in every one of my classes this semester - biochemistry, biology, biology lab, computer science, and history. It seems this semester I'm having extraordinarily bad luck at getting teachers with both a good sense of logic and a good sense of time.

The first of these tests was in biochemistry. The teacher had very clearly said, about a week before the test, what material would and would not be on the test (that is, none of the stuff in lecture less than a week before the test would be on the test). She even very specifically listed a couple topics in particular that would not be on the test. Guess what was worth 15% of the grade on the test? However, when she saw that I'd written on the test that she said that wouldn't be on the test, she decided to multiple everyone's test scores by 1/0.85.

But that wasn't the only problem. I noticed that at the end of the test, when she told everybody to turn in their tests now, only 3 or 4 people (out of a class of at least 30) had left early. I reasoned that if only 10% of the class had left early, that probably meant that a good 65%+ of the class or more hadn't even finished the test. I sent her an e-mail to that effect, saying that the test was too long. I got back this reply (actual quote taken from the e-mail):

at least 30-40% of the class had finished the test before time was up thus I do not believe that there was any problem with the length of the exam (except that it was probably too short)...

Okay, moving on...

Next up: biology. This test had more or less the same problem, only worse: few, if any, of the students had time to complete the test (indeed, after we handed in the tests I heart just about everybody at my table complaining that they weren't done). On the test was a wide variety of questions, but one, worth about 20% of the test (which means you should be able to answer it in about 20 minutes), was really the deathblow to reason and sanity. It went something like this (recalling from memory):

You are working in a barn, and sit down for a moment. When you sit down, you find that you've sat on a rusty nail, and deeply impaled yourself. An additional concern to you is that you have previously had a skin infection, which might have managed to get in the wound. Explain how the immune system would respond to this, including specific cells, locations of occurrence, chemicals, and chemical receptors.

Okay... macrophages, neutrophils, cytokines, inflammation, complement, lymph system, phagocytosis, antigen presentation, B-cell proliferation/differentiation, memory cells, plasma cells, antibody production, and a few other assorted things. Well that answer covers a good 2/3 of everything we'd learned in class up till the test. A succinct person like myself might be able to squish the answer into 3 full pages (had I had the time); other students had already gone beyond that before running out of time (and still didn't get near all of it covered). Honestly, this is about as much material as I expected to have to recite on the entire test; but then, maybe I'm too sane to be a teacher.

Next up was computer science. Nothing much to see here, other than more of the same: too freakin long. Again only 2 or 3 people out of a class of at least 30 had turned in their tests before being forced to, and again I heard people all over the room saying "I didn't have time to finish!" Somehow (probably due to the fact that 2 out of 2 of the previous tests had been this way) this wasn't so very surprising.

This was the same test that one grammar question was on; the teacher is a pretty cool guy (imagine a slightly nerdy Howie Mandel; he even looks like Howie Mandel), but he really could stand to get a handle on the fourth dimension.

Next was the history test. This was the only one of the tests that I was actually satisfied with my answers (and didn't feel like I could have done better if I'd had more time). Although a bit of that is due to the fact that we knew exactly what was on the test before we took it; the teacher made a study guide (about 3 times as long as the test) which included all of the questions on the test, as well as about twice as many questions that weren't (though we didn't know which was which ahead of time).

Then today came the biology lab test. This test seemed to be the worst of all of them, but that could just be because I've forgotten some of the specifics of other tests (which were 1-2 weeks ago). As this post is already way too long, I'll limit my complaints to only a few of the problems with this test. Let's start with this gem (rough recall of the question from memory: "Explain what the difference between confocal microscopy and fluorescent microscopy is, and the advantages of confocal microscopy." Mu? How does one explain the difference (and the superiority/inferiority) between two things that aren't mutually exclusive?

A second example (the last one, as this post is already hideously long) is one involving a graph of "precipitation" (no units given) vs. "antigen" (mg). The question asks you to calculate how much antibody there is at a given point in the graph, giving the answer in mg/ml. A bit of explanation is in order for this. This is a graph you would make using a spectrophotometer (hence the lack of units for the y axis); you would then use a standard curve to calculate the concentration of the unknown based on its absorption. Usually the x axis is in mg/ml, but this could be calculated if the volume was known (since the weight is known). I go up to the teacher, and the dialog goes something like this:

Me: There isn't enough information to answer this problem
Her: Huh? Never had a problem with it before...
Me: This graph and the data table are in mg. The answer requires the volume to be known, and it isn't given in the question.
Her: *takes a minute or two to look over the question* Oh. Well, I guess just assume that was supposed to be "mg/ml".
Me: Also, this y axis of this graph has no units
Her: So? That's how we always do it.
Me: We always have a standard curve. There is no standard curve here.
Her: *takes a minute or two to look at the question* Oh. I guess that axis would have to be mg/ml, then.
If you're looking to get a space craft to Mars, I can give you the name of somebody not to employ.

Tuesday, March 21, 2006

The Solution

Alright, let's see if I can get through writing this post without my computer blue-screening (again).

The reason this question was so cool is that it's not only hard (1 in 25 isn't very much), but the solution is extremely simple and elegant (at least in concept; when written out in grammar it isn't so pretty): it's a simple deterministic 4-state machine, represented by the following graph:

The machine begins in the even 0s and even 1s state, and changes state each time it reads a bit in the number (the order it does this doesn't matter). If at the end of the string the state is even 0s and odd 1s, then the number is valid. This machine can be directly expressed in grammar, but it can be a bit cumbersome to read; thus why I've only given the graph.

As a bonus, this next graph shows a machine for the same problem, save that it's 0-exclusive: it isn't valid to have zero 0s and odd 1s.

Oh, and on an unrelated note, I just learned that Windows Vista has new API functions for read-write locks and condition variables. Also, NT 3.5+ has undocumented but stable functions for read-write locks. I'll have to see about adding support for those in LibQ at some point (heck, I'll have to see about doing anything with LibQ at some point). For those of you wondering, the complete lack of content lately has been due to me getting back into WoW after a couple month break :P

Friday, March 17, 2006

MSDNAA is Godly

So I just got hooked up with Microsoft Developer Network Academic Alliance through my school. I more or less downloaded everything they had up there, including Windows 2000 Pro, Windows XP Pro, Windows Server 2003 Enterprise (!!), Visio 2003 Pro, Project 2003 Pro, Visual Studio 6.0 Pro, and Visual Studio 2005 Pro (KAITY). Nothing like waking up and finding like 5 grand of software legally at your fingertips for free!

Oh yeah, and I used Visio to make a beautiful diagram of the solution to that grammar problem. I'll post it this weekend, so you better try it before then! :P

Wednesday, March 15, 2006

The Challenge

I just had my first test in High Level Languages, a third-year course about the structures common to most/all high level languages, and how high level languages in general work. I thought one of the questions on the test was absolutely godly (and from what the teacher said, I was the only one in the class who figured out how to do it; however, I don't know if this is because nobody could figure out how to do it, or they made some critical typographical errors in their answers). I suggest you try and solve it, because it's an awesome question. It goes like this:

Create a grammar (BNF, EBNF, syntax diagram, whatever kind of formal metalanguage you want) rule for binary numbers of any length, containing an even number of 0s (0 inclusive) and an odd number of 1s, in any order.
You have fifteen minutes. Go!