login
v2
v1

jmoiron.net

- python : the language

The Python Language is a high level, dynamically typed, object oriented language available for most major platforms.

QuerySet Caching

posted May 18th, 2009 @ 21:48:47

- tags: python , development

- comments: 0

Spent a few hours today trying to figure out how to do QuerySet caching in django in some kind of transparent manner. We are working on a multi-tiered caching system, sort of like that which was released by the pownce guys a few weeks ago, except with a bit more there there.

read the rest of "QuerySet Caching"

Be careful with metaclasses

posted May 13th, 2009 @ 23:40:14

- tags: python , development

- comments: 0

Python metaclasses can be really intense. SQLObject's declarative metaclass base, popularized by Django's ORM, has been as useful a DSL as the python world has had in a long time. But please be careful when using metaclasses in a way that makes it difficult to extend via subclassing!

read the rest of "Be careful with metaclasses"

Plaintext Style Markup

posted April 23rd, 2009 @ 02:07:39

- tags: python , development

- comments: 0

I've been in search of the "holy grail" of plain text markup for years. Before the first django version of this site, I was writing a custom mod_python handler to run a server-page style site and as part of that writing my own wiki creole. Since then, I've used TracWiki, reStructured Text, Markdown, MediaWiki, and Textile but have been left slightly disappointed by them all.

read the rest of "Plaintext Style Markup"

py7zlib patch

posted February 6th, 2009 @ 02:43:34

- tags: python

- comments: 0

If you go to the py7zlib page you will see a comment describing a problem with the timestamps. I was having a similar problem with the timestamps, except the comment didn't provide a patch or a way to convert time time. This problem exists in svn trunk as of this writing, although it was discovered a year ago. The issue is perhaps due to a slight fileformat shift, but essentially there is an extra byte (or 9) that are not being read and shifting the time results.

read the rest of "py7zlib patch"

Troubleshooting

posted January 19th, 2009 @ 22:24:42

- tags: general tech , odd , life , python

- comments: 0

The past 2 days I've had a few perplexing technical problems that have had interesting answers. After a long weekend of drinking, eating, and lest I forget drinking, I got back to Cecilia's late last night and felt like doing a little digital maintenance on my computer, when I noticed that it was down. It's never down.

read the rest of "Troubleshooting"

Good of Society?

posted May 10th, 2008 @ 18:47:37

- tags: python , development

- comments: 0

I've disabled comments because I have some neat captcha-less ideas for how to tell bots to fuck the hell off from my comments section but I don't feel like implementing them for django. The new system (mostly homegrown glue w/ selector, beaker, mako & werkzeug thrown in) has been in heavy development the past few weeks and commenting should be available by the summer. Sorry Mike; now you've no reason to come here.

read the rest of "Good of Society?"

Slipcover

posted April 19th, 2008 @ 19:42:50

- tags: python , development

- comments: 0

I've been doing a lot with CouchDB and WSGI the past few months, with positive and negative results. I'm finally getting the "hang" of Document Orited Databases (DODB? Rubbish acronym), and starting to understand what is possible and what isn't, how to do one-to-many and many-to-many relationships without having lots of queries. It struck me that although the per-query time in CouchDB is thusfar a lot slower than relational databases, the overall database time for individual webpage loads is far less, and there are far less queries and complex information joins going on.

read the rest of "Slipcover"

Happy Anniversary: An Introspective

posted February 22nd, 2008 @ 22:40:36

- tags: life , site news , python , development

- comments: 0

Happy Anniversary to me!

read the rest of "Happy Anniversary: An Introspective"

On WSGI, CouchDB

posted January 30th, 2008 @ 01:25:41

- tags: python , development

- comments: 0

pythons on a couch

I've been thinking about WSGI and CouchDB recently, while on the subject of digital inflexibility. First, I want to clarify a few things about what I mean by flexibility with respect to an application, and how the current crop of frameworks approach this problem. If you want to follow this musing well, I highly suggest reading "What PHP Deployment Gets Right" by Ian Bicking; or just his entire blog, and most of the crosstalk on the web about REST, Web Services, and the evolution of the WWW.

read the rest of "On WSGI, CouchDB"

Pythonicism

posted October 6th, 2007 @ 03:37:23

- tags: python , development

- comments: 0

I have been programming in Python for quite some time now, and I've been doing it professionally for over 2 years. Despite this, I am not nearly as proficient at the language as I could be, probably because I am using it professionally and have to devote time I could be using learning the language to solving problems.

read the rest of "Pythonicism"

ninrename

posted January 11th, 2007 @ 00:18:46

- tags: games , linux , python , development

- comments: 0

Just "finished" hacking together some code that started out as a small desire and has ended up an obsession of sorts. Initially, it was just going to be a smart, specialized file renamer. It has ballooned into a poorly written (but fairly solid) beast of a program with crc checking and unrar/zipfile support. When I say it's poorly written, I mean it's not beautiful like my xdccq module is, for instance. It isn't elegant in the least, does things in a way that is acknowledged as poor design decisions, and the main dispatch is a giant ugly conditional mess. But it works pretty well!

read the rest of "ninrename"

Saudade 0.1

posted December 16th, 2006 @ 15:23:00

- tags: web design , site news , python

- comments: 0

I mentioned before that I had splintered off my blog developing efforts into a project I named saudade. The first somewhat releasable ball of code is now finished and in operation at jmoiron.net. This is a (thusfar modest) blog engine utilizing Django and focusing on levereging existing technologies, best practices, and a slim codebase. Some features saudade has over my previous software:

read the rest of "Saudade 0.1"

Some EXIF.py changes

posted September 5th, 2006 @ 00:56:08

- tags: site news , python , development

- comments: 0

This one's a quickie. I promised to make available some changes I made to Gene Cash's EXIF.py library. I'm only providing them as a diff patch because ceache is working on improving the performance of the library extensively by using PIL's exif parsing code with EXIF.py's MakerNote deciphering code.

read the rest of "Some EXIF.py changes"

The mario challenge!

posted August 11th, 2006 @ 17:21:00

- tags: python , development

- comments: 0

mario!

It started out as an insertcredit forum post, but the promise of extreme difficulty coupled with my complete amnesia about completing Super Mario Bros. 2 made me very interested. To throw some fun into the mix, and as a little academic exersize, I wrote the mario challenge! website for me and some friends to track our progress and win fabulous prizes.

read the rest of "The mario challenge!"

Coding's shifting complexity

posted August 7th, 2006 @ 00:38:00

- tags: site news , python , development

- comments: 0

I spent most of today investigating different ways to read EXIF data in Python for the up and coming gallery. A few days ago, as noted elsewhere, I spent a day investigating Mono and writing trivially simple GUI applications in boo. These were kind of liesurely activities, but their usage was immediately relevant to anyone.. even a non-coder. When my images are immediately available to everyone along with the ISO setting, shutter speed, and timestamp, normal people will understand. When I show my parents GUI apps that I have written, they understand its uses.

read the rest of "Coding's shifting complexity"

mod_python & mod_php

posted February 24th, 2006 @ 23:56:51

- tags: python , development

- comments: 0

I finally understand apache, and what really happens internally when a request is made. I wasn't able to understand mod_python until today. Until the limitations of the server page model are ground against in such a way that you actually wonder, "There has to be a better way!" you aren't really ready to write your own Apache request handler. Even if it's totally fucking easy.

read the rest of "mod_python & mod_php"

No time

posted February 3rd, 2005 @ 05:26:32

- tags: life , python

- comments: 0

The average latency for blogposts has increased for me and for others, but the bandwidth has stayed about the same, regardless of what format I'd rather employ. The problem lately is that I detest my ¼ complete backend and the entire structure behind it; Jerm's decision, although heavily ridiculed by myself and yet others, was the right one, because he and I are of a particular breed of perfectionist that can either have everything absolutely perfect, or nothing being satisfactory at all. I am just not capable of doing small, incremental design changes; when I get into a process, I put my all into it, and when I back out, I forget about it and use that space for other things. I work best in batch mode, a-la Knuth.

read the rest of "No time"

Elf only inn

posted May 8th, 2004 @ 15:37:01

- tags: games , politik , python , development

- comments: 0

I read the whole archive of Elf Only Inn the other day, mostly at the impersonal behest of Tycho, who's on comic has left me somewhat empty these days. This archive reading of course reminded me that I haven't read the Thin H Line/Sexy Losers in a while, so maybe I'll eventually get to doing that.

read the rest of "Elf only inn"

Polish and context menus

posted February 18th, 2004 @ 16:31:22

- tags: C , python , development

- comments: 0

Why the hell can I not design context menu's in designer? The idea is so idiotic that I've spent 2 days trying to figure out how, because it's something I think just has to be there. I'm just missing it, or something, because I'm new. But after surfing freenode for a while and asking some questions there, I couldn't figure it out. It has become a major roadblock in the first steps I was about to take towards making my program actually do anything.

read the rest of "Polish and context menus"

PacMan/SWareT configuration screens

posted February 17th, 2004 @ 05:18:04

- tags: python , development

- comments: 0

I am no GUI designer. I have new found respect for all of the people from whom I've consciously or unconsciously stolen the ideas that go into the screens coming up shortly. Actually, I always had respect for a well built program, but at this point I think I have more respect for poorly built programs: in order for them to get wherever they are, a lot of people had to think quite a bit.

read the rest of "PacMan/SWareT configuration screens"

PyQt corrections and notes

posted February 15th, 2004 @ 13:29:00

- tags: python , development

- comments: 0

I mentioned that I hated having to install Eric3 in order to compile the *.ui files that QtDesigner creates. I did some exploration and realized that Eric3 used "pyuic" (PYthon User Interface Compiler), which, wouldn't you know it, comes standard with PyQt. There goes one huge complaint I had about the whole system as well as 3 packages. I find myself thinking that PyQt did it right, and that libglade should develop a python generator for the glade UI files.

read the rest of "PyQt corrections and notes"

Python + QT, and why C++ is annoying in the GNU environment

posted February 14th, 2004 @ 19:47:31

- tags: C , python , development

- comments: 0

When I first started using python+gtk+glade/libglade, I didn't think that any other programmers had it better than me. I was still in a platform dependent stupor, a sublime state of anti-idiocy insanity where my own idiocy was incalculable and yet undetectable, but then again I had never had any experience developing Gui's even though simple tools were most likely available. My PyGTK Tutorials, available still in the docs section, are a testament to how much I enjoyed the system, as well as how much I began to understand it.

read the rest of "Python + QT, and why C++ is annoying in the GNU environment"

Why I do various things

posted February 11th, 2004 @ 22:36:13

- tags: general tech , C , linux , python , development

- comments: 0

I've been trying out a few console only programs in the past week; a few programs that I had been meaning to try for some time. One of them was swaret, the SlackWARE Tool, and the other is Screen, the UNIX tool.

read the rest of "Why I do various things"

Its the most wonderful time

posted August 31st, 2003 @ 05:38:02

- tags: odd , python

- comments: 0

Ahh, its that time of year again, when the freshman orientation week ends, they get their laptops, and then fuck our connection right in the balloon knot. If this was last year at this time, only this year (bear with me), I'd still be fine with this, because I'd be downloading packages pertaining to whatever interest I have this week at lightning I2 speeds. Unfortunately, Stevens needed the valueble I2 network money to water the grass and plant flowers.

read the rest of "Its the most wonderful time"

It is my contention

posted July 17th, 2003 @ 09:20:08

- tags: python , development

- comments: 0

It is my contention that Lorde Omlette is a fake; a ninny with soiled knickers. Let me explain, please.

read the rest of "It is my contention"

Somebody's Heine is crowding my icebox

posted June 23rd, 2003 @ 10:56:39

- tags: life , games , python

- comments: 0

Its been quite a few days since I set out to rewrite this site in python, and so far, I have only constructed a minimal scaffolding where I want my great statue to stand. How the brilliant fire of fervor can die down to the smoking head of a recently lit match, blown out by the wind or put out of its misery by a single rain drop, is beyond me. How my mind that seemingly lives only in pursuit of its own destruction due to overactivity manages to latch on to something so completely only to let it go is also not yet within my understanding.

read the rest of "Somebody's Heine is crowding my icebox"

Blue Funk Wedding

posted June 6th, 2003 @ 18:18:10

- tags: life , python

- comments: 0

It would appear that submission is working, although in a non-final rudimentary form. Still, something had to be done, and even more will soon have to be done because the main page and other pages work off of different databases entirely. Unfortunately, there are no plans to get any of the functionality in the comments or rant section ported to the new system within the next 5 days; but I don't think that will kill anybody.

read the rest of "Blue Funk Wedding"

Jtex 0.3 on its way

posted June 1st, 2003 @ 04:47:56

- tags: python , development

- comments: 0

In an effort to keep the design of Jtex simple, and further reinforce that it is not competition for other projects, I've taken a few features out of the release plan. The project is more exciting to me as a tutorial to myself and others on building PyGTK applications rather than reinventing the text editor yet again. The removed features follow:

read the rest of "Jtex 0.3 on its way"

XML DTD for JTex

posted May 31st, 2003 @ 13:45:57

- tags: python , development

- comments: 0

I can't seem to remember what it is that I wanted to have done by Friday night, but whatever it is, I probably don't have it done. The tutorial is still languishing on page 3, and although I didn't get much actual development done, I did learn quite a bit about how to use pango to change fonts in the TextView, among other things.

read the rest of "XML DTD for JTex"

White Striped XML

posted May 28th, 2003 @ 12:05:06

- tags: python

- comments: 0

While thinking over what to include as features for the Jonas Text Editor Experiment, XML struck my fancy as a way of creating a simple properties interface that was as extensible as it was clean and easy to parse. And then XML took my fancy and beat the ever living shit out of it.

read the rest of "White Striped XML"

Goals for JTEX (jonas text editor experiment)

posted May 28th, 2003 @ 05:54:43

- tags: site news , python

- comments: 0

In an Ideal world, here is what the schedule looks like. I hope to have 0.2 complete by tonight, and 1.0 released by mid to late june. PySCP should start up heavy sometime early july, and I expect to have working scp code by mid to late august. There's also another project on the way... and I need to re-write my website to adjust for my newfound thirst for development.

read the rest of "Goals for JTEX (jonas text editor experiment)"

Pango

posted May 25th, 2003 @ 08:21:35

- tags: python

- comments: 0

Pango is most interesting in its infinite uses. Check out a Pango Tutorial if you are interested; using glade with pango can be very enriching. As soon as I find out how to find the windows and dialogs i create with gtk.glade.XML, I'll write something up on that. It would obviously have something to do with an event; in this case, I'm just connecting an about dialogue, so its going to be an onclick signal. Even so, I find glade an excellent tool for RAD, and the whole glade + python thing looks like it could be extremely powerful in well developed hands.

read the rest of "Pango"

pygtk + glade woes addressed?

posted May 22nd, 2003 @ 01:55:29

- tags: python

- comments: 0

Now, part 2 of the old tutorial (the one that I was porting) runs and displays properly, with signals connected properly; but displays a warning that is just as useless as the previous one I was getting.

read the rest of "pygtk + glade woes addressed?"

Bug Fixes, Features, and Nonsense

posted May 18th, 2003 @ 16:20:15

- tags: site news , python

- comments: 0

To Do:

read the rest of "Bug Fixes, Features, and Nonsense"

Look out!

posted May 12th, 2003 @ 12:25:40

- tags: life , python

- comments: 0

Yesterday, Phil (firu) and I spent about 4 hours in dazed mixture of drowsiness, cleaning, and chilling. We managed to remove and organize the metric fuck-ton of shit that was blocking the windows, and ended up chilling on the radiator, right next to the windows, on the 3rd story. The newly opened windows (and newly opened line of sight to said opened windows) have revealed unto me a most amazing view of the rooftops of hoboken from my seat, and since their opening I've spent many an idle minute gazing out at the tree with the strange hairy seeds and cranes out near Jersey City.

read the rest of "Look out!"

Change my Pitch Up

posted May 10th, 2003 @ 11:20:06

- tags: general tech , life , C , python

- comments: 0

My thumbs seem to be any color except green, a contributing factor to the apparent slow and painful death of my new foliage. They are, however, rather adept at writing compilers; as I was able to finally compile useful code today with my pascal compiler (fibonacci and factorial). Will it ever be completed? The world will never know.

read the rest of "Change my Pitch Up"

Deploying django on mod_wsgi, virtualenv

posted May 27th, 2009 @ 01:23:40

- tags: python , development

- comments: 0

With my recent release of a new version of this site, I finally made the jump from using mod_python to using mod_wsgi. This change had been a long time coming, but was made slightly less than straight forward by my desire to deploy to virtualenv environments.

read the rest of "Deploying django on mod_wsgi, virtualenv"

Finding images in a binary file w/ python

posted June 15th, 2009 @ 23:13:27

- tags: python , general tech

- comments: 0

asobi seksu album cover

Been having a sort of chronic problem with my phone over the past couple weeks where songs would skip. Didn't think it was too big of a deal, but transferring some more music over to it the other day somehow my pictures all disappeared. I take fairly frequent backups, but this caught a few that weren't on the memory card. I checked dmesg, saw end_request: I/O error, dev sdg, sector 48728, and knew that I was probably in for some problems.

read the rest of "Finding images in a binary file w/ python"

Cheesy color console output

posted January 20th, 2010 @ 00:09:34

- tags: python

- comments: 0

Since Audacious crashes in Ubuntu 9.10 when playing NSF files, I was compelled to compile a newer version for personal use, and I noticed that their build system is tricked out with very little extraneous geek-cred output and some colored output. I have been writing lots of little one-off bulk job scripts lately, and when I realized the answer to the question "Why don't I do this?" was "I don't know how", I decided to do some google jump roping and figure it out.

read the rest of "Cheesy color console output"

Subclassing Django's TestCase

posted February 15th, 2010 @ 13:51:28

- tags: python , development

- comments: 0

As mentioned in yet-unresolved #7835, I've been writing a sort of meta-application recently that doesn't provide any models of its own but absolutely requires models (and data) of various types to test against. I ended up adopting julien's technique, which puts the test-only application inside the tests module, and then overrides setUp and tearDown to monkey patch your settings to include the test-only application and then run a syncdb command. This approach started out working very well, but I soon ran into a fairly major problem: fixtures failed to load.

read the rest of "Subclassing Django's TestCase"

Profiling Generalizations

posted February 25th, 2010 @ 22:00:05

- tags: development , python

- comments: 0

A friend and colleague Jeremy Self, who I've been working with the past few weeks on a project that will probably be released shortly, told me the interesting results of some profiling he was doing on a lazy-evaluated data structure:

read the rest of "Profiling Generalizations"

Johnny Cache

posted February 28th, 2010 @ 12:11:56

- tags: python , development , web design

- comments: 0

I've been waiting a long time to write about this. Johnny Cache is now released upon the world. It's a drop-in caching library/framework for Django that will cache all of your querysets forever in a consistent and safe manner. You can install it via pip install johnny-cache.

read the rest of "Johnny Cache"

Is johnny-cache for you?

posted March 2nd, 2010 @ 05:24:36

- tags: development , python

- comments: 0

I've been pleasantly surprised with the amount of interest in johnny-cache since Jeremy and I released it this past weekend. A lot of the comments revealed that perhaps the documentation is missing an important discussion on the repercussions of using Johnny. They are also pretty positive about the name :)

read the rest of "Is johnny-cache for you?"