Sunday, December 28, 2008

Superpowers

This vacation I've been reading Superpowers by David J. Schwartz.

I picked this book up as an impulse buy, and here's why:

First of all, it's a novel about college students in Madison, WI. Since I spent a large slice of my college career there, all the locales mentioned in this book are easily remembered. When the characters go to the SERF, I remember myself going to the SERF.

However, you don't need to know Madison to enjoy this book. The concept alone is enough to merit a read: ordinary people wake up one morning transformed into beings with superpowers. You won't find a cliche supervillain subplot here--mostly this is about what would happen if an ordinary person suddenly had extraordinary powers.

The five powers themselves make for a great conversation piece: which of the five would you choose if you could pick one of them for yourself.

1. Speed. The ability to run 20 miles in a couple minutes. When you run, objects in the world seem to be standing still, so dodging bullets isn't out of the question. Running to a nearby state is not a problem.

2. Flight. No wings necessary. The ability to soar through the sky.

3. Invisibility. Can be turned on and off at will.

4. Super strength and near invulnerability. Think of the powers of the Thing, except you still look normal.

5. Telepathy. Not just able to read the minds of those nearby, but also the ability to scan an internet-like web of thoughts.

Which would you choose?

Schwartz does a good job on this novel. It doesn't surprise me that he has a large selections of comic and science fiction/fantasy reviews that he has documented from a former blog and also a current blog. If you enjoy reading reviews, give them a try.

Tuesday, December 23, 2008

Object-Oriented Programming Example

My Java programming project is going a bit slow, but I have many excuses. The one I like to use in OOP (Object-Oriented Programming) is "well, I'm still working on some design issues before I start writing all the code."

So I'm converting Football Strategy, the old Avalon Hill game into a modern Java version, complete with opposing coach AI. OOP will allow me to extend the coach class through time, making better and better opponents for humans to face.

But that all comes later. Since I give my AP Computer Science students the whole year for their project, I too have a lot of time to develop this application. Recently I've been hitting my head against the wall trying to come up with a system for encoding play results that include all the relavent information in one result. For instance, a result of 723 may have used the 7 as a play-type indicator (say, "complete pass play that went out of bounds"), and the 23 might have been the net yardage. On the suggestion of one of my students, however, I have decided to encode all the play results as String objects. Perhaps something like "15cpno023" for complete pass no fumble out of bounds and 23 yards, with the play taking 15 seconds. I don't know, I'm not there yet.

The point of using an OOP approach, however, is to allow you to think of things as actual objects. What better way to do that then open up the Football Strategy game box and see what objects in the game may lend themselves to objects in Java. One that clearly lends itself to being a Java class is the scoreboard. Before OOP, making a football simulation would have been a long and tedious process, as the data would just be flying around the program, jumping from function to function. With OOP, though, you get to break things up and decide where the data lives. In the case of a footballScoreboard class, you can easily think of the data fields (homeScore, awayScore, down, yardsToGo, fieldPosition, etc) and the various behaviors (incrementDown, incrementHomeScore, etc). What was so nice about this, though, was that there is an actual object in the real world that is so familiar to anyone who has ever been a football fan. Ask some football fans at random to draw a football scoreboard and a lot of them would draw something like this post's image.

Coming from a procedural programming background, OOP was a bit strange at first. Now I can't imagine programming relatively large projects without it.

Monday, December 22, 2008

Ubuntu Gets Even Better

Joey Stanford's recent post about Ubuntu Ethos came at a perfect time for me.

Last night I did a fresh install of Ubuntu 8.10: Intrepid Ibex. I had avoided switching to the new Ubuntu version simply because I had a lot of things set up on my laptop that I use for teaching math and teaching programming classes.

After copying most of my home folder files to an external hard drive (I love the Western Digital Passport series), I did the install from the live cd.

After install, I did the usual updates and installed all the Linux applications I use for programming: things like Eclipse, Geany, IDLE for Python, Comix for reading comic books, and so on. I also installed the Sun Java 6 JDK using the package manager. After a nice little test of HelloWorld.java, I got the latest versions of BlueJ and Greenfoot and installed them.

Now this is where things were different than in the past. Back in the days of Feisty Fawn, I had to mess around a lot with the xorg.conf file and set some class paths for Java. I always considered these steps to be necessary evils and a small price to pay for a great, free alternatives to MS Windows.

This time, however, I didn't have to do any of those steps. None. Everything worked correctly right away. I even was able to turn off tapping on the touchpad without having to do anything on the command line.

I like the command line. In fact, I use it quite a bit. The point here, though, is that you really don't have to use it anymore. That's a good thing for helping spread Ubuntu. If you have ever considered Linux, but were intimidated for one reason or another, now is the time. The Ubuntu community can help you with the switch.

If you're a math or computer science teacher, you'll be amazed at how Ubuntu can help you with your job.

Saturday, December 20, 2008

Java for the Holidays


I've blogged about Cay Horstmann before. In the world of Java books there is no shortage of "so-so" tomes that "kind of" teach you the language. Then there are a few truly great books that are several levels above the rest. One is Head First Java, but that book is in need of a rewrite soon. The other great Java book is Core Java Vol 1: Fundamentals by Cay Horstmann and Gary Cornell.

What makes a great programming book? For me, the author must get to the heart of the language. Mark Lutz and Wesley Chun have written truly "Pythonic" books about the Python language. Their books are miles ahead of many of the other books on Python programming, which seem sloppy and inefficient.

Horstmann's Core Java is a great book. So I finally went to Borders and bought my own copy. I worked through the first 138 pages today (as review) and can't wait to revisit the chapters on Swing GUI development. If you really want to understand Java, try this book.

Teachers who read this books will have a big advantage in teaching Java, no matter what textbook they have officially adopted for their class.

Monday, December 8, 2008

When Zombies Walk the Earth

Found this anthology of zombie fiction in Borders last week. Started reading "Meathouse Man" by George R. R. Martin and found it to be quite good, in a very disturbing way. I put the book back and went on my way.

Then I read the two latest issues of The Walking Dead and realized that zombies have been quite prominent in my film, fiction, and music choices lately.

What makes this such a successful subgenre? I don't know. Maybe it's got something to do with zombies traditionally being dumb and slow. I know there have been variations on this, but I still prefer the mindless wandering version over all the rest.

I think these stories work because the rules are so simple. Add on the fact that most of these take place in a post-apocalypse setting and you know have two for the price of one in horror and science fiction subgenres. Maybe it works best on people who like rainy days. Zombie stories make us thankful for what we have.

I went back to Borders yesterday and bought the anthology. The cover alone was worth the price.

Wednesday, December 3, 2008

Creating a school website

Being in charge of a school's computer science department has several perks. I get to help shape our curriculum. I get to hang out with some of the brightest students at our school. I get to occasionally play video games and call it "research."

All of those perks are great, but being the department chair also brings great responsibility. Were I just a mere computer science "teacher", I would not feel so inclined to take on the task of implementing our new website for our STEM Initiative. But now that I'm chair, hell, it's the least I can do!

Actually, I'm joking a bit here. The fact is, I was always interested in helping to bring our new STEM website to fruition. I just knew how messy large websites can become.

Thankfully, there's Joomla.

Joomla is a content management system that allows one to create and maintain an active website. It's open source, and free. You can see the current version of my Joomla STEM and VPA site here, but it's still under construction. Still, Joomla has made it easy to do what used to be a chore when I'd write HTML and CSS from scratch...

Those were the days.