September 2006 Archives

AddThis Social Bookmark Button

Intel, despite claims of openness and support for open source is, again, refusing to allow open source OS’ to freely redistribute the binary firmware required to make their products work.

They’ll sell you the hardware, but don’t want it to just work on free OS’. They claim to support open source, but don’t follow through on the talk.

This isn’t about releasing source code, it’s about allowing redistribution of the binary firmware which runs on the card itself to make it work.

If you want Intel hardware you paid for to work properly, you might want to read more.

Curtis Poe

AddThis Social Bookmark Button

Many programmers feel they have bragging rights if they’ve written large systems. This isn’t always fair as many times a quick twenty-something line program might save the day and programmers who can crank them out shouldn’t be undervalued. Be that as it may, sometimes we need to write large systems and we need to know how to do it. But what if you’re just writing a small system? What’s small? And as many of us know, small systems stick around and often grow. While rules which affect larger systems don’t always seem as important on small systems, it’s fair to say that if you want your small systems to be able to grow to large systems, it doesn’t hurt to start with sane rules.

chromatic

AddThis Social Bookmark Button

If you really want to make something a habit, find a way to do it without thinking about it. I like to automate the things I value so I never do them incorrectly, incompletely, or infrequently. Thus Test::Perl::Critic allows you to add customizable Perl::Critic tests to your test suites, so you can ensure that you’ve followed local style.

Chris Tyler

AddThis Social Bookmark Button

Red Hat and Fedora distributions of Linux create a separate user group for each user on the system. To someone coming from another distribution, such as SUSE (which puts all users in the group “users” by default), this may seem bizarre — but there’s a good reason for this often-ignored feature.

chromatic

AddThis Social Bookmark Button

Steve Yegge’s Good Agile, Bad Agile needs a filk song. Maybe it needs some classic Star Trek fanfiction where the main characters are marmots. Either one would make it clear that you should not take it seriously.

chromatic

AddThis Social Bookmark Button

Most technical writing I’ve read isn’t very good. One of the reasons the Head First series works is because applying a little cognitive science to the process of writing forces writers and editors to think from the audience’s point of view now and then.

The mini-rant How Not to Teach Database Design uses an existing article to show mistakes common to much technical writing. Even if you don’t know or care about databases, read and think about the post if you might someday write documentation, an article, a tutorial, or even a set of instructions in your weblog or a wiki or an e-mail somewhere.

Don’t worry; they’re not grammatical rules you’ll never remember. They’re just five tips that will help you craft better prose.

Jeremy Jones

AddThis Social Bookmark Button

Fuzzyman just posted yesterday about TIOBE’s index of top programming languages. It’s interesting, but not particularly meaningful, that Python and C# have swapped places since last year, putting Python in slot 7 and C# in slot 8. What’s interesting about this? It implies that Python is in the realm of being commercially competitive. This is a good statistic to provide to dynamic-language-leary bosses when that next project rolls around. What’s not particularly meaningful about this? It doesn’t mean anything, really, in regard to Python’s usefulness compared to C#. Nor does it mean that Python is really being used more than C#. Python had a 3.144% and C# had a 2.992%. I’d say that statistical wiggle room outweighs the 0.152% variance between these two numbers. At best, I’d put all these statistics in the category of “rough guess” even though they have hard evidencial “proof”. Regardless, it’s encouraging how hight up in the list Python is. And it was amusing that Python bumped C#.

Curtis Poe

AddThis Social Bookmark Button

Twice now I’ve been hit by cars. The first time it was no big deal. My vehicle wasn’t damaged and neither was I. The second time, a guy wasn’t paying attention and ran a stop sign and totalled the car I just bought. Both times I knew people who urged me to sue. I thought that was pretty ridiculous. For the second incident, I called the guy’s insurance company and asked that they pay replacement value for my car, my hospital bills, and time lost from work. They paid in full and even gave me a $5,000 “bonus” for not suing, even though I didn’t ask for that.

I received no money for the first and a fair amount of money for the second. What’s the difference? In the first case, though there was negligence (the lady who hit me was driving on a learner’s permit and slammed on the brakes in the rain), there was no damage. In the second case, there was negligence and considerable damage. It was only reasonable that the guy pay up. Once I even had a hospital bill wiped out because a doctor stitched up my lip but forgot to remove some splinters that were still in it. The doctor was negligent and the hospital assumed responsibility.

So what’s wrong with software manufacturers? Why the heck can’t we sue them when they do something wrong? When your business suffers millions of dollars of losses because some software malfunctions, why can’t we hold software companies liable? According to one survey, bad software annually costs companies $59.5 billion in losses (and that’s only in the US economy!). At least half of those losses are born by end users. I think it’s time that malpractice be extended to software producers, but doing it wrong will make things much, much worse. It could also destroy the open-source movement.

Ann Barcomb

AddThis Social Bookmark Button

This week on the Perl 6 mailing lists

my Yellow sub marine { @we.all.live }

– Larry Wall, concluding a series of Beatles references in the grep thread.

chromatic

AddThis Social Bookmark Button

If you want to criticize a language or platform or technology you don’t use, attack its scalability. Though the word could mean that the entity requires a proportionate amount of effort to work for small loads as well as large ones, the common derogatory connotation is that it’s inappropriate for the largest, manliest projects where so-called real developers build serious systems.

(If that offends you, good. It should.)

chromatic

AddThis Social Bookmark Button

Jeff Atwood’s recent Coding Horror essay, When Understanding Means Rewriting, argues that software developers spend most of their time trying to understand old code. In my experience, that’s true — and not just because as soon as I check in new code, it becomes old code I need to maintain.

Atwood’s thesis is that developers should rewrite code rather than trying to understand it, because it’s difficult to read source code and source code itself doesn’t always reveal the vision or the domain rules behind the project.

At best, that logic is… well, confused.

Jeremy Jones

AddThis Social Bookmark Button

Python 2.5 Final has been released. Here are the main release page, the 2.5 highlights, and the full-blown what’s new in Python 2.5 page.

Jeremy Jones

AddThis Social Bookmark Button

Everything that I have built in Django so far has been pretty simple. Perhaps “limited scope” is a better choice of words. Each project I create tends to only contain one user-created app. There are a couple of sites that I’d like to build which could share some code between them. So, I decided to look into using multiple user-created apps and seeing how things fit together. My primary interests in this exercise were the url configuration and template inheritence among applications.

I created a project named “mproject” and, for the sake of simplicity, three apps named “main_app”, “foo_app”, and “bar_app” under the “mproject” directory. In addition to the autogenerated files, I created a “urls.py” for “foo_app” and “bar_app” and one html template for each of the three apps (named “bar_main.html”, “foo_main.html”, and “base.html”). Here is a tree view of the directory structure:


.
`-- mproject
|-- __init__.py
|-- bar_app
| |-- __init__.py
| |-- models.py
| |-- templates
| | `-- bar_main.html
| |-- urls.py
| `-- views.py
|-- foo_app
| |-- __init__.py
| |-- models.py
| |-- templates
| | `-- foo_main.html
| |-- urls.py
| `-- views.py
|-- main_app
| |-- __init__.py
| |-- models.py
| |-- templates
| | `-- base.html
| `-- views.py
|-- manage.py
|-- settings.py
`-- urls.py

I added the following three lines to the INSTALLED_APPS section of my settings.py file:

'mproject.main_app',
'mproject.foo_app',
'mproject.bar_app',

This is how applications are “plugged in” to your Django project.

I added the following to the project-level urls.py:

(r'^foo/', include('mproject.foo_app.urls')),
(r'^bar/', include('mproject.bar_app.urls')),

This says to use everything in the foo_app.urls url configuration, but map it by prepending “foo/” to all those entries. Likewise for bar_app.urls and “bar/”.

main_app/views.py is empty. Since this is a simple example, the main application isn’t doing anything.

main_app/templates/base.html:

<html>
<head>
<title>{% block title %}Main Base Title{% endblock %}</title>
</head>
<body>
{% block content %}
Unset Content
{% endblock %}
</body>
</html>

bar_app/urls.py:

urlpatterns = patterns('',
# Example:
# (r'^mproject/', include('mproject.apps.foo.urls.foo')),

# Uncomment this for admin:
# (r'^admin/', include('django.contrib.admin.urls')),
(r'^main/', 'mproject.bar_app.views.main'),
)

I only created one mapping for this app. “main/” will map to the function mproject.bar_app.views.main. But, since the main url config is including this url config, “/bar/main/” will map to the mproject.bar_app.views.main function.

bar_app/views.py:

from django.shortcuts import render_to_response

def main(request):
return render_to_response('bar_main.html', {})

This simply links the “main” function with the “bar_main.html” template.

bar_app/templates/bar_main.html:

{% extends "base.html" %}

{% block title %}Bar Title{% endblock %}

{% block content %}Bar Content{% endblock %}

Here, I’m extending base.html, which Django will pick up from the main_app application. I’m overriding the title and content blocks so that this template gets to fill in its own content.

Here are the details on foo_app, but without explanation since I’m doing the same thing here as in bar_app.

foo_app/urls.py:

urlpatterns = patterns('',
# Example:
# (r'^mproject/', include('mproject.apps.foo.urls.foo')),

# Uncomment this for admin:
# (r'^admin/', include('django.contrib.admin.urls')),
(r'^main/', 'mproject.foo_app.views.main'),
)

foo_app/views.py:

from django.shortcuts import render_to_response

def main(request):
return render_to_response('foo_main.html', {})

foo_app/templates/foo_main.html:

{% extends "base.html" %}

{% block title %}Foo Title{% endblock %}

{% block content %}Foo Content{% endblock %}

A couple of really practical uses for this come to mind. First, this is an easy way of separating logical pieces of your application. This approach makes it really easy to separate your site into its logical pieces. For example, you could have a blog, main static content, user reviews, photo gallery, etc. each in their own applications. This should lead to a less cluttered views.py file (even though you should be able to do something similar by separating things out and creating a “views” directory and putting logically separated code there).

Second, this makes for really nice sharing of applications among projects. Why not create your own customized user registration app and use it in each of your projects? Or a blog? Or photo gallery? (Or what have you.) All you have to do to re-use code is add an entry to the INSTALLED_APPS section of your settings.py file and create an include in your urls.py file.

I remember hearing or reading someone say that the pluggability of Django apps is one of its under-touted features. I couldn’t agree more. Something that I had previously avoided because I didn’t need it is turning out to be an incredibly powerful feature.

I’ve uploaded the project and app files here for anyone interested.

Jonathan Wellons

AddThis Social Bookmark Button

I love fractions because they always cancel so nicely. It’s well known that when you have an expression like xy/yz, you can cancel the common components. In this case, there’s a y in the top and bottom, so you can just eliminate them both and reduce down to x/z.

Need a concrete example? Suppose I have 26/65. The 6’s go away and we have 2/5. Check me on a calculator, 2/5 = 26/65 = 0.4.

Not convinced? Take 4784/7475. The 7’s and 4’s cancel and we get 48/75.

Another example picked at random: 6188/1820, here we can eliminate the 1 and an 8, to get it down to 68/20, which is a lot simpler. Or I’ll take another one, say 4277/2730. Let’s see, there’s a 2 and 7, so we get 47/30. You might think this is some sort of trick, but Math really is this easy. Let’s make up some more numbers to prove it: 138/1840, cancel the 1 and 8 and we get 3/40.

Ann Barcomb

AddThis Social Bookmark Button

This week on the Perl 6 mailing lists

This summary has been posted early because I will be going to OSCON Europe on Sunday. Next week’s summary will include any threads which were not included this week.

Ming Chow

AddThis Social Bookmark Button

I love to program in Perl. It is so effective for system administration tasks, but we all know that. Several weeks ago, I resurrected a project I did when I was a graduate student. Back in 2003, a course called “Perl Programming Practicum” was offered at Tufts by Professor Alva Couch, and the first assignment was to write a program to report system resource usage by user. It is similar to the ps command. Snapshots are sorted by greatest CPU-time use, and then by greatest memory use. You can use this tool to yell at the biggest CPU hogger. I made a number of changes to it, including logging the information on processes and its dependencies to a database (yes, on large systems, the database might get really big really fast). That way, I can create an interface to run system usage reports on the web.

I recently released the source and my changes to the new Google Code Project Hosting site. The program is called syshogs (originally named “pigs”). I wanted to see the differences between hosting a project though Google and SourceForge. The obvious difference I noticed with Google was no review process to host my project. Unlike SourceForge, you have to wait at least 24 hours before your project becomes official. You cannot register a project name in Google that is already registered in SourceForge. The one thing that I am still adjusting to is Subversion. I have experienced some kinks with checking-out and committing with https:// (remember if you are a developer, you better use https:// for both). With regards to the project page, it is very lite in Google: project home, issues, source, and administer –no frills. Project pages in SourceForge can be very heavy: lengthy message board and project details, and administration functions are hard to find. Finally, I can now see the source code directly in the project’s Subversion repository. All in all, Google’s Code Project Hosting is good, especially for hosting small projects.

chromatic

AddThis Social Bookmark Button

A new user appeared on Use Perl; the other day. rodi’s first journal, A Citizen of Perl demonstrated how powerful it is for new users to be able to join a community immediately.

Audrey Tang’s relentless Optimizing for Fun contrinualy attracts new users — and helps to encourage novices to become contributing community members. What barriers to entry can your project remove?

Chris Tyler

AddThis Social Bookmark Button

For the past five years, Seneca College in Toronto has been running a Free Software & Open Source Symposium. This year promises to be the best yet, with an interesting lineup of speakers including:

  • Chris Blizzard, Red Hat / One Laptop Per Child Project
  • Marcus Bornfreund, Creative Commons Canada
  • Nat Friedman, Novell
  • Mike Shaver, Mozilla Corporation
  • Louis Suarez-Potts, OpenOffice.org

I teach at Seneca (and will also be speaking at the Symposium) and I’m really looking forward to this event.

If you’re in Toronto or within a reasonable drive, come join us on October 27, or come a day early and take in some fabulous workshops on the 26th (XUL and Firefox Extensions, Building an OSCAR Cluster, Getting High on Rails, Eclipse Plugin Development, and more). The cost is next to nothing and the atmoshere is a lot of fun - details at http://fsoss.senecac.on.ca

Jeremy Jones

AddThis Social Bookmark Button

I’ve seen references to ShowMeDo in the past, but just haven’t taken the time to check them out. I have been poking around there for a few days and really like what I see. From the main page of the site:

This site is dedicated to showing demonstrative videos produced by our community. For many subjects seeing something done is the most effective way to learn, whether it’s peering over an expert’s shoulder while they explain how to program or watching while someone grinds beans and makes coffee. Please watch, learn and perhaps share your knowledge back.

They have a smallish (but growing) number of tutorials available from debugging Python using the IPython shell to making the perfect cup of coffee. One of the really interesting features of the site is voting on a desired tutorial topic. Currently, there are requests for tutorials on TurboGears, Django, and IPython among other topics. Currently, the top voted request is for

I’d like to see Django worked-example videos for building e.g. a ‘newspaper’, wine-store, blog and other practical applications.

The tone of the tutorials that I’ve watched and the overall feel of the website is very community friendly. I think this site has tremendous potential for helping spread information to knowledge seekers on a potentially limitless range of topics. This could be a very interesting site to keep an eye on. Check it out and vote for a topic you’re interested in.

chromatic

AddThis Social Bookmark Button

James Shore is my friend and co-author of The Art of Agile Development (in progress). In between writing furiously, becoming a father any day now, and running Cardmeeting, he still has time to discover new insights and write them for the world.

Technical Debt refers to all of the design decisions and shortcuts you make that may eventually cause you to do more work to resolve them later. Managing technical debt is one of the most basic (and most challenging) parts of any project.

Jim’s new essay on Voluntary Technical Debt demonstrates Technical Debt on a real project, as well as an advanced technique: deliberately incurring technical debt for short-term gains. Please note Jim’s estimate that he and Dave will spend more time reducing their debt than if they’d never incurred it. (Yet also note that Jim, Dave, and I all voluntarily took out mortgages to buy our houses. Sometimes it’s worth it.)

chromatic

AddThis Social Bookmark Button

Jim Thomason has an excellent writeup at Perl Monks called The History of a Templating Engine. It’s almost a rite of passage for Perl programmers to write a simple templating system, and novice programmers somehow universally fail to understand why writing yet another templating system is an exercise in pain, frustration, and usually unmaintainable, unremarkable code. Jim’s account of the evolution of his system and the lessons he learned is, hopefully, a great bucket of cold water to cool those youthful urges.

Ann Barcomb

AddThis Social Bookmark Button

This week on the Perl 6 mailing lists

Andy Oram

AddThis Social Bookmark Button

It gave me a warm, nostalgic feeling when I read of ICANN’s proposed agreements to let domain name registrars raise
prices arbitrarily on domain names. This is what the Domain Name
System is all about–at least, since I got involved in policy debates
around the Domain Name System about 1994: milking a monopoly for all
the cash you can get. But the issue also made me re-examine an old
question: in place of the ordained chaos of the current governance
policy, is it possible to administer the Domain Name System in a way
that apportions names in a rational manner?

The rent-seeking history of DNS

The thrust of the proposed ICANN agreement with three top-level
domains (.BIZ, .INFO, and .ORG) is simple: a registry could charge as
much as it wants for a domain name once it finds out if it’s popular.
Thus, if some scrappy startup-in-a-dorm-room registers
GitYourCheapMovies.biz and it turns into the next Internet sensation,
the registrar could raise its fee to a million dollars.

Admittedly, there’s a built-in lag: the registrar would have to give
six months notice, and the site registering the name could lock in the
old fee for ten years. But with commerce on the Internet becoming
mainstream, this is inadequate protection against exploitation. The
business of registering domain names becomes like the old joke of the
gunman who demonstrated perfect marksmanship–until he admitted that
he shot the holes first and then drew the targets around the holes.

This is, of course, all about ICANN supporting its own bureaucracy, a
quest that has been an almost perpetual crisis since ICANN began. The
fees paid by registrars to ICANN are based partly on what the
registrars charge their clients (see, for instance, paragraphs
7.2(a)(ii) and 7.2(a)(iii) of the .BIZ agreement). So the proposal is just a particularly scary
variation of an old trend: to siphon off from innovators some of the
substantial revenues that the Internet makes possible, and use it to
benefit those with a choke-hold on the indispensable Domain Name
System.

The policy debates around the Domain Name System began in the
mid-1990s when Network Solutions decided to charge $100 to register a
.COM domain, and $50 to maintain it hereafter. Because maintaining the
computers that serve up .COM domains costs a fraction of a penny per
domain name, this was what I called Information Highway robbery, and
it generated (along with various other abusive practices) a revolt
among Internet activists.

The cost of domain names has gone down drastically since then, but
egregious rent-seeking behavior has remained. ICANN created a huge
superstructure that does nothing very much, and does it mostly to
perpetuate ICANN’s own dominance, rather than things that would
actually improve the Internet for its users (such as promoting IPv6
adoption, or measures to secure DNS such as DNSSEC, or truly
internationalized domain names that are fit for every
language). Flirting with bankruptcy every couple years, ICANN has
tried to fund this superstructure through various fiats such as trying
to collect one dollar per year per domain name.

Can we leave this sordid history behind and look toward a future
Domain Name System that offers sensible policies and enhances the
user’s Internet experience?

AddThis Social Bookmark Button

This year’s YAPC::Europe conference was held in Birmingham. In this post I look at the third and final day of the conference.

chromatic

AddThis Social Bookmark Button

Damien Seguy from Nexen just sent some interesting statistics on PHP Versions in Use in August 2006. I’ve ranted before about the use of obsolete, unsupported software way past its expiration date, but it’s nice to see PHP 5 adoption continuing to grow (nearly 10% of all servers running PHP, with PHP 6 on the way) and PHP 4.4 poised to overtake all other versions as the most used.

Perhaps the most useful piece of information for PHP developers is that targeting the feature set of PHP 4.3.9 will produce software that runs on three out of four servers surveyed. If backwards compatibility is important to you, that’s good to know.

chromatic

AddThis Social Bookmark Button

Luis Villa is a hacker turned law student. His Things I’ve Learned in Law School, part 1 has an interesting metaphor, comparing making and revising the law to programming. Apart from the fact that people are even less predictable than electrons flowing through gates, I’ve long thought such a metaphor was appropriate.

Perhaps by understanding the law as we understand programming and treating bad laws as refactoring opportunities, hackers can help refine the law into something clearer, more accurate, and more effective.

AddThis Social Bookmark Button

This year’s YAPC::Europe conference was held in Birmingham. In this post I look at the second day of the conference and that evening’s conference dinner.

Jeremy Jones

AddThis Social Bookmark Button

I wish there were a category of “comedy” that I could post this under. A friend of mine just forwarded me this blog post: http://perkypants.org/blog/2006/09/02/rfte-python/ The title of the post is “RftE: Python”, meaning “Ready for the Enterprise”. In this post, author Jeff Waugh asserts that Python is not ready for the enterprise because “the Python shell wakes up every 100msec”. Some of his readers pointed out that it was the readline library waking up rather than Python in general.

I didn’t post this because I wanted to point out error or give the article’s author a hard time. Jeff’s readers did a fine job rather quickly with that. I’m mentioning it here because Jeff’s post was absolutely hilarious, especially the references to Senator Ted Stephens and the “Snakes on a Plane” movie. And the reader comments are equally entertaining. Funny thing is, I am not convinced that he was serious with the post. It seems that it was intended for entertainment-oriented consumption. So, take a minute, read the post and enjoy. In my opinion, this is brilliant humor. Thumbs up, Jeff!

AddThis Social Bookmark Button

Last week I was at the annual YAPC::Europe conference which was held this year in Birmingham. It had been a few years since I’d been to a YAPC, but this one was so much fun that I’m kicking myself for missing the last two. In this report, I talk about the first day of the conference.

Ann Barcomb

AddThis Social Bookmark Button

This week on the Perl 6 mailing lists

“I once saw an overfilled waterbed that was almost as tall as I am. I would have called it PHP, but it didn’t explode and throw cold water all over the house.”

– chromatic

Andy Oram

AddThis Social Bookmark Button

We just brought a Macintosh into our family for the first time,
because my daughter matriculated at a music conservatory that
recommended the Macintosh over a Windows system. So I got a chance to
experience the vertigo and disorientation of learning a new system
that other people consider extremely easy to use. (My last sustained
use of a Macintosh was around 1985.)

Here’s an example of the frustration we had. We called up a Web page
with some administrative advice, and it told us to pull up the Finder
and look for a file. We called up the Finder and saw the Go menu
appear on the menu bar at the top of the screen. But what were we
supposed to look for? Back to the web page, to get the name. OK, now
back to the Go menu–but wait! The Go menu is gone!

The idea of putting the functions from each program in the menu bar
made sense in 1985, when the Mac ran only one program at a time. Even
one program could be a strain, when the system lacked a hard disk.

But now the Mac is a multitasking system. And I am a multitasker. I
expect to run Safari and the Finder at the same time. But I must treat
the menu bar as if I were still on a single-tasking system.

I think it is time for the most advanced operating system to advance a
bit in the multi-tasking world. The interface should obey the basic
interface rule of consistency, also called predictability. Items
should not disappear just because a different window is visible.