Lack of Husbandly Sympathy

5 AM May 27, 2004

Sympathy:

Karen: I feel terrible. I woke up in the middle of the night with a tooth-ache.

Alan: Are you sure it wasn’t half past two?

Karen: It could have been, did I disturb you?

Alan: No, it’s just that it’s traditional to wake up at tooth-hurty…

Surprisingly, she let me off with only a dirty look.

By alang | # | Comments (5)
(Posted to Stuff)

DHMO.org

8 PM May 26, 2004

I normally steer clear of ugly, animated banners, but this one is about an environmental issue that directly affects every man woman and child on the planet:

DHMO.org
By alang | # | Comments (4)
(Posted to Stuff)

Twisted: Bye for Now

3 AM May 25, 2004

Back in February, I decided to write my blogging software—KangaPy—in Twisted.

For those who have it come across it before, Twisted is a single threaded, “event-driven networking framework.” The price of using Twisted is that your code must never block on I/O. Instead, the code must return a “Deferred” object that contains a callback which is fired when the I/O operation completes.

In return for writing your code inside-out, Twisted gives you a framework that scales well, freedom from multi-threading concurrency issues and a very clear idea of how your application interacts with the outside world.

Aside from that, Twisted has three1 big pluses:

  1. An active, helpful user community,
  1. Support for a wide range of internet protocols, and
  1. The cutest web framework/HTML generation/templating system I have seen, Nevow.

Unfortunately, a blog with a simple web interface on one end and an RDBMS on the other is not a good fit to Twisted. Since KangaPy is due a major refactoring, I had to decide whether to stay with Twisted (and start using Nevow) or move to a different framework.

I decided to port KangaPy to another framework. This will most likely be CherryPy with Cheetah templates, but time will tell.

I’m glad I decided to give Twisted a go, because the experience may well turn out to be useful in other contexts. I’ve already had one project for which Twisted would have been a great choice, except that my client needs it done in Java.

And finally, a big thanks to Matt Goodall and Donovan Preston for taking the time to point me to Nevow. I played with the tutorials, and it looks great. If you ever manage to make Nevow useful without Twisted, I’d be very interested.


1 This is just my opinion, formed in the light of limited experience.

By alang | # | Comments (17)
(Posted to Python)

Beer. Wynyard. Friday.

4 AM May 24, 2004

What: Beer, optionally followed by Japanese Food.

When: Friday 28 May, 5:30pm.

Where: Wynyard Hotel. Cnr Clarence and Erskine Sts, Sydney.

Who: Everybody coming so far is a Java programmer. Feel free to join in.

Further Info: Keith

By alang | # | Comments (0)
(Posted to javablogs and Java)

[link] Reflections on Abu Gharib

2 AM May 24, 2004

And in my thirst they gave me vinegar to drink—a reflection on humanity and Abu Gharib. I’m posting this link because it is the most thoughtful and humble piece I’ve found on the topic so far:

Just speaking for myself, I can’t imagine what those soldiers are going through. ... I’d be loathe to second guess what they did because I don’t honestly know what I’d do in the same situation.

The military force in Iraq are the representatives of all the countries that sent them. If our military has not waged war and kept peace in a humane manner, then we should be as much ashamed as outraged.

By alang | # | Comments (0)
(Posted to Stuff)

C.S. Lewis: The Inner Ring

11 PM May 20, 2004

Before you and I were born, C.S. Lewis gave an address to a group of students, on the topic of “The Inner Ring”:

There are no formal admissions or expulsions. ... The only certain rule is that the insiders and outsiders call it by different names. From inside it may be designated, in simple cases, by mere enumeration: it may be called “You and Tony and me.” When is very secure and comparatively stable in membership it calls itself ‘we.Â’ When it has to be expanded to meet a particular emergency it calls itself “all the sensible people at this place.” From outside, if you have dispaired of getting into it, you call it “That gang” or “they” or “So-and-so and his set” or “The Caucus” or “The Inner Ring.”

(link)

Lewis first examines the phenomenon and how it affects individuals, then explains what he believes is the correct reaction to it. It bears repeated reading, whether or not you agree with his conclusions.

By alang | # | Comments (2)
(Posted to Stuff)

Found Friend

12 PM May 20, 2004

Today my wife, Karen attended a hospital workshop where she recognised one of the other attendees as an acquaintance from her university days. While she was telling me about this Doctor Shane, we figured out that not only was he an old acquaintance of Karen’s, but that he was a long lost friend of mine from high-school.

Interesting: a google shows a Dr Shane Trevithick that flies around Sydney, saving people’s lives. There can’t be that many Shane Trevithicks in the world, let alone Sydney.

Anyway, because Shane probably hasn’t made the connection between Karen and me, Karen is going to go back and re-introduce herself. But before she does, she’s going to ask him if he’s still upset with Channel 9 71 for cancelling re-runs of The Professionals back in the 1980s. Heh.

I’m looking forward to catching up again.


1 Update: I am informed, by someone whose memory I trust far more than I trust mine, that it was Channel 7 that screened The Professionals.

By alang | # | Comments (0)
(Posted to Stuff)

Python if-then-else In KangaPy

11 AM May 19, 2004

While writing my blogging software, there were several times when I wished that Python had an if-then-else expression à la PEP-308. I know that PEP-308 was thoroughly rejected for Python 2.4, but just in case discussion about it should ever surface again, I thought I’d examine my blogging software, Kangapy, to see what effect an if-then-else-expression would have on it.

I found that an if-then-else expression would reduce Kangapy’s lines of code count by 1.7%. This is small, but significant, and indicates to me that PEP-308, in some form would be worth proceeding with.

David A. Wheeler’s sloccount tells me that Kangapy has 3849 lines of code. A walkthrough of the code shows that 165 of those are ‘if’ statements. Examining each, I found 26 that could be replaced by an if-then-else expression, saving a total of 66 lines, or 1.7% of 3849 lines.

The rules I used for deciding which if statements could be replaced were fairly strict: the replacement had to be a semantically equivalent, readable, and fit on a single, 80 character line.

For example, I allowed this snippet:


if self.__isInclude:

op = ‘IN’

else:

op = ‘NOT IN’

to be rewritten as:


op = (if self.__isInclude: “IN” else: “NOT IN”)

As a counter example, I did not rewrite the following code with if-then-else, because the result would span multiple lines, and not be particularly readable:


if not isValidBlogDate(linkDate):

return None

return common.Link(

cls.MakeUrl(category, linkDate),

cls.MakeTitle(category, linkDate))


*And Another Thing*

Given the ominous wording of PEP-308’s introductory paragraph I think I’d be pushing my luck to write two blog entries about it, so I’ll add this here.

The voting process for PEP-308 was fundamentally flawed. It is absolutely no surprise that a “community” of 400+ voters couldn’t settle on a single option out of a range of 20 similar ones, much less produce a “clear majority.” Duh. It’s called vote splitting and it’s the reason that Republicans cheer Ralph Nader, and that Australia is still a monarchy.

Short of using a preferential voting system A vote of this kind should be at least a two stage process – first decide whether a change is necessary, and only then choose amongst the options for change.

In PEP-308’s case, “the community” has indicated, by a “clear majority,” that they want a change. Further, the community has indicated four leading options. The results of the voting seem to say that “the community” would be happier with any one of those four forms of if-then-else than it would be with none at all.

If PEP-308 were ever to openned up again, the next step would be to hold a vote to choose from amongst those four options.

I’m happy to believe that Guido knew what he was doing when he rejected PEP-308, but I would have liked to have seen a bit more structure to the community consultation.

By alang | # | Comments (11)
(Posted to Python)

In Response To Type Inferencing in Java

10 AM May 18, 2004

In response to Charles’s post, Type Inferencing in Java.

+1

A moderate amount of type inferencing would be nice, but I suspect that we would soon be demanding even more.

Type inferencing is currently receiving attention in the Python world, where it is being used to make execution more efficient, by specialising the generated bytecodes for the types the code actually deals with. It would make many people pause for thought if it also made some compile time type checking possible.

(I did write this in a comment, but Fishbowl’s comment cgi script was AWOL.)

By alang | # | Comments (0)
(Posted to Java)

Kangapy: Components

1 PM May 17, 2004

I named my blogging software ‘Kangapy,’ partly in the tradition of CherryPy, partly for it’s association with that great Australian icon, Skippy.

Kangapy is built with:

  • Twisted – for the web framework.
  • pysqlite – a DB-API interface to sqlite. A truly neat little database engine.

* pytextile – text formatting. Version 2 has been released since I started, and I’ll have to try it out.

  • webunit – unit testing framework from Richard Jones.
  • dateutil – used to do date arithmetic with months.

I am grateful to the authors of all this software for generously releasing under such liberal licenses. Thankyou!

Kangapy development is continuing in my commuting hours, and I am certainly learning much about Python and web development. The codebase is up to 6800 lines in 32 files. The sqlite database has 851 items—a mixture of articles, blog entries and comments—and I just collected my first blogspam today.

Kangpy currently embeds all of its HTML in Python code. The next challenge is to move to an HTML templating system, which ought to cut the lines of code count markedly. Nevow is the likely candidate, but I’m not looking forward to the learning curve. It may be time to try Webware.

By alang | # | Comments (3)
(Posted to Python)

Java Coding Standards

11 PM May 16, 2004

Some coding standards from around the web:

Spotted in the introduction to the The Caltech Infospheres Java Coding Standards:

Code standards aren’t just about obsession…

Although, for some of those standards documents, obsession seems to play a large part.


1 Emphasis mine.

By alang | # | Comments (7)
(Posted to javablogs and Java)

Gosling on Sun's Java Plans

11 PM May 13, 2004

Expecting PR fluff, I almost didn't read this interview with James Gosling on BuilderAU. I was pleasantly surprised by his frankness as he spoke of the obstacles on Java's road to broader acceptance:

... So if you want to build say, an infrastructure for a large global bank or a national medical system for a 100 million people, no problem. All the facilities with J2EE deals with that kind of scale.

(But) the problem with dealing in that kind of scale is that it brings about a certain amount of complexity. So our system have tended to be, wellÂ… like if you want to do the really hard stuff, it is possible, but doing the easy stuff, it is hard.

The article also touches on the IBM-Eclipse relationship, Sun's agreements with Microsoft, cell phone development, and Queen Elizabeth I.

By alang | # | Comments (0)
(Posted to javablogs and Java)

Blog Fixes

12 PM May 13, 2004

A few minutes ago, I put up a bunch of fixes and enhancements to the site. Amongst other things:

  1. Now better at recognising URLs in comments – underscore and hash are now accepted.
  1. Put navigation panel on the left right hand side. When you view a single post, it will let you navigate to the next or previous item. Also works for monthly archives.
  1. When you click on the title picture, it now takes you to the cardboard.nu home page.
  1. Fixed yet another problem with the CSS and IE.

Thanks to all who pointed out bugs and suggested features – Simon, Jed, Richard, Keith and Charles.

When I took down the Python server, it had been up for ten days and served 44,000 requests. That was better than I had expected for these early days. The database corruption problems seem to have gone away for the time being, too.

By alang | # | Comments (3)
(Posted to Software Development and Python)

JDK1.5 Release Date?

2 AM May 12, 2004

Does anybody have an idea about when Sun might do a production release of JDK1.5? I had a look around the Sun web site and couldn’t find anything.

Just trying to figure out how excited I should be getting.

By alang | # | Comments (12)
(Posted to javablogs and Java)

Constant Parental Adjustment

10 PM May 10, 2004

Sureka’s recent entry on Jeyanth’s blog reminds me of an incident at my friend Andrew’s house. Karen and I were visiting with number one son Mitchell, who had been crawling for just a few months. Karen, Andrew and I watched as Mitchell backed himself down two ivy-covered garden steps. Mitchell made it down the first step, but tumbled over the bottom one. Andrew was horrified that Karen and I laughed as we picked up our surprised and worried son.

I remember this clearly because, just a couple of weeks earlier we would have let Mitchell within ten feet of the steps only if one of us had been holding his jumpsuit. Andrew’s facial expression captured our previous attitude perfectly.

Self-propulsion marks the beginning of toddler-hood. It is the point when Baby begins the metamorphosis to Rug-Rat. For some time, Karen and I were at a loss for how to care for this new creature. Eventually, we worked something out.

As they grow up, children go through many stages. Karen and I have seen quite a few of these, and had to adjust our parenting accordingly. Apparently,1 these changes and consequent parental adjustments will continue until our children are fully mature – age eighty-five or so.

1 Pun intended.

By alang | # | Comments (0)
(Posted to Christian Life)

Blogger .com Makeover

11 AM May 10, 2004

This morning, David and I noticed that blogger.com was down. It turns out that it had been taken down for a complete makeover.

It is really quite good, and I am having trouble not raving about it.

For instance, I got this little blog going in four minutes flat. Other good things:

  • Professional, round-edge templates.
  • Blogger now provide a commenting facility as part of the base product. I feel sorry for Haloscan.
  • An easily accessible explanation of what Blogger is and how it works.
  • Still supports syndication (via an Atom feed.)

All this brings to mind a friend, Jed Wesley-Smith. He has been posting interesting tid-bits to odd places for many years now. Jed, in the immortal words of the Silhouettes, “Get a blog. Sha na na na, sha na na na na.”

Boing Boing has a few more details.

By alang | # | Comments (9)
(Posted to Software Development and javablogs)

Maureen Dowd on Donald Rumsfeld

8 PM May 9, 2004

In a recent New York Times editorial, Maureen Dowd reviews Donald Rumsfeld’s handling of the recent exposure of torture in U.S. run prisons. Dowd writes:

By the end, Rummy was channeling Jack Nicholson’s Col. Jessup, who lashed out at the snotty weenies questioning him while they sleep “under the blanket of the very freedom I provide, then question the manner in which I provide it.”

She doesn’t actually use Colonel Jessup’s line, “You can’t handle the truth,” but it lurks quietly in the background.

By alang | # | Comments (0)
(Posted to Stuff and Rants)

Name That Task

6 AM May 6, 2004

For the past three days, a colleague and I have been putting together estimates for a potential client project.

It’s hard.

It’s not that estimating any individual task is hard – that’s easy. Neither is it that working out a sensible list of tasks is hard – that’s straight forward, too.

The hard part is choosing names for tasks that are meaningful to everybody that will be reading the estimates. For instance, I understand what “Initial High Level Design” means, but my manager and clients may not.

The trick is—for each of 120 line items—to find a three or four word phrase that succinctly and completely expresses all the activities and outputs of a five or ten day task. And I’m not good at names.

Since finding an acceptable name is not always possible, we have been rearranged and regrouped the tasks several times, until they were more easily nameable.

The result is an estimation worksheet that is pleasingly complete and accurate. However, turning it into a sensible work breakdown structure for a project plan is another matter altogether.

By alang | # | Comments (0)
(Posted to Rants, Software Development and javablogs)

python-hosting.com

12 PM May 4, 2004

I moved cardboard.nu over to python-hosting.com a week and a half a go. My “free week” expired today, so I paid up my account with for full year. Two reasons:

  • Fast – On my account’s server, top consistently reports loads of less than 1.00. This is a brilliant effort considering the server is running 50+ accounts, most with some kind of Python server.
  • Remi is friendly. He even put a smiley in an email he sent when my mis-configured server had 100 threads and was spawning still more.
By alang | # | Comments (2)
(Posted to Software Development and Python)

"Scripting" Languages in a Sentence

8 AM May 4, 2004

Tim Bray gives the argument for “scripting” languages in a sentence:

If I had to cram it into one sentence: itÂ’s faster to write software in dynamic languages, and the (real) benefits you get from an anally type-sensitive compiler can be had more cheaply with modern testing disciplines.

Nicely put.

By alang | # | Comments (0)
(Posted to Software Development and Python)

WS-Sanity = WS-Simpler?

4 AM May 3, 2004

I was heartened to see Tim Bray allude to a body of work within Sun known as “WS-Sanity”.

Currently, gaining a working knowledge of Web Services requires reading well over one thousand pages. I sincerely hope that Tim’s work at Sun will reduce that number.

By alang | # | Comments (3)
(Posted to Software Development)

Three Little Things

1 AM May 3, 2004

I have an index card pinned to my cubical wall. On it is a list that I wrote in the midst of a hectic project, back in 2002. The card reads:

  • We work faster if we do it our way.
  • We work faster if we don’t have things changing on us.
  • Must track and push back.

I find myself unable to throw this card out. It’s not that it expresses anything novel; nor is it well written.

I keep the card because it reminds me that, while I don’t have control over the whole project, I can and should have a say about my own area of expertise, and do it in a language that my manager and his customer understand.

By alang | # | Comments (0)
(Posted to Software Development and Rants)
© 2003-2006 Alan Green