Tuesday, November 08, 2005
Monday, November 07, 2005
Structure Generation and z3
Carlos de la Guardia posted a recent
blog entry that mentions the need for "rails-like" code-stubbing,
or the automatic generation of directories and files in z3. I think
there was one comment that wasn't spam, and then I posted one in
addition to that. So, I thought I'd post a long over-due entry here
myself.
A tool like that exists; I wrote it a while ago, but didn't get a
chance to clean it up (a little) and post it to the zope.org site until about a month ago. Here is the
z3 project starter.
It's alpha, and I need to encode the 1px.gif image so that a proper
binary file can be created. But that's pretty easy, I just haven't
gotten around to it. The basic css tabs are really only usable with
vhost. It has only been tested repeatedly in a narrow set of use, so it
needs more people playing with it. I'd love it if folks wanted to
contribute, helping to get it into shape suitable for entry into the z3
repository. It'd be great to bring it in line with Benji's quickstart
guide.
/back
It's been far, far too long since my last post. I can lay the blame for
this soundly at the feet of economic hardship and business suckage. One
of my oldest business partners was acquired by LEDS last year, and this
guy continues to be the most amazing friend, resource, and bread-winner
for my company. It really blows me away. Lots of other "partner"
companies make promises out the arse, with 80% of them falling through.
Not Allen, though. He just blows my mind... if it weren't for him, I
wouldn't even be able to write this blog entry.
Okay, so that's why I've been missing in action. In my silence, though,
I have done a tremendous amount of coding. I've been working on two
different versions of twisted object brokers for CoyMon; been updating
pymon to run from python eggs; been doing an insane amount of z3
development; teaching z3; been working on some custom astronomy python
utilities; been doing python image processing again; been exploring
darcs, ubuntu, MochiKit, Dojo Toolkit, Axiom; catching up on python
blogs; catching up on DivMon, Quotient, Nevow; just signed up for http://clickchronicle.com; been
catching up on experiments in gravitational physics as well as my
5-year cycle for M-Theory refreshing.
There's also a small group of friends that have started a mail list for
very cool explorations in practical... hmmm, don't even know what to
call it... metaphysics, I guess. Some of the most amazing discussions
and conversations I've had in a while.
I expect that I'll be posting here again, soon. It feels good to be
crawling out from under the rock where I've been hiding :-)
Saturday, August 06, 2005
New Zope3 Skin
Today I developed a skin for Zope3. As is evident from an earlier post, I had been exploring the Django web app dev platform, and after some intensive use and investigation, I returned to zope3. It was like a breath of fresh air. However, I sorely missed the slick interface of Django.
So, I decided to make my own :-)
AdytumAdmin z3 skin
All of my z3 projects will be using this skin (or a derivative) as the default admin skin. This will give clients something they can be happy with/proud of when they visit the ZMI to manage their site, and it will keep me and other developers happy, as we have to look at the ZMI for hours on end each day. If you've worked with z3 at all yet, you know how basic and ugly the default (non) skin is... and thus understand the need for people to start doing this kind of thing.
I would like to note and share my gratitude of the fact that this was based on the ZopeTop skin for Zope3 (I think written by Paul Everitt). Without that work and prior development, this would have been an arduous task. With the work, it was a facile process of tweaking colors and shuffling page/zpt parts around. Simply fantastic.
Once again, z3 shines as a rapid development platform. This was all done in less than a day :-)
Update: This blog post originally pointed to resources that are now no longer available. However, thanks to the Wayback Machine, I've been able to rescue the old instructions from an archived version of the web page.
Setup
There are no docs included with the tarball. You just need to do the following:
- checkout the adytumadmin directory from svn
- move the adytumadmin directory into you lib/python directory of your z3 instance
- create a the file etc/package-includes/adytumadmin-configure.zcml in your z3 instance directory with the following contents:
<include package="adytumadmin"></include>
- restart your z3 instance
Access the skin by using ++skin++AdytumAdmin in your URL, e.g.:
http://127.0.0.1:8080/++skin++AdytumAdmin/@@contents.html
If you like this skin enough to make it your default skin and don't want to add it to the URL manually, just add this line to your etc/overrides.zcml file:
<browser:defaultskin name="AdytumAdmin">Note that it is the skin name and not the skin package that is used.
Screenshots
Friday, August 05, 2005
Django vs. Zope3, or "The Right Web App Dev Platform"
First of all, let me start off by saying that this is not a flame nor a
crusade :-) The title of this post needs to be taken in context: this
is about making the right choices for you, the developer. We are not
machines, we are quirky people, each with our own uniquenesses. The
choice of platform needs to be as much about what technology best fits
the needs of the project as well as that which fits the personality,
the strengths, and the weaknesses of the developer.
I just spent an interesting two days with django. Let me just say,
right off the bat: I like it, it's fun, it's cool. I like their site,
their growing docs (I've contributed a little to the wiki), the homey
feel of the project. I got my first little app up and running in no
time. Piece of cake, just as advertised.
However, for my second project, I wanted to do something a little
strange. Oddly enough, just the kind of irregular thing a client would
ask for. Thus began the headaches. I spent about 30 hours with my head
up against the wall. I will say that my primary problem was not
understanding the not-so-documented subtleties of django. Additionally,
I'm really not that good at database modeling. Object relational
mappers are cool (much better than having to write SQL), but to me, the
logical next step is to give up the ghost and use an object-oriented
database. For situations that require hard-core databases, hire the
dba/db designer, and do what's needed.
It was tough going. I really wanted to do some strange things, and
django didn't seem to be so flexible in different areas. And I think
that's actually something that the django developers have openly
stated. They have written and are targeting their software for a narrow
problem domain, a domain that brings them a lot of business and for
which there is great need.
I want to emphasize that I'm not a python or software noob. I've been
writing code, in one language or another, since 1981. I've been in the
industry since 1994. I've worked with twisted for a couple years, more
so recently. I regularly delve into its internals. I have a love/hate
relationship with Zope: I love z3 and hate Zope2. I spend a fair amount
of time digging through z3 code and find it (almost entirely)
delightful. However, I don't have any of that experience with django.
The source code doesn't make architectural sense to me. I guess I like
and use frameworks, and django's actually really an application and not
a framework. This is reflected in the code, and I have difficulty with
that.
So, as I slugged through the issues of bending django to my will, I
found myself wishing for things: what would it take to add ZPT support
to django's templating? Could a wrapper/adaptor be written for the ORM
so that ZODB could be used? Could the code be refactored to use
interfaces, adaptors and components? Yup. I was unconsciously trying to
rewrite djando into z3. However, this is also flattering to django: I
was trying to hang on as long as I could. Why? Well, it's got some
really cool things:
* a fantastic look and feel
* a slick admin interface generation (z3 has auto-generation of this
too, but it's not as pretty)
* really cool URL dispatcher for custom URLs perl application
Overall, they did some great work. They sell the point that you can
build apps in record time with django. And they're right -- you can.
But you know what else? I was able to build a project from the ground
up with z3 in two days -- and that *included* learning curve. No
kidding. Talk about rapid. I was stunned. In fact, after that
experience, I emailed several close developer friends of mine as well
as a few partner companies we consult for. I did a write-up on the
project and an analysis of the z3 development process and how it
benefits our timelines. The reason things went so smoothly with z3 is
because it's designed the way I think. By using a framework that
matches me so well, I move through code with zero resistance and get a
tremendous about of work done.
I'm not trying to sell z3 here. But, what I did discover with django
was that it's not my platform for web app dev: z3 is. This is because
of the kind of developer I am, the kind of code I like to work with,
and the kind of tools that allow me to be as productive as possible.
This combination of factors is different for different developers. As
many others in the community have pointed out, pick the right tools for
you and the job. There's a lot of hype about Rails, Django, etc., these
days; all the different web platforms available for python. People are
complaining about proliferation, but that's what drives evolution.
Software evolution has provided me with great business tools: twisted
and z3. What's it provided you?
Thursday, July 28, 2005
Phillip Eby has changed my life... again.
First it was PEAK, then it was PyProtocols/generic functions (which has
now been split from PyProtocols in to its own package called
RuleDispatch). Now, it's EasyInstall. Everyone has been raving about
it, but I hadn't tried it out until tonight. Holy crap. This is crack
for python programmers. I built my first python egg when Bob Ippolito
first started writing about the alpha code he and Phillip Eby were
working on. Pretty cool stuff, but it didn't really hit me as to how
great eggs were until I actually saw it in action today with my upgrade
of setuptools, my first use of EasyInstall, and my upgrade of
PyProto/RuleDispatch (each creates an egg and dumps the file in
site-packages).
It blew my mind when I saw these two luminaries getting together. I
knew that it didn't matter what the hell these guys did together, it
would rock the world. Awesome. And thanks :-)
Monday, July 18, 2005
Solaris Returns?
Since moving to Colorado, I have had many friends visit... and now
family members are signing up. This is actually very nice for me, as I
have always been the one visiting. People *like* coming to Colorado,
hiking in the mountains, breathing the incredible air at high
altitudes. However, every single commodity-based workstation I have
(and I have over 10 of these boxes) has failed. These two topics are
actually related.
Most of the x86 machines I have, I did not purchase new. All of them
have had replacement parts, after the originals had burned out or
become obsolete. And all have since died, in some fashion or another.
In fact, the only exception to this are two machines I have: a Gateway
PC from 1997 with most of it's original hardware running FreeBSD (with
3 extra NICs) as my firewall/router and a Gateway laptop from 1998.
As a result of all these dead machines, there are no machines available
for use by all the people visiting -- there are two Mac OS X laptops
for use, but I am on my 17" almost 90% of the time I am awake, and
there are often more than 3 people in the house. This means that 2 or
more people have to juggle one 15" PowerBook. I have considered buying
a Mac mini, but with the changes of architecture at Apple, I am
exploring other options (I *will* be buying a 17" x86 PowerBook).
One of those is Sun. In a past life, I was a systems administrator and
worked a great deal with Sun hardware and was pretty familiar with
SunOS and intimately familiar with Solaris 2.5 and up. Last night, I
discovered (a month late) that Solaris has been open sourced. I
remember discussing this possibility with fellow admins and developers
in the late 90s, where a few of us optimists were called crazy for
thinking this was a possibility. I had since given up hope, and haven't
worked with Solaris in about two years, and then only in passing.
I spent several hours yesterday reading developer blogs and browsing
the site
(http://www.opensolaris.org/os/),
and I'm getting pretty
excited about the potential of this move by Sun. It is very likely that
this could move me back into not only using Solaris machines again, but
brushing up on my Solaris sysadmin skills, particularly catching up
with all the work they've done on virtual server technology. Running
python application servers in Solaris virtual machines will provide
many excellent solutions for application architectures.
Anyway, Sun is offering a "free" Opteron Sun box, with a 3-year support
subscription for about $30/month, and I'm heavily leaning towards
purchasing this box to fill the machine gap in the house:
If that goes well, and I like it, I may get another one for a local
subversion repository/backup development server... If their new
hardware is as solid and reliable as their old stuff (I have a
still-working Sparc server from 1995 that I bought from a DiGEX
employee -- it was the original web server for Dole.com), then I will
be most happy and they will have a new hardware customer for developer
platforms.
Monday, June 20, 2005
Tibetan Village Project
A good friend of mine, Tamdin Wangdu, started and currently manages a
non-profit called the
Tibetan Village
Project. I have talked with Tibetan friends and Westerners (Injees)
about a concept that is tangentially related: the preservation of
Tibetan culture in the West by means of establishing a functional,
thriving, "organic" Tibetan village. The architecture we are planning
is 100% authentic traditional. Tibetan monks and laity are providing
time, drawings, ideas, planning, and resources. It's getting exciting.
Tremendous resources would have to be poured into this. We're looking
at all kinds of options, from forming several companies that would
employ members of the village and whose profits would be put into
village infrastructure and support, to artisans and farmers.
The village would be comprised of Tibetans and Injees, both. Monks and
laity. Babies growing up, learning Tibetan and English fluently; the
culture and history of Tibet and the West being taught simultaneously.
The idea being that Tibetans would evolve from
refugees to a people with a new home, an old, preserved culture, and a
new integration.
But a group of people living together tends to have limited wide-spread
impact. We want this to be something that can be easily duplicated; we
want this idea to catch hold in the hearts and minds of others. We are
therefore going to publish ALL documents related to this project and
organize them for easy navigation and quick access of particulars.
This is a start... but we need to actively encourage and participate in
the wide-spread preservation of Tibetan culture. The first idea I had
regarding this was rather silly (but I still like it): to provide
streaming images and an application that could make these streamed
images the desktop background image on Mac OS X, Linux/*BSD, or even
*shudders* Windows workstations. Similarly for screensavers. The
streamed images would be taken from massive Tibetan digital archives
that detail every aspect of Tibetan life and culture.
The second idea I had is 100% inspired by BBC Radio Scotland. And yes,
we Scots are refugees ourselves -- just ask us! (Especially the
MacGregors...). BBC Radio Scotland is an amazing online resource for
both real-time and pre-recorded Scottish programs. Very well organized,
very simple to navigate, and a wide selection of modern Scottish
culture. It provides a perfect template or starting point for doing
this with any culture.
Imagine a Tibetan village in rural, mountain America. A village where
several clever and community-owned companies employ villagers; where
there is a focus on sustainability and cooperation; where there is a
very good broadband connection, with regular shows broadcast on the
internet live and archived for later listening. Shows of traditional
Tibetan music, world, national, local, and village news in Tibetan;
Tibetan news in Tibetan and English; shows discussing the cutting edge
politics, political research, self-governance, sustainable living, and
the Tibetan Village project; history shows; fictional story shows
presenting Tibetan folklore; various dharma talks and instruction by
monks and nuns; Tibetan language classes that are broadcast, as well as
English-for-Tibetans classes. Every member of the village would be
actively involved in preserving culture and spreading it; greatly
decreasing any possibility of the current trend: its complete
annihilation.
The list could go on and on...
And this is technically and exciting project: I see visions of twisted
python streaming media code :-) Twisted Oog Radio player anyone? Raise
your hand if you're sick of RealMedia and WMP? Yes... this could be
very cool.
Update
I didn't make it to pycon this year, and I just found some good links
on streaming media with twisted, including a presentation at PyCon2005:
http://twistedmatrix.com/pipermail/twisted-python/2005-March/009730.html ([Twisted-Python] streaming producer)
http://twistedmatrix.com/pipermail/twisted-python/2004-October/008846.html
([Twisted-Python] First public release of Flumotion Streaming
MediaServer)
http://www.flumotion.net/
http://www.flumotion.net/doc/flumotion/presentation/pycon2005/html/img0.html
Monday, June 13, 2005
Thinking in Twisted
My friend was trying to make use of basic Twisted stuff like deferreds, combine that with other parts of Twisted, but traverse the problem-solving process from an essentially ground-up, Python approach. I had tried to provide the shift in perspective needed in order to write Twisted apps with much less effort than he was exerting, but I fear that I failed.
Then, this morning, I thought of the perfect analogy. Actually, it's more than an ananlog -- it is the thing itself. Since really starting to learn Twisted, my programming has changed. Well, that and since absorbing such books as Patterns of Enterprise Application Architecture and Refactoring to Patterns. The deal with writing applications in Twisted is that you're no longer programming in the same language (Python); you're learning a new language. A more abstract one.
When we learn to think in Twisted and write applications in Twisted, our solutions will be elegant and compact. Before that starts to happen, we try to use our "old" ways of Python programming mixed in with the new one we are learning... and that, of course, defeats the purpose of the new "language."
The tricky thing about Twisted is that its patterns are an integral part of its "language" (perhaps it would be better to stop using quotes, and just call it a meta-language...). This is not true of most other languages -- though I would venture to say it is true of good frameworks in general. You don't need to know the patterns to use the grammar/syntax/control structures of most languages. Patterns in a language are usually optional.
With Twisted, if you aren't using the patterns, you aren't really using Twisted.
I am midway through this learning process. Therefore, I can't point to the solutions for many Twisted problems immediately or directly. I have, however, learned to see most of the critical components of a Twisted implementation. I still miss a few, though, and I have to keep reviewing code until I catch them all. Seeing these components clearly is what leads to the solution. As the time between "component vision" and "solution" gets shorter and shorter, we come closer and closer to thinking in Twisted.
Saturday, June 11, 2005
pymon Nearing 0.3.3 Release
pymon is nearing its second public release (but first packaged
release). We've spent the past couple months doing a refactor by
examining the patters we were using or not using. In the process, we
have made MUCH better use of twisted's internals and are increasingly
more impressed with it as a networking application development
framework. To be honest, I would be very happy doing full-time twisted
development now.
Email alerts are turned on; ping hosts are running; HTTP status, HTTP
text checks, DNS dig checks, and MySQL admin queries are currently
being developed. We're going to try to knock out FTP and SMTP in the
next couple weeks, as well -- and then we'll bundle it up and release
it :-)
A tentative road map is up on the wiki, and we've got the beginnings of
developer docs on how to write "monitors" (like ping checks, HTTP
status checks, etc.).