Skip to content

Weblog About Jim Jim's Resume Discussion Mailing List Search
  You are not logged in Link icon Log in Link icon Join
You are here: have browser, will travel

Twitter Updates
Pro Services

Jim Roepcke specializes in WebObjects (Java), Plone (Zope, Python), and Cocoa (Objective-C).

  • consultation
  • development
  • documentation
  • mentoring

Contact Jim for more information.

Python Tutorial

I presented the Introduction to Python for Plone developers tutorial at the first Plone conference in October 2003. Slides and Video are available to all on the plone.org site.

Badges

Proud Member of the ACM

Proud Member of the Association for Computing Machinery

RSS reader for Mac OS X

NetNewsWire: More news, less junk. Faster

Fantasy Trading of HBWT at:

Listed on BlogShares

Design by:

Powered by Plone
Blog Directory - Blogged
Log in
Name

Password

 
I forgot my password; please send me a new one.
 


Friday, March 16, 2007

Warning: I'm migrating between mail servers

I signed up for a new hosting provider yesterday, and tonight I flipped the switch on the DNS changes. So, long story short, if you are sending me important mail right now, please follow up with an IM or a phone call.

Thanks!

Thread: 0 replies. reply Last updated: 1:44 AM

Wednesday, March 14, 2007

Penguins stay in Pittsburgh

Yahoo! Sports: Penguins, officials strike arena deal to keep team in Pittsburgh

I'm very glad for Pittsburgh, but it would have been interesting to see an NHL team in Las Vegas. I'm not sure if I'm happy that the Oilers won't have to play the Pens more often (since they remain in different conferences) or be disappointed that us westerners won't see more of that exciting young team...

Thread: 0 replies. reply Last updated: 12:36 PM

Tuesday, March 13, 2007

PETAL and Perl, why must you suck?

In CSC 370 (Database Systems), our current assignment is to write a bunch of UDFs for accessing our local IMDB database, then write programs in 2 languages that display all of the information available about a single production, in HTML. This (like all assignments in this course) is a group assignment.

I chose Python, because it's what I've been using most recently and therefore it would be the easiest to write code quickly in.

One of my team members chose Perl. Ouch, but at least I'm not writing it!

I finished mine last week. I used Python, psycopg2 for PostgreSQL access, and SimpleTAL for templating (again, since TAL is what I've been using most recently and therefore would be fastest to get the job done - but also because TAL is sweet). The program is short and sweet.

In a meeting last week I demoed the program to the group. The fellow using Perl liked the TAL template made and we agreed it would be cool to reuse it for his solution. After all, PETAL is a Perl port of TAL, so why not.

He was having a lot of trouble getting PETAL to accept the data he was giving it. I decided to help him out, even though I haven't written Perl in years, 2 heads may be better than 1.

First of all: After all these years, I still hate Perl! I've never understood how people enjoy writing software with it. Then there's PETAL. I'm sorry to be rude (porting TAL to another platform is a nice thing to do), but what the hell were they smoking when they decided to change the TAL namespace from "tal" to "petal"?

Instead of the standard tal:content, tal:repeat, tal:condition, etc., as the TAL specification states, PETAL uses petal:content, petal:repeat, petal:condition! Now we need two versions of the template - one that uses tal: attributes for SimpleTAL, and one that uses petal: attributes for PETAL. A key advantage of TAL's design is being language neutral, and PETAL threw it out.

Also, the documentation and cookbooks we could find did NOT help us get the damn thing working. All we wanted to do was pass it hashes and arrays of hashes with data from SQL queries executed with DBI. But no matter which combination of stupid variable prefixes we used, it wouldn't work. How hard should it be to pass a hash containing keys to things like arrays of hashes, hashes and other simple values? In Python it's dead simple. It just works.

We ended up having to scour Google for some sample code to figure out what actually works. After a while I finally found this message to a mailing list with some DBI and PETAL code. After adapting our program to use the syntax used in that message, we got it working.

Today's lesson: Perl sucks, so I shouldn't be so surprised when Perl-based libraries don't improve the situation.

Thread: 0 replies. reply Last updated: 5:11 PM


March, 2007
Sun Mon Tue Wed Thu Fri Sat
  1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Feb  Apr
 
Sponsors
Research

Jim Roepcke is Willing to Fail

Books

I'm currently reading:

I'm currently reading Programming Erlang

I co-authored:

I co-authored this book