RelStorage: MD5 sums

If you study RelStorage a bit, you’ll discover that every object it stores is accompanied by an MD5 sum of the object state.  Then you’ll probably wonder why, since MD5 computation is cheap but not free.  We do it to support undo.

ZODB expects the storage to check whether an undo operation is safe before actually doing it.  FileStorage performs that verification using the following algorithm: if each object’s state in the transaction to undo matches the object’s current state, it is safe to undo.  If any object does not fit that rule, raise an UndoError instead.

RelStorage uses the same algorithm, but it compares states using the MD5 sum rather than the full state, allowing the comparison to proceed quickly.  Actually, the real issue is not speed, but portability. Do all of the supported relational databases have the ability to compare the contents of BLOBs in a query?   It’s hard to find documentation on questions like that.  It’s much easier to just compare MD5 sums.

Besides, it generally feels good to keep MD5 sums around.  If the filesystem hosting your database ever accumulates some corruption, you can use the MD5 sums to help sort out the mess.

My Rep(St)rap

Items of note that you can see in this picture of my Rep(St)rap:

  • I used the BitsFromBytes laser cut plastic with alloy screws and other hardware I bought from McMaster.com and Fastener-Express.com.
  • I decided to mount all of the electronics on a thin 8×10 acrylic plate ($1.58 at Lowe’s) to make power distribution easy and to retain an appearance similar to the rest of the machine.
  • Everything is there but the heater.  I’m still waiting for the nichrome wire to arrive.  I can be patient, so I used free super saver shipping. 🙂
  • I used aluminum gears in place of the plastic ones because the aluminum gears have the same pitch (distance between teeth) as the belts.  Until I did this, the belts slipped a lot, but now it’s actually kind of hard to make them slip.
  • The Z belt tensioner uses an M8 rod instead of an M8 screw.  It extends to the bottom of the cage, giving the tensioner extra stability.

Deliverance Seems Cool

I have begun using the Deliverance package.  I think it cleverly solves the web software theming problem.  Its method of theming is deliciously simple and straightforward, yet I imagine most software developers will shun it at first because its method is inefficient.  Actually, that makes me happy, because Deliverance is going to save me and my family business a lot of development time, giving us an advantage in the market compared with those who continue to theme sites by fighting with CMS frameworks.

On the other hand, there is no 1.0 release of Deliverance yet, so it’s not ready for everyone.  It’s undergoing major changes right now.  I like Ian‘s new direction a lot, but when I tried the trunk, it made a royal mess of my CSS with embedded URLs.  I intend to try again in a few days before reporting a bug.

Still A Gentooligan

Ubuntu is what I install on nearly every server and everyone else’s personal computer, but for my own desktop and a few select servers, Gentoo is still the winner.

Binary distributions release a set of packages that have been tested together, which is an excellent service to users.  In the open source world, every part of the stack is changing at irregular intervals.  Binary distributions serve as the buffer between that wild world and users who just want their computer to work.

However, that buffer has a cost: it has a side effect of adding barriers between open source developers and users.  For example, sometimes I need to run a specific version of someone’s software, but my distributor has chosen a different version.  This happens quite often for me.  With a binary distribution, my options are limited, but with Gentoo, I have several ways I might accomplish that, most of them involving little effort on my part.

I would like to take this moment to say “thanks!” to the Gentoo developers and users who contribute to Gentoo.  I realize it’s hard work, and the hardest work might be resolving conflicts with your peers.  Your efforts have been worthwhile for me and have not gone unnoticed.

RepRapping

I am a RepRapper!  The RepRap project is an open source effort to build low cost 3D printers.  Yeah, we’re building the seed of a Star Trek replicator.  Don’t expect to eat the results yet, though!

A few months ago I bought the laser cut parts kit from Ian Adkins’ BitsFromBytes store.  I expected that the laser cut kit would be very similar to the standard Darwin design on reprap.org, so I bought just the laser cut parts and ordered the hardware for the standard design from other sources (as listed on the former parts.rrrf.org site, which is now redirecting to Zach Hoeken’s RRRF store).  I hoped to save a little money that way since shipping overseas is expensive.  Unfortunately, the laser cut design is significantly different; in particular, it uses primarily M3 nuts and bolts while the standard design uses M5.  So I ended up ordering a lot of extra hardware.

On the other hand, I don’t think that was such a bad idea, since now I have hard-won knowledge of where to find this obscure hardware.  I know the RepRap project is trying hard to rely on commodity hardware, but metric hardware is rare in hardware stores in the USA, and what they have is overpriced.  So I’ve had to rely on online sources for nearly everything.

In any case, I’ve forged ahead and now my machine is very close to being ready to print.  All 3 axes move smoothly and the extruder motor seems to work well enough.  The only thing I’m stuck on is the heater, which I have tried to build 3 times now, each time making some critical mistake.  I’ve ordered a roll of 30 AWG nichrome wire from Amazon and a brass tube from onlinemetals.com; once they get here, I should be ready to build the heater correctly. I only wish I could buy such things locally so I wouldn’t have to wait!

Must… Write… Something…

Life is really great–so great that I would generally prefer to spend more time living it rather than writing about it.  Still, I’ve got to write, or I’ll forget things and I’ll miss opportunities to communicate.

Yet there’s so much to write.  Where should I start?  Anywhere will do.  Ok.  Time to blog again, and not necessarily about what is most important or what happened most recently.  I’ll write about what I want to write about.