Posted on Feb. 5, 2008 at 12:35 P.M.

The recently released Google Social Graph API was a bit of a wake-up call for me on the power and importance of microformats. So I've hacked together a quick implementation of XFN for the blogroll, and added a few rel=me links as well.

I'll follow this sometime soon with a post about how I implemented the XFN on a Django model.


Posted on Dec. 5, 2007 at 9:33 P.M.

I've just relaunched the redesign of this site. Nothing major is different, but one fun thing that I'd like to highlight is the way the blogroll is displayed. I got the idea from Motel de Moka, which has more links to work with than I do.

First, I set up a very simple model:

class BlogRollLink(models.Model):
    name = models.CharField(max_length=128)
    date_added = models.DateTimeField(default=datetime.now)
    url = models.URLField()

But we've got a problem at this point: we can't order this by the number of characters in the name. So we must modify our model to have an integer called name_size, and then override BlogRollLink's save function to fill in that field any time the model is saved. Our final model is below:

class BlogRollLink(models.Model):
    name = models.CharField(max_length=128)
    name_size = models.IntegerField(editable=False)
    date_added = models.DateTimeField(default=datetime.now)
    url = models.URLField()

    def save(self):
        self.name_size = len(self.name)
        super(BlogRollLink, self).save()

    def __unicode__(self):
        return self.name

    def get_absolute_url(self):
        return self.url

    class Admin:
        pass

Now to display this on every page, I've created a context processor named blogroll_processor. It looks like this:

def blogroll_processor(request):
    blogrolls = cache.get('blogrolls', None)
    if blogrolls == None:
        blogrolls = list(BlogRollLink.objects.all().order_by('name_size'))
        cache.set('blogrolls', blogrolls)
    return {'blogrolls' : blogrolls}

And we're done! A nifty "waterfall" of blogs. Let me know what you think about this technique. Is it stupid?



Posted on Aug. 8, 2007 at 12:09 A.M.

Very interesting discussion going on right now about Django's templating language and whether to split it off into its own separate library. One of the justifications is that it will "feel" easier to plug in other template languages into Django itself. Funny how I just blogged about how easy this is already.

Also, previously this site was run with apache2 and perlbal. Now it's running apache2 and nginx. At some point I'm going to make the switch to having all of the media pointing to an nginx-only server which short circuits the mod_python (also soon to be mod_wsgi, lol) handlers altogether.

Sorry that this is another in a line of short posts, but I expect this trend will continue as I move twice in the next 2 weeks. Crazy stuff happening in my life right now!


Posted on Aug. 2, 2007 at 10:06 P.M.

django-simpleaggregation

I have just released Version 0.2 of django-simpleaggregation. Updates in this release:

  • The detection of an update on a unique field was not being correctly computed. It used to use the addition of an id field to determine whether an aggregate should be incremented, but now it uses another hook into the dispatcher to annotate pre-save the model instance with some metadata related to aggregation.
  • The old helper functions which were used to get aggregate data have now been replaced with an object which is smarter and cleaner. I suspect there will be a few more cleanup changes to the implementation of this, but the API should now stay fairly stable.
  • Pagination is now usable. In 0.1, some rudimentary pagination abilities existed, but now it supports most of the same pagination data that a generic view gives a template.

Eflorenzano.com

I've updated this site to use freecomment and the excellent django-comment-utils by James Bennett, which allows me to automatically use Akismet to block spam. Hopefully this will solve the problems that I've been having with comment spam, despite the efforts that I've made in the past to combat it programmaticaly.

Eyespot

My internship at eyespot is coming to an end in a little over a week. It's really bittersweet for me: it has been such a great experience, moving out to California and working on the "Web too pwoint oahh" craziness, but I miss my friends from the midwest. I was a little nervous to take this internship, because of the technologies that I knew eyespot was using (notably, Perl), but my experience this summer only reinforces my original thought: programming language doesn't matter, it's people who matter.

If it's people who matter, eyespot matters a whole lot, because there has been no other time when I have respected the people around me even close to as much as I respect those at eyespot. I've never seen someone who can come up with the solution to a problem as I'm still trying to grasp the idea of the problem itself. I've never seen people so willing to listen to and implement the ideas of an intern. I've never seen a group of coworkers who were more welcoming and tight-knit, hanging out after work as much as during. And most of all, I've never seen a group of people who were more skilled at their craft, as the people at eyespot.

Sure, there are some things that I think could be done better at eyespot. Sometimes, frankly, I'm surprised that it all works. But I'm not going to go into those things, however, because it's actually not relevant to my point.

So, all said, I'm excited for what the future holds for me and eyespot, my working life after college, etc. But to bring it back to my earlier point, I'm also excited for my last year in college. Being away from home and family and friends has made me realize just how much I appreciate all of them on a daily basis, and perhaps just how much I take them for granted. I could care less about going back to learn computer science--I'm going back for the people (is this a recurring theme, or what?)

I'm going to carpe diem this next school year, because it's the last one I've got.


Posted on March 9, 2007 at 2:15 A.M.

So I've yet again redesigned the site. This was not a backend redesign, but rather an aesthetic redesign consisting of mostly changing the CSS. The other change that was made was that now I am deploying via subversion checkout. I do my changes on my local copy, and then I commit those changes to subversion, and finally I do a checkout from the server's SVN. This makes it much easier to deploy in general, and I will see how this ease continues into the future.

I'd like to work on all of the project ideas that I've got, but it seems like every time I get a free moment, it gets snapped up by something else. For example, I thought that I would have some time to set up the secret santa site for my family finally, but then I realized that the database backend to this website is going to change a bit in the next few days and if I send everyone links to the secret santa stuff now then they won't be able to access it in the near future. That's why I've got to do the database transition to postgresql during spring break and then I can get the secret santa information sent out.

I'd also like to work on my Django API idea, and I have a rough implementation figured out. But it's not as robust as I'd like it to be before I release it to the public, and I'll actually have to do a little hacking on Django's source itself so that I can serialize some meta-information about models themselves, and not just instances of models which are supported right now.

But unfortunately right now I've got to do some learning of Perl, although in a way that kind of excites me. (Sometimes I just get the itch to try something completely different, and that's happening now for sure.) I'll need to invent some kind of pet project to help learn Perl for the future.

Blah, there's a bunch more personal stuff to write about, and frustrating professional stuff as well, but nobody that reads this (e.g. nobody) wants to hear about my personal stuff nor be frustrated by the professional stuff.

Despite all there, I'm excited for what this summer holds in store for me. No matter what happens, it'll be a new and exciting experience and I cannot wait to see what does end up happening.

Until next time!

Search

 

Recent Links

  • git-issues: A distributed issue tracker built-in to Git.
  • I predicted this back in March--can't believe a solution has surfaced so soon. It makes so much sense to build in an issue tracker to a revision control system. Since you're working with the code, might as well track the issues in the same system and take advantage of the extra metadata. This is really cool (and as a bonus, it's written in Python) so I hope to see it really grow and flourish!

  • How I Work Daily
  • Daily blog by Kevin Fricovsky. In addition to having some really great content, he has started to post audio interviews with people from the Django community. This is a site to keep an eye on in the coming days and months.

  • django-arcade
  • Demo site for django-arcade, an open source reusable Django app to add new flash games to any django-powered site. Looks very cool for easily creating game portals. It also comes from my future employer.

  • Facebook Chat and Scalability (with Erlang)
  • Eugene Letuchy talks about how they they took Facebook Chat from no users to 70 million users, with the help of Erlang.

  • Simon Willison: The Implications of OpenID
  • I somehow missed this presentation when it came out, but it's an absolutely fantastic overview and defense of OpenID by Simon Willison. If you are in any way interested in what OpenID is and what it can offer, you owe it to yourself to check out this presentation.

  • StupidXML
  • Probably the simplest XML library that I've seen for Python. Sometimes you just want to generate some stupid XML, and this is the perfect tool for the job.

  • See the rest of my links...

Pownce

Badges

  • django badge
  • apache badge
  • GeoURL
  • XFN Friendly
  • Valid HTML 4.01 Transitional