Older blog entries for spiv (starting at number 10)

RickMuller:

Rather than compare and contrast, I'll just add to the problem -- there's also epydoc, which Twisted uses.

bigbuba mentions an IDE with support for no overlapping windows:

Just like tab support in the window manager, this might be tough to implement. Anybody take that as a challenge?

It's already been done; I've used it for ages. It's called ion. The development version is very slick -- you can have PWM-style (i.e. normal floating, overlapping windows) workspaces as well as ion's normal no-overlapping windows workspaces at the same time.

In other news, Twisted just keeps on getting better and better... Woven is now one of the best documented parts of Twisted, rather than one of the worst. Also, I started reading and posting to comp.lang.python several months ago so I could point people to Twisted when appropriate -- and mostly, I don't need to. The comp.lang.python regulars are cheerily recommending it already.

And best of all, I got an awesome tshirt while at PyCon featuring artwork from isometric's Twisted-inspired strip. Life's good.

22 Nov 2002 (updated 22 Nov 2002 at 11:45 UTC) »

robilad:

Seems like I need to have a look at a reasonable documentation system that will let me generate man pages, info files, HTML and pdf docs all from one source.

I recommend Twisted's Lore package, which will be part of the imminent 1.0.1. Lore can output HTML and LaTeX (and thus ps and pdf) from XHTML source. Actually, it's a subset of XHTML, and it uses the class attribute alot to provide semantic rather than presentational markup, e.g:

... will return a <code class="API" base="twisted.internet.defer">Deferred</code>.

or:

You can footnote<span class="footnote">This is a footnote.</span> text.

It's currently geared towards Python docs, i.e. it can pretty-print python code and automatically link API references to epydoc's output, but is easily extensible. Docbook output is in the works (which in turn provides for info pages), and we have a man2lore utility, which is simple but sufficient for Twisted's manpages.

It does nice things like turn relative links to other HTML files into LaTeX cross-references, and so forth. It automatically creates a table of contents for the HTML output based on your H1, H2, etc tags. And a nice side-effect of using XHTML as source means that the unprocessed source document is directly viewable (although occasionally ugly, such as with footnotes (but stylesheets can help)), which is handy.

It's also quite small; there's only about 600 lines of source that does all this, and it includes a lint utility! So, it shouldn't be too scary to work with, even if you don't know Python. Feel free to ask about it on #twisted (on freenode) or the mailing list if you're interested, we'd be happy to help.

Hacking:

I was going to talk about the fun I've been having working on Lore, but I think I've probably covered that quite well already for this entry :)

jds:

Woah. Chill.

You're missing the point. It's "HOWTO Encourage Women In Linux". Not "HOWTO Make Linux a Feminist Battleground" or "HOWTO Use Linux to Overthrow the Patriarchy". Val's HOWTO isn't there because Linux is meant to be about gender issues. It's there because there's less women involved in Linux than there could be. Don't misrepresent the message or intent of the HOWTO -- that wouldn't be truth, would it?

And you've got it backwards, anyway. The problem isn't a HOWTO that you fear will "Make Linux about gender." Of course gender should be irrelevant to Linux -- so why does the HOWTO exist?

It's because some people in the Linux, unwittingly or not, do make gender an issue. They treat women differently, make them feel uncomfortable, unwelcomed or even threatened. That, I think, is why Val wrote the HOWTO: to point out this problem and give ideas on how to correct it, so that gender isn't an issue for Linux. I think you, me and Val all agree that this is the way it should be.

Hacking:

Twisted 1.0 has been out for a while and no show-stoppers have been found... in fact the response has been quite positive. It's great to see the mailing-list become more active -- we're obviously getting more users.

1.0.1 is slowly arriving, with lots of nice little bits and pieces: the UDP API is better and will probably be marked stable soon, and the documentation is much better, in quantity, quality and presentation. It's been fun working with moshez on the doc generation stuff (which will be in the twisted.lore package of 1.0.1).

Oh! -- and z3p's ssh implementation, twisted.conch, is rocking. The client works beautifully -- running terminal programs, or doing CVS checkouts, or whatever. I still find it to be amazingly cool.

dopey writes:

What do you do, on an open source project, where the author takes in any patches that you submit, uses them, but fails to credit you in any way?

Submit a patch to update the CREDITS file, of course ;)

Work

I'm starting to feel comfortable at my new job, although I'm still discovering new things about Zope...

Twisted

1.0 is taking a little longer to happen than originally planned, but is very close now.

Recently I wrote an inetd(8) replacement for Twisted, mainly as a practical example of how to write a superserver that spawns child processes. It was liked enough that it was given its own subpackage, rather than being buried in the doc/examples directory. I'm happy that it's a fairly short and mostly functional implementation of inetd.

I was disappointed that I had to resort to writing a C extension module for part of setting up Sun-RPC services (for the pmap_set(3) function), and they still don't quite work properly. I'm not sure where to find documentation on how an inetd implementation should run rpc services, although I'm sure it's out there (yes, I've looked at the inetd(8) source in Debian, but not know the first thing about Sun-RPC, it didn't really help).

15 Jul 2002 (updated 15 Jul 2002 at 15:07 UTC) »

Job
Starting new job tomorrow. Scary and exciting.

Twisted
So Twisted 0.19.0 is out. I'm finally starting to feel happy about the FTP client code, after figuring out that I needed to extend DeferredList a little. It's so obvious in retrospect. I'm amazed at how enthusiastic all the Twisted developers are -- myself included. There's a strong feeling of "we need more people so we can do more cool stuff" -- it's a very friendly and welcoming project. Bug reports are welcomed and thanked, documentation contributions are particularly appreciated... Twisted is getting to the stage where I could say it is well-documented and keep a straight face.

It's amazing how much difference a positive development community makes, at least to me, a potential developer. Before I started playing with Twisted, I contributed a few patches to another project (which shall remain nameless). While I've no doubt that the people behind it are nice people, you quickly get discouraged when your posts to the mailing-list get completely ignored (except by a couple of other users). While I'm not so arrogant as to think my work was flawless, some acknowledgement from the developers would have been appreciated. Some criticism explaining why my patches were not included would've been even better. Anyway, about a year later, that particular feature is still on the "todo" list for that project, and I spend my time working on other, more rewarding, things. It took very little effort to become involved in Twisted, thanks to their active encouragement of potential developers.

Twisted is slowly accumulating random fun bits on its way to 1.0 (which isn't looking so far away anymore). There's an implementation of the "MouseMan" serial mouse protocol in 0.19.0. There's also signs of an ssh implementation coming soon...

linux.conf.au 2003
I see that they've extended the deadline for abstracts by 2 weeks. That means I get to sleep a bit longer tonight, and worry about it later...

mwh: Heh. It was such a trivial "problem" that I nearly didn't bother mentioning it in my Advogato diary... but you've just made my day :). Hooray for slicing, and for Python 2.3! (isn't the 2.3 alpha release overdue?)
Physio

Physiotherapy is great, but expensive when you have it several times a week. I think my shoulders are slowly improving without needing physio anymore, so I probably won't be making any further appointments. It'd be good to be able to stop consciously thinking about my shoulders and wrists, though.

Twisted

19:21 <adiabatic> get a flower and say to yourself "how can one screw up sending a filelisting via passive FTP? let me count the ways..." and then start plucking petals

0.18.0 was released a while back, and seems to be solid. Unfortunately some of the FTP unit tests are failing again, and there seems to be really nasty timing issues involved -- adding a blank print statement to a single-threaded program should not make a test pass. Similarly adding a time.sleep(0.1) call somewhere else shouldn't make another test fail.

The FTP server code is sufficiently ugly that I think I'll simply rewrite most of it, and see if the bug goes away. It needs a rewrite for other reasons anyway, it should be using stuff like twisted.cred. I suspect this is simply a different manifestation of the same bug that causes the bulk of the FTP tests to fail on Win32. At least I'm reasonably certain the bug is in the server and not the client code, which means it's not my fault ;)

PyGTK

I had an opportunity to muck around a little with PyGTK this afternoon, helping a housemate plot a wave to a pixmap in a window. It turned out to be surprisingly difficult, mainly due to us making various incorrect assumptions. I stupidly assumed that the colormap's alloc method took 8-bit RGB values (I'm too used to HTML), whereas it took 16-bit, meaning that I everything I did seemed to come out black. The other big problem was that the pixmap persisted between invocations of the python script! That meant that making a change and trying that, then undoing the change and trying again would not give the same results as the previous time until we explicitly cleared the pixmap with a draw_rectangle call. GUI programming is painful.

Python

A small problem that I occasionally bump into: sometimes you want to iterate over every 2nd item of a sequence (or more generally, every n'th item). I'm yet to find a satisfying solution to it, as it doesn't map cleanly onto a for loop, and slices don't support skipping n elements like that. You could do it with a generator that keeps a counter internally, or perhaps subseq = [seq[x] for x in range(0, len(seq), 2)]. Actually, that list comprehension isn't so bad, that didn't occur to me before. I guess I'm just feeling spoilt by Python's tuple unpacking that allows stuff like for a,(b,c) in [(1,(2,3)), (4,(5,6))]: ...

Ouch
My shoulder and neck have been hurting alot. I'm seeing a physiotherapist about it, and I've realised it is due to bad posture. I've fixed the problem at work, thanks to an adjustable chair, but my home computing environment is the real problem. I'm currently sitting on an "executive" style chair, which means it leans back if I lean back at all... very comfy, until you find yourself hunching forward to counteract the leaning back. Hence the severe pain. Moral: Posture is important. And don't wait a few weeks hoping the pain will go away by itself.

SLUG
A month ago, I allowed hypatia and jdub (both of who I live with!), who are on this year's SLUG committee, to convince me to give a talk on Python to SLUG. I was assured the Perl bigots would be gagged ;)

I'm generally not a confident public speaker, to say the least. I've had many bad experiences with hand tremors and general nervousness making public speaking a real nightmare. Also, my previous talking experience has never been for more than 10 minutes, and a SLUG talk is typically 40, so I was starting to feel quite worried as the hour of the talk approached. However, I felt very confident that I knew what I was talking about (as opposed to half-researched uni assignments), and I apparently gave a really good talk. People asked questions during and afterwards -- and I could answer them. And it is really, really wonderful to have people come up immediately afterwards and say "Thanks, that was a really good talk". It sounds so simple but it is such a great feeling to receive that sort of compliment. Thank you to everyone who was kind to me after the talk!

I was unsure of what I should say. I didn't really know how many people were at all familiar with python -- or indeed with programming in general. I decided to do a broad, but shallow talk, which means I covered lots of random things, but didn't spend very long on any one thing. My reasoning was that Python is easy to learn, and there are good tutorials on the web that can probably teach it better than I can, so instead I should try demonstrate why you might want to use Python. The format of 10 minutes flicking through the basics ("here are the built-in data types, here's what functions and classes look like"), followed by an overview of Python's object system, functional programming, and random odds and ends (the talk was roughly 40 minutes all up). Things like interactively using the dis (disassembly) module and the one-liner mandelbrot generator were nice examples, I think. People also seemed interested in the wacky stuff like generators and nested scopes.

Perhaps the most remarkable thing about the talk was that people found my joke about Singleton funny :) Singleton is where I grew up, and it has the southern hemisphere's largest monolithic sundial (the sign in the town simply says "WORLDS LARGEST SUNDIAL"). People don't expect a picture of a big concrete sundial to appear on slide about implementing the "Singleton" design pattern...

Neato
Hooray... updating my diary from the Python interpreter. Very cool.

Twisted
My FTP client for Twisted seems to work well. I'll check it in tonight. It feels odd to be rewriting something as common as FTP, which you just get used to taking for granted...

1 older entry...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!