Nov 14 2006

The wisdom of DEBUG=False when loading LOTS of data.

Tag: Geekstuff, djangoJoe @ 7:45 pm

For a site that I’ve been working on, I’ve enabled a load up of data all in a python script. Darned handy. The magic method that does all that nice reseting bits is:

from django.core import management
from django.contrib.auth.create_superuser import createsuperuser
from django.db import connection
cursor = connection.cursor()
cursor.execute(”select tablename from pg_tables where schemaname=’public’”)
tables = cursor.fetchall()
for table in tables:
cursor.execute(’drop table “%s” cascade’ % table[0])
management.syncdb()

And then I go on to run a bunch of other methods to do all that cool initial data loading goodness. Only we ran into a problem:

Traceback (most recent call last):
File “initial_data_load.py”, line 641, in ?
create_geography_table()
File “initial_data_load.py”, line 474, in create_geography_table
latitude = radians(float(lat)),)
File “/users/home/joseph/local/Django-0.95/django/db/models/manager.py”, line 73, in create
return self.get_query_set().create(**kwargs)
File “/users/home/joseph/local/Django-0.95/django/db/models/query.py”, line 223, in create
obj.save()
File “/users/home/joseph/local/Django-0.95/django/db/models/base.py”, line 203, in save
‘,’.join(placeholders)), db_values)
File “/users/home/joseph/local/Django-0.95/django/db/backends/util.py”, line 19, in execute
self.db.queries.append({
MemoryError

I couldn’t figure out what was happening for a while, since it was only happening on one system (and annoyingly - not my laptop…). Turns out the detail is in that last line of the traceback. We had “DEBUG=True” enabled in settings.py, and that there Geography table - well, it’s a big’un. We blew out the memory for the python process because when DEBUG=True, the database cursor does a really nice little thing - it keeps all your SQL queries for you. Which is great until you hit that per-process memory limit and your script terminates unexpectedly.

Switching the settings.py to DEBUG=False stopped keeping those queries in memory - and the memory exception went away. Yeah for the wisdom of DEBUG=False!


Nov 13 2006

Django book - chapters 5 and 6 now available

Tag: Geekstuff, Ranting and Reflections, djangoJoe @ 8:29 pm

Two more chapters are live on DjangoBook:

Chapter 5: Interacting with a database: Models

and

Chapter 6: The Django admin site

The comment system is interesting, and I think it’s great for the authors - but while it’s cool, I’m honestly not a huge fan of it. One of the best things about the comment set to my mind is getting the collaborative effects inline with the document - frankly, available right then and there. To be clear - visible on a print-out. Yeah, I print it out. Sorry - paper kicks even the best display’s ass for contrast and flexibility of purpose.

A friend pointed me towards Rob Flickenger’s latest gig - HackerFriendly, which is actively working on this really cool product that drives a publication from a wiki. I saw a copy of their latest new book (How to accelerate your internet at MindCamp, which Rob told me was published for $10 a copy on demand. Now take a look at the pdf of the content. That’s some excellent stuff in there. It was developed for the NGO’s, but that is some seriously good technical documentation in there. (They have another - Wireless Networking in the Developing World from back in January that looks equally compelling).


Nov 13 2006

while I’ve been sleeping…

Tag: Ranting and ReflectionsJoe @ 8:16 pm

While I’ve been sleeping, it’s clearly been a good day for Tech News…

Sun announced open sourcing java, a move that will have slow (I think) implications - if any at all at this point. I honestly wonder if they didn’t wait too long for that move - the software is in many circles being considered the “new cobol” - something you can get a good paying job doing, but which isn’t very interesting. My own opinion is that java became excessively and overly complex with its crazed “NIH” api replication sets. I’m a real freak for essential simplicity, and Java just isn’t that anymore. Not that it couldn’t be again, but it’s so far down the road of complexity that I think other languages are going to move in and ultimately kick it’s ass for the “run anywhere” model.

There’s a good general article on the topic at OReilly Radar by Allison Randal. Strangely enough, I heard a news story about it on NPR that so horrifically oversimplified the issues as to make the story sort of non-news.

In different news, I predict a rough, rough future for Universal Music and all its holdings. The CEO is clearly an idiot (at least based on this article about music players, and some folks are getting seriously pissed off at it. Rightfully so - actually. It’s the mentality of this tiny-brained amoeba that leads people to steal music. (I tried to find a better link, but Universal Music’s site kind of sucks - but I wouldn’t really expect anything else based on the prevailing attitude from the top.)


Nov 13 2006

stayed home sick

Tag: Ranting and ReflectionsJoe @ 5:04 pm

I’m really hoping I didn’t pass anything along to my fellow mind campers - but I just absolutely crashed last night and stayed home sick today. I’m blaming it all on Karen (of course), as she’s been under the weather for a while, and these things tend to follow… Plus it gives me someone good to blame. She’s on the upswing, and I’m hoping that with a double metric boatload of sleep I’ll be fast behind her.


Nov 12 2006

Eric’s PhotoBooth Hack

Tag: Geekstuff, Ranting and ReflectionsJoe @ 11:08 am

Karen and I headed back to MindCamp this morning for the morning breakfast, chat, and closing sessions. While we were lurking about, Eric showed me his PhotoBooth hackwith evidence!
(yeah, that’s karen in the background getting in her game of Werewolf…)

It’s a neat hack, and I’m wondering if we can’t use it maybe next year at MindCamp - set it up during registration and have a Flickr feed of everyone who attends…

Well -we’re back now, and I think it’s time to crash on the couch for a while.


Nov 11 2006

Happy Birthday Gus!

Tag: Ranting and ReflectionsJoe @ 10:41 pm

happy birthday gus!!!


Nov 11 2006

Mind Camp 3.0

Tag: Geekstuff, Ranting and ReflectionsJoe @ 10:40 pm

Mind Camp 3.0 started at Noon today with the usual confusion and chaos of any sort of self-organizing conference. The past two conferences, I’ve stayed through the night - but today Karen wasn’t feeling very well and I thought it best if I got her to sleep in her own bed tonight. So we bailed around 9pm and came home.

But hey - it gives me a chance to blog about it.

First up - they had a new system for placing sessions and choosing among them that, while a pain to navigate around all the bodies, was 100 times better than the last camp. The biggest issue is that ~200 people want to try and all read sheets of paper in a 10′ corridor, and usually 50 of them want to read the same one at the same time. Giant arterial clogs… I do wish more folks had the sense to loose the backpack - that just adds a huge amount of bulk to the clogs. One of the best things to come from the new system was the popular sessions obviously stood out and were scheduled in the largest rooms - and that’s a HUGE improvement over Mindcamp 2.0.

I sat in a number of good sessions - the top two for me were a session on community sites (the guys at Menuism.com hosted the discussion) and Amazon Web Services - which was sort of delightfully given by the guys using the service instead of the guys running the service. The real-world anecdotes and information were refreshing.

Dinner was provided by Google this year, and they did a nice job of it. A good spread and there was certainly plenty of food.

Karen and I will be heading back for the morning sessions, although I rather expect it’ll be more socializing than any directed conversation based on past experiences.

Oh - and on the game side, they had a Wii there - and it looked pretty darn fun. They had a “tennis” match going that was as fun to watch people play as it looked to be playing it. I also got to briefly play a little Gears of War on the XBox 360 which was amusing. I sucked at it though - the game is reasonably complex, very detailed, fast paced - and I was suffering with an inverted view control - which just kills you in a first person shooter. Best of all, Gears of War has a co-op split-screen mode - which means I’ll of course have to buy it for when Dan and I can play over holidays…


Nov 11 2006

heading to camp today…

Tag: Ranting and ReflectionsJoe @ 11:00 am

Mind Camp that is.


Nov 09 2006

Good XCoder meeting tonight

Tag: Geekstuff, Ranting and ReflectionsJoe @ 11:42 pm

We had a good turnout at the XCoder’s tonight - 21 folks. Not a record, really - but definitely the near-term high water mark for attendance.

Andrew did a run-down of that latest fab-craze, Ruby on Rails - a very nice taste of the overall kit. Made me think that maybe I should do something on Django - you know, just to keep up the whole spirit and all. I think I first ought to finish and present my thing on using Shark though… it’s only been months since I said I’d do it.


Nov 06 2006

And the rain came down…

Tag: Ranting and ReflectionsJoe @ 8:12 pm

It’s the first really big rain of the “winter” season here - it’s been steadily dumping for over 24 hours now, and it should continue to dump through tomorrow at least. According to the specs, we’ve had over 3 inches so far, as the grand pineapple express has slammed into the mountains and stalled. The more inland areas are actually having to deal with flooding and a number of the slopes around here are doing that “Hey, we’re mud - let’s think about sliding” sort of thing.

Karen and I spent a fair bit of this morning standing out in the rain - and let me tell you - that’s pretty darn wearing. When we got home, I just sacked out on the couch for two hours, and even now I’m pretty darned sleepy and I suspect not long for the evening.

So far our basement hasn’t flooded - I even saved a worm that wandered in under the back basement door. It wouldn’t surprise me if we had some water by the end of the day tomorrow though. It’s just one of those heavy times that we use as an excuse to wash our basement floors…


« Previous PageNext Page »