Showing posts with label geek celebrities. Show all posts
Showing posts with label geek celebrities. Show all posts

Wednesday, November 2, 2011

Loving the bunch class

Warning

This is me playing around with things in Python. It's not anything I use in real projects (except maybe the odd test). Please don't use these in anything important or you'll regret it.
Every play with a bunch class? I love 'em and make them protected or unprotected. I started using them early in my Python career, although it wasn't nearly about 2 years ago that I learned what they were called and the best way to code them. In any case, here is a simple, unprotected Bunch class.
# Simple unprotected Python bunch class
class Bunch(object):

    def __init__(self, **kwargs):
        self.__dict__.update(kwargs)

bunch = Bunch(name='Loving the bunch class')
print(bunch.name)

You can also make protected ones, that don't let pesky developers like me overwrite attributes, methods, and properties by accident:

# Simple protected Python bunch class
class ProtectedBunch(object):
    """ Use this when you don't want to overwrite existing methods and data """

    def __init__(self, **kwargs):
        for k, v in kwargs.items():
            if k not in self.__dict__:
                self.__dict__[k] = v

You can also write them to raise errors when a key is in self.__dict__. Or perhaps merely publish a warning. There are many ways to customize, but generally you want to keep these things as simple as possible. Anyway, let's get back to the main topic...

In the early days of my experiences with Python I found a small, nagging issue with dictionaries and objects. The notation wasn't as handy as what you got with JavaScript and some other languages I was using at the time. For example:
// JavaScript object notation
o = {};
o.name = 'Loving the bunch class';
o.name; // Calling with 'dot' notation
o['name']; // Calling with 'bracket' notation  

Unfortunately, in Python you can't do this with a normal bunch class:
# Python bunch class failing on bracket notation
class Bunch(object):

    def __init__(self, **kwargs):
        self.__dict__.update(kwargs)

bunch = Bunch(name='Loving the bunch class')
print(bunch.name)
print(bunch['name'])
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'Bunch' object is not subscriptable

The quick answer is found with a little trick I found in the comments of a recipie by Alex Martelli that gives you the ability to do:
# Fancy dictionary/object trick
class Buncher(dict):
    """ Warning: DON'T USE THIS IN REAL PROJECTS """

    def __init__(self,**kw):
        dict.__init__(self,kw)
        self.__dict__.update(kw)

bunch = Bunch(name='Loving the bunch class')
print(bunch.name)
print(bunch['name'])

I'm not the only one who likes Bunch classes. On PyPI I found a really complete implementation.

Of course, in a lot of cases you probably don't want this 'weight of code', right? Dictionaries being lighter than full objects and all that. Nevertheless, it's fun for noodling and playing around with code. Still, I'm thinking it might be a fun little project to take a group of bunch implementations and do performance checks on them versus each other and dictionaries. Maybe the 'performance hit' isn't so bad.

I should also dig into things like defaultdict and other constructs to learn more. Part of the fun of any programming language is the depth of even the 'simplest' components of the language.

Friday, October 14, 2011

PyCodeConf 2011 Report

As my fiancee said, "PyCodeConf is a new kind of Python conference with a radically different format. Speakers are invited to speak about whatever they desire relating to the theme ("The Future of Python"), in front of a room of round tables. In between talks there are long breaks to encourage discussion. As a result, talks are edgier, and you really get to know people and possibly shape the future together."

This summer (2011) I was invited by Chris Wanstrath to be an invited speaker at the first ever PyCodeConf, to be held in Miami, Florida. I've been using Git and Github since early 2009, and more importantly, I've known Chris since DjangoCon 2009. I've always appreciated his interest in not just providing tools for the community, but also his efforts across languages and platforms to improve the lives of developers and those who support developers. And that he and his partners seem to make a pretty penny at it and share what they make (drink-ups and now conferences) is only a good thing in my opinion.

So I accepted Chris' invitation. :-)

The theme for the conference was the future of Python, and I submitted a talk proposal about Collaboration. Chris helped me figure my talk topic, which was awfully nice of him. Shortly afterwards my fiancee, Audrey Roy, received her own invitation to speak.

Between the time that Chris invited me to speak and the start of conference, Chris Williams of JS Conf got involved.

Alright, let's review things...

Accommodations


Everyone stayed in the Epic Hotel, in downtown Miami. The rooms fit the name of the hotel, being Epic in size and having amazing stuff in them. The rooms had free/good internet if you signed up for a hotel mailing list. Since we rehearsed and polished talks the night before the conference we ordered room service and were pleased with what we ate. The hotel had a heated outdoor pool on the 14th floor, which I'll get into later. In any case, the only time I've been in a comparable hotel was the incredible arrangements provided by the PyCon New Zealand folks who put us up in the Museum Hotel for a few days.

Sure, $189/night is high, but 3 nights when you split it with 2 or more people makes it not so bad.

Result: Superb

Conference Meals


If you are serving me food, you can't go wrong with salmon, steak, good cheese, fresh vegetables, coffee, and juice. I can report that PyCodeConf did quite well in this regard.

Outside of the conference I really enjoyed the food. Andiamo was a crazy good pizza place. I also got some really nice grouper which you can only seem to get in Florida.

Result: Superb

The Conference Room


The conference took place on the 14th floor of the Epic Hotel. This was a single track conference, with all the talks were given in the same room. The room was large, but everyone had a comfortable seat at large round tables. That was a nice touch, because it encouraged you to socialize with everyone nearby.

That worked out for the most part, except for a couple of developers sitting at a table who had backs turned to the speakers and were talking loudly while pair programming or something. I asked them to quiet down but 30 seconds later they were back at it. We moved away, but in retrospect considering their rudeness, I should have politely asked them to take it outside.

Anyway, the acoustics were good, the temperature comfortable, and the seats comfortable.

Result: Superb

Speakers


Speaker selection was done magnificently well. There wasn't a dud within the lot of speakers. I normally expect that in any conference you'll get at least one dud talk per day, and pycodeconf didn't have that problem (unless my talk sucked).

Jesse Noller opened things up with a great encouraging talk, Raymond Hettinger gave a talk on Python basics that was so full of nuance that I'm terrified of attending an advanced talk by him, Alex Gaynor filled us with hope for PyPy, Tracy Osborn taught us how to bootstrap entrepreneur projects, Travis Oliphant wants Python core and PyPy to collaborate more with the Scientific Community, Audrey Roy gave up some of her community building secrets, David Beazly explained the issues of the GIL in terms mere mortals such as myself can understand, Gary Bernhardt gave an amazing talk comparing Python and Ruby, and Leah Culver made Django + backbone.js look easy, but if you talk to her you know whatever she does is sophisticated and not for beginners. Dustin Sallings sold me on a neat idea for testing to help catch edge cases and Armin Ronacher opened my eyes on WSGI.

The wonderful thing about these talks is that since everyone knew the upcoming tracks, or had seen the previous ones, we could relate to each other. So David Beazly, Travis Oliphant, and Avery Pennarun raised interesting concerns about PyPy that everyone got the chance to hear about. They weren't show-stopping issues, just raising awareness about things that Alex didn't cover in his talk.

I live-noted the event as much as I could, with notable gaps in Leah's talk (she talks fast and is very technical and wanted to give her my full attention) as well as Armin (his talk shocked me a bit - I'm still a WSGI newbie). You can see my efforts at my PyCodeConf live-notes.

Speaking of live-noting, Josh Bohde also live-noted the event and captured a ton of stuff I missed.

The gaps between talks were also a nice 15 minutes. That meant you could stretch your legs, get a drink, and talk to people.

Result: Superb

Parties


We (me and Audrey) missed the first party (hosted by New Relic at a place called DRB) on account of preparing for our talks. We always do our absolute best on talks, and both like to practice a lot. Also, Mark Pilgrim's disappearance had touched me and I wanted to talk about it. We heard it was a great party, so we'll assume that it was. :)

The next evening the party (hosted by Heroku) was on the 14th floor, which meant it was a pool party! There was great food, good drink, and a latin jazz band playing. One of the pools was heated, so most people stayed in there, and drank many watermelon mojitos served by the staff. The pool was a huge hit because it was comfortable and people just talked freely. No laptops, no phones, just talking. Chris Williams served us drinks himself, Chris Wanstrath got wet, and everyone just relaxed. I have to say, a heated pool party is something EVERY conference should give. MOAR POOL PARTEEZ PLEEZE!

The final night's party was at the News Lounge and was hosted by Github and Droptype. The drinks and people were awesome, and I have good memories of being in a circle listening to Chris Williams and Audrey Roy talk. I did go beyond tipsy, overdid the Capoeira, and tried to convince Chris Wanstrath to give up the whole DVCS hosting thing to do wedding planning. There was also a bunch of us getting kicked out of a Karaoke bar because of the antics of a Python core developer. Ha ha ha. It was a crazy night that took me two days to recover from.

I'm glossing some important discussions that happened while I was still sober at these two parties, and maybe in the future if things play out right I'll go over them.

Result: Superb

People


Part of attending conferences is to meet old friends and make new ones. I got to spend time with Mark Ramm, Jesse Noller, Nick Coghlan, Alex Gaynor, Ben Firshman, Armin Ronacher, Raymond Hettinger, Rachel Hettinger, Chris Wanstrath, and many other excellent people. I also got the chance to meet and befriend Kenneth Reitz, Chris Williams, David Cramer, Wayne Witzel, and Leah Culver. I'm missing at least a dozen more. It was great to put faces to people, and in some cases, hear their side of a story.

Also, I got to gush at programming heroes like David Beazly and Travis Oliphant like a total fanboy.

Believe it or not, I got a bit shy. I'm kicking myself over not introducing myself to more people. Next time!

Result: Superb

Summary


The conference was amazing. Like all conferences it had its own character and fun. Because it was a purely commercial conference I was a bit worried going into it, since I've heard about the corporate feel of these things. Those fears were completely mitigated by the open attitude and decentness of the conference organizers and sponsors. I look forward to attending PyCodeConf again in the future.

If you've got good senior technical staff and you want them to benefit from a conference, this is a good place to send them.

Overall Result: Superb

Sunday, July 31, 2011

The Ultimate Django Tutorial Workshop

That is a big statement to make as a title of a class/workshop blog post. However, in this case I believe I'm fully justified because this is going to be awesome. Here's why:

1. The teachers are beyond incredible

In the course description it says I'm the teacher and I have lab assistants. In retrospect, what I should have said is, "Daniel Greenfeld is organizing a workshop taught by the people he respects and admires".

Think I'm kidding? Look at just some of the names of people I've got lined up to participate:
Follow those links to their bios or talks and you'll see that they are the people speaking at DjangoCon.  The general idea is to get the people already speaking at DjangoCon or those who are extremely experienced in it to teach the class.

2. The teacher to student ratio is going to be really small

This is not going to be a room with a few instructors and umpteen students in it. If the class size gets big, I'm going to bring in more teachers. I'll cajole, plead, and do whatever I must to get them in the room. I don't want anyone left behind!

I want a ratio of 5 students to each teacher.

3. Class implemented with a lot of lessons learned

I've taught a bunch. So have a number of the instructors I've lined up. We know which parts of the tutorial are important to focus on, and which parts should be visited by students later on their own. This means you learn the critically important parts that get you kick-started as a Django developer.

One thing we'll try to squeeze in is deployment to one of the new Django hosts such as Djangozoom.com, Gondor.io, and ep.io. In fact, Shimon Rura, one of the co-founders of Djangozoom, participating as an instructor.

4. We're all volunteers

All the proceeds earned by the instructors for this course will be going to the Pyladies Sponsorship program. That is important for two reasons:
  1. Your attendance will help Pyladies sponsor more women to learn Python in the future.
  2. The teachers are doing this because they want to do it. They want you to learn Django.
5. It won't end at 12:30 PM

Officially the tutorial ends at 12:30PM and we should be done. Sometimes though we stumble on things  and we don't finish with the rest of the class (like me in my last C programming class). But after a lunch break I'm planning on grabbing some space and working through the rest of the tutorial with anyone who didn't complete the class.

6. The tutorial opens DjangoCon

The tutorial starts on Monday, September 5, 2011 at 9:30 AM at the Hilton Portland and Executive Tower at 921 SW Sixth Avenue in Portland, Oregon, USA. If you do plan on attending DjangoCon and are new to the framework, what a great way to get started!

7. You don't have to attend DjangoCon itself to take the tutorial

Tickets for the event are being sold separately from the conference. So if you can't take off more than one day of school or work, this is a great way to capitalize on DjangoCon.

Convinced? Here is what you need to know and do to get signed up:
  • Get a laptop running Windows 7, Mac OS X 10.5 or higher, or Ubuntu.
  • If there is no Python installed, install Python 2.7.1. DO NOT INSTALL PYTHON 3!!!
  • Make sure you have a grounding in Python. If you are new to Python you need to have finished at least half the chapters in learnpythonthehardway.org before you attend. If you come to this event with no prior Python experience you will be left behind.
  • Buy a ticket!

Thursday, March 24, 2011

I'll get you next time, Wesley Chun!

At the start of this month I laid out the Great Pycon Ribbon Game. PyCon ribbons are given to people based on their contribution to the conference. Give a tutorial, present a speech, volunteer to do grunt work, sponsor the event, be Guido van Rossum, and more each gives you a special colored ribbon you get to attach to your conference badge.

Last year I had the most of anyone except for Wesley Chun. He's one of my favorite instructors, is an author and Google App Engine advocate, and a good friend. To my five ribbons he had seven. He clearly beat me and deserved the win.

This year when I issued my ribbon challenge he immediately said that he was giving up. He had too much work and family things going on. I gave him my regrets and planned to totally crush everyone's ribbon count at the conference. I was sure I could duplicate my five ribbon effort from last year and no one else would be able to match me!

So imagine my surprise when Wesley Chun had seven, SEVEN ribbons on his badge. He beat me this year. Worse, I managed only four this year. So he didn't just beat me at the game, he opened the lead.

I'm a good loser. I don't begrudge him. Well, maybe not too much.

Next year I'll issue the challenge again. I hope you join us, since win or lose the wonderful thing about this competition is that PyCon and the community benefits.

Thursday, February 17, 2011

My Django tutorial at PyCon

Working on my tutorial slides for my PyCon class/tutorial/workshop last night I suddenly came to a stark realization.

Out of dozens of slides, only 5 of them are Pinax specific.

o.O

I think this is because the slides are a condensed version of what the best and brightest in the Django and Python community think are good practices and tools. What do I mean?
So what does this mean?

Well, I've been rethinking the mantra "Pinax is Django".  It is hard to say that when users of django-cms and satchmoproject and other frameworks can't use core Pinax components. That said, users of those tools tend to rely on same foundation: Python, Django, virtualenv, and pip and growing ecosphere of Django Packages.

Which leads me to realize that with just 5 slides pertaining to Pinax material in the tutorial, the Pinax Solutions class could be renamed "Django Solutions class with a bit of Pinax".

And this makes a lot of sense. Some of the bits that made Pinax special such as static media handling are now part of Django as of the forthcoming 1.3 release. Lessons learned from Django Uni-Form which grew out of supporting div-based forms in Pinax are helping determine the path of forms work in Django 1.4. Which means that if you are using django-cms or other CMS, django-shop or other e-commerce tools, then you are benefitting from what Pinax has done for the community.

All of this leads to my closing statements about the class/workshop: The class is about Django with a little bit of Pinax tossed in. Having in the past worked with multiple non-Pinax projects, I can assure you that the solutions presented and the workshop itself will be of use to you regardless of if your project is using that framework.

Friday, May 7, 2010

Steve Holden giving a talk on Python education

Steve Holden, Python Software Foundation chairman and all around decent guy is giving a webcast talk today at 1 pm PST (4 pm EST) about the O'Reilly school courses on Python and the upcoming O'Reilly Python certification programs. Check out the O'Reilly promotional page:


Some quick notes:

1. Steve Holden is a marvelous speaker and a great wit. Even if you don't do Python and aren't a geek its worth listen to him talk. Leaving the DC area means I won't get the chance to sit at his feet and absorb his magnificent wisdom.

2. In certain ways, I believe Python needs these kinds of certification programs. The lack of certification or any paper validation of python skills means that a number of large and conservative organizations are often hesitant to use Python. And one way to make those organizations more open to using Python is certifications. Its not the only answer, and its an answer that comes with its own set of problems, but I think that Steve and O'Reilly are a really good choice for overcoming these problems.

3. I helped Steve write the Python 1: Beginning Python. So by attending you will be supporting my work too. :)

Thursday, January 28, 2010

What I don't like about Pycon

1. Too many awesome events to attend them all

Thirty incredible tutorials, over a hundred sessions, and only Guido knows how many sprints. Everything runs concurrently even with the GIL.

However, thanks to Doug Napoleone's great Django work, its trivial to pick and publish which sessions you want to attend. Doug's work on the scheduler is just plain awesome. While just plain intuitive to use, the scheduler also has a wonderful help page.

2. I won't be doing enough session staff work.

Yeah, I'll be working a few sessions but I do want to at times to focus on things critical to me. So that means other people like you, dear reader, ought to pick up my slack.

3. Only once a year per continent

One of these years I'm going to try and hit US Pycon, EuroPycon, IndiaPycon, and all the others. This would make for an awesome year. It would be like living the life of James Tauber, Jacob Kaplan-Moss, or other geek traveller.

The negativity of this post is a joke. Please don't take it seriously. I am giddy for pycon.

Thursday, January 21, 2010

My pre-history with Plone

In the late 1990s I was working at a job doing a mix of Foxpro development, windows system administration, and help desk. I enjoyed the Foxpro development (laugh if you will) and despised the other stuff. So I was always looking for work in other places where I could be doing pure development. However, lacking much work experience at that time, or knowledge of other programming languages, or a college degree, that made switching positions really hard.

Well, one day, probably in 1999, I stumbled across a job opportunity down in Fredericksburg. I I got an email inviting me down for an interview for Zope Corporation, or maybe its predecessor. The job meant working with an obscure language called Python and a web based development system called Zope. Python seemed pretty interesting, and doing development through the browser seemed fascinating. I even looked up some articles on Yahoo (this was before Google and Wikipedia).

Alas, I did not take the job. Python seemed too different and obscure and I was already stuck in the closet with Foxpro. Fredericksburg would have involved a move from the Washington, DC area and my ex-wife and I were even then scraping the bottom of the barrel for money. We lived on the metro, lacking a vehicle between us, so just getting down to Fredericksburg was nigh impossible. So I stayed with Foxpro, eventually finding work in a few other languages before finding my current home in Python in 2005.

What might have been

In an alternative history had I interviewed and been hired for the Python/Zope job I might have worked with Guido van Rossum during his tenure at Zope Corp! I might still be deeply entrenched with Zope and subsequently Plone. My linux skills would be much better. Fredericksburg would be my home, not Arlington so I probably would not be working for NASA right now. I would have never founded NOVA-Django. Finally, the armies of Iceland would have conquered the world.

A very different universe indeed.

Next: My history with Plone

Sunday, January 3, 2010

DjangoCon 2009 videos are up!


Also, when its all said and done, I can say I was in the room to watch the Fake Jacob Kaplan-Moss.


Sunday, November 8, 2009

What I love about Python

A ways back I wrote about eight things I don't like about python. I'm in a good mood today so I'm writing about what I love about python.

Typing
Let's imagine I have long, blond hair and am named Goldilocks.
Goldilocks tried the first language and everything was rigid and method overloading was painful. Too static!

Goldilocks tried the second language and everything was too loose and crazy. Evaluators could fool you into thinking different types equaled each other, causing many false positives. Too loose!

Goldilocks tried the third language and it had some rigidity but not too much. Method overloading was so easy you did it without thinking. Evaluation gotchas were non-existent. Wonderfully dynamic and strong!
Everything is an object

To be honest, most of the time we don't care that everything is an object. We just code. However, when it counts, it just makes life so wonderful.

Intelligently named built-in functions and keywords

The functions like help(), print, list(), file(), dict(), and most other things are named elegantly and simply. Print is obvious; put, say, or echo are not.

Um... so maybe dir() and zip() are not very clear.

Whitespace
I love proper indentation. When I look at other people's code in other languages, first thing I do is start fixing their indentation issues. Python makes that so much easier for me.

Competing web frameworks

When I was first playing with Python I heard people gripe that the volume of web frameworks in Python is a bad thing. I wasn't so sure then and now I completely disagree. Competition is a good thing, and friendly competition is even better. Otherwise things go stale and the community suffers.

Python's web framework designers tend to get along really well. While the community leaned this way I believe that Mark Ramm has been instrumental in keeping things friendly.

The Community
Most of the time the python community is the best. They are open minded, smart, willing to learn, and willing to teach. And no one makes too much fun of my gushing man-crush on Guido.

23 more posts to go!

Wednesday, October 7, 2009

Have you signed up for the Django Master Class?

Django chief maintainer Jacob Kaplan-Moss is teaching a master level Django class in the Washington, DC area (actually in Springfield, VA) this October 16th.

Jacob Kaplan-Moss is one of the chief maintainers (BDFL) of the Django project. Besides being a technical guru and good teacher, Jacob is a great guy. Approachable, funny, and taught me about anchovies.

Django Master Class

Lets go over some of the hidden perks that the class description does not provide:
  • Even if you know Django already and have memorized the documentation you are sure to pick up some choice bits! BDFL FTW!
  • Ask questions at any time!
  • Provided 8 a.m. breakfast (so get there early!)
  • Provided Lunch
  • Dinner afterward with lots of fun local Django/Python people including Steve Holden
  • Accessible by metro, bus, and car
  • Lots of cheap hotels to stay at nearby so you get good sleep before and after class.

I'm signed up. Are you?

Thursday, September 10, 2009

Best DjangoCon 2009 Day Ever!

This might sound a bit familiar, but yesterday was a day I don't think I will ever be able to top again. It was one of the pinnacles of my geeky existence, and I fear that the rest of my life will be a dull effort to recapture the glory that was yesterday. Why do I think this is so?
  • Fresh Oregon state blueberry pancakes for breakfast with James Tauber, Brian Rosner, and Jannis Leidel. If you know me well, you'll understand why the pancakes were so important.
  • Great keynote speech by Ian Bicking.
  • I gave my first Django and Pinax related talk in a single combined event. Me and James Tauber gave a Pinax Tutorial that besides a demo gaff at the end went very well.
  • Saw a really good talk by my new Public Broadcasting System (PBS) friends! Those guys are really smart and I'm delighted they are in my home area.
  • I participated in my first conference panel ever! We (me, Katie Cunningham, Gary Wilson, Shawn Rider, and our host Brian Luft) told our story with getting Django (and python) into our shops. Lots of great questions at the end.
  • Finding out that my 508 form project django-uni-form isn't just used by NASA and Pinax, but also by PBS!
  • Chocolate peanut butter filled cookies for afternoon snack.
  • Got a chance to tell Chris Wanstrath not only how much I appreciated that github kept me from having to learn all the git functions besides the basic ones, but also fended off the inevitable person accosting him about github performance issues (I fully recognize that scaling complex dynamic sites can be hard).
  • The weather was amazing with a nice second trip to Powells. We should move the conference outside.
  • Fondue for dinner that was so good it shut down James Bennett for 2 minutes!
  • I witnessed my fellow NASA Dangonaut from Ames Research Center, Mark Friedenbach (NAI, NLSI) get married to his lovely fiance, Ariel Lee. Pictures to follow soon!
Best. DjangoCon. Day. Ever.

I'll say right now that yesterday tied my 'Best Pycon 2009 Day'. I'm delighted I got something just as good as that wonderful day in the same year.

By the way, watching Mark and Ariel get married was much, much better than Zed Shaw kicking me in the nuts.

Wednesday, August 19, 2009

NOVA-DUG August 19th summary

People were already there at 7:24 pm when I showed up at the Nature Conservatory lobby. They kept filtering in until 8 pm. We had another three new people show up - and all the regulars. I want to thank everyone who came, and Eric Coffman for hosting us yet again.

Some notes:
  • We introduced ourselves several times. How does one handle this when each person showing up is awesome and you want everyone to know each other throughout the meet up?
  • I did my two stock Django presentations. I need to not only touch them up and extend them, but practice them more. Thanks to the next bullet I was a bit flustered when I presented.
  • Yup, I was star struck by the presence of Steve Holden. Its funny how I can easily deal with large numbers of people but my fan boy nature screws me over when someone like a python rock star enters the room. Steve was down-to-earth though, and did an ad-hoc presentation on testing that impressed the heck out of me.
  • If Steve flusters me, what happens if I have to ever have to present with Guido in the room?!? I am Guido's biggest fan...
  • As a group, we talked about testing, wonders of django, pitfalls of django, virtualenv, and many other things. I think one presentation a night and more general talking might be good.
  • Johnny Dobbins of Media General showed up. They are in the midst of converting many newspaper and media sites to Django/Pinax from various other systems. He said once they converted everything over they would be releasing some of their code as open source.
  • Afterwards we sat outside and had drinks. We talked the state of python in the DC community and what could be done to enhance it. More on that to come!
What comes next:
  • Meet on August 30th for a Northern Virginia day of coding Pinax!
  • Meet two weeks from today on September 2, 2009 at the Nature Conservancy.

Monday, April 6, 2009

What I would change in Plone: Generic Setup

At the Washington, DC 2008 Plone Conference I took Joel Burton's awesome two day tutorial on Plone Theming. I don't do design myself, but I have implemented them from time to time. My CSS skills are weak, but Plone gives us lots out of the box so I figured this would be a great way to ramp up on skinning. Also, from a work perspective it made sense, because many Plonistas seem to care more about the engineering/database side of things rather than on the front end.

Joel's class, to put it succinctly, was magnificent. If you want to learn Plone, take one of his classes. It is well worth the money.

We learned about reorganizing viewlets on the fly, making css changes, tab controls, content well manipulation and lots, lots more. Two days of knowledge that didn't just go in one ear and out the other, but really stuck.

I was one of the tech-heavy guys in the room, and the rest were graphic designers. At first the ZMI terrified them, and the two different types of views did not go over so easily. But thanks to Joel, by the end of the two days the designers were really enjoying what they could do with Plone. Everyone felt confident and ready to move forward. The positive energy in the room was energizing!

Then it came time to 'save' the site design we had been working on. In other words, export it so it could be reused. Or sold even! We fired off Generic Setup to export things, and then...

The positive energy diminished

I'm capable of searching through Generic Setup XML files to figure out what is needed in order to capture a Plone skin. I'm sure anyone bothering to read this blog entry is the same way. Yet graphic designer skills tend to end at Photoshop, sometimes at CSS and JavaScript, rarely at PHP. Asking them to go through a few thousand lines of XML is not the way to garner good will.

There was grumbling, and mumbling. Some that were happy until that moment left the class unhappy. Not because of Joel, but because of the export tool that Plone gives us.

When I brought this up with Joel after the class, he said he was aware of it but it was beyond his control. When I brought it up with others, I got a mix of apathy or rejection of the issue. I was told by several that the designer could hand it off to a developer if this was beyond them. Or that it would be too challenging to address. I mentioned it to Tres Seaver and I believe he said he would look into it.

In retrospect, I should have made a bigger stink about it.

In my opinion, Plone should be as developer friendly as possible. Generic Setup should have an 'Export Skin' function, available via the Plone Control Panel. Not the ZMI.

And I think that this should be part of core Plone. As soon as possible. Preferably Plone 3.3.

Why?

At least half the customers you will ever have care very little about the back end. They just want a pretty and functional site. Which is why graphic designers are often so important to them. For example, how many customers do you have who care more about the comps of the graphic designers than the engineering that publishes it?

By making Plone more accessible and friendly to graphic designers, it means they will stay excited about it. Which will attract more of the graphic designer friendly customers.

It gets better.

This export utility would empower graphic designers. They will be able to create Plone skins and publish them. They can make money doing this, advertising their craft. In fact, I predict dedicated on-line stores for this sort of thing will become popular, making the cottage industry for plone skins much more viable.

Which is great for us developers who lack decent design skills. If exporting skins is easy, then I can find (and purchase) them and modify to suit customer needs. And if I need one from scratch, I can rely on a larger crowd of graphic designers.

Saturday, April 4, 2009

Jinja2 in zope

Getting Django Tempates inside of zope is not trivial. Yet getting Jinja2 to run inside of zope is easy! Use easy_install (or whatever) to fetch Jinja2 from PyPi and then from the zope debug shell:
>>> from jinja2 import Template
>>> t = Template('{{ name }} rocks!')
>>> t.render(name='Guido')
u'Guido rocks!'
So what does this mean?

It means that right now you can have Django style templates inside of Plone, Zope, Grok, et al. However, you can't mix TAL and Jinja2 in any way via template inheritence.

Off the top of my head I can think of two possible use cases:
  1. You have the HATE for XML based template languages and just need something else for all rendering of all content including HTML. This is actually a very feasible option for Grok and pure Zope application development, yet functionally impossible for Plone. Too much of Plone is woven into TAL to make this work.
  2. You are using lots of AJAX via KSS, JQuery, YUI, plain old JavaScript, etc and want something handy to help you write content coming from the server side. This is feasible in Zope, Grok, and even Plone.
The downside of using Jinja2 is that you are adding more complexity to the mix. I like simplicity. I would be very careful about using Jinja2 in Zope products, and would only consider option #2.

Thanks to the the indomitable Ian Bicking for suggesting Jinja2.

Sunday, March 29, 2009

Best Pycon 2009 Day Ever!

Yesterday was a day I don't think I will ever be able to top again. I think it was the pinnacle of my geeky existence, and I fear that the rest of my life will be a dull effort to recapture the glory that was yesterday. Why do I think this is so?
  • My project, NASA SMD Spacebook got mention during Katie Cunningham's lightning talk.
  • I lost one of the Django BFDL's dongle And everyone in the worldwide Python community saw it happen live.
  • Guido van Rossum talked about twitter in his keynote. He referred to a twit post which was Barbara Shaurrette helping me get a chance to gush at him like a screaming fan boy. So yes, Guido is aware that I exist!
  • NASA SMD Spacebook got multiple mentions in the Pinax talk by James Tauber.
  • In Ian Bicking's infamous pycon 2009 talk I managed to misspell Whiskey/Whisky twice! Once the Old Country way and once the New World way.
  • I got a 3 minute opportunity to gush like a raving fan boy to Guido before he managed to escape.
  • Zed Shaw kicked me in the nuts!
Best. Pycon. 2009. Day. Ever.

That said, in the hopes that I can top this magnificent effort, I am calling this post the 'Best Pycon 2009 Conference Day'. My hope is that maybe I can beat it in the future. I doubt it. Sob.

Update: I beat this day the next year when I met Audrey Roy.

Monday, March 23, 2009

Heading off to Pycon 2009!

Tomorrow I'm boarding a flight to go from Washington, DC to Chicago, IL to experience another Pycon. Pycon is the big Python Conference here in the USA.

You can thank the NASA Science Mission Directorate and Indyne Incorporated for sending me to Pycon 2009. I would like to toss out a hearty thank you to the following people for helping me get to this conference:
  • Ruth Netting
  • Jim Consalvi
  • Corin Turner
  • Kathryn Luke
  • Malik Abdul Mahmad
  • Candace Solomon
  • Meredith Mengel
  • Vicky Niblett
You can thank these people in person at Pycon:
  • Katie Cunningham
  • James Saint-Rossy
  • Chris Shenton
I can't wait to meet old friends and make new ones. To again gawk at the feet of Guido van Rossum and other luminaries like a gushing schoolgirl over a boy band (All with the proper decorum of course).

While I'm there I guess I need to sheepishly admit to Bruce Eckels an apology. My idea was off. Lets just say that Pycon needs to keep corporate endorsements in the vendor area. It doesn't need help anywhere else. ;)

I am taking a whopping four tutorials, then attending the full conference, then working hard through four days of sprinting. I had thought of volunteering to help with a session or two but backed off since I am not paying my own way there. Instead I will stay focused on the task at hand, which is learning, networking, and contribution to various projects that NASA SMD is interested in supporting.

Look me up if you are there. I'll be playing with the other Python, Django, Plone, Pinax, and Zope kids.

My conference schedule:
webcal://us.pycon.org/2009/conference/schedule/ical/1c68d36a70bd61ea4d0de3a5d5d7e9b8g104/

For those of you who sent me resumes, you are not forgotten! We had hoped to get formal responses to everyone by Pycon but that was not in the cards. Feel free to chat if we bump into each other.

Monday, September 15, 2008

Plone OS projects take two: Radius package and FeedFeeder package

I still haven't made up my mind. Lets go over my options, since working on either can be lots of fun. Do keep in mind my target Plone version is 3.x.

Plone Radius Package
This would be really useful for my job. A Plone package that allows authentication via Radius/RSA would likely mean lots more Plone work for NASA HQ. Once I got a functional prototype I'm sure I could get some funding for more work. Since Wichert Akkerman's pyrad python module is supposedly pure Python this makes integration really easy. I like easy integration.

One thing I like about this potential project is that it should be a pretty quick effort. Actually, the hard part will probably be finding a server to test against.

FeedFeeder Package
Reinout van Rees invited me in a response to this post to take a crack at FeedFeeder when I brought up this issue. The issue?

Feedfeeder assumes the best out of its sources, and assumes that FeedParser is going to return something nice. What if we could make FeedFeeder either assume the worst of its sources, or give FeedFeeder administrators more flexibility in how to handle feeds?

Alas, the problem with RSS (and even Atom) is that people consider the specification (if they actually look at the specification) as mere loose guidelines. I'm not going to point any fingers at anyone because I like my job, but I will say that the ability of Web Browsers to look at anything remotely like RSS and then display the contents like a feed makes life for us Plone developers a pain in the butt.

Periodically, I got people saying, "Include this as a feed!" until I trained them to realize that most RSS feeds are junk. Which is nevertheless embarrassing when the so-called feed that displays as an RSS feed in Firefox or Safari is completely screwy when it comes the XML. In fact, at my job we've pretty much forked FeedFeeder in order to support customer requests, with each RSS feed item being a custom script. The results work and yet are not very pretty.

So my big idea is this that FeedFeeder would be enhanced in one of two ways:

  1. Custom Scripts - FeedFeeder administrator can do TTW scripts (portable via Generic Setup) to control how FeedFeeder parses the incoming feed. The scripting would be restricted Python. This way the same feed that can be seen via the browser can now be interpreted by FeedFeeder as well. The problem is the normal sort of issues you get with TTW programming, especially when it comes time to validate the script, or port it around (Even with Generic Setup).
  2. Custom Plugins - How about a plugin system of some sort? Basically, you would follow a standard API and put your plugins in a particular folder. FeedFeeder would pick up the plugin and run the appropriate plugin (we would have a selector tool) against the appropriate feed. This way we could grow the functionality and robustness of the tool as more RSS and Atom feeds are added, and could also support new protocols as they become popular
Idea #1 seems quick to do, yet iffy and chock full of potential surprises, but Idea #2 seems like a solid way to do this effort.

BTW, Reinout van Rees has responded to all my posts on the subject of FeedFeeder. He commented on my first post, which was me whining about not reading the code, to the second which was deliberating on making a RSS package that was like FeedFeeder, but could handle problematic RSS better.

So hopefully Reinout is going to read this post too and share an opinion. ;)

Sunday, June 15, 2008

Umlizer lives!

Still is an early alpha release but nevertheless it lives! At this moment it currently handles all the formats I want for version one and has been tested against all target Plone versions. In other words, it meets the requirements I set for this tool, and now what remains is cleanup, documentation, and more testing.

What is Umlizer?
Umlizer is a Plone 2.5x/3.x package that introspects your Zope Object DataBase (ZODB) and then returns a view of your database in the specification that you want. Currently Umlizer provides the following formats for its view:
  • DOT for rendering into UML via graphviz
  • UML in JPG rendered via graphviz if graphviz is installed
  • HTML list for easy reading
  • Comma Seperate Values (CSV)
  • 3-d animated graph rendered via ubigraph
Before you ask this is a very Plone specific tool. Django already has a similiar tool called DjangoGraqhviz.

Why Umlizer?Umlizer was designed to represent the complexity of the Nasa Science site architecture, which was originally a rather complex UML diagram. The XMI for that UML diagram became corrupted, and we did not have a backup. Training people on the database has thus been a chore since, whether they be developers or content editors. In a couple other projects I've noticed that going through Plone code to figure out an architecture can be a pain. So what about a pretty diagram?

For nearly a year I tooled around with different iterations of this effort. In general, each of these iterations relied on protected Python scripts in Plone, which are limited and forced the user of the tool to make many steps before getting a view. These scripts were fragile and arcane, and just plain sucked. Different views of the data were impossible to generate. The latest version of this hack had really nice code, but was a hack.

So I thought, why not try to make it a Zope 3 style Plone package again? My previous attempt in September of 2007 tanked, but my skills in this arena had really improved thanks to training, a cancelled Zope 3 effort, and lately my co-worker Reed's insistence on using it and my need to maintain and extend his work.

Also, in the Plone community, thanks to Jens Klein we have ArchGenXml which is why we used UML in the first place. When I met him in Italy in October of 2007 for Plone Conference 2007, he told me about a pet project of his called Genesis. From what he said at the oldest pizzeria in the world is that Genesis is ArchGenXml with a very modular architecture. So I was determined to make this as modular as possible, trying to work outside the confines of Plone and isolating individual pieces as much as possible.

After about a week of playing with this along with my other duties, Umlizer is working at an alpha level!

Where can we get Umlizer?
That is a very good question. Because of our internal need for documentation this was done under the auspices of NASA. One of the things on my schedule tomorrow is asking for permission to release Umlizer as an open source package. Since there is nothing sensitive about Umlizer, I don't see anything preventing its release.

Thursday, June 5, 2008

MVC public service videos

The railsenvy guys do it again with a series of public service videos on model-view-controller. I especially like the third and fourth videos. Unlike their RoR versus videos, these are tool neutral.

http://railsenvy.com/2008/6/3/mvc-videos