Thursday, November 13, 2008

Random book meme thing from the Django planet

"A syntax error occurs when the string of input tokens is not a sentence in the language." From Modern Compiler Implementation in Java, Appel.

I've spent a pretty frustrating 24 hours+ (sleep included) trying to grade a ridiculous exam, so I felt like doing something silly. From Eric Florenzo's blog (et al):

  • Grab the nearest book.
  • Open it to page 56.
  • Find the fifth sentence.
  • Post the text of the sentence in your journal along with these instructions.
  • Don't dig for your favorite book, the cool book, or the intellectual one: pick the CLOSEST.

My quote was dumb. Too bad that book was the closest, instead of the Dragon book (or the only non-textbook in vicinity, Chainfire by Terry Goodkind)...I think it's time to rearrange my shelf.

Wednesday, September 24, 2008

Pittsburgh takes a dump on education

It's been awhile, I can't sleep, and even though I posted this on Facebook, I think it merits repetition, even if it's late-night, drowsy, nonsensical repetition.

A post appeared on Slashdot today titled, "Students Are Always Half Right In Pittsburgh. A curious title, but what's truly astounding is what the article is about. Apparently, Pittsburgh public schools are, in a no-child-left-behind fashion, are going to be limiting the lower bound on grades to 50%. Seriously.

The reason is relatively obvious; the Post-Gazette article quotes a spokesperson saying, "We want to create situations where students can recover and not give up." Quite a noble reason, I suppose. Yet, the consequences seem to be alarming. Wait, no they aren't, because "it's not grade inflation." Guess that settles that. Or not. Slashdot commenter Jason Pollock explains just how bad this system actually is. Essentially, you can easily get a passing grade, with very, very little effort. The example is somewhat incorrect, since grades are done differently than simple overall percentages, but the effect is the same.

I don't know how this managed to come about, given the fairly obvious ethical concerns, never mind the fact that you only need a 20% in each grading period to pass a class. It scares me that so many high level officials in the Pittsburgh area seem to agree with institution of this policy. The solution to the goal thoroughly destroys the essence of a proper education. Incentive to actually learn material is diminished, when students are always "half right" anyway. There aren't many ideas that I can think of that would be less apt to striving for "Excellence for All."

It's not like trying to help students boost their grades is a new subject. Giving free points for no work is simply not the correct answer. One district made students redo homeworks until it was A or B material. While I think this could be a good idea, to some extent, it sounded like they actually were given an A or B in the end. While it's great that they learn the material, grades don't mean much if everyone gets an A or B. The basic concept, however, I agree with: Give students opportunities to make up bad scores, rather than just giving them away for free. Giving remedial homeworks, allowing a redo of homeworks for added partial credit, or some forms of extra credit are all better, logical, ethical alternatives. I just hope that this decision is contained, if not reversed.

Saturday, July 19, 2008

I am really lazy

This is not the next post I said I would write. It's more or less an update of my lazy life. I've mostly stopped playing games, but now I apparently still have no motivation to do anything productive. Great. There is really not much happening right now. Two weeks ago, I was on vacation with my family in Glacier National Park. Pictures will come eventually. Maybe.

Dr. Horrible's Sing-Along Blog was "aired" on the Internet this week. Apparently it wasn't as widespread as I thought, since I assumed the people who were on top of their game (I'm looking at you, James) would know about it. It's Joss Whedon's latest creation (Buffy, Firefly, etc. fame), and I found it to be pretty amusing. So, if you liked his shows, you'll probably like this one as well. But you know, watch it anyway. The free viewing ends after tomorrow (or at midnight tonight, it's kind of ambiguous), so you should step on it, if you're interested.

The female actor, Felicia Day, in Dr. Horrible was new to me, though apparently not new to Joss Whedon fans. I stumbled upon a small web series written by her called The Guild, which was also pretty funny. I can relate to it a lot more than I can to superheroes, even though I don't play WoW.

On a less-fun-more-nerdy note, the newforms-admin branch of Django was merged to trunk last night. This is probably the one good result of me procrastinating so much—I don't have to convert any code to match the new admin module. I hope I can get motivation to start working with Django (and other projects) again soon, but I still have some other stuff for CS190M to finish up, and that's stealing all the motivation I can get.

Wednesday, May 28, 2008

The saga continues...

Well, it's been almost 3 weeks since commencement; as usual, I've been in summer-time slacking mode. I'm still doing a bit of work, but most of my time has been allocated to playing games and sleeping. Hopefully I can come off this habitual productivity death (don't I say this every summer?). Of course, I have goals, but they're farfetched as always, given my work ethic.

Last summer was mostly spent looking at Pylons as a Python web framework; Bennett and I started a project that progressed at a reasonable pace until school resumed. After awhile, I started looking at Django again, so hopefully I can come up with a good project idea that would use it. Since my last experiments with Django, they've made some great progress in development, as well as the release of a new book, which is a good reference; something I feel that Pylons never really had.

I have a few project ideas in mind, but they're all personal. I'm more or less hoping some others will be interested in some sort of group project (and have ideas!); unfortunately, most of my friends are starting "real life" mid-summer at their jobs all over the country, so I don't know how feasible this will be.

Django aside, I feel like it might be time to learn another language—Erlang is a possibility, but at this point I'm thinking that JavaScript is a good candidate. It's in the theme of web development (I guess you could argue that Erlang is too), and isn't something I've touched since middle school. Undoubtedly JavaScript would be much easier to learn than Erlang, so maybe restricting myself to one language is not a good idea. Suggestions are welcome.

Getting away from web development, shaim is still up in the air as to if I'll start working on it again. An IRC plugin is scheduled for the 0.5 milestone, and since I've made IRC clients before, this would be my area of expertise. What I really need to do is manage my time (stop playing games), but I don't foresee that occurring—at least not completely.

I also get to introduce one of my brothers to C this summer—as the next family member in line to go into Computer Science, he's one of the programmers for the high school's robotics team. This will be interesting, given that I've been so used to teaching Java (and hence gotten used to programming in Java, not C). I was just going to throw K&R at him, but I can't seem to find my copy.

Researchy type things are still ongoing; the same stuff as this last semester. Professor Vitek is out of the country for the entire summer, so I'm kind of on my own as far as real-time Java goes (P.S., I got a free Macbook Pro), but I hope to make more progress than I did during the semester, without any class obligations. I've nearly completed the labs for the new class, currently offered as CS180M, but subject to change. It will be interesting to see how multicore programming will pan out for freshmen; I would like to see how I would have fared in such a course. Of course, now something like that would be a cinch (given that I'm writing the labs).

I'm also apparently under obligation to be flying around again this summer to visit people. I haven't quite made a schedule for it yet, since I am technically working already, but I guess the unnamed will drown in a cup of sorrow if I don't fly out.

Next semester should be interesting. I decided my schedule with Professor Vitek before he left, and it looks like I'll be taking:

  1. CS580 - Algorithms (Frederickson)
  2. CS565 - Programming Languages (Vitek)
  3. CS591C - Research Seminar (Various)
  4. CS590V - Principles of Programming Languages

The first two have qualifiers, which will probably suck a lot. As someone who's gotten away with not studying for exams (predominantly), qualifiers will probably destroy the notion of me getting away with laziness. These next years will be quite an adventure.

Next time, a blog post at request of a future Purdue student.

Friday, April 18, 2008

The Indiana earthquake

I've been incredibly busy lately (and still am in the middle of a homework due in less than 12 hours after having worked on it all night), but I guess this is some sort of historical moment, even though it's not CS-related at all. Around 4:30, Phil and I were doing our Parallel Computing homework when I noticed my leg was shaking. It came to be no surprise to me that my leg was jerking since it happens on occasion, but I couldn't get it to stop. Then, as cliche as it sounds, I looked over at my water and it was rippling. It started seriously vibrating the room after awhile, which was really freaky, since I live on the 10th floor. About half of our floor noticed it and came out of their rooms, wondering what happened. Of course, it had to be an earthquake or a bomb. Bomb didn't seem likely, and sure enough, it was reported a few minutes later. A 5.4 earthquake in the middle of the United States seems absolutely incredible.

In other news, school has been wreaking havoc on my health. Phil told me yesterday that Parallel Computing was allegedly the second hardest graduate CS class offered at Purdue, which is insane, yet I wouldn't doubt it at all. Our professor is a good teacher, but tends to consider things to be much easier than they actually are. This homework was supposed to be "easy", but I've worked on it over 12 hours so far and am still not finished. Of course, I still have plenty of work in other things coming up and will be until finals are over. Sometimes I wonder why I chose to stay in school. Actually, I guess I never actually posted about that. I accepted Purdue's offer, so I'll be staying here for my Ph.D. There's only one other person I know at the moment that's doing it, and I'm surprised that I even know one.

Back to work, anyhow.

Sunday, February 24, 2008

An odd case of senioritis

In high school, I used to wonder how people managed to get senioritis—the mythical disease contracted during graduation year with the symptoms of being really, really lazy. I was actually the opposite way; senior year is probably when I worked the hardest, since I was taking calculus classes at Purdue, as well as AP French and Physics C (for both kinematics and e&m). Now that I'm on my way out of college, however, things appear to have changed. Not only do I procrastinate madly on my homework, which has resulted in all-nighters for both of my parallel computing assignments, I've also picked up a habit of not going to a significant percentage of my numerical methods class. I don't think it will ever become a serious problem, though it makes me feel like a serious slacker.

Fortunately, this whole slacking business seems to have an upside. Since neither of my classes has a "real" programming component (yet), I've been doing more extra-curricular programming than I thought I would have time for. RITA has made decent progress, and some people use it for monitoring purposes even though it's technically not production ready. The key items that still need attending to include cleaning up the terrible mess I've made out of the code, as well as implementing a few more options. That aside, I was able to code up some other needed features, such as syncing to ResNet's traffic stats on the hour (which can still be tweaked some, I suppose), displaying the traffic graph, and creating a task tray icon with gauges to determine how close you are to the bandwidth limit. The tray icon was probably the most tedious, but it ended up being the most interesting. At first I had static icons set to display at low, medium, and high levels. The granularity of that is highly dissatisfactory and the icons weren't even displaying properly, for some reason, so I ditched that. In the end, I just dynamically drew the icons as necessary. This saved me the trouble of drawing 196 icons and calculating 14 different colors to use; even though the middle area turns to an ugly brown color, I'm still happy that it actually works.

The other project I've been working on starts with Ragel, which is a state machine compiler. I was interested in seeing how efficient an IRC library parser, which is really quite simple, could be in C#. SmartIrc4Net is one obvious benchmark to compare against; the single regular expression in Parse::IRC is another. Ragel is supposed to be really fast, so I wanted to try it out. The problem is that Ragel only supported Java, not C#, so my first task was to implement C# output for Ragel. This didn't turn out to be very hard; instead, it was mostly fixing errors that surfaced because of differences between C and C#, such as type safety rules.

Implementing a simple parser for IRC is not so hard; the syntax is pretty easy to break down. By "simple" I essentially mean that it's like a single regular expression. I was able to implement it at the end of the week, though I had trouble getting Ragel's scanners to work. Instead of using scanners, I used one of Ragel's cool features, embeddable actions, to mark tokens on transition enters and exits. I finished my first "benchmark" comparison against the giant Parse::IRC regular expression as well, after sticking it into a C# Regex object. The benchmark was simply to parse a few IRC commands a million times; as it turns out, Ragel is about 33% faster than a compiled Regex object in this measurement. It's kind of fun to suddenly start worrying a lot about efficiency, even though parsing is probably a small task compared to, well, what the rest of an IRC client would do. There is still more to be done with the Ragel parser, before I start trying to actually incorporate it into a library, though. More on that later, maybe.

Along the way, I got kind of annoyed at switching between Vim, a DOS prompt, and Visual Studio. Lucky for me, I discovered custom tools, which are basically processors that take a file and spit out code in a certain language. I implemented a custom tool processor for Ragel yesterday, so now I can use Visual Studio for everything. Using cmd.exe gets pretty annoying, especially when you're used to bash.

There's still much that could be done—I haven't done anything with Django this semester, which is kind of sad, but I guess you have to prioritize at some point. Hopefully this motivation sticks around long enough for me to eventually get to more web programming. Even though I've always been more of a desktop/non-web programmer myself, Django is a pretty cool piece (pieces?) of software, and I guess the web is the future and all that jazz.

Saturday, February 09, 2008

On C# and properties (continued)

Awhile ago, I posted about a problem that I started coming across when I took software engineering with C#'s properties. Even though it was a great improvement over Java's get/set methods, there are still problems to be had (you can read the article here.

Interestingly enough, the release of C# 3.0 has fixed this problem, and in a much better way than I had thought of. I discovered this while working on RITA in Visual Studio 2008, whose property snippets (prop and propg) were updated. The syntax of the language remained the same, which is great. In C# 2.0, you can declare an abstract class to have a property with the following syntax:

public int X { get; set; }

In C# 3.0, a new feature called "automatic properties" allows you to use this syntax in concrete classes, as well. The compiler automatically creates the private variable for you, but you don't see it, all access is forced through the property, which solves the problems I mentioned in the previous post. You can prepend the get and set with access modifiers as well. For example:

public int X { get; protected set; }

This is a very clean way of doing things, and I feel rather silly for not thinking of it myself. It's a pleasant surprise in C# 3.0, since only the main features ever seemed to be touted (LINQ). It's also backwards compatible, so when I compile RITA to be compatible with .NET 2.0, it works just fine.

Sunday, January 27, 2008

This week in life

Here I am again, with no motivation to think of a real title, due to peer pressure of a certain jerkasaurus rex (jerkasaura regina?). Thus, I present an update on recent happenings in a disjoint, sloppily written fashion.

Last Monday, Purdue sent me an offer of support and admission to the Ph.D program in Computer Science. Exciting, but this is only the beginning of responses. Hopefully Purdue isn't the last university that responds positively. They gave me a fairly short notice of a fellowship that I should apply to, which is due on the 31st, so I guess I have to work on that. Recent weather, apparently reaching double digit negatives, is not positively influencing my opinion of Purdue. Not it's weather, anyway.

One of old friends (makes me feel old just saying that) is coming up to Purdue to visit, since he applied to Purdue for grad school, as well. It could be interesting if we both ended up here, since we used to be best friends before I moved across the States.

I had a meeting two Mondays ago to discuss the course I'm helping design. It was interesting, but will probably be quite a bit of work. I'm still in vacation mode, since I just turned in my first homework on Friday, which will be a problem if it continues for much longer.

I also met with Professor Vitek, who's supervising my honors research project, to talk about what I would be doing. I agreed to read some relating to RTSJ, which will probably end up being my research project (sorry, Luke). This will probably be a challenging topic, since James and I didn't really do so well on the RTSJ project we had in our programming languages class.

I'm also juggling way too many games for my own good, at this point. In addition to playing Materia Magica again, James has convinced me to start playing Freestyle Basketball again. Archspace also re-opened as Magellan Wars, which I used to play a lot. Hopefully I won't play too much this time, since the playerbase has dwindled dramatically. I also started a Travian account today, a game that Phil ahd been telling me back. I think it looks like a graphical Utopia, which makes it better than Utopia already. The cherry on top is that Mabinogi, my favorite Korean MMO, is opening at the end of this month for closed beta in English. James and I played the game in Korean, which, as you could imagine, was somewhat limiting, but it could be more fun this time around. Hopefully we get in. It's also kind of sad that my biggest paragraph is about computer games.

Realistically speaking, unless I stop playing games (with your heart, playing games with your heart~), I probably won't have much spare time for recreational programming. I have no ideas that would involve Django programming, but I have been tossing around ideas for a C# IRC library again for shaim. Pun intended. I've looked into other libraries, particularly SmartIrc4Net, but I don't know if I really like it.

I think that accurately summarizes how I haven't been doing much.

P.S. Dear Google, please re-evaluate your Blogger shortcuts. Ctrl-shift-arrow is commonly used to select words, but I can't do it anymore because ctrl-shift changes to preview mode.

Tuesday, January 08, 2008

The beginning of the end

Assuming I don't royally screw up this semester, this is my last semester at Purdue, at least as an undergraduate. No idea what I'll be doing after graduation yet. Grad school applications have been sent in, and I guess I should resume job searching this semester. Unfortunately, I have no idea where I want to work, which is a big issue.

How did my winter break plans go?

  1. Sleep. As per usual, I lost sleep over break rather than gained it. Gotta take maximum advantage of recreational time.
  2. Study for the Western Civilization I CLEP exam. I half-heartedly did this. I took the exam today at 2 and passed with a bare minimum. Fortune smiles upon me, for I no longer have the threat of taking 18 credits looming over me.
  3. Read The Little Book of Semaphores. I read through a good portion of it. It turned out to be different from what I expected, being a very example/problem-driven book, but I still read through it like a normal book, rather than trying to figure out most things. Probably wasn't a good idea, but I think it helped.
  4. Look into more web programming. The Django book did come out, and I read/skimmed most of it. Most of it that had already been written was still the same, but the new sections were good to read about. I started a project in Django before I got lazy and started MUDding a lot again.

This semester, I'm only taking two classes--Numerical Methods and Parallel Computing. Numerical Methods will kill me, since I don't remember any calculus anymore, but Parallel Computing should be interesting. I'm not teaching a lab section this semester, so hopefully I'll have free time to do other things.

And there's my update, now leave me alone. You know who you are.