enough water makes all rocks round

Latest

PythonDoc Wiki Macro for Trac (Update)

Big updates for a small module. The TracPythonDoc wiki macro now has enough features for real use.
Read the rest of this page »

PythonDoc Wiki Macro for Trac

In a time long, long ago in a cubicle far, far away, I once wrote a wiki macro for Trac to generate documentation from python modules in a Subversion repository using PythonDoc.
Read the rest of this page »

SELECT Surprise

While experimenting with unicode values in Python, PostgreSQL and pyscopg2, I ran a little query like this:

>>> cur.execute("SELECT (note_id, body) FROM troy.morenotes")
>>> cur.fetchall()
[('(1,"The rain in Spain falls mainly in the plains.")',),
('(2,"Twenty dwarves did handstands on the carpet.")',),
('(5,I\xc3\xb1t\xc3\xabrn\xc3\xa2ti\xc3\xb4n\xc3\xa0liz\xc3\xa6ti\xc3\xb8n)',)]

Read the rest of this page »

Advertisement

Automatic Pickle Serialization and Deserialization with PostgreSQL

Building on the earlier success of creating a pickle data type in PostgreSQL, I’ve come up with this small and comfortable way of automatically serializing and de-serializing python pickles with PostgreSQL and psycopg2.

Read the rest of this page »

Cheat Sheet for Kid Templates

Kid Templates rock! In an effort to learn and memorize the syntax, I created a cheatsheet for it using Inkscape.
Attached is the PNG export and the SVG source. Enjoy!

(I’ve removed the SVG source because WP won’t allow the attachment – troy 24 jan 2010)

A Tale of PostgreSQL Types and Python

Thinking of integrating user-defined types in PostgreSQL and psycopg2? Here’s the path I walked, hopefully you can avoid the same pitfalls.

I was after a PostgreSQL data type for storing Python pickles. This seemed simple enough because the database facility for aliasing a type already exists. So the first thing I tried was a CREATE DOMAIN statement in PG, like so:
Read the rest of this page »

Confession

Christ said:

“Therefore whoever confesses Me before men, him I will also confess before My Father who is in heaven.” – Matthew 10:32

I confess Christ is God. And I will not forget the next verse, either. He said:

“But whoever denies Me before men, him I will also deny before My Father who is in heaven.” – Matthew 10:33

How does a Christian know the will of the Father? This is important to me, because He said:

“Not everyone who says to Me, ‘Lord, Lord,’ shall enter the kingdom of heaven, but he who does the will of My Father in heaven. Many will say to Me in that day, ‘Lord, Lord,’ have we not prophesied in Your name, cast out demons in Your name, and done many wonders in Your name? And then I will declare to them, ‘I never knew you; depart from Me, you who practice lawlessness!'” – Matthew 7:21-23

As for an answer, listen to this passage.

For God may speak in one way, or in another, Yet man does not perceive it. In a dream, in a vision of the night, When deep sleep falls upon men, While slumbering on their beds, Then He opens the ears of men, And seals their instruction. In order to turn man from his deed, And conceal pride from man, He keeps back his soul from the Pit, And his life from perishing by the sword. – Job 33:14-18

That reads as poetry to my mind.