| Subcribe via RSS

SQLObject - OS/X

November 29th, 2005 | | Posted in Programming, Python

Building on my SQLObject post from Yesterday I figured out spit out my notes from setting SQLObject up on my Powerbook (with Postgresql).

Now, you'll need to satisfy some dependencies first - I'm doing this from the point of view of getting it to work with PostgreSQL - not any of the other DBs it supports.

Grab the postgres distribution from: PGSQL For Mac This distribution is nice, as it contains an installer, as well as a control panel and other utilities for postgresql. It's convenient for "1 click Setup" This package installs everything in /Library/PostgreSQL8/

Once that's done, you'll need to install MX Date Time (Get the Source .tar.gz) (This is a Psycopg dependency). Because the version of SQLObject I am using does not support the latest rev of psycopg, I had to fall back to version 1 of psycopg, which forced my to pull in MX Date time.

Setting up MXDateTime is a simple affair of grabbing that source tarball, unpacking it, cd'ing into the directory and doing a sudo python setup.py install

With that done, you need to download and install Psycopg version 1 - version 2 won't work. You can grab it from here.

After unpacking it, you'll need to do a special ./configure line - like this:

(this is all 1 line!)
./configure --with-postgres-libraries=/usr/local/pgsql/lib
--with-postgres-includes=/usr/local/pgsql/include
--with-mxdatetime-includes=/System/Library/Frameworks/Python.framework/
Versions/2.3/lib/python2.3/site-packages/mx/DateTime/mxDateTime

Then do a make, and an sudo make install

Now it's time to download SQLObject from here (I grabbed the source tarball. Unpack that zip, and do the normal sudo python setup.py install If it prompts you, let it download setuptools.

Viola! You should now be ready to start the postgres server (after poking a hole in the OS/X firewall for port 5432) and make a new database, or simply pick up the handy SQL Object Docs.

SQLObject

November 28th, 2005 | | Posted in Programming, Python

Sorry for the lack of posts - I've been out on Thanksgiving vacation - which allowed me to play with SQLObject for some in-house projects. Barring some setup problems/dependency issues I've had on OS/X - it rocks!

It took me a bit to wrap my head around what SQLObject is meant to do, and how it would apply in my situation - it's also pointed out some very poor DB decisions I've made (I'm using it against pre-existing DBs).

Overall, my hat goes off to Ian Bicking and the entire SQLObject team for the tool - once I got it up and running, the only barrier I hit was one of documentation/comprehension on my part (I hope to take some time and write up "SQLObject for Morons").

I'm going to try to type up my exact experiences (including things I learned, and OS/X setup instructions) shortly. The documentation is good for SQLObject, but I think it could be better (or maybe I'm just reading-deficient).

Vacation is pretty cool - let's me hack on things I normally don't get a chance too. Now that I think I've wrapped my head around SQLObject (and getting it working with my internal databases), I think the next stop is going to be TurboGears to write an application.

Hopefully I can brain dump the SQLObject stuff and hack on turbogears before PyCon - which I should be attending (woot!).

Just thought I would add my working example of SQLObject Use - in this case I want to connect, get the results and drop the results into a list (and in a dict):

#!/usr/bin/python

from sqlobject import *
import os, sys

connection_string = 'postgres://mydb@localhost/data?debug=true'
connection = connectionForURI(connection_string)
sqlhub.processConnection = connection

class TestFiles(SQLObject):
class sqlmeta:
table = 'testfiles'
fromDatabase = True # Don't make something new

# Get some testfiles:
testfile_results = TestFiles.select(TestFiles.q.testsuite==_mysuite)

t_file_data = [ i.file for i in testfile_results ]

mydict = {}
for i in testfile_results:
mydict[i.testsuite] = i.file

print t_file_data

MD5/MD4 Collision Generator(s).

November 15th, 2005 | 2 Comments | Posted in Technology

This is actually a big thing (that I haven't seen talked about a lot) - someone has posted a working program capable of generating MD5/4 collisions in under 45 minutes on a 2.4 GHZ processor.

Bugtrack Email here

Website with Source

This is significant because previously, while everyone knew that MD5 was basically worthless at this point (due to the How to Break MD5 and Other Hash Functions paper, people continues to say "but there's no exploit code!".

Now there is. People need to start using something in the realm of SHA-256 for hashing (SHA-1 is "weaker" then expected) or some other authenticity method, but really, MD5 is worthless, and SHA-1 is going to go down as well.

You can see Bruce Schneier's writing on this as well.

Add: Oh look. Slashdot finally caught it

Drucker-ism

November 11th, 2005 | | Posted in Other, Testing

Another crazy week. I've actually been fairly Python-Active, but instead of (again) working on those things I can make public-domain, I've concentrated on certain internal project.

Hopefully, in the upcoming months, I can get a release to let me talk about some of the ideas and concepts I'm hacking on and I can them really start talking about them.

In any case - Based off this entry: Agile Testing: Drucker on agility and testing

I picked up a couple of Peter Drucker books from Amazon and I've started reading them. I previously had no knowledge of this man, but in starting to read this stuff, I see why people like him (and his thoughts) so much. A lot of it is amazingly applicable to the space I am in at the moment.

Also - you should check out the Python411 Webcast - I've started listening to the series on my drive, and it has a lot of good information. Between this and the QA Labs podcast, I'm getting a lot of "Good Ideas" about Python/QA projects and improvements.

I managed to sit down and watch the vid cast for the Turbogears 20 Minute Wiki - and where I was simply confused before (I'm not a web-programmer by any means) now I am completely daunted. Turbogears looks damned nice - I just don't know how easy it is going to be for a non-web programmer to really get "into" it.

TmCodeBrowser - TextMate (works with Python!)

November 4th, 2005 | | Posted in Programming, Python

I just found this TextMate plugin: TmCodeBrowser via the The MacroMates Weblog

I loaded it up, restarted TM - and BAM. All of my Python classes, functions etc pop up in a nice panel and I can click through to them.

It has the Jesse Seal of Awesome!

AlmostVPN - Trac

November 4th, 2005 | | Posted in Apple, Technology

Ran across this app via version tracker: AlmostVPN - Trac

It's interesting - it's an SSH tunneling manager that sits in the Pref. Pane in OS/X instead of being a standalone application. For those of us who have to VPN a lot, but despise things like the official Cisco VPN client (on any damned platform) this might be useful (if you have ssh access into the corporate network).

Random Week Roundup (QA, Python)

November 4th, 2005 | | Posted in Automation, Programming, Python, Testing

Man. Have you ever had one of those weeks that makes you feel like your brain just got backed over by a semi-truck? That's what this week was for me. Between seeming juggling angry bears, everyone around me seems to have come down with the creeping crud.

Of some interest, I've discovered a series of QA-Related blogs (the resulting reading of these makes me question my own methodologies) - including a QA Podcast (in one episode they cover Selenium). Here's that roundup:

Collaborative Software Testing
James Bach's Blog
Agile Testing Blog
QA PodCast

Most of these concentrate on the concept of Agile Testing, and basic to advanced methodology. I know they made me think about various approaches. Overall, I think a lot of what's said inside the community is applicable to most software development/QA groups - but I strongly disagree with some of the assumptions (but I'll cover some of that in later posts).

Good Info!

I'm hoping to be able to cycle back into PyHack mode next week - I haven't been able to make progress on any of my python projects (both internal and external), so my ability to talk about anything new or interesting is greatly diminished.

One general thing I have been Navel-Gazing about is this:

My company (and a few others I know about) have been looking for solid Python people - QA people who can program in python (for tools development, test automation) and in general competent "Python Hackers". After scouring the internet, and posting everywhere we can think of, it looks like a employee-market. The number of skilled Python people is either incredibly low, or those who are skilled, are not looking (or not looking for something outside of core development).

Overall, it's sort of depressing (especially as I need the help!) but then again - I realize the traditional stigma of the QA role (and how do scream "it's not like that here" loud enough) and I also realize that QA is considered a stepping stone position for many on the path to development.

Like I said - Navel Gazing. I just want to find good QA Engineers who can also write code. I know they exist, dangit.