geek

test node

This is a test.

PgDBF

PgDBF is a program for converting XBase databases - particularly FoxPro tables with memo files - into a format that PostgreSQL can directly import. It is the successor to the XBaseToPg project, which works well but is comparatively slow and big and complicated. The smallest changes touched lots of files, and the scope of that project is far larger than I actually needed on a daily basis.

Thus, PgDBF. It's a small C project comprising two files with no dependencies other than standard Unix libraries. While the project is relatively tiny and simple, it's also heavily optimized via profiling. I routinely got benchmark results that were many times faster than with XBaseToPg. In fact, even on slower systems, conversions were typically limited by hard drive speed.

Features

PgDBF was designed with a few core principles:

  • Simplicity. This code should be understandable by anyone who wants to hack it.
  • Robustness. Every syscall is checked for success.
  • Speed. I wanted the fastest conversion available anywhere.
  • Completeness. It has full support for FoxPro memo files.

In defense of the Model M

There are few joys in life like using something that is the perfect expression of its intent. Each trade has its representative tools, and their common trait is quality, even if it's not obvious to the casual observer, and often counterintuitive. The best tools in a category are almost always the least flashy, and rarely the ones a new practitioner would choose.

Komando? Gorilla.

A man calls into a radio show because his son received an obviously-spam email telling him that he's been kicked off of Facebook. The host gets worked up and sympathetic and wants to handle it like a legitimate eviction notice, even though no one's verified whether the kid can still log into his account.

Another man calls a radio show because his business stores a lot of personal information about its customers, and he wants to know what he should do to keep that data safe. The host tells him to install Norton Internet Security.

What do they have in common? They made the mistake of asking Kim Komando for help.

Yet another Python map()

In another article, I described a replacement for Python's built-in map() function that could take advantage of multi-processing systems. That one was based on the standard Unix fork(). Since then, I've written another based on Parallel Python that is much simpler and lets other, better-tested code do all the hard work. It could also be easily extended to run on a cluster instead of just the local system, but I haven't been inclined to tinker with that too much yet.

Note one possibly important difference from the builtin map() function: this version returns a generator that yields values as they are calculated. That way, you can launch the parallel processes then go on with other work while you give the workers a chance to finish their jobs.

Fun with software licenses

Did you know that you're probably not allowed to make backups of your computer? It's true, if you believe in the legal fiction known as "End User License Agreements" (or EULAs), which are those annoyingly long contracts where you have to click "I Agree" before you're allowed to install some program or another.

For example, here's a snippet of the Adobe Integrated Runtime (AIR) End User License Agreement:

2.3 Backup Copy. You may make one backup copy of the Software, provided your backup copy is not installed or used on any computer.

Nice, huh? If you install this software, its EULA forbids you from making more than one backup copy. This is a deal-breaker for business which keep multiple backup archives from days, weeks, and months past.

Don't bump that flash drive!

From the manual of an Asus Eee PC:

The solid-state disk drive's head retracts when the power is turned OFF to prevent scratching of the solid-state disk drive surface during transport.

I think someone got a little zealous with the find-and-replace.

Buffer overrun in "Antitrust"

Skip this unless you're really, really geeky.

Still with us? OK. In the movie "Antitrust", there's a screenshot of some code that has a possible Denial Of Service vulnerability:

Python.org

Slashdot.org

News for Nerds. Stuff that Matters.

XBaseToPg

Replacement Notice!

I'm dropping my work on this project in favor of PgDBF, which is functionally identical, faster, and easier to maintain. If this is your first time here, use that project instead. If you're already using XBaseToPg in production, you should probably switch anyway.

Introduction

So, you want to convert some FoxPro tables to PostgreSQL, huh? You're in the right place. Although this project works well for one-time data migrations, it's designed and highly optimized for regularly scheduled jobs.

Installation

  1. Download the "xbase64-3.1.2.tar.gz" archive from the Xbase project at Sourceforge.
  2. Extract it and apply the XbaseToPg patch below.

How not to save a game

I was about halfway through a game called "Final Fantasy XII: Revenant Wings" on my Nintendo DS. I was having a great time and loving it until a stupid bug wiped out all the work I'd put in and made me start over.

When I was in the middle of a particularly involved battle, the red "low battery" warning light came on, so as soon as I finished I tried to save my game. Big mistake. The DS used up its remaining power during that instant and turned itself off. When I plugged it into the charger and turned it back on, I got a message saying that my game file was corrupt and had been deleted.

The dawn of mechanism

Let a robot do your dirty work.

I love the little iRobot Roomba vacuum cleaners, but something about their new tagline bothered me until I identified it. If I am certain of anything, it's that in 50 years the National Association for the Advancement of Digital People (NAADP) will use that quote as proof of our society's discrimination against Mechanical Americans.

Antonym

Many people use anonymous pseudonyms to send and receive mail that cannot be traced to them. This program is for people who know what the pseudonyms ("nyms") are, understand how they work, and wish to make their use a little easier.

Powered by Drupal - Modified by Danger4k