<M <Y
Y> M>

Re-reading ancient old Python-Dev archives, I stumbled on this Tim Peters comment on "modern" open source licenses:
All the legal mumbo jumbo in the "modern" licenses is like wearing garlic around your neck to ward off vampires: the threat isn't real, and if it were it wouldn't do you any good anyway.



Upgraded to NewsBruiser 2.6

Finally decided to upgrade to a more recent version of NewsBruiser, namely 2.6. I don't actually know whether there's a real NewsBruiser upgrade guide out there somewhere, but I did it by making a new installation of the more recent version and manually copying the data from the old installation. Then I checked that most of the stuff still worked and switched to the new location with Apache rewrite configuration change. Seemed to work. Let me know if anything's hosed.

(Well I did incorporate the couple of dirty tweaks I did for my Finnish weblogs, but you don't want to know about those..)

SummaryList does not work for POU right now, though it works for my other blogs; I need to figure that out.

I leaped from 2.3 to 2.6 and the change definitely seems substantial. Thanks again to the Evil^H^H^Hnergetic Master Mind behind all this, Leonard.

update: OK, some minor differences are visible to users. URLs are bit different. Old links to POU's articles should work, but links to individual entries now have longer URLs.

[1 comment]



NewsBruiser plugin in development: Automatic paragraphs

I don't have reST support on the site where my NewsBruiser installation lives (and I don't particularly like reST anyway), so I decided to write a plugin that does the only thing I really need when writing entries: converting two consecutive linefeeds to a <p> tag. (Two consecutive linefeeds is, of course, the Universal Paragraph Separator; so much that even in applications where you don't need to type two consecutive linefeeds to start a paragraph, you do it anyhow.)

The only challenging thing writing the plugin was that my ISP doesn't provide a decent programming environment — I don't have command line Python or Python mode for Emacs there. Otherwise, writing the plugin, with all its warts and bugs, took about 15 minutes, including the "I Want Options" based option to NewsBruiser configuration.

So I propose a NewsBruiser Plugin Development slogan:

NewsBruiser Plugin Development — so easy that a child can do it (see the picture below)

(To be honest, though, Telma was IRCing at the moment..)

Here's the tgz package of the plugin: AutomaticParagraphs-1e-13.tgz. Extract it to your NewsBruiser base directory (it creates a directory nb/plugin/entry/filter/paragraph/) and configure it on the Entries tab in the NewsBruiser configuration.



IDEs are not silver bullets either

I am really growing tired of hearing the same old "Java has Eclipse or IDEA or Some-other-IDE, therefore you can be as productive in Java as in any other language" phrase spouted whenever anyone mentions Python, Perl or Ruby (or Lisp or Smalltalk). Sure, Eclipse is neat. Sure, even I use Eclipse at work.

Eclipse makes it easy to find appropriate Java methods, because it has a powerful auto-completion. It even opens up the corresponding documentation in the context. And yes, Python IDEs do something similar too, but they can never be quite as complete as Java's, because of the dynamic typing. Ditto for refactoring. Ditto for many other features.

But it does not mean that programming in Java suddenly, magically becomes easy. Programming isn't hard because you can't always find the right libraries, classes and methods instantly. (Programming might be a bit inconvenient because of this.) Programming is hard, because it's complex. Programming is hard, because it's abstract. Programming is hard, because you can't visualize it. Etc.

Programming isn't hard at the level of individual expressions and statements. Programming is hard at higher levels, at higher levels of abstraction. But these two are not separable. The higher levels, where things are more hairy, are composed of the individual expressions and statements. What's more, you can't escape from the lower levels. You drag them with you whatever you do. This is why programming in assembler is harder: you have drag the most low-level statements with your abstractions. The devil really is in the details.

The issue is of course not as bleak as I have painted it. You can make your own abstractions, making it easier for you to work with the high level concepts. Making abstractions is indeed a very powerful tool. Unfortunately, abstractions are not silver bullets either. (Not in the form of Objects, or in the form of Subroutines.) You still can't completely escape the individual expressions. You just can't. Abstractions leak. Bugs creep in. Integration becomes harder the more components you have. In some sense, abstractions makes the thing just harder.

What dynamic languages target is the level of the individual statements. They make —it is argued— the lowest level visible to the programmer a bit higher. They make the base level a bit higher. It's the fundamental bottom-up programming. Make the language of the programmer a bit closer to the domain of problems. (Domain specific languages are even more powerful with this, but they have their own set of problems, too.)

The point is not to make programming more convenient (although that's arguably one side-effect of dynamic languages); the point is to make the difficult task of making large programs less daunting. It's of course debatable whether dynamic languages succeed in this mission, but IDEs do not belong to that discussion. It all boils down to this: No IDE is going to make Java a higher level programming language. Unless, of course, the "IDE" is actually a interpreter to some higher level language itself.



Bug fix

Due to a slight mis-understanding, Automatic Paragraphs had a serious bug, which is fixed now, though. Fortunately, no one, besides me, is particularly interested in the plugin.

Motto: don't let children do plugin development!

[1 comment]



Yet another NewsBruiser plugin: WordCount

As a finger exercise, I made another NewsBruiser plugin. Also I wanted to invalidate the NewsBruiser wiki page PluginList comment

As far as I know there are no non-core plugins yet.

Thus, Python owns us un-proudly presents: WordCountPlugin. Untar (tar xvfz) it to your local newsbruiser installation base directory and you'll see a "word count option" in the Entries tab of your NewsBruiser configuration.

Un-proudly because WordCountPlugin is really a shamefully over-simplified plugin and should probably be used with care. I use it myself, though. Report bugs to me directly.

The way I use word count in my work-flow is probably not the way everyone else would want to. If this is the case, let me know; maybe I'll enhance WordCount's functionality.



Ultra Gleeper, a recommendation engine that really works, unlike most

The brief exposure that I had with Leonard's Ultra Gleeper —he gave me a free test-drive after I whined about the sorry state of recommendation engines in my weblog— was sweet and joyful. It really did fix the problems I reported about recommendation engines I had had the displeasure to deal with. Check out his latest Ultra Gleeping status report and particularly the introduction paper: The Ultra Gleeper: A Recommendation Engine for Web Pages.

[3 comments]



New layout for POU

I don't how many of you regular readers get your daily POU straight through the front page (Python owns us, that is) —presumably not too many—, but, be that as it may, I redesigned the HTML layout. It's really simple now. And I like it.

[3 comments]



Programming language news

I stumbled to a neat weblog through NewsBruiser's home page: PLNews - Programming Language News.



Python really becoming Lisp?

Y'all have of course read all the past Python vs. Lisp hoobla; Python being "Lisp-envy" of sorts, and you may have mostly ignored it, or tried to, at least. Nevertheless, Oliver Steel offers a clearer viewpoint to this kind of thinking with his post Becoming Lisp.

He points us to recent Python Cookbook recipes that are based on (to some extent) type/class unification, decorators and generator expressions:

I’ve listed below some of the functional and metaprogramming recipes and packages that have shown up in PyPI and the Python Cookbook over the past few weeks.

...

The point is that these are flowing in fast and furious, and that they don’t take much code. The recipes below are from just two weeks.



Little information about me

I wrote a short page about me and this weblog so that can link the "About" text to it.



Q & A on starting a weblog

I know that half of the people using Internet are already writing a weblog themselves, and that 95% of my readers have a weblog of their own. Nevertheless, I thought I'd give a simple Question & Answer kind of introduction to whether or not to start writing a weblog. So, if you're having hard time deciding this, let me give a piece of advice.

Q: So, should I start writing a weblog?

A: Maybe, maybe not.

Whaddaya mean? I thought you were supposed to give answers.

I am, but I am trying be honest too. Maybe you're the kind of person that shouldn't start writing a weblog, I dunno.

But I really want to start weblogging. I just don't know if I should.

The thing is, you shouldn't start writing a weblog for the sake of starting a weblog. You should start a weblog for a passion for some particular thing, or an extensive knowledge about something, and that kind of things. We're way past the point when people started weblogs because of the phenomenom itself. (And being way past that point is a good thing, by the way.) Now that all the glory and mysticism have vanished, the only good reason to start a weblog is to have something to say.

I'm not sure if I have something to say, but I am interested in a lot of things.

Well, that's OK too. As long as you are not starting a weblog because you want to start a weblog.

Now, then, how will I get 100000 readers for my weblog?

You won't, unless you're Stephen King.

OK. So how many readers will I get for my weblog?

It depends. Most weblogs have less than ten readers, I'd guess, so statistically speaking a good estimate would be just that, ten readers. Reader-friendly writing, original ideas or solid knowledge will get you to perhaps several hundreds. If you're some sort of celebrity (even in your own speciality), then you might get even more. Being very talented helps.

Uhh. That's depressing

No, it's not. First, the most important audience for your weblog is yourself. You write for yourself to figure out stuff. Second, you've got to realize that one passionate reader is better than ten thousand casual readers. (Though having ten thousand readers probably means that you have a lot of passionate readers too, but that's besides the point.)

Let me give you an example. My wife and I write to our daughter's (private) weblog. We write about Telma's casual everyday happenings and occasionally put some pictures up there too. The readership consists of our relatives and a couple of friends, alltogether around ten readers. But the point is that they are really happy to read that weblog. The weblog is not a substitute (for them) for seeing her in real file, of course, but they can't see her in real file that often (because of the distances and people's schedules and so on). That weblog will not become more popular ever (measured by the amount of readers), but it still serves its purpose.

How will I earn my living for writing a weblog?

You won't, unless you're Stephen King.

So, how much money will I get for writing a weblog?

Again, statistically speaking: nothing, zilch, zero. (Actually, the figure could be negative.)

Well I defy statistics and I am going to be a very popular writer; how much money will I get?

Enough to pay your bandwidth bills.

If you're good and lucky, you might also get to write for magazines or bigger websites and get paid for that. Or you might end up writing a book. But that's got nothing to do with weblogging.

So, statistically speaking, I will get roughly ten readers and no money for my weblog, why should I bother, then?

Because this is the way information is and will be spread in the world. Weblogs and the Internet in whole have removed the barrier to entry when it comes to publishing. Clay Shirky calls this the Mass Amateurization of Publishing. There won't be much money in publishing if anyone can offer the similar information to the customer with the price of zero. (We're not quite there yet, and perhaps won't ever be, but you can publish your thoughts for free (as in beer) now —free for you and free for the reader.)

So you can be part of this great information super-highway we call the Internet, contributing to it and perhaps filtering information from it. If that isn't great, then what is?

(words: 757)

[2 comments]



On using unique IPs as a measure of the amount of readers

(Not that I'd expect anyone (except me, of course) to do such a silly thing, but anyhow.)

:~/logs$ grep python access.log | cut -d ' ' -f 1
 | sort | uniq | wc -l
 1850
 

:~/logs$ grep python access.log | cut -d ' ' -f 1
 | sort | uniq | grep inktomisearch | wc -l
 820
 

For the record:

:~/logs$ tail -1 access.log | cut -d '[' -f 2 | cut -d ']' -f 1
12/Feb/2005:19:20:49 +0200

:~/logs$ head -1 access.log | cut -d '[' -f 2 | cut -d ']' -f 1
06/Feb/2005:06:52:37 +0200

[1 comment]



Comments were broken, and possibly something else too ..

.. but hopefully I've fixed them now.



Mr Ed of Hacknot on Wikiphilia

Mr Ed writes about Wikis:

Wikiphilia: A mental illness characterized by the irrational conviction that any problem faced by a group can be rendered solvable through installation and use of a Wiki.

[2 comments]



Python whitespace FAQ, or, Python is not Fortran 77

It's really rather shame that I should write a page like this in these modern, wise times, but I have heard people mentioning this stuff now and then.

So, does Python's significant whitespace suck because Fortran sucks?

No, it doesn't.

Should I refer to Fortran (77)'s whitespace syntax and semantics when discussing Python's significant whitespace?

No, you shouldn't.

Why not?

See Fortran 77 language reference. Python's significant whitespace just means that you need to indent your code correctly, which you should do anyway, and that's it. There are no fixed fields or anything like that in Python. See this old Linux Journal article by Eric Raymond for overcoming similar preconceptions.

But am I allowed to dislike Python's significant whitespace anyway?

Sure, as long as you don't refer to Fortran (77).

Should I dislike Python's significant whitespace?

No, you shouldn't.

Why not?

Because it's the most natural thing, and, while it's a lovable feature of Python, it's not that big a deal anyhow. It shouldn't be a show-stopper.

But it's ugly and wrong.

No, it's not. It's beautiful and right. But this isn't going anywhere with us arguing whether it's right or wrong. The point is that if the only reason holding you back from trying out Python is its significant whitespace, then you're really stupid. I mean a total idiot. Even if the significant whitespace is only the proverbial straw that broke the camel's back, you're still an idiot for not trying out Python because of this.

You need not like it after you've really tried it. You may as well say that you don't like the significant whitespace because you couldn't get comfortable with it. I would find that odd, but I wouldn't argue with you on that. However, if you dismiss Python as a viable alternative because of its significant whitespace; well, as I said, that's just stupid.

But it's so brittle!

No, it's not.

I know of zero cases where a non-newbie has unintentionally screwed up his Python program totally because of the significance of the whitespace. That just does not happen. Again, these are not issues that make programming hard or easy (and, believe me, there are things that really make programming hard), but are of rather minor importance.

I am not saying that messing up one's Python program is something totally unheard of, but, on the other hand, I personally know of many cases where screwed-up indentation in a language that doesn't have significant whitespace has lead a programmer to astray. Yeah, sure, from time to time you introduce a bug to your program by mis-indenting in Python, but this happens in other languages too (only in reverse, because of the insignificance of the whitespace). On my personal account, then, significant whitespace has saved me from more trouble than it has put me into.

Well, the indentation might get screwed in web pages or emails, right?

Yeah, sure. And that's an annoyance. But if the code is anything more than ten lines, it should be laid out by a professional anyhow and if the code is something significant, you shouldn't distribute it that way. If the code is an example, it's a nuisance if the indentation gets screwed, but you can work the indentation out yourself, too.

(My own code examples in the archives of this blog are actually broken, because of some change in the blogging software I use. You can more easily copy & paste the Java code in my archives, right now, but I really should just fix the mark-up.)

If you're distributing the code in regular script files, the significant whitespace poses no extra threats.

It's difficult to program Python in Notepad/Word/Some-other-exotic-editor because of the significant whitespace.

Yes, it's a bit difficult, though not impossible. I hope you don't get too upset by this, but I'll have to be insulting you again: if you program in Notepad, then you are stupid. You are, believe me.

If you don't know what editor you should use, see the page Python Editors.

It's difficult to move around big code blocks because of the indentation issue.

This is true and a real issue. There are features in advanced editors that make it easier, but it's not real easy with them either. But it's not like you can move around big blocks of code easily in every other language either. The program might be syntactically correct after moving the code block, but you still have to fix the indentation.

But this is really also a question of one's personal programming habits.

(words: 758)

[11 comments]



Stumbled on: Henri's list on how to spot a wannabe web standards advocate.



Lesser known historical tidbit of Python

Most of us know, and some have even read, the original announcement of a new programming language called Python back in 1991 by Guido van Rossum. But did you know that shortly before that Guido wrote a rather apologetic response to being flamed about non-source posting to alt.sources.d:

OK, hey, I surrender! I won't ever post non-source to alt.sources again! But don't send me any more flames. How many self-appointed policemen does alt.sources have? Are there any other rules I should be aware of? I am about to post half a megabyte of source; wouldn't want to be flamed for *that*...

?

Well, I didn't.



So much for Google's services being flawless; I've been waiting for a half an hour now for Gmail to respond me. It has been giving me 502 Server Error. And, no, I haven't been "trying again in 30 seconds."

Gmail is still one of the most reliable and responsive services I use regularly, but I am glad they are not perfect either.



<M <Y
Y> M>