Posts for May 2007

I know, I know...it's been quiet

Sorry for lack of posts, podcasts, etc....getting back into the swing of things after vacation and such has been a little tough. Plus, I have been working on backend code stuff, and I end up tired and unwilling to spend the time at the end of the night to work up a good post. That being said, I have noticed that having a unpublished flag for entries would help give me time to edit, prep, etc. Yes, that's right...I don't even have a non-public attribute on these posts. As soon as they're in the db, they're available! If I edit after first commit, it's live in front of Google and everyone!

I've been dallying around with hacking a flag onto the posts table, but that felt kinda icky. Then I just finally realized today that Django has an excellent permissions system! Duh. I may poke it with a stick. It might be overkill...we'll see. If nothing else, it'll give me some experience with it.

I have also been experimenting with Twitter and tagged del.icio.us posts for lightweight updates of present state (twitter) and notable urls that I don't have much else to say about (del.icio.us "toblog" tag). I'm thinking of actually importing that data into a blog post, though, rather than just pointing to it; I'll check those feeds in the early morning hours, get any new data, and create a blogpost with it via a script. That way, I can save posting for slightly meatier thoughts.

May 31, 2007 permalink | Comments (0)

Django, datetimes, and SQLite

Just a quick note to sock away my code snippet, and hopefully help others. When working on Django development, the SQLite backend is awesome; it's simple, self-contained, and easy to carry about (I carry apps on my USB fob). But be careful with datatypes; datetimes in particular (at least for me).

SQLite (v2) stores everything as text under the covers, even though is accepts typed column declaration (it keeps track of the datatype you declare, but doesn't do anything with it really. v3 adds some typing possibilites, but I don't think Django leverages this. Consider everything a string.). So you can insert an invalid datetime fragment via Django code (this is most common when you're calculating it yourself, rather than using the form widgets), and you may not realize anything is awry until you try to pull data back out. You'll start to get unpack errors and such, as the Django SQLite datetime parsing code fails. After a bit of munging about, I tracked down out the incantation to take a 9-tuple time struct and pop it properly into a SQLite datetimefield:

if item.has_key('date'):
    foo = item.get('date_parsed') # date_parsed is a 9-tuple 
    pc_date = datetime.datetime(*foo[:6]) # this generates the correct input type

Hopefully I can save someone a bit of pain. *grin*

May 23, 2007 permalink | Comments (1)

Universal Feed Parser ftw

Holy...crap. I knew about Universal Feed Parser, but it slipped my mind, and spent two days reimplementing about 20% of what it does (the easy 20%, too). Do yourself a favor...if you're hacking on feeds (RSS or Atom) in Python, just go get it and import feedparser. You'll be glad you did.

May 19, 2007 permalink | Comments (0)

Back from London!

We're back! Our London holiday was great...it's an awesome city. So much to do, so much to see. It's fairly rare that we pull a repeat, but London definitely falls into that category. Perhaps as a springboard to the countryside...we spend a day in Sussex, walking some trails, and it was beautiful.

Pics on the way. (I'll update that link specifically to the vacation photos as soon as they're all organized.)

May 16, 2007 permalink | Comments (1)

2057: The City

GNUCITIZEN included a link today to a Discovery Channel video over on Google Video: 2057: The City. GNUCITIZEN's comments are worth reviewing: he's a security researcher, and understands how powerful and fragile our increasingly computer-mediated reality will become. The video is your typical Discovery Channel; half future vision, half present-day documentary on precursor tech. But not bad, though the gung-ho surveillance stuff gives me the same queasy stomach feeling that it always does. Time to re-read The Transparent Society!

UPDATE: Ugh...it got cheesier as I went along, but still, I've seen worse. Apparently there's an entire 2057 series of shows; City, Body, World, etc.

May 1, 2007 permalink | Comments (0)


Earlier posts -- Later posts