Tag Archives: MIT

Reason for my Absence: Freshman Fall

The good news is that I’m done with school until February; I’ve been on break since the middle of December; everything has gone very well since I left. Still, I feel as though I should update my blog–even during the school year–from now on. I learned tons and tons of interesting things this fall, and I’d love to share them!

Oh yeah, and one of my friends (my neighbor, in fact) has started blogging, and I would never want to miss out on the fun. The difference is that he’s writing his own blogging platform, and I’m lazy and running WordPress.

Maybe I’ll do something cool with Django someday.

In the meantime, it’s good to be authoring some content again. I’ll start posting a lot more regularly (no, really, I will this time), especially since I’ll be authoring lots of cool software in 6.01 (Intro to Electrical Engineering and Computer Science I) next semester. Here’s what I’ve done since I left:

Wrote a Book

A long time ago, I started authoring (and nearly published) a blog post about how one could beat the SAT essay. I expanded that rough post into a much longer handbook that I lovingly call The SAT Essay Ace Template. You can get your own copy at http://satessayace.com. Kindle and print (!) versions are forthcoming on Amazon!

Almost Released Hawgrade GradeSolve

As I reread my blog, I realized that I hadn’t given any of my last summer’s work nearly as much love as it deserved. I released a beta version (that I redesigned and am almost ready to release) of a web application remake of Hawgrade that I call GradeSolve. Learn more at GradeSolve‘s website.

Joined a Fraternity

Or, as my girlfriend’s father calls it, a franerdity. I’m a pledge-member of Phi Kappa Sigma at MIT. Hopefully, I’ll post that I am a brother within a few weeks.

Lived Through Freshman Year

I did well, even with Pass/No Record taken out of the picture. I’m proud of how I did.

Started Writing More Software

I’m working with a friend to expand GradeSolve into something even more useful. I’ll probably be posting a lot of code snippets from my work.

Speaking of code snippets, I’ve been working with updating Django model data with user input from ModelForms. This would normally be trivial, except I’m getting my data via AJAX: I cannot simply render a ModelForm with data in a GET request, and I don’t think it’s necessary for all relevant fields to be present in the POST data for the update.

In other words, I want to update what a user tells me to update, and leave everything else alone. Simply specifying a model instance for a ModelForm does not work. Luckily, you can create a new dictionary to which to bind the ModelForm for validation. The dictionary contains the data supplied by the user, and form fields left blank are automatically populated from the model instance. Here’s the method:

def edited_form_data_merge(post_data, model_instance, form_fields):
	data = { }
	for field in form_fields:
		if field in post_data:
			data[field] = post_data[field]
		else:
			data[field] = getattr(model_instance, field)
 
	return data

The method should be invoked like so (Subject is a model, SubjectForm is a ModelForm for Subject):

from x.y.z import Subject, SubjectForm, edited_form_data_merge
# ...
subject = Subject.objects.get(id = subject_id)
frm_data = edited_form_data_merge(request.POST, subject, SubjectForm._meta.fields)
form = SubjectForm(frm_data, instance = subject)
# ...

The form will always validate (assuming correct user input), and will reflect only changes: if data is not specified by a user, then data from the model is used instead.

One very interesting part of this is SubjectForm._meta.fields. This collection contains a string list of fields that makes it very easy to create the new data dictionary.

It’s good to be back!

Whoops.

I know I haven’t posted for far too long. It’s really embarrassing, especially since I now aspire to be an admissions blogger at MIT.

Wait, what?

Yeah. I committed to MIT. I’m going to be a Beaver (or maybe an Engineer or an IHTFPer or whatever), and I couldn’t be happier! So now that the college admissions process is done until I (hopefully don’t have to) apply to grad school, what am I up to? Moreover, what have I been up to for the past month and a half? Why haven’t I been blogging?

I could post myriad excuses, and depending on how the rest of this blog post goes, I very well might. However, for the time being, I think it would be more appropriate if I directed your attention to Hawgrade!

Hi, Hawgrade!

Hi, Hawgrade! What the heck are you, anyway?

You can actually see the live version of this website at www.hawgrade.com. Now, to answer the caption’s snarky question, Hawgrade is grading for the Twenty First Century, developed with the help of one of the social studies teachers at my school, Dave Hawley. Mr. Hawley also goes by Hawley, hence the name Hawgrade. The website will eventually join forces with an iPad app, and the two will offer the following functionality:

  • Easy, paperless submitting of student papers.
  • Grading that stores data remotely. Teachers can keep their students’ papers anywhere!
  • Corrections for the most common student mistakes built in. This makes grading most papers as simple as highlighting passages and pressing a few buttons.
  • Recording voice comments to end the time consuming process of actually writing comments on students’ work.
  • Returning students’ corrected papers over email.

Most of that functionality has been implemented by now. It’s a wonderful culmination to my high school career, although it is unfortunate that I (a second semester senior) actually have to work on something! It’s also an enormous project. Maybe I’ll post some of my secret, proprietary code samples on this blog.

Regardless, I’ll definitely start posting more!