May. 20th, 2009

elfs: (Default)
So, I've put up my latest geek piece: Fixing an omission from Django's simplejson: iterators, generators, functors and closures, which is exactly what it says it is. Django's "simplejson", which bundles up server-side structures and exports them to the browser for interpretation and display in fat client applications, is okay, but it fails in some common ways.

For example, if I want to render a tree of data stored in a database as a JSON object, first on the server side I have to devolve the database into a massive dictionaries-of-dictionaries or lists-of-lists, and then pass the product to simplejson. The process of devolution usually involves recursing down the tree structure, and the process of rendering involves recursing down the dictionaries-of-dictionaries structure.

Why not write a class or closure that describes the process, and pass that to the JSON renderer, which will build the JSON object with a single recursive pass? A completely great idea as it eliminates this obscure, error-prone, and wasteful interim dictionaries-of-dictionaries, and it describes the rendering process in clear, tight code.

Except, the JSON handler in Django has no idea how to handle a class or closure designed to do that. It does not understand the next recursive or iterative step when presented with one of those as it recurses. My post addresses this issue.

I confess that this was a sidelight on yesterday's research: figuring out how to create a list-of-lists data object in Dojo. That stymied me, and this is a better implementation. Still, I regret not being able to publish a class called "LOLTrees."
elfs: (Default)
Today, I have been beseiged by phone calls and emails from recruiters about this one job that's apparently opened up in Bellevue, and every pattern matcher on the planet is recommending me for the job. I've told one recruiter to go ahead and submit me, of course.

Along with the three mainstream recruiters from local hauses that I recognize, there have been three phone calls and almost a dozen emails from men and women with accents so thick I often couldn't make out what they were saying. When I could, their English was fractured and terrible.

But more than that, they were rude. It wasn't "Please send me your resume and a phone number where we can reach you." It was "Here are the job requirements. You meet them. Send me your resume now. Sign and fax us this PDF form that says you agree that we exclusively represent you for this offer." Uh, fuck you? I'm not going to send you my resume blind, you git, and if you double-submit me I'm doomed.

I know the market's desperate, but geez, this is outsourcing human contact.

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 7th, 2026 10:07 am
Powered by Dreamwidth Studios