Tuesday, November 10, 2009

Any teachers or professors using classroom management software?

Every few months, I get an idea for a web app. My most recent one stems from hearing constant complaints from my UMass professors about the UMass classroom management software. It does a whole boatload of stuff, but apparently it's extremely hard to use. Keep in mind, I'm hearing that criticism from Computer Science professors. I'd wager a bet that it's much worse for professors whose subjects are unrelated to computers.

With that in mind, I've been working for the last month or so on my own classroom management web app. I doubt I'll find many teachers or professors with this post, but if I do, could you please leave me a comment? Specifically, I'd like to know if you use classroom management software. If you do, what do you use, and do you have any complaints about it? If you don't, what areas of your job would you like managed by software? Grading and student notifications ("You have a test in 2 days!") are the obvious ones to me, but are there any good ones I'm not thinking of?

Wednesday, November 4, 2009

Little Joys of Rails (Part 1) - Renaming Associations

I've spent the last month or so teaching myself the basics of Ruby on Rails. By far my favorite thing about it is that, at every turn, I find a little feature or helper that works really well and does exactly what I want without feeling messy or "magical".

Unfortunately, I have no one to share these little joys with, as pretty much none of my programmer friends know Ruby or Ruby on Rails. So, I figured I'd start sharing them on here. Hopefully, Rails newbies (like myself) will learn something, and Rails veterans will be able to chuckle knowingly as they fondly look back on the glory days of learning Rails.

Renaming Associations



If you have one model that belongs_to another, the association (in both directions) is named after the models. For example, if I have Users and Courses, and I want a course to belong_to its teacher (who is a User), I would start with the following:

[code lang="rails"]
class User < ActiveRecord::Base
has_many :courses
end

class Course < ActiveRecord::Base
belongs_to :user
end
[/code]

This is nice and simple, but if I want to access a course's teacher, I have to do it like this:

[code lang="rails"]
my_course = Course.first
puts my_course.user # Print out the course's teacher
[/code]

That's a little confusing. What if my course also has_many students (also Users)?

[code lang="rails"]
my_course = Course.first
puts my_course.users.first # Print out the course's first student
[/code]

So, my_course.user is the teacher, and my_course.users are the students. There's nothing to indicate that, I just have to know it. Wouldn't it be nicer if the associations could be named for what they represent?

[code lang="rails"]
class Course < ActiveRecord::Base
belongs_to :teacher, :class_name => 'User'
end
[/code]

To make this work properly, the foreign key needs to be teacher_id instead of user_id (that can be overridden too, but I won't go into that right now). Then, you get to do this:

[code lang="rails"]
my_course = Course.first
puts my_course.teacher # Print out the course's teacher
[/code]

Much better!

Now, I recognize that this is far from a revolutionary feature. I'm pretty sure it's possible in Django and most other MVC frameworks. I was just very happy to bump into it.

Tuesday, October 13, 2009

Twitter Weekly Updates for 2009-10-13


  • "isn't sour cream like, the mayonnaise of mexico?" - alicia #

  • dunno if obama deserves a nobel peace prize or no, but he does deserve recognition 4 peace achievements, and im not a judge, so im fine w/it #

  • anyone have any google wave invites? i'd really like to take a look at it #

  • don't need a google wave invite anymore! thanks a ton @MattMarzilli #

  • me: "it sux cuz sports stars peak at like 28. we wont peak till we retire."
    alex: "i dunno, i think i peaked in 7th grade" #

  • haha randy moss's first caught ball of the day was thrown by kyle orton #


Powered by Twitter Tools

Tuesday, October 6, 2009

Twitter Weekly Updates for 2009-10-06


  • i wish the code examples in all the ruby on rails guides didnt omit the parentheses on methods with parameters. it always messes me up. #

  • Bueno y Sano 5/5 on #Yelp: Along with Anna's Taqueria (which I believe is only in/near Boston), this is my favorite ... http://bit.ly/2q1SB #

  • asked my man at the grill for "rice" and he heard "fries". +20g fat for the day :( #

  • "First I was aroused, then I was furious" - Jane Lynch, funniest line of all the episodes of Glee #

  • this looks like it could be everything Puzzle Quest Galactrix wasn't and more: http://bit.ly/8fuQU #

  • outlook is definitely microsoft's best product. it's their only one that gives me more "that's cool" moments than "omg i wanna die" moments #

  • 11 yd WR screen = edelman's least bad play of the year #

  • this is the longest last 2 minutes of the first half of any NFL game i've ever seen #

  • weird time to call timeout by john harbaugh. either call it right away or wait till after the play, not with 3 sec left on the clock. #

  • haha i dunno if i've ever seen a penalty against a team's bench before. ravens need to chill. #

  • wtf you can't say "injury timeout on the field" and then cut to commercial before you say who's injured #

  • im glad we won, but i feel bad for the ravens. he absolutely should've made that catch. #

  • testing and debugging in a compiled language really makes me appreciate interpreted languages #

  • wooo pats bringin back junior seau!! #


Powered by Twitter Tools

Tuesday, September 29, 2009

Twitter Weekly Updates for 2009-09-29


  • can anyone with ruby on rails experience recommend a good book? im about to start on it. #

  • Anna's Taqueria 5/5 on #Yelp: Anna's Taqueria is one of my two favorite fast Mexican restaurants (the other is Bueno... http://bit.ly/Xr2rt #

  • got ruby 1.9 + ruby on rails 2.3.4 installed on my mac (snow leopard) last night. rvm caused more trouble than it was worth, so i removed it #

  • "hey can we find a Family Guy to sleep in?" - Alicia #

  • 1 play left. go lions!!! #


Powered by Twitter Tools

Friday, September 25, 2009

Does this count as ironic?

Salad with dressingI was sitting at my cubicle today, eating a salad (with fat free sun dried tomato dressing) for lunch. Despite a perfect knowledge of my spill-happy past, I ate the salad leaning back in my chair.

About halfway through, I decided I was just asking for trouble, and decided to lean over my desk for the rest of the meal. Two bites later, a piece of lettuce (covered in dressing) fell off my fork, hit the side of the desk, slid off the desk and onto my pants, then slid off my pants and landed on the floor.

It's things like this that make me think God doesn't exist.

Tuesday, September 22, 2009

Morning Sickness

Over the last dozen or so mornings, I've felt anywhere from below average to awful. I'm not sure what it is; my friend Ron thinks it's the change of weather, which is definitely possible, but it's never happened before.

I wake up with a sore throat and headache (each of varying intensity). It starts to dissipate as the day goes on, and I usually feel fine by the early afternoon.

I've been getting about six hours of sleep per night. Maybe going to bed earlier will help.