I was walking across a bridge one day, and I saw a man standing on the edge, about to jump off. So I ran over and said, “Stop! Don’t do it!”
“I can’t help it,” he cried. “I’ve lost my will to live.”
“What do you do for a living?” I asked.
He said, “I create web services specifications.”
“Me too!” I said. “Do you use REST web services or SOAP web services?”
He said, “REST web services.”
“Me too!” I said. “Do you use text-based XML or binary XML?”
He said, “Text-based XML.”
“Me too!” I said. “Do you use XML 1.0 or XML 1.1?”
He said, “XML 1.0.”
“Me too!” I said. “Do you use UTF-8 or UTF-16?”
He said, “UTF-8.”
“Me too!” I said. “Do you use Unicode Normalization Form C or Unicode Normalization Form KC?”
He said, “Unicode Normalization Form KC.”
“Die, heretic scum!” I shouted, and I pushed him over the edge.
(with apologies to Emo Philips)
(resurrected from a dead Dive Into Mark posting from 2004)
Hi! My life is getting a reboot, and I’m looking for feedback about how the new seasons should go. Please give me your (anonymous, no log-in-required) feedback so I can make this next season Awesome!
If you’re using mysql and are trying to store UTC datetime values, and elsewhere are sane enough to use datetime values that are timezone aware, here’s a little type for stripping out the timezone data on store and replacing it on load:
from sqlalchemy.types import TypeDecorator, DateTime
from dateutil.tz import tzutc
from datetime import datetime
impl = DateTime
def process_bind_param(self, value, engine):
if value is not None:
def process_result_value(self, value, engine):
if value is not None:
I have spent way too much time trying to figure out how to automatically have
modified_by be foreign keys to the current user, without mucking with every view and form. Every example I could find that told me how to do this, including django’s documentation itself, told me I had to customise every view and form, which I found to be rather un-DRY.
stealing borrowing some code from django-audit-log (in order to be threadsafe) I figured out how to update these values on any model that has them, without any fiddling with forms or views. I might wrap this up in a little project, but for now, here’s the gist.
Note that you should set
editable=False on your
modified_by fields so that they will not otherwise show up in forms.
If anyone is really interested i could wrap this in a self-installable package.
Notes to myself so I can set things up properly. Hope they’re useful to you as well.
- Install any OS Updates.
- Get XCode from the app store. Launch it, accept the license, and go to Preferences, then choose “Downloads”, and install Command Line Tools.
- Install XQuartz.
- Install Homebrew:
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
- Install git from homebrew (
brew install git).
- Install Tower.
- Install Sublime Text.
- If you need subversion, install it from homebrew. If you need to use java, make sure you pass the –java flag.
You’re pretty much set at this point. Special per-dev type notes below: Continue reading
Aand there goes another year. One day I’ll get back to blogging. At the moment I am coaching a seminar on game-making at nuvu studio!
Hi! Sorry I’ve been awol for… sheesh, a year!
I started a company a year ago and it like totally ate my brain.
I will have more to say very soon now that I have resurrected my site.