Archive for June, 2007

MySQL for Python (MySQLdb) – Enum Datatypes Return a Set

Monday, June 11th, 2007

This is a bug which appears to have been fixed in the latest MySQLdb release:
SourceForge.net: Detail: 1561190 – enum return list

Also here’s a discussion on it.

If you don’t feel like upgrading MySQLdb or can’t, I made this function to work around the issue. You just run your returned values through it to set them straight. And the good thing is it’s harmless to still run even after you do upgrade and this problem is fixed.

def enum_set_to_str(val):
    """Fixes http://sourceforge.net/tracker/index.php?func=detail&aid=1561190&group_id=22307&atid=374932
    enum returns set, until they upgrade.  Should always be harmless to run"""
    import sets
    if type(val) in [sets.Set,set] and len(val)==1:
        return list(val)[0]
    else:
        return val

Python – Wrong Filenames, Paths in Traceback

Monday, June 11th, 2007

I copied some Python modules I wrote from my home computer over to a web host via FTP. I ran the code on the webhost and there was an error. The odd thing was that the traceback for the error mentioned file paths from where the modules were stored on my home computer. This really confused me for 10 minutes. I spent 10 minutes thinking there was some spooky connection between my home computer and my web hosting server.

Then I realized that I had also copied over .pyc files. So I tried deleting those from the web host directories and rerunning it. After that the traceback showed the correct file paths. My best guess is that .pyc files store the filepath where they were compiled to and the traceback reads that instead of looking at where the file is now located.

Does anyone have any more insight on this?

Update:
Perhaps I’m hitting one of these Python bugs:
[ 1180193 ] broken pyc files
[ 1051638 ] incorrect traceback filename from pyc

Refrigerator Repair in Frederick, Maryland

Monday, June 11th, 2007

My refrigerator had some kind of leak coming into the refrigerator part from the freezer. I called Steve Ebberts (301-834-6452) whom I found through a google search.

He came out and said all it was was a frozen defrost cycle drain and fixed it in under an hour. I was pretty impressed. He fixes other appliances too. Thus he’s the official Answer my Searches reccomendation for appliance repair in Frederick, MD.

CDBurnerXP Pro – Writing Error 3

Monday, June 11th, 2007

CDBurnerXP Pro version 3.0.116 started giving me this error when trying to burn DVD ISO’s:

writing error: (3) error closing DVD-R RZone invalid command field (1022) Error sense data: SENSE KEY: 5 ASC: 24 ASCQ: 0

Unfortunately I didn’t find a good answer but the two pieces of advise to try are:
1. Update DVD burner firmware
2. Change the burn modus from “Joliet” to “Iso-Level 01″ (which I don’t see how to do when burning an ISO from a file.)

Here’s a forum with people complaining about this problem with few solutions.

Here’s an FAQ that addresses it but still doesn’t help.

I’m going to try installing some different software, perhaps NERO. I hate fooling with firmware updates, it always breaks everything.

Mini Searches with Answers

Wednesday, June 6th, 2007

These are links associated with recent searches I’ve done. They’re not difficult enough to warrant to their own posts but still super useful.

DivmodReverend – Divmod – Trac
a general purpose Bayesian classifier, named after Rev. Thomas Bayes. Use the Reverend to quickly add Bayesian smarts to your app.

Family name – Wikipedia, the free encyclopedia
What’s the deal with last names? Where do they come from? Why do we have them? When did they start?

LetterMeLater.com – Schedule Email to be Sent Later Automatically
A way to schedule an email to be sent later. I was thinking of making a website like this myself, but since it already exists …

Graph of Federal Funds Rate and Table of Values – HSH Associates Library of Mortgage Information
A table showing most of the intended federal funds rates for the past few years.

How to allow more file types to be uploaded in WordPress
How to fix the "File type does not meet security guidelines. Try another." Error in WordPress.

A programmer’s tale ? Wordpress upload file type security restrictions
Another option for fixing the "File type does not meet security guidelines. Try another." error in WordPress so you can upload more file types like XPI, or .Gnumeric for example.

Tags: , , , , , , , , , , , , , , ,