Archive

Archive for the ‘coding’ Category

Love.Sonnet();

February 13th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

In anticipation of Valentines Day. I figured I would draw a comic, where a geek professes his love.

In summation:

for (int i=0; i<ways.length; i++) {
   print("I love thee, " + ways[i]);
}

Have a great Valentines day!

coding, comic, relationships

Crunch Time

February 4th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

I have been going to RIT for a while. Grad school is still fairly new to me, and it really has been the first time I have been challenged. The work isn’t particularly hard, but the most difficult part is the intense amount of work expected. Throw in the 20 hours of tutoring and teaching I do, and I start running out of time fast.

What does this mean? It means that I spent last night’s exciting superbowl in my living room with my laptop coding (although, to be fair, I was pretty much only paying attention to football by the 4th quarter). I was hoping to draw a comic last night after the game, but since I was experiencing a delightful bug with glassfish, I was unable to get to it. This is a direct side effect of “crunch time”.

Weekends are assumed to be spent in the labs now, be it for tutoring or to try to get my projects done. I knew this coming in, but it starts to get worse and worse as the quarter ends. Since RIT has 10 week quarters, when the crunch starts to come, the best students are the ones that are adept at the art of triage. Which assignment is worth most? Which assignment has the closest due date? How much will not doing this assignment hurt me? These are not good questions to have to ask, but in a student-academic setting it happens a lot.

(several paragraph rant on homework assignments deleted, perhaps I will write an post on it another day)

So, it is crunch time here at RIT. You can see it in the eyes of the students, you can start to hear the sense of urgency in their voices. General grumpiness levels are up due to lack of sleep, and labs are starting to get more and more crowded as the final weeks tick away. Not much can be done to prevent the inevitable, but some thing can be done to keep yourself sane.

  1. Set aside 30-60 minutes a day to have fun
  2. Have one fun thing to do a week that takes up a little bit of time (usually Friday or Saturday night)
  3. Smile, at least a little.

Making sure that you get to at least spend a little bit of time a day to do something fun (be it playing pool, playing a video game, watching TV, or hanging out with a friend for a meal) is vital to keep yourself from burning out, and burn out is the worst thing that can happen here. Shutting down at the worst possible moment, the last week of the quarter, is what needs to be avoided at all costs. So, grab that cup of coffee with a friend, let your brain reset before getting back to work.

Do at least one big thing that is fun a week. If it is going to a party on Friday night, or maybe going out bowling with friends, it is what you have to use to drive yourself to make it through the week. Think of it as the reward for accomplishing the work you have been doing all week. Make sure you don’t get too crazy, because I know programming with a hangover sucks, but make sure you relax.

Smile. Please Smile. This is the toughest one for me. Despite the scientific proof that smiling is actually good for you, this is just as much about keeping everyone around you from getting more and more down. Seeing someone smile is… rare… here at RIT. Try to make the last few weeks of the quarter as painless as possible for yourself and everyone around you - if you smile, it adds that little bit of happiness to the environment you are in… and if enough people do it, maybe the end of the quarter will just be busy and stressful, but not depressing and painful.

coding, education, life, tutoring

Shotgun Debugging

January 27th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

One of the most painful things I experience with the students I tutor is the practice of Shotgun Debugging. The practice will generally give the student horrible, unreadable code. After today’s tutoring, I determined it was time to write about some common debugging practices. So, here are the things I tell my students every week - and they quickly forget.

Only change one thing at a time.

This one is hard for beginning programmers. They get a logic error (or sometimes even a compile error) and then change 5-6 things in their code before they try again. If the changes work, they have no idea why, and will change 5-6 things next time they get a similar error. Which leads me to the next point:

Learn what the common errors mean.

….and how to fix them. When you get the error in Java for “cannot find symbol”, what does that really mean? Look at the text associated with it! It will tell you if it doesn’t understand the class you are looking for, or the variable, or even the method. Got a “null pointer”? That really does mean that something you are referencing is null! The JVM does not lie! Sure, some errors are a little more complicated, for those:

Actually read the error.

The biggest problem I see with students is they simply do not understand the code that they are working with. Reading the errors and understanding what is actually happening when you manipulate a line or two of code is the first step in becoming a better programmer. Every good programmer has spent a significant amount of their time learning how to debug, not just how to code. Lastly, I find myself telling my students:

Make sure you catch every instance of the error.

Let’s face it. We try to teach reusable, generic code, but it just doesn’t happen. I have learned to accept that some students are just going to copy and paste branches of code, over, and over, and over again. So, if you must do this, when you realize there is a logic error in the branch you copied, it will exist in every branch… no matter how much you think you “just fixed it”.

Sometimes tutoring can be very frustrating, but I really do enjoy the moment when a student finally has it click. I suppose there is nothing I can do sometimes, because some students just really hate code, but I hope that they can at least take a little bit back from what I help them with.

coding, tutoring

Design Patterns

January 21st, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

I think I might file this one under “Bad jokes I should have never drawn”, but I still get a chuckle out of it.

I think this is a sign that I need to stop coding for a few days…

coding, comic

Realization: I AM a Code Monkey

January 4th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

Something interesting happened tonight, between the hours of 3:00am and 4:00am (can you tell I haven’t been getting sleep?). The interesting thing that happened is that I trying to find plug-ins for WordPress that would allow easy sharing of articles that I write with facebook, digg, slashdot, etc…

I found one that seemed promising called obsocialbookmarker. He had a new release out, so I figured I would give it a whirl and see if I liked it… because I really didn’t feel like writing something custom that I knew someone out there had already done.

It didn’t work!

I was frustrated to say the least, but I was able to at least get some of the error messages to display to me. The errors were not WordPress errors, but actually PHP errors from the plug-in code. I thought “Damnit this guy must suck”. Then I realized what the error actually meant… The plug-in tries to figure out if it is out of date. Fair enough. The problem is that my server does not take to kindly to PHP trying to call fopen() on a remote server via URL (a security setting I cannot change, since allow_url_fopen is disabled… although this does give me more motivation to try to get around that).

So what was I to do? I suppose anyone that wasn’t a programmer wouldn’t have even got this far and would have moved on to another plug-in, but I saw some of the other ones and I thought they sucked. So, I did was most programmers like to do, and hack. Sure, the hack was only removal of the version checker, but it was still something kind of neat.

  1. Something didn’t work.
  2. I wanted it to.
  3. I made it work.
  4. I posted a comment on his blog to let him know.

Sure. This isn’t anything huge, and I have been a programmer long enough to know that this happens all the time! I think tonight something was just different about it. When I was learning how to code, I used to talk about how being a programmer was akin to being god-like. It kind of motivated me to learn. You can create things, destroy things, do good, do evil. This kinda just touched me again to think about that concept… what kind of power a programmer has.. Sure, for me just now, it is as simple as making something work that will put little icons on every post I make. The bigger thought perhaps, is what makes the idea interesting.

coding, technology

2:58am

December 17th, 2007

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

What an hour to still be awake. Here comes the stream of consciousness

I kind of have to look at this past week and describe it as one stupid event after another. I put my foot in my mouth several times, I upset my best friend, Had other friends stop talking to me all together, and of course, I got even more behind on all my classwork.

However, I also used this week to try to really continue with my ‘reinvention‘. I was notably more outgoing at no voice zone. I also forced myself to just talk to people. Sure, all of the things I did may have caused some of the undesirable consequences mentioned before, but… it was worth it?

I find I haven’t been able to sleep lately. I need to listen to music to lull me to sleep - and it has never been that way before. Not totally sure if this will get better when break hits at the end of the week.

Speaking of. Is it Friday yet?

I have been programming in JAVA again as of late. My XML class project seems interesting, and in my excitement I have been putting that assignment on the top of my queue…. much to the dismay of my other courses (if they cared?). I wrote a pretty nifty drag tool. Maybe if I get some time when its not so late to post the logic behind it.. I will.

I think I may withdraw from my Beers of the World class right before the last day to withdraw… only so I can spend more time on other homework than it… because seriously, even an hour of working on homework for a class that is of no credit value to me as a grad student is silly when I have hours of other work to do.

I’ve been listening to music I haven’t listened to in a while, including Lucky Boys Confusion, Bon Jovi and Shades Apart.

I think I need to leave Rochester. I already know I am going to Boston over the break to work on TAP, but I really don’t know if that will quench my thirst. It might be time to throw a dart at a map and just do it.

I need to meet someone new that intrigues me.

I also need to sleep. So, here goes attempt 2.

booze, coding, life, rambling