Tuesday, January 27, 2009

complexity

Fire up a program like Eclipse or Visual Studio and start a new project. Blam! It creates a dense forest of code files, text files, configuration files, XML files, directories, subdirectories, assistant directories, deputy directories, acting deputy subdirectories, and special liason to the ad-hoc subcommittee directories.

Java and C# people seem to think this is great. "Look at all this work the tool does for you!"

I disagree. "What IS all this stuff?" I wail. "What's it for? What's it doing? My program is already hopelessly complex and I haven't even started writing it yet! Guido, take me away!" A tutorial may tell me to start on one file and ignore everything else, but that's completely unsatisfying psychologically. I feel like I'm learning nothing because I'm at the mercy of so much auto-generated stuff I can't even hope to understand.

This, I think, is my biggest barrier to learning the "enterprisey" languages.

I admit, starting a project in TurboGears or Django does something kind of similar, and I tolerate it there. I think that's because I know Python well and can handle a limited amount of temporary mystery. It's when I'm trying to dip into a brand-new language and a brand-new environment that I want a small, digestible bite of mystery to get my mind around.

[ADDENDUM]

I'm beginning to think that what might get me over this hurdle is a C# tutorial that specifically avoids Visual Studio and similar IDEs... that gives projects and examples in old-fashioned code files in a text editor - and as few files as possible - even if that seems crazy to VS junkies, if it means the examples are a lot more painstaking and a lot less impressive. But that's what I need - I need to feel like the code I'm writing really encompasses the problem, isn't just a little flourish atop a vast understructure that I didn't write and don't understand. Then, after a while of that, I can start dipping into the IDEs and perhaps appreciate the code generation, rather than dreading it.

Any pointers to a C# tutorial along those lines would be most welcome.

Friday, January 23, 2009

Reinteract

Shortly after semi-finishing pyparsing_helper, I realized that it's really not needed, because there's a tool called Reinteract that can fill the same role, plus much more.

Reinteract is a graphical Python session that lets you tinker with your code at any point and get an immediate recalculation. That's what pyparsing_helper does, too, but pyparsing_helper is specialized for pyparsing use, whereas reinteract is suitable for any Python. Here's reinteract applied to a pyparsing example.

Reinteract is also more sophisticated and versatile, so I'm afraid pyparsing_helper's short time in the sun has been eclipsed. I'm happy to have found this new tool, though!

Monday, January 19, 2009

New Year's Resolution (blogging while angry)

From now on, before spending any significant money on anything, I will test their customer service phone number. If I cannot get to a human being who is reasonably helpful, I will not become a customer.

Understand, I'm all for saving money by automating customer service where possible. But many companies (AT&T Wireless, for example) now make ad hoc, human-interaction support literally unavailable. A demonstrated intent to avoid customer contact is a sign of a bad business partner, and I will not support such bad business practices anymore. (steam, steam, steam)

Friday, January 16, 2009

coworking for the rest of us

Ah, so many ways to learn from each other.
  • Formal conferences and meetings. "Eyes-front" presentations.

  • Getting together with the geeks for chat.

  • Unconferences and open spaces. Lots of potential for multi-directional learning, yet shaped around specific topics.

  • Sprinting: gathering to code together with people outside your usual circle on specific projects. GiveCamps.

And yet, there's a new one: hanging out and geeking out with other geeks. Programming with, or around, people who aren't your usual co-workers. Like sprinting, sort of, but on no predefined topic. Questions, advice, and ideas bubbling around unpredictably while you code.

That's basically what the CodeJam at CodeMash was, and I loved it. Even if you already work every day with a wealth of fiercely creative, inquisitive, knowledgable co-workers who are delighted to pitch ideas into your project - and not all of us do - it's still a benefit to mix it up with some new minds.

That happened just a week ago, yet suddenly, I'm seeing it everywhere. In Cincinnati, they're doing an evening called "bitslingers". In Ann Arbor, they're doing a daylong Code Retreat.

Solo from-home workers developed this a while ago; they call it "coworking". Now we cubicle monkeys are getting some chances at it, too. I'd love to see this carried to its logical extreme - a custom of getting out to work in new places with new people, say, one day a week. I think the payoff would be enormous.

Sunday, January 11, 2009

pyparsing_helper

I'm back from CodeMash!

I got a lot of great ideas, and I especially liked Wednesday's CodeJam, where I started building pyparsing_helper. Hacking on code while surrounded by sharp people to absorb energy and advice from is a great way to get things done! I finished it on the way home, so pyparsing_helper is officially a child of CodeMash!


This is what I had in mind when imagining "Kodos for pyparsing" last week.

One big bad fly in my ointment: pasting into pyparsing_helper isn't working. I don't know why. That's top priority for fixing for v0.1.1; I wonder if I'll have to switch out of Tk to get it to work.

easy_install pyparsing_helper

[EDIT:] Paste does work under Windows, and it looks like it's an inherent Tkinter flaw... what's up with that? Tkinter's only been around for, oh, 15 years or so - and this core function is still unfixed? Maybe that's why all the cool kids quit using it years ago.

[EDIT #2:] OK, paste did work in *nix, but only in its Shift-Insert variety. pyparsing_helper 0.1.1 (available now) makes the more familiar Ctrl-V pasting available, too.

Monday, January 05, 2009

new baby

Items shipped on December 30, 2008:
Delivery estimate: January 6, 2009
1 package via USPSTrack your package
  • 1 of: One Laptop per Child XO Laptop (Give a Laptop, Get a Laptop)
    Sold by: OLPC Foundation (seller profile)
Before or after I leave for CodeMash? I MUST KNOW!

Well, even if the new baby doesn't arrive on time, I'm very much looking forward to CodeMash. It's very hard to decide what to do, though, particularly with the Precompiler day. I like the CodeJam idea best, but I'll have to see if the particulars of the project appeal to me - and I'd want to do it in a platform I don't yet know, and I'm not sure whether I could be effective that way. And a whole day of absorbing Ruby from Jim Weirich would certainly be an entertaining alternative. But maybe I should do the .NET tutorial... knowing some .NET would really help me get going in IronPython. Decisions, decisions... what a nice dilemma!

Friday, January 02, 2009

domain name woes

I bought the domain name for nerdstogether.org from 1and1.com, but I'm now realizing that domain name ownership isn't as straightforward as I thought.

Apparently, the Domain Name Servers of the world have not been alerted that nerdstogether.org now points to 66.35.48.8, the IP address where I'm hosting nerdstogether. Instead, they believe that it points to a server at 1and1, which then is responsible for passing the request along to my machine.

1and1 offers two choices for how this can be done.

HTTP forwarding

This simply sends the user's browser off to 66.35.48.8. There are two drawbacks:
  • The browser's URL bar shows 66.35.48.8; "nerdstogether.org" would be much prettier.
  • 1and1 truncates the URL before sending it on; this makes RESTful access impossible, since http://nerdstogether.org/dayton goes to 66.35.48.8/ instead of 66.35.48.8/dayton

Frame redirect

In this case, 1and1 hosts a webpage which simply contains a single frame; the contents of this frame are requested from my server. This looks better, since the user's URL bar continues to display "nerdstogether.org". Furthermore, 1and1 does attach the remainder of the requested URL, so RESTful access remains possible.

The problem? I'd like to provide not just visible HTML access from this domain, but a JSON web service as well. JSON data should be returned raw, as "content-type: text/json", not as an HTML frame embedded in an HTML webpage. No web service consumer can digest that! So I need to distribute a separate URL, with my raw IP address, to web service consumers.

Virtual servers

Finally, both HTTP forwarding and frame redirect also make virtual servers impossible. I'd like to serve multiple unrelated websites from my machine, which I can do by configuring my webserver to react differently based on whether the URL requested was for nerdstogether.org or for a different domain name. Unfortunately, either of 1and1's options remove this information from the request before it is passed along to my machine; my machine only sees a request with its IP address. The fact that nerdstogether.org was the domain name requested is not passed along.

It's still possible to host multiple sites, by specifying a separate directory within 66.35.48.8 for each separate domain. Virtual servers would enable a cleaner separation between sites, though, with no possibility of navigating back up the directory hierarchy.

As far as I can tell, there is no ideal solution for me, aside from buying my domain name from a different provider, one who would actually propagate my domain name ownership out through the worldwide DNS network. I don't even know what the term would be for that kind of "full ownership" of a domain name.

This is my first trip through this wilderness, and I'd be delighted if I've missed some better solution that someone wise can point out to me.

Thursday, January 01, 2009

nerdstogether.org

Happy New Year! And a happy new name for The Application Formerly Known As Geek Event Aggregator (or geekeventfinder). Say hello to

nerdstogether.org

It's your one-stop resource for finding out, "How can I get together with some nerds in <insert place here>?"

nerdstogether.org comes with an exciting new feature: it actually works now. No, really. Go try it.

I achieved this by using some cutting-edge technology called "CGI scripting" and a "database". The problem of gathering the data has been pretty much solved for literally years, but I kept trying to find Web 2.0-ish solutions for getting the data to you: Oracle Application Express, Google Calendar, Google App Engine. All of them seemed great at first, but eventually frustrated me to tears.

The one nod to Web 2.0 is the very helpful use of Yahoo and Google web services for interpreting location information.

Anyway. I was so proud I actually bought a domain name for it. So go use and enjoy, and suggest missing events for it, and I'll see you at the VIC-20 club in Kalamazoo.

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.