Coding for efficiency: a non-programmer’s approach


(source: PhD comics)

Outside of programmers and computer science, the phrase “coding” always seems to come hand-in-hand with a sigh, groan, or an eye-roll. This is more common than I anticipated coming into my graduate program. Many fields in biology are moving in a computational direction, and with molecular components to many of our datasets benefiting from automation. Of course, `a talk about trends in science wouldn’t be complete without an xkcd reference, either. This is a mental computation I make fairly often – almost so often that I worry that it buts into my productivity time. I’m proud to say that my latest little venture has most likely paid off in time.

My recent time-consuming task was to grade 7500 pages of undergraduate lab manuals for the class I was TA’ing. Not only is this a lot of reading, but it’s also a lot of tallying and adding. To keep track of numbers, and do it in such a way that I don’t bias my results (e.g. “This student is tallying up a fairly low score so I’ll grade easy on the second half), I crafted a little tallier applet. Here it is!

Instructions:

  • Space bar increments the count by 1.
  • Numbers 1-9 increment the count by the respective number (example: pressing 9 when the count is 10 will make the count 19).
  • The number 0 resets the count
  • All other keyboard buttons decrease the count by 1.

Not the prettiest, but it did its job. It took an hour or two to write, and saved me at least that amount of time in grading (not to mention it helped me standardize my results. A next step would be to have an entry field for “student name” and have the program write a spreadsheet with the the score of the student! Here’s the project file, but you’ll need to read below to figure out how to open it. Sure it’s not fancy, but it was extremely practical for me

Now to get on about how I wrote this…

The script was done in Processing, a very easy-to-use Java-based language that is used widely by the digital arts and new media folk. I was first introduced to Processing by an instructor at UC Santa Cruz, Mr. Evan X Merz, who literally wrote the book on composing electronic music in Processing. I got to witness his piece “Cannot Connect” preformed live at UC Santa Cruz, and it has made me seriously investigate the possibilities of interactive algorithmic music using Beads.

 

There, I tied it all back to music in the end, huh? Of course what I did is significantly more rudimentary, but it’s great to have access to free, easy languages for little interactive projects. I’m fortunate enough to be vaguely familiar enough with languages to know what means to use for my ends.

My association with Processing was from slightly earlier than that – the Arduino software is heavily based on Processing, and a lot of my practical electronics/programming experience came from arduino projects!

200489_10150178295274104_378433_n

 

I’ll write more about this wiring monstrosity of mine soon.

Thanks for reading!

Leave a Reply

Your email address will not be published. Required fields are marked *