Wednesday, December 31, 2008

Kodos for pyparsing

"Kodos for pyparsing"

Perhaps if I say it, with earnest conviction, it will come into existence. Perhaps if I intone it repeatedly; light a candle, maybe.

Or perhaps I will get around to creating the modification to Kodos myself. It might not even be too hard - it just can't be a priority project right now...

Kudos for pyparsing, too, of course.

Friday, December 19, 2008

speaking at IOUG

Whoo! My talk got accepted at IOUG Collaborate!

Congratulations! Your Technical Session (60-minute) proposal below has been accepted by the IOUG Conference Committee for presentation at COLLABORATE 09 IOUG Forum. You are scheduled to present at the following date/time.

405: Long Live the Command Line: SQL*Plus and Alternatives
Thursday, May 7, 2009 from 11:00 AM until 12:00 PM

Yay! I even got a good time slot!

This will be kind of like the talks I've given at Oracle user groups around here... but more polished, of course - as SQLPython itself is more polished.

Thursday, December 11, 2008

account rot

I feel a gradually growing sense of nervousness and guilt over the growing trail of accounts I have opened on various web-based services, then abandoned. You know how it is... you try out a service, but 95% of the time you lose interest or find a better one eventually. Then your account just sits there forlornly, quietly counting the months since your last login.

I'd back up and delete the old accounts, but many of them don't provide convenient (or any) account deletion options, and most of them I have just plain forgotten.

What's the harm? Well, I do have a very young nth cousin named Catherine Devlin who is probably going to curse me in 15 years for squatting on her account name EVERYWHERE. Assuming she doesn't want to be "WebkinzBellybuttonLint" or something. Worse, there are just a couple sites where I got the username "catherine" - which is awesome, except when I ended up not using them, leaving a choice username to gather digital dust.

Plus, there's this feeling that any of those accounts is potentially crackable, creating risk of a very mild form of identity theft. OK, I don't care that much if somebody's leaving comments as me on IMDB, but it still doesn't seem quite right.

This is one thing I love OpenID for - my account at liquidID.net has a nice listing of everyplace I've used it. Alas, that represents maybe 0.1% of the services I've signed up for in the past 10 years.

Anybody have a solution? I should probably start a centralized record of all my newly created accounts, but what about the ones I've already forgotten?

Wednesday, December 10, 2008

Planet CodeMash (Yahoo! Pipes)

When a product is described as, "Easy to use - requires no programming!", run. Run, and don't look back.

That's been my rule, anyway. After my first Yahoo! Pipes project, I'm willing to flex it... a little bit. It's been a blend of agony and ecstasy.

Dozens of CodeMash attendees have listed the URLs of their (human-readable) blogs on a webpage. I wanted to browse their blogs, but not by drilling into each one manually. I wanted to read them in one place, with a Planet CodeMash.

(Would you believe that I couldn't find an online "planetizing" website that would simply take a list like that and generate the planet for me? The closest I found was RSSMix, which wanted me to find the RSS URLs myself - which I did, with Python - but then it couldn't read Feedburner links.)

Enter Yahoo! Pipes. VoilĂ .

Planet CodeMash


Yahoo! Pipes is good for problems like this where you get web-published data (not only RSS feeds, as I first believed), apply a series of transformations, and publish it.

You design your project by dragging logical blocks around a 2-D graphical flowsheet, with pretty curvey lines connecting them. The modules are well-chosen to provide a fair amount of versatility despite their limited number. I was happy to find a Regex module, as well as Feed Auto-Discovery, which drills into a page and finds its RSS link - perfect for this project.

There are problems, however. The biggest one is that, since the editor runs in your web browser, there are some... annoying... ... lags. Every time you click on anything, it takes a second or two for your click to register. That's more than annoying; when you need to click-and-drag, it's nearly crippling. If you can sit there with your finger on the mouse button, wondering, "Has my click registered? Can I drag yet?", again and again, and not curse somebody, then you're a wonderful person.

Of course, every new environment seems a bit confusing and wrong until you've had a chance to poke all the buttons and twiddle the knobs - but this painful interface pretty much prevents playful exploration, so the environment will remain alien and full of surprises for a long time,

Oh, and the error messages stink. "Oops: System error. Problem parsing response." Gee, thanks.

Still, I did get it done, in a halfway reasonable amount of time, and the result is undeniably pretty.

I will consider Yahoo! Pipes for future projects like this. And if I ever find a way to run its editor locally, it will probably become one of my favorite toys.

Thursday, December 04, 2008

gift idea and hot investment tip

Yay for Python 3.0! You knew I had to say that. I'm not actually using 3.0 or even 2.6 very seriously yet, though Brandon Rhodes showed me how to use comprehension for dictionaries, and that's just awesome. So I'm going to try to switch as soon as cx_Oracle and pyparsing are ready.

Anyway, I do have one more nontechnical thing I've just got to talk about. I want to do some free advertising for Microplace, a microcredit investment site. I discovered them a few months ago and was delighted with how smooth and easy they made it to place a microcredit investment. It was as professionally done as a good bank's site, and there is enormous choice in where you want your investment to go.

They're also doing a promotion right now where they'll give you a handmade piggy bank! I got one unexpectedly about a month ago, and I absolutely love it.



The picture really doesn't do it justice - it's delightfully cute. More, the tactile and audio sensation of plunking a coin into it is just... astonishingly satisfying. It's just exactly the way a piggy bank should look, feel, and sound, the Platonic ideal of "piggy bank". I find a nickel under the couch cushions and I practically dance over to the bank to plunk it in. I'm going to get another for my nephew for Christmas. This is what you should get somebody for Christmas (or any other gift-giving occasion).

Obviously, from an investor's point of view, microcredit sucks. The interest rate probably won't even keep up with inflation. That's OK. This is not serious capitalism; this is more like making a loan to a friend in need. I like it that way. Generally, what we hope to buy with money is satisfaction anyway - buying stuff we hope will satisfy us. If I put $200 in a standard investment for a couple years, maybe it would earn me enough to go see a movie, and maybe the movie would be satisfying. But the thought that the money is actually hard at work in somebody's life - that's vastly more satisfying, in my book. (I also find it a handy way to squirrel away little self-earmarked savings funds. If I intend to put aside $100 toward a future bathroom remodeling, but I put it into my regular savings account, I am really bad at keeping track of my specific intention for that money; it just vanishes into the ebb and flow of funds. But it's easy to remember that the $100 investment to Tanzania has a specific purpose.)

Monday, December 01, 2008

a viral Bible campaign

A different topic today, though still with an open-source tie-in.

I've never seen anybody offering free audiobook CDs of the Bible. The only audiobook Bibles I've ever seen were actually kind of expensive.

How come? Unless you live on Mars, somebody has thrust a free paper Bible into your hands at least once in your life. Yet, if you drive a car, you have sometimes stooped to listening to painfully worthless crud on the radio just to alleviate the boredom of driving. If you'd had an audiobook Bible, you probably would have listened to it, if only for your cultural education.

Yet a bit of websearching suggests that, holy cow, this actually hasn't been done yet. Am I wrong?

Probably one reason is that the only well-known translation that isn't strictly copyrighted is the King James Version, which is perfect if you intend to do outreach to 17th-century England. No CD players there, though, so it's not so useful for this purpose.

Alas that all the well-known translation committees apparently preceded or were unaware of the open-source/creative-commons movement. Especially since, you know, Jesus did kind of INVENT the GPL for crying out loud. And explicitly applied it to his teaching. Hello. "Freely you have received; freely give".

Anyway, there is, fortunately, one English translation that is freely distributable, the World English Version, and one site that's done voice recordings of it, audiotreasure.

So here's a plan for a viral campaign.

1. Make up a master audio CD from audiotreasure's MP files. I'm really not ambitious enough to try for more than one CD's worth, so I hope at least the Gospel of Mark will fit. If not, make a new recording with someonewhotalksreallyfast. Or something.
2. Compose a nice CD label. Include the URL (#4)
3. Write a nice letter asking permission to distribute the CDs without charge from places where you find bored drivers: fast-food restaurants, truck stops, etc.
4. Set up a website with the files from #1-3, and instructions on how anybody else can do step #5, becoming another viral site of distribution. It looks like you can make a homemade, home-labelled CD for $0.25 or less, so anybody with a computer can make a hundred or two with a modest commitment.
5. Burn some CDs, label them, get permission and distribute them.
6. Hopefully, others join in and the campaign spreads...
7. Profit! Oh, wait, I guess not.

I'm excited. I plan to do this. I wonder if I can get CDs out there by Christmas? However, if you move faster than me and want to set up the seed site, go for it!

I'm sure the Gideons would have started this years ago, if only their grandkids had taught them how. (I'm teasing! Hey, if any Gideons or similar groups should read this, yes of COURSE you can use the idea.)

Wednesday, November 19, 2008

Python 3.0: what to do?

In recent months, many people considering taking up Python have asked me what Python beginners should do about the release of Python 3.0. Here's your answer.

nothing


To be more specific,
1. Install Python 2.6
2. (optional) Learn Python 3.0 syntax, and use it in Python 2.6.

It's been confusing, I admit; people hear about Python 3.0 and naturally wonder if Python 2.6 is now obsolete. No, Python 2.6 is specifically designed to make a smooth transition by accepting both Python 3.0 and 2.5 syntax.

The problem with installing Python 3.0 right away is that it will take a while before all the juicy third-party modules are available for 3.0. They should be available immediately for 2.6, though, since 2.6 can run them exactly as 2.5 does.

If you learn and use Python 3.0 syntax, then the code you're writing now in Python 2.6 will work in 3.0 in the future when your third-party modules are ready and you want to convert.

And if you'd rather ignore it all? That's fine, too. The differences are really pretty slight, and if you put off updating all your Python code for a year or two, it will be a very minor endeavor.

In short, it's really nothing to lose sleep over. And you absolutely don't need to hold off on learning Python until the situation is "more stable" - Python 2.6 provides you with a stable platform right now that bridges Python's past and future nicely.

Thursday, October 30, 2008

Sprechen Sie GNU/Linux?

My boss has been supportive of my love for open-source, but I've never really been able to make him understand what makes it commercially viable. I think I finally blundered across the right analogy, though.

Simon and Schuster could develop a proprietary written language for their authors to write fiction in. Then, they could try to persuade people to learn Simon-and-Schusterese in order to read their books. In fact, if they did a fantastic job of marketing, they might persuade people to buy the right to learn Simon-and-Schusterese, then buy the books. Meanwhile, their legal department would chase down anybody using Simon-and-Schusterese without proper payment and licensing. Random House, HarperCollins, etc. could do the same with their own proprietary corporate languages. It's vastly more practical, though, for everybody to write in - and sell in - a language that nobody owns, everyone can use, and everyone contributes to.

Of course, in the real world, shared human languages came before publishing companies. But if, somehow, things had happened the other way around, you can see how there would be some initial skepticism (What? Give away our language for free? When we could charge money for it?), but companies that started working with a shared language would eventually dominate, and society would be much richer and more literate for it.

Wednesday, October 29, 2008

cmd2 0.4, now with testing

cmd2 0.4 has been released. Its biggest new feature is transcript-based testing. Basically, you can write a test suite for your cmd2-based application just this easily:

1. Add to your application script (suppose it's myCmd2App.py):

from cmd2 import Cmd2TestCase
class TestMyAppCase(Cmd2TestCase):
CmdApp = CmdLineApp
transcriptFileName = 'exampleSession.txt'

parser = optparse.OptionParser()
parser.add_option('-t', '--test', dest='unittests', action='store_true', default=False, help='Run unit test suite')
(callopts, callargs) = parser.parse_args()
if callopts.unittests:
sys.argv = [sys.argv[0]] # the --test argument upsets unittest.main()
unittest.main()
else:
app = CmdLineApp()
app.cmdloop()
2. Run a session of your application. Run all the commands you want to test.

3. Cut-and-paste your entire session into exampleSession.txt.

4. Run python myCmd2App.py -t

Ta-da! cmd2 runs runs your app, issues all the commands saved in exampleSession.txt, and verifies that they produce the same output as in your transcript. Now you can change your app fearlessly without bugs sneaking in.

Finally, cmd2 is now available for Python 2.4 through 2.6.

Tuesday, October 28, 2008

Monty Python Fluxx

We are so going to play this game at PyCon.

Maybe I'll go to a talk or two, too. Between games.

Tuesday, October 21, 2008

sqlpython: getting crowded in here

I've come across two other SQL command-line clients lately, both written in Python:

pysql, like sqlpython, is for Oracle only.

sqlcmd is intended to work across all sorts of database backends (Oracle, postgreSQL, MySQL, etc.) seamlessly.

I intend to publicly review them soon. In the meantime, thought I'd let you know of their existence.

Saturday, October 18, 2008

speaking at IEEE

In my ongoing campaign to teach Python to every multicellular organism in Ohio, I'm bringing my Smash, Crash, Kaboom Course in Python (you know, the one with the exploding planets) to this Tuesday's meeting of the IEEE-Dayton Section Computer Society Meeting. The chapter invites non-members to attend, too; no charge, but $3 to buy into the pizza.

The talk materials are here.

October 21, 2008 11:3012:30pm
Introduction to Python
Lockheed Martin Corporate Sales
2940 Presidential Drive, Suite 290
Fairborn, OH, 45324 USA

This hCalendar event brought to you by the hCalendar Creator.

Monday, October 13, 2008

Counting votes: You're doing it wrong

I have to admit, the first time I heard about people mistrusting computerized voting, I just felt amused. Silly Luddites, I thought. After all, how hard can it be for a computer to count?

Really hard, it turns out, if you start with the stupid premise that you ought to write every byte of the software from scratch, incorporating no preexisting software of known and verifiable quality. That's the approach that proprietary vending machine makers have taken - presumably to lend credibility to their patents.

There's a new interview with the Ohio Secretary of State, Jennifer Brunner, where she talks very frankly about the serious problems Ohio has found with its voting software. I'm glad Ohio now offers a paper ballot option. I'm going to use it. I truly have no idea what happened to my 2004 vote.

There's a perfect solution waiting to be used: PVote by Ka-Ping Yee, one of the Python community's greats. In his interview with NPR's Science Friday, he describes how voting software should and can be written: as a minimal, readable, high-level program that relies on existing open-source components of thoroughly-verified quality. Ka-Ping, my vote is for you.

PyOhio's table at Ohio LinuxFest

This year, PyOhio decided to buy table space in the nonprofit exhibitors' area of Ohio LinuxFest to publicize PyOhio (as well as PyCon and Python in general).

It was a really good decision! The "hallway track" is one of the most interesting parts of any conference, of course, but when you have a table of interesting stuff to draw people in and start conversations about, it goes to the next level. I barely made it into any formally scheduled events at all, and had lots of fun meeting people from the big and growing open-source community. I tried to preserve my voice, but I was half-hoarse by the time my 4:00 talk started.
  • Ponyshow was a big hit - it caught peoples' eye and drew them over to the table. I'd still like to add more flashy graphics to it for next year, though - I ran short on time, and had trouble installing pyglet. Tables in the nonprofit zone lacked electricity, but I used two laptops to get around that - one on display at the table and one recharging at an outlet elsewhere.
  • Python stickers donated by PyCon were an even bigger hit. If 1/2 the people who took a sticker are using or will use Python, we've got a very healthy community here!
  • I whipped up a homemade PyOhio banner that went pretty well. I projected our logo onto a wall, traced the outline, used an Exacto knife to make a stencil from the pattern, then used some fabric spray paint.
  • For next year: bring candy. We may see if we can do a swag raffle of our own, too.
  • A rerun of last year's Python introduction went well. The Python Beginners' Hackathon was good, but small. We'll have to think about what might need changes there.
  • I really like the idea of PyOhio running something on the Friday of next year's LinuxFest. Join the pyohio-organizers mailing list to help kick around ideas for that.

There was a lot of interest among the attendees. There were more people already actively using Python than I expected, and virtually everyone else knew Python as something they wanted to learn more about. I think we'll see that reflected in an even bigger and more intense PyOhio next year.

Saturday, October 11, 2008

Ohio LinuxFest 2008 - talk materials

Thanks to my Ohio LinuxFest audience for learning some Python with me! The talk materials are here.

Here's the "Resources for Python Learners" handout.

I had a great time at OLF, particularly in the "hallway track"; we have a really fun and growing open-source community in Ohio. Go, us!

Monday, September 29, 2008

I can plot that data in two keystrokes

(plus a carriage return)

One of the ideas I most gleefully stole from YASQL for sqlpython is special terminators, sequences like \g and \c that replace a SELECT statement's ending semicolon. When a query ends with a special terminator, the output is specially formatted: \c gives CSV, \h gives HTML, \t gives transposed (columns as rows / rows as columns), etc. Type help terminators for details.

sqlpython 1.5.0 is out today, with the most demented special output format yet: CHARTS! Instant ad-hoc grapical goodness direct from your query, no tedious mucking around in spreadsheets or exporting to another program. Just terminate your query with \l (line graph), \L (scatter graph - no lines), \p (pie chart), or \b (bar graph).





Also, as of 1.5.0, it's pretty easy to define your own special terminators and formats. Just install sqlpython in uncompressed form (easy_install -UZ will do that), open up output_templates.py, and follow the pattern.

Tuesday, September 23, 2008

ponyshow: showing off in Python

PyOhio is getting a table at Ohio LinuxFest to advertise PyOhio and Python in general. We're going to set up a computer running demonstrations of eye-catching Python tricks - stuff passing geeks can look at and think, "Hunh! That's pretty cool! I'm going to try this Python thing."

To run the demo, I've written a little script called ponyshow. You can use it yourself (on *nix) - install Mercurial, then
hg clone http://hg.assembla.com/ponyshow ponyshow

I need suggestions for what to put in the show! If you had a few lines of code to show why you love Python, what would they be? Importing modules is fine - I'm certainly going to show off vPython and pyglet, for example. What would you show?

Tuesday, September 16, 2008

more area events

Ohio LinuxFest isn't the only major geeky event coming up in our area. Also check out:

Thursday, September 11, 2008

Geek Event Finder: now working

It's working! The Geek Event Finder on Google App Engine! Go play!

In some ways, the Google App Engine is a dream. Not thinking about the app server is wonderful. Deploying couldn't be easier.

I hate the GAE datastore with the passion of a thousand blazing suns, however. 90% of the work of this project has been trying to figure out workarounds and kludges for its bizzare limitations, like
  • There is no mass delete. None. No truncate. No way to get rid of a large number of records at once.
  • Bulk upload exists, but it always appends to the datastore - never replaces - which brings you right back to the "no mass delete" problem.
  • No long-running operations - anything that would take more than a couple seconds dies - so you can't loop over all your records to do something (like delete them).
  • Countless unexpected restrictions on queries. Can't filter on one property while sorting on another. Can't do inequality filters on more than one property. Can't filter on a string property if it is multiline (has \n's) or is longer than 500 characters (type Text). Can't use any function calls or arithmetic within a WHERE clause. Queries that fetch a large number of records die instead of completing (so I fetch in LIMIT 20 batches and assemble the results on the app side... crazy).
So if you look at the code and see some incredibly stupid stuff going on with data access - trust me, I tried fifteen different sane ways first. I am so not buying the buzz about this being "the future of databases". Fighting for hours to try to kludge your way to your data... that's the Bad Old Days, not the future.

My workaround for mass deletion was to write pages that would delete one record, then invoke it in a loop from my client computer. That has to run all night to clean out the datastore when new data is uploaded.

But anyway. I'm still very happy. It works!

Ohio LinuxFest

Ohio LinuxFest is Oct. 11 - one month from today!

It's free, it's fabulous. Missing it would be like missing your own birthday. Go get registered!


The PyOhio gang is going cook up some good stuff to do - a table in the midway, a Python workshop in the Open Spaces, etc. Let me know if you have ideas and/or if you'd like to help staff the table.

Tuesday, September 02, 2008

BigTable blues

This was supposed to be the blog entry where I would announce the Geek Event Aggregator's successful port to Google App Engine.

(sigh)

I've read an awful lot of buzz about how GAE's BigTable is the Next Big Thing in data, makes RDBMS obsolete, etc. Maybe I'm just doing it wrong, but right now I am utterly unimpressed.

The Geek Event Aggregator needs to search its database of 5000 or so events for events whose longitude and latitude are close enough to the user to be of interest. Does that sound so impossible?

I couldn't do it in GAE. First, "Inequality Filters Are Allowed On One Property Only" - so I can filter for longitude or latitude, but not both. I had to filter only for longitude, pull all resulting records into the application, and finish boiling the ocean in my app. It was slow, in the local application environment, but I hoped it would run faster once uploaded to the actual GAE production servers.

In production, though, it doesn't run at all - "Timeout: datastore timeout: operation took too long.". Querying from 5000 records - too much for the mighty BigTable, apparently. Dropping the filters on longitude (to do all the filtering in the app, in case inequality filtering is just so poisonous) didn't help, either.

Oh well. I still enjoyed working with GAE at first, and maybe I'll use it again for something with very light data demands. For the Geek Event Aggregator, I do have a server available where I can host in TurboGears - it'll just take a bit of rewriting. Later this week, hopefully.

Tuesday, August 26, 2008

recursive dowload with wget

I often need to download documentation for offline use. Online docs typically come as a finely branched tree of separate .html files; sometimes a one-page or PDF version is also available, but those aren't as convenient to use.

I'd gotten sick of using "File/Save As..." from my browser again and again, but Firefox shortcuts like DownThemAll flattened the directory structure, broke the internal links, and didn't crawl them to get sub-pages.

The answer, of course, was in my /usr/bin all along: wget.
catherine@Elli:~/docs$ wget --recursive --convert-links \
> --page-requisites --no-parent \
> http://www.postgresql.org/docs/8.3/interactive/index.html

or, shortcut form,

catherine@Elli:~/docs$ wget -rkp -np \
> http://www.postgresql.org/docs/8.3/interactive/index.html

pulls down the everything beneath the index page, and it turns out perfectly, with a single command!

--convert-links adjusts all the internal hyperlinks so they'll work perfectly in your downloaded version.

Without --no-parent, wget would find the link to "Home" and download everything under that.

--page-requisites makes sure you get the images, stylesheets, etc. for your pages to work properly.

Now bookmark the downloaded top page in firefox, give the bookmark a keyword, and voila! Now just typing your keyword into the Firefox URL bar gets you to your perfect offline mirror.

Friday, August 22, 2008

Regex skirt review

I got my xkcd regex skirt as a birthday present (funny what subtle hints like "this is exactly what I want for my birthday please please please" will do), so I thought I'd give a review. An hReview-microformatted review, of course.

gloriously geeky, if flawed

Aug 22, 2008 by
Catherine Devlin
()
photo of 'XKCD Regex Cheat Skirt'

Rating: 4 of 5

We've all got a drawer full of geeky T-shirts. But what about a geeky skirt? Thanks to XKCD, it finally exists!

The text is regular expressions syntax reminders, oriented upside down so you can read it while you sit. Simple stuff, like:


Must escape: \|()[{^$*+?
^ start of string
$ end of string
[^abc] ^ means not
\n Newline
{N,M} N to M

The font is large, comfortable to read while sitting. I wish the lines weren't double-spaced - I think 1.5 spacing would make the text look more like a trendy decorative hem accent.

The sizes run big. I wear 10's or 12's, ordered the medium, and it is more than big enough, even without the stretchiness. It's a soft, stretchy fabric, stretchy enough to do Rockettes high-kicks if that's what you do (but programming pays better).

The hem falls a bit above the knee, but not at all "you are not leaving the house like that young lady" high.

I'm a little disappointed in the craftsmanship, to tell the truth, for the $35. It kind of looks like a skirt made by T-shirt makers - it's two simple trapezoidal panels sewn together. The text leaves a fairly broad gap at each edge of the panels, making it really obvious where the side seams are. (I guess that could be considered a fashion choice, but I prefer hiding the seams.) The print is that slightly raised plasticky print, and I have zero confidence in its longevity. I will obviously not only have to launder it gently as advised, but also refrain from wearing it every single day. Save it for geeky occasions where it will be properly appreciated.

Nonetheless, it is far and away my favorite skirt, because it is far and away the winner of the "geekiest skirt ever" contest, and that trumps everything in my book.

This hReview brought to you by the hReview Creator.

Thursday, August 14, 2008

taking FOSS to the people

It's all very well to invite newbies to come to your Linux group, but you're not going to get really new people that way. Coming to a meeting or an Installfest is a commitment that demands strong, specific curiosity at the very least. Chances are, if someone knows enough about Linux to know that they want to know Linux, they're going to learn it, helpful usergroup or not. That's especially true now that the entry barrier is so low with super-easy distributions like Ubuntu. But what about those who don't know what they're missing?

That's why some of us from Dayton Linux User Group are considering renting a booth at the Montgomery County Fair. We can set up several computers and let people touch, try, and see just how easy it is - people who had never even heard of Linux or open-source, people who had no idea there was a choice, who thought that Microsoft was just how computers run. Step right up, folks. Surf a webpage, write a document, edit a spreadsheet. It's real, and it doesn't bite.

"Do you know that Tux loves you, and has a wonderful plan for your computer?"

(WOW, if only I had cartooning talent, I would make THE BEST mockup of a lowbrow evangelical tract there has ever been.)

(Wait a minute. Since when did that require cartooning talent?)

(Incidentally, I really am a hardcore Christian. Seriously. Maybe that's why this sort of thing appeals to me so much. "Freely you have received, freely give"; Jesus wrote the GPL!)

The only thing that may stop us is the booth fee: $270. It's reasonable, all things considered, but it's still a sizable hat to pass around for a small group.

Anyway, whether we get this together in time for the fair or not, I'd love to get other ideas for where to take a show like this. The fair is perfect because it has a whole lot of people milling around looking for something interesting. Where else?

Tuesday, July 29, 2008

Good Kids and Open Spaces

Not everything at PyOhio was perfect, of course. In particular, we were frustrated that we didn't get more participation in the Open Spaces. Some of the attendees pretty much took a spot in the auditorium, watched the scheduled talks, and went home. I think they were satisfied, but those attendees missed out on a lot.

I wasn't too surprised, since even PyCon wrestles with how to encourage Open Space participation. Many PyOhio attendees were inexperienced conference-goers with absolutely no experience with Open Spaces. But I don't think unfamiliarity was the only barrier.

Back in high school, I was one of the Good Kids. I was Born to be Mild. I went to class early, sat down, readied my notebooks, and waited for the teacher to start. I did not hang around in the hallway gossiping. I certainly did not cut class!

I think most people who become programmers started out as Good Kids, and that's part of why this is hard. We can put a preachy message in the program guide singing the virtues of Open Spaces and the hallway track, of informal, collaborative learning - but they were Good Kids, and they're not buying it. When we say, "get into unplanned discussions, skip some scheduled talks in favor of Open Spaces", it sounds to them like "cut class and hang out." No wonder it's a tough sell! Closing their ears to that is exactly how they became educated enough to be at a programming conference in the first place. In high school, the things your peers could teach you would probably get you arrested, hospitalized, and/or pregnant.

So we've got some ideas to get people over this psychological hump for PyOhio 2009. We're going to use panel discussions to ease people from listening into talking, try a schedule that forces people to get up and move around and bump into each other, and leave time slots where there are no scheduled talks.

Honest, everybody, it's OK. One Good Kid to another.

[EDIT: Let me make clear that this wasn't the only thing keeping people in their seats. We had a jam-packed schedule - gave in to the "fit everything in" temptation, I'm afraid; the Open Space rooms were distant from the main lecture room; and there was no natural transition to a hanging-out space when the library closed at 6. We'll certainly be looking hard for ways to improve those for PyOhio 2009.]

Sunday, July 27, 2008

PyOhio: wow

Wow. PyOhio went great. I have so much to say, I hardly know where to start. Expect multiple posts.

The hope was to duplicate some of the learning and atmosphere of PyCon on the small scale. I really think we achieved it. The talks were excellent, attendee enthusiasm was high, and plenty of people stepped up to the tasks that needed doing.

THANK YOU to everybody who was involved!

Not everything was perfect, of course. I'll devote a full post to glitches and mistakes. But in general, I'm extremely happy. We could have sat around wondering whether this area could really support a good regional conference, but instead, we just went ahead and did the experiment, and the answer is clear: yes, it can and it did!

Check out some of the neat swag donation we got from WearPython and Apress!

Friday, July 18, 2008

PyOhio: one more week

PyOhio is Saturday, July 26!

Please register right away - it helps us schedule talks properly and guarantees you entry, food, and swag.

What sort of Open Spaces do you want to take part in? Do you want to do a poster? How about a Lightning Talk?

See you there!

Thursday, July 03, 2008

serendipity

I just met with Amanda Laucher at the Blue Moose Cafe in Morgantown, WV.

I don't live here; she doesn't live here; we weren't at a conference; we didn't expect to meet. We were both in town on family visits, and both seeking out an internet fix. (I'm visiting my father-in-law at Ruby Hospital - but writing Python there, hah.)

She's a serious geek-community addict like me - she's organizing the DevLink Bus. She gave me great advice for PyOhio and tipped me off to other upcoming events, and I gave her some ideas from PyCon. It was great!

That's just really cool. Someday, when wireless access is ubiquitous, geekish nomads will no longer concentrate themselves in a handful of WiFi hotspots, and unforeseeable meetings like these will become more rare. That will be the downside of the future.

Thursday, June 12, 2008

cx_Oracle and Oracle XE on Ubuntu

Simplifying options have appeared since the last time I posted about installing cx_Oracle against Oracle XE on Ubuntu, so I thought I'd produce an updated, simplified summary.
  1. Install Oracle XE from Oracle's own repository of .deb files
  2. export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$ORACLE_HOME/bin:$PATH
  3. sudo apt-get install python-dev python-setuptools
    sudo -E easy_install cx_Oracle

    The -E flag carries your environment variables into your sudo session; if you omit it, you may get a cannot locate an Oracle software installation error.
  4. Test:
    $ python
    >>> import cx_Oracle
    >>> cnxn = cx_Oracle.connect('system/mysystempassword@xe')
    >>> crsr = cnxn.cursor()
    >>> crsr.execute('SELECT * FROM dual')

Monday, June 09, 2008

cmd2 0.3.4

I just keep having fun with cmd2 (and with sqlpython, which is built on cmd2 and inherits its goodies). The latest:
  • If you use > to redirect output and omit a destination filename, your output will go into the paste buffer. Then you can Ctrl-V and paste it into any window.
  • You can use the pipe symbol (|) just like in Unix, to redirect output into any shell command.

Friday, May 30, 2008

geographical anonymity

On the Internet, nobody knows you live in Dogtown.

I've volunteered to do the publicity for PyOhio. I guess it's going really well. Two months out, we've already got 80 people signed up for the PyOhio announcements mailing list. If we assume that most of them will come to PyOhio, plus some others, and that the numbers will keep growing... maybe I'd better relax before we max out the library's capacity.

Still, bootstrapping a regional community is an interesting challenge. It's easy to go out on the internet and find a bazillion people who use Python - but how many of them are in or near Ohio? The wonderfully free-floating nature of the Internet and the open-source community, where geography is irrelevant, can become frustrating when geography actually is relevant.

Finding local companies is even harder. Most companies' websites try to give the impression that they have no geographical location whatsoever - wouldn't want to put off a potential client just because they're on another continent, after all. They also try to avoid mentioning the languages they use, again trying not to appear limited. (In a sense, that's a very good thing, because end users should shop for brains, not tools - it's just difficult for this application.) Finally, with a technology like Python, many of us users sneak it into our jobs without our higher-ups even knowing it, much less promoting it as a strength of their companies.

Any ideas? Googling for "Python Ohio" gets... well, me. Looking for "Python" plus the domain names of Ohio universities is helping a bit. (Universities, unlike businesses, do publicize their physical locations and the technologies they use.)

Anyway, if you've been thinking of submitting an abstract for PyOhio, quit thinking and write; our deadline is June 1 (this Sunday). And don't forget to blog...

That number again:

PyOhio
Regional Python programming miniconference

July 26th, 2008
Columbus Metropolitan Library
96 S. Grant Ave.
Columbus, OH 43215
USA


(Side note: Blogger's captchas are very near the threshhold of legibility, and getting worse. If I quit posting, I guess you'll know why.)

Wednesday, May 21, 2008

slides from SQL*Plus Alternatives

I've posted my slides from today's GCOUG presentation here.

Thanks for being a great audience! Feel free to contact me to ask questions about SQLPython or request new features.

Thursday, May 15, 2008

cmd2 0.3.0

I'm speaking on SQL*Plus alternatives again on Wednesday at GCOUG, and trying to polish up sqlpython a bit in preparation for that. That required polishing cmd2; I've been increasingly embarrassed that cmd2 used homemade code (flagReader) to interpret --options --like --these, instead of using a perfectly good module from the standard library (optparse).

Optparse is not designed for iterative cmd-type apps where you remain at an application prompt after issuing each command - it keeps issuing sys.exit()s to kick you back to the shell. That was my excuse for not using it earlier, but once I decided to fix it, a little subclassing took care of it.

Next I got a little deeper into decorators than I'd ever been, to provide a concise way to specify those options:

@options([make_option('-k', '--ketchup', action="store_true", help="Ketchup on that?"),
[make_option('-r', '--relish', help="relish (sweet or dill)")])
def do_hotdog(self, arg, opts):
if opts.relish:
self.stdout.write('One dog with %s relish\n' % opts.relish)
if opts.ketchup:
self.stdout.write('Hope you're not wearing white!\n')

That was pretty fun. Took some experimentation and this article, though, to figure out how to write a decorator that would accept an argument.

I didn't throw away the homemade ("flagReader") code, for backward compatibility; I issue a DeprecationWarning instead. I did throw away the guts and reimplement it as a wrapper around optparse. I managed to do that part on a single 20-minute bus ride, thanks to good doctests on flagReader. I feel so grown-up!

Finally, inspired by Brandon Rhodes' article in the March 2008 Python magazine, I tried supporting buildout deployments this time. I'm not sure I'm getting it quite right yet; expect it to actually work in cmd2 0.3.1.

Tuesday, May 06, 2008

PyOhio Call for Proposals

PyOhio: Call for Presentations

PyOhio, the first annual Python programming mini-conference for Ohio and surrounding areas will take place Saturday, July 26, in Columbus, Ohio. The conference is free of change and will include scheduled presentations, Lighting Talks and unconference-style Open Spaces.

You can read more about the conference at http://pyohio.org

PyOhio invites all interested people to present scheduled talks. All presentations are expected to last 40 minutes with a 10 minute question-and-answer period. PyOhio will accept abstracts covering any area of Python programming. A classroom area with computers will also be available for possible hands-on sessions.

All presentations proposals should submit abstracts no longer than 500 words in length. Abstracts must include the title, summary of the presentation, the expertise level targeted, and a brief description of the area of Python programming it relates to.

All proposals should be emailed to for review.

The submission deadline will be June 1, 2008. Accepted proposals will be notified by July 1.

Friday, May 02, 2008

choose the tool last

Yesterday, someone asked me if I could design "an MS Access database" for him.

Growl.

As I reflected on it, I realized that the problem is not really the particular technology specified - the problem is that the technology was specified at all before the need was described.

If I offered to make you anything you wanted for dinner, would you ask for "something made with a Teflon spatula?" If you did, I'd tell you, "No no no no no. Describe what you want to eat, and let me figure out what I'm going to use to cook it."

My potential client didn't literally mean that he wanted MS Access to be used, he meant that he wants a database with a GUI interface. He thinks of "Access database" as a way to describe that, because it's the only thing he's ever seen used to build products vaguely resembling the one he's imagining. It's nothing more than a limitation of vocabulary and experience.

The problem is that, so often, that kind of pidgin is taken literally. Tools are pre-selected far too early - while the business users are imagining their needs, before the geeks themselves are even involved,

As a result, there are a lot of geeks out there trying to beat eggs with Teflon spatulas.

My story ends happily, however. My potential client got it when I explained this, and we're going to meet so I can find out what he wants. Then - and only then - will we start discussing which tools to use.

Thursday, April 24, 2008

Penguicon talk materials

Ooh - sorry, I got distracted! Here, at last, are the materials for my talk last Saturday, "Into the Dayta-b'hase: A First-Level Introductory Adventure".

A tarball is here with the slides (dnd.html), queries run (scripts.sql), and a big SQL script to set up the database (dnd.sql)

Monday, April 14, 2008

tax rant

ABSTRACT

Citibank spends a lot of time imploring their customers to go to all-electronic statements... but they don't improve their electronic statement availability to make them practical. Ohio Dept. of Taxation spends a lot of time imploring people to file electronically... but they can't be bothered to test their forms, or to provide a feedback button so that end users can notify them of errors they find.

This is a bad pattern. If you want people to go electronic, focus on getting it right, not on pro-electronic cheerleading.

* * * * *


Ohio has a "use tax" - a law requiring that you add up all your mail-order and interstate purchases from out of state so you can retroactively pay Ohio sales tax on them with your tax return. I think six or seven of us actually obey this law, and the folks at the bureau of taxation laugh, blow a kazoo, and scrawl "PATSY!" on the return whenever they come across someone who paid it. Oh, well.

Digging up records on all these purchases sucks. Citibank, though I love their customer support*, didn't help. (You can download your last six statements, one at a time... or, after March, you can request a PDF report of the whole last year - please allow two business days for your request to be processed. Excuse me? Some people store information on devices called "computers"? A year of credit card statements is about 50 KB... I think you can afford to keep that on disk. Ask Google if you're hard up, they'll give you a few gigs.)

So anyway... I finally, FINALLY, splice electronic records and sift paper records and total up my internet purchases for the year... open up the Adobe form from tax.ohio.gov... and...

...and the line to enter your quantity of out-of-state purchases is not editable. It is pre-set to zero and locked.

One good thing has come out of tonight: I found wesabe, a really nice site for slurping up records from your various accounts automatically. Next year I won't need to fight Citibank, because my Wesabe account will keep itself updated all year long. Wesabe, I'm happy to say, gets it right. Free services generally do, as opposed to people I pay, who generally get it wrong. It's a strange era we live in.

(* - When my credit card was stolen years ago, Citibank was absolutely wonderful to me. It'll take a lot of blundering to erode the goodwill they earned from me then.)

Tuesday, April 08, 2008

PyOhio

It's official! We have a place, we have a date... now all we need is you!

PyOhio
Regional Python programming miniconference
July 26th, 2008
Columbus Metropolitan Library
96 S. Grant Ave.
Columbus, OH 43215 USA

Friday, April 04, 2008

Alas, Mendelson's

Mendelson's is planning to shrink their store and relocate. This is very sad news. I can only hope they don't shrink too much or move too far. Fortunately, they have no timetable for this move yet, and if we're lucky a giant asteroid will hit the earth and wipe us all out first.

If you don't know Mendelson's, the best way I can describe it is "a Jawa sandcrawler parked in downtown Dayton". It's a giant industrial salvage shop, the most amazing pile of thingies and whatsits you can imagine. I consider it the most entertaining location in our fair city. If you can walk through Mendelson's without saying, "MY robot will have THIS!", then you are already dead.

Tuesday, April 01, 2008

Beautiful Visual Python examples

The best thing that can happen, when you try to teach something, is to have somebody learn it and do something that amazes you. That's exactly what happened after my demo of Visual Python at CodeMash... Doug Mair started to play with vPython and came up with two really beautiful examples: a (working!) Rubik's Cube and a set of magnetized disks.

Thank you, Doug!

Monday, March 24, 2008

PyOhio

PyOhio

a regional Python miniconference


Ohio had a good representation at PyCon, and we agreed that the time has come.

http://pyohio.org

announcement-only list: http://mail.python.org/mailman/listinfo/pyohio

planning list: http://mail.python.org/mailman/listinfo/pyohio-organizers

Almost everything is up in the air right now... all we know for certain is that we're aiming for one day, presumably a Saturday, in the Columbus, OH area. Join us, and help the plan take shape!

Friday, March 21, 2008

Teach Me Twisted

I got home from PyCon last night, having stayed for sprints for the first time (I'll blog about that later). It was amazing.

One of the amazing things was Steve Holden's Teach Me Twisted session. I came out of simple curiosity; I witnessed the invention of a whole new form of teaching, I think.

Steve had the front of the room and a laptop with a projector, just as if he were teaching a conventional class - only he wasn't teaching, he was learning. All he had, to begin with, were some ideas of what Twisted could do, not how to do them. "So, how would I use Twisted to check if my website is up?", he began. The Twisted experts sprinkled throughout the audience talked him through it. Steve asked questions to move the session along, and channeled the discussion to keep it focused on his needs as a learner. In particular, when the Twisted experts started waxing eloquent on subtleties or engaging each other in esoteric discussions, Steve cut them off and redirected them back into the task at hand - the task of directing a beginner.

It was wonderfully effective! When you think about it, the standard classroom arrangement gives all the power to the teacher, which is precisely where it doesn't belong, because the teacher is distanced from the learners' needs. By the time you're an expert, you've forgotten what it was like to be ignorant. Bad teachers even forget how to pity the ignorant, using the podium to demonstrate their mastery of the subject to an imaginary audience of fellow masters. Good teachers try to be responsive to the learners' needs, but the arrangement conspires against them. They're like a blindfolded chauffeur, trying to find the road by the verbal instructions of their passengers, who may be too shy to even speak up. It's very hard for a learner to muster the courage to tell a teacher, "I still don't understand what you're saying, and your tangents aren't helping."

By taking the role of the ultimate, empowered learner, Steve turned all that on its head, and made for a session that really was all about the learners' needs to learn. Yet even the experts said afterward that they, too, had learned from it. Perhaps that's because it harnessed the multi-directional, easygoing, collaborative spirit of a good Open Space session, while remaining technical and specific, not wandering into vague chitchat. Bravo, Steve!

Pycon-organizers is buzzing about it, with perhaps overambitious dreams of immediately start a whole series of "Teach Me..." sessions. I'm thinking about trying it out at a local Dynamic Languages SIG meeting. Teach Me Ruby, SIG guys?

Wednesday, March 19, 2008

PyCon Cleveland 2010: Python Rocks!

PyCon is coming to Cleveland in 2010!

OK, I understand there are some other places bidding to host PyCon - some podunk towns like San Francisco and Atlanta - and I'm sure the PyCon organizers will hear their bids attentively, because they're generous people. But, c'mon, you don't seriously think anybody but Cleveland could win, do you? After all, Cleveland is Cleveland, and the others are not!

Anyway, if you want to help bring PyCon to Cleveland, it's time to join the ClePy mailing list and start figuring out how to make it happen.

Saturday, March 15, 2008

Live from PyCon

Yesterday, I was wondering whether this year's PyCon was really turning out to be as amazing as its attendance suggested.

I'm not wondering today. I saw some excellent conventional talks earlier in the day. Mike Bayer showed yummy new SQLAlchemy with infectuous enthusiasm. Kumar McMillan gave a blessedly clear explanation of Unicode in Python. Brandon Rhodes laid out ideas like Adapter patterns very nicely, and showed magnificent stage presence, too.

During discussion of Boston's PyCon 2010 bid:

Steve Holden: "I'm not surprised food is expensive. You send them perfectly good tea, and they throw it in the harbor."

And then, as the pre-scheduled talks ended, the Open Space board went white-hot. I learned a lot at well-attended Open Spaces for DevChix, DBSprockets, and usergroup leaders, and could have enjoyed a dozen other sessions if only I could fork myself.

Right now, I'm finishing my day at Steve's "Teach Me Twisted" session, and wow. I didn't even really care about Twisted, I just wanted to see how the learner-driven idea would work out, and it's going great. About a dozen fat brains and fifty hungry brains are here, and Steve is doing a masterful job of herding us along with skill and humor. How he's managing to absorb this all at the same time as he guides it along with well-placed questions, I don't know. I guess that's what years of teaching experience can do.

Itamar Shtull-Trauring: "Can't we refactor the code a bit more?"
Alex Martelli: "No."

Monday, March 10, 2008

KDE 4: wait

I'm a habitual early adopter. For instance, I moved my production databases to Oracle 11g weeks ago. So, naturally, I had to try the new Kubuntu with KDE 4.0. Sometimes, however, "alpha" really means "alpha", as in "nope, it's not ready yet, leave it alone unless you really want to suffer for science".

So far, these are the features from earlier Kubuntu / KDE combinations that aren't working for me on the new Hardy / KDE4 alpha-alpha.
  • response to volume / mute buttons on hardware
  • Automatic mounting of USB drives (the device doesn't show up under /media until after you've navigated into it with Dolphin)
  • Alt-Tab switching between windows (AAAAAARGH!)
This last one brings it to the threshhold of unusability, and I'll probably uninstall, unless I can find a keyboard shortcut to switching windows soon (and I've had little luck finding a good users' introduction to KDE4). Now, I'm sure there's lots of wonderful stuff about KDE4. I think there's an eternal tension between brilliant designers who improve products and ungrateful users who do nothing but gripe. That's because, if you introduce fifty new features that will please me greatly - when I get around to learning to use them - while, at the same time, breaking five old features that I know and have come to rely on... well, I say the new version "sucks". It isn't fair, is it? But it's the way it works.

Sunday, March 09, 2008

learner-driven Open Space

Over one thousand registrations are in the system for PyCon 2008. Over 2**10, actually. Amazing!

After exulting a bit over that kind of growth, I moved on to worrying about whether PyCon can keep the magic that makes it so great as it grows. A look through the still-forming Open Space schedule quickly reassured me. For instance, Steve Holden has scheduled an Open Space session called "Teach Me Twisted" - not because he knows Twisted, but because he wants to learn it. So he's challenged the Twisted community to come and teach it, and it looks like they're responding.

Learner-driven content - I love it!

Thursday, February 28, 2008

Introducing Mixed

As far as I know, the Cheese Shop didn't have any way to handle fractions and mixed numbers... until now. Introducing mixed.
>>> print Mixed('-1 1/2') + 2
1/2
>>> print Mixed('3/4') + Mixed('1/2')
1 1/4
>>> print Mixed('-1-1/4') * 2
-2 1/2

You'll feel like you're in second grade all over again!

easy_install mixed to get it.

I hosted the code on Assembla, which has free mercurial repository hosting, so anybody who wants to polish it up is welcome to! hg clone http://hg.assembla.com/mixed_python mixed_python gets you a copy of the repository.

And all this because I was importing into a table last night and noticed some mixed numbers. A normal human being would have just converted them to floats in her head and gone to bed...

Sunday, February 24, 2008

Speaking at PenguiCon

I really enjoyed last year's PenguiCon - science fiction geekery and FOSS geekery make a surprisingly nice combination, with the SF people adding a nice lightheartedness to the atmosphere.

I'm giving a talk again this year, but this time, it will have nothing to do with Python - really! I'm going to try some of that hybrid vigor for my own talk, hoping that a fun theme will leaven a potentially dry topic.

Into the Dayta-b'hase: A First-level Introductory Adventure
April 19th, 2:00

Relational database technology underpins modern business, finance, engineering, and a lot of other boring stuff. You know you ought to learn something about databases, but how can you stay awake long enough? Come see database software used for something that actually matters: D&D characters. We'll set up a postgreSQL database, demonstrate all the fundamentals of relational databases, and advance Gruk the Unbathed to 4th level.

Northfield B
Hilton Detroit/Troy-Auburn Hills
5500 Crooks Rd
Troy, MI 48098 USA
(248)879-2100

Friday, February 22, 2008

how to spoil an OSS conference

I'm expecting to be in Washington D.C. on April 22-23, so imagine my delight when I learned of a "Military Open Source Software Conference" at that very time... in that very place! I work on a military contract! What could be better?

Now imagine my shock when I went to register. $1.945. For two days. Two days!

This, folks, is the problem with conferences run by for-profit training companies instead of volunteer organizations. No, wait, it's just one of the problems.
26 Senior Experts from: OSD, BTA, DHS, DON/CIO, AFAE, SPAWAR, FCS-BCT PO, HPCPO NGA, NASA/JPL, PEO-STI, USACE, Hill AFB, BAE, Boeing, Northrop Grumman, Lockheed Martin, Unisys, IBM, CSC, Rockwell Collins, Sun, Booz Allen Hamilton, Autodesk, SEI, and Mercury
What's wrong with this list? Not one representative of any open-source project! With a speakers' list like that, I don't know if it's even worth pilfering a hotel catering uniform and a pitcher of ice water to go eavesdrop on the talks.

Apparently, the topic is limited to decisions regarding open-source at a managerial level, rather than the actual use of the software and participation in its communities. That shows a serious lack of understanding. Breaking the separations between decisionmakers, code-writers, and users is part of what gives open source its power.

And suppose you, as an attendee, wish to suggest a topic, present a talk, or facilitate a discussion? Well, you can't. There's no provision for participation by the attendee community. Again, they very seriously do not get it, only seeing one-way relationships from paid content creators to passive content receivers. It seems that, just as "you can write COBOL in any language", you can buy proprietary software under any license.

It all makes me extra-grateful to the volunteers who run conferences like PyCon. (Register by March 7!)

Thursday, February 21, 2008

VC cloning into an existing directory

Mercurial won't let me clone into an existing directory.

This is a problem when trying to put (only) a subset of files under version control. For example, an Oracle installation includes an enormous directory structure. A few of its files really, really ought to be under version control (init.ora, tnsnames.ora, etc.); most shouldn't. I need an hg repository in the root of the Oracle software installation. Then, when I set up Oracle on a new machine, I need to clone that repository into the new machine's Oracle root... even though the new machine's Oracle root already exists and is chock-full of files.

$ hg clone src target
abort: destination 'target' already exists


I'm surprised that there's no --overwrite flag for hg clone, or anything like it, saying "go ahead and clone into that directory even though it already exists." Perhaps it's simply because VC programmers are software developers, used to working with a clean slate rather than configuring an existing directory structure? Anyway, I made up a script workaround.

hg clone $1 $1_clone_temp
cp -r $1_clone_temp/* $2/
rm -r $1_clone_temp


Or, in Windows,

hg clone %1 %1_clone_temp
xcopy /e /s /h /g /y %1_clone_temp %2
rmdir /s /q %1_clone_temp


Thanks to the Linuxchix irc channel for helping me figure out the syntax.

Dayton Oracle SIG

At last, it's time for DAY-O to meet!

Meeting of Dayton-Oracle SIG (DAY-O)

March 10, 2008, 5:30 pm
A hands-on, cooperative, laboratory-style meeting. Bring a wireless-enabled laptop if you have one. This meeting's topic will be Flashback.
Mary-Ann's Kitchen
33 N Ludlow St
Dayton OH 45402 USA
(937) 222-3663

Wednesday, February 13, 2008

Access forbidden. Attempted work detected.

The forbidden-content blocker at my worksite is more stupid than the one at your worksite. Doubt me? "Computing/Internet" is one of its forbidden categories. Blogs, another forbidden category, are the biggest problem because, as you know if you're reading this, most of the good code samples in existence these days are on blogs. We aren't allowed to appeal categories, only individual sites.

When I whined about it to my boss, he reminded me that I've done some work with web-scraping, and that I could probably write a Python script to make an exemption request for thousands of blogs at once, including ones I've never seen but might Google up someday. It'll benefit thousands of geeks across the organization, and maybe even convince somebody that they should turn the "stupid" dial down a notch.

I love my boss.

Here's the plan:
1. whitelist and blacklist of known legit and non-legit sites, respectively
2. count words. Words that appear much more frequently on whitelisted sites than on blacklisted are positive scorers, and vice versa.
3. apply the scoring vs. unknown sites. Hand-check a lot of results. Beef up the whitelists and blacklists and repeat until the scores against new sites are reliable.

Oddly enough, the hardest part of the process is gathering a long enough blacklist. I'm not just talking porn - I need harmless but non-work-related stuff, blogs where people are writing about their Irish setter instead of their SQL queries. (I need bunches of them - dozens, at least - so don't just comment to tell me, "My blog is useless and banal!")

One of the best sources I've found so far has been googling for "typical stupid blog".

Friday, February 01, 2008

TechFest 2008

If you're near Dayton, and you have a child, or know a child, or can find a child, or feel like a child, then you really need to get to TechFest!

Hands-on science and technology family fun
Feb. 16, 10 AM - 6 PM; Feb. 17, 11 AM - 5 PM
Sinclair Community College - Ponitz Center
444 W. Third St., Dayton, OH

I'm afraid the information technology people haven't traditionally brought stuff with quite the "wow" factor that the physical scientists and engineers bring. What's something we computer geeks could do that would compete with the chemists' goo-making or the physicists' pneumatic implosions? Have to think about that one.

in school, not even a Smurfette

So far, I've taken my smashing-planets introduction to Python to two groups of college students: the Wright State chapter of ACM and an OO programming class at University of Dayton. It's been lots of fun. I appreciate the chance to show young people something I really love, something I think can make their computer work more productive and more fun. My thanks to the folks who decided to invite me and the students who gave me their attention.

But. If I don't see a woman student in computer science soon - just, for crying out loud, one woman student - I am going to... I don't know. I'm going to have to research "how to go berserk".

What's going on in this country? I think I'd see better gender balance in a classroom in Iran.

Packet from table 6

I wish I knew more about networking. I have a technical need that I can barely describe, much less name.

For our new Dayton Oracle SIG, we want to run interactive, laboratory-style meetings. We'll meet in a place with wireless, one member will bring a laptop running an Oracle server and Oracle Application Server, and other members will use their laptops to access it and muck around.

This requires the computers using the wireless network to access not just the internet, but each other. I'd call this "peer-to-peer" networking, but it's really "peer-to-router-to-peer".

If I connect to my wireless at home and issue ifconfig, it reports eth1 ... inet addr:192.168.1.45. For other machines connected to the same router, that IP address is as usable as anything on the internet. If Oracle and Apache are running on the machine, I can use 192.168.1.45:1521 and 192.168.1.45:80 to log into the database or view webpages from other machines. If I go into my router and set Port Forwarding to ship incoming traffic to 192.168.1.45, then those become visible to the wider internet... but, to access them within the wireless network, I don't even need to do that. (In fact, I don't see any way I could turn it off even if I wanted to.)

So all we need is a meeting location that allows the same thing. It's not that simple, though. As far as I can tell, the wireless at Panera Bread (my first choice) doesn't permit this kind of inter-machine connection. That locally assigned IP address doesn't produce any response from other machines in the same network; it seems the router simply doesn't route traffic between machines. For security's sake, that kind of makes sense; I wouldn't want somebody hacking my database from the next table over. (Actually, if they did, I'd invite them to the SIG, but that's me.) But it removes some really neat possibilities for interaction.

I've found one place so far - the Hope Hotel in Fairborn - where the wireless does allow connections between machines. I was all ready to declare the hotel restaurant our meeting location, until my boss reminded me that it's full of GIANT TELEVISION SCREENS BLARING SPORTS and some people don't tune that out as automatically as I do.

I suppose there's always the option of bringing a router with me... but then I'd have to bridge people's traffic up to the internet somehow. I'm sure it can be done, it's just something I've never developed the skills for, nor do I own a particularly portable router. Hmm...

Thursday, January 24, 2008

Chicago

CODE Hacker for the World,
Programming Tool Maker, Stacker of w00t,
Player with Rails and the Nation's Error Handler,
SourceForge, Cheese Shop, CPAN,
City of the Big Dynamic Language Conferences:...

I just found out that Chicago, after hosting PyCon in March, will host YAPC::NA in June, and hosted RailsConf in 2006. Crazy!

Dave Barry's Only Travel Guide You'll Ever Need makes a joke that every single state claims to be "dynamic". Looks like they all lose to Chicago, though, because that's where the real dynamic types come to play.

Sunday, January 13, 2008

brilliant PyCon publicity ideas

I was alarmed to find that many of the attendees at CodeMash didn't know that PyCon 2008 will be in Chicago - right here in our beloved Midwest.

So, as volunteer publicity coordinator, I thought I should brainstorm on more ways to get the word out. Here's what I've come up with so far.
  • National "got whitespace?" skywriting campaign
  • Spread urban legend about programmer whose kidneys are stolen by organ smugglers when he fails to attend PyCon
  • Invite presidential candidates to debate their choice of Python web framework at PyCon
  • Post hilarious "DO NOT WANT STATIC MANIFEST TYPING!!1!" pic at icanhascheezburger
  • Vote Guido into final round of American Idol
  • Bribe fortune cookie factory employee to replace fortunes with "PYCON 2008 CHICAGO IN BED"
  • Use laser to engrave giant announcement in the moon's surface
  • JEN IN TEARS AFTER ANGELINA'S LIGHTNING TALK
Please supply more ideas in the comments... (serious ideas doubly welcome!)

CodeMash slides

Thanks, everybody, for another great CodeMash - even better than last year! More babbling about it will follow when I have time,

As promised, the material from my presentation. It's almost identical to my LinuxFest presentation of last September.

Saturday, January 05, 2008

Introducing cmd2

cmd is a Python Standard Library module for constructing command-prompt applications. It's very easy to use - just subclass its Cmd type, create an instance, and call that instance's .cmdloop(). To support a command, just write a do_yourcommandname(self, arg) method within your Cmd instance.

cmd is also very bare-bones. It forms the backbone of sqlpython, and while improving that package, I've created cmd2. cmd2 is an extension for cmd that adds helpful functionality without requiring any changes to cmd-based applications.
  • Searchable command history
  • Load commands from file, save to file, edit commands in file
  • Multi-line commands
  • Case-insensitive commands
  • Special-character shortcut commands (beyond cmd's "@" and "!")
  • Settable environment parameters
  • Parsing commands with flags

I've found several alternatives to cmd in the Cheese Shop - CmdLoop, cly, CMdO, and pycopia. cly looks wonderful, but I haven't been able to get it working under Windows, and that's a show-stopper for many potential sqlpython users. In any case, none of the alternatives are based on cmd - they're written from scratch, which means that a cmd-based app would need complete rewriting to use them. I like sticking close to the Standard Library whenever possible. cmd2 lets you do that.

Switching a cmd application to cmd2 is as simple as changing from from cmd import Cmd to from cmd2 import Cmd, and the new functionality is ready to go. See a usage example of cmd2.

It's in the Cheese Shop, so you can easy_install cmd2. (Cheese Shop page for cmd2)

Thursday, January 03, 2008

Geek Event Aggregator code

I've told several people that I would post the code for the Geek Event Aggregator "as soon as I get it cleaned up".

Today, I swallowed my pride and admitted that I've really got to post something - that the much-needed code cleanup isn't going to happen for months. So, I created a page for it at Google Code: http://code.google.com/p/whatwhenwhere/

Not that you want to do that. It's ugly. Really. It will be cleaned up someday, but if you really want to make use of it now, there it is.

I decided to name the project "whatwhenwhere" because the code might well be used to aggregate events that are not at all geeky, and to host it at Google Code because, well, I'd never tried it.

Most of the stuff you might be conceivably interested in is in scan.py, ship.py, and events/model.py.