Search Results: "bab"

12 November 2005

Anand Kumria: Plugins I have installed

<p> <a href="http://www.stillhq.com/">Michael Still</a> <a title="trackback pings" href="http://www.stillhq.com/blosxom/000007.html">writes</a> about <a href="http://www.movabletype.org/trackback/beginners/">Trackback pings</a>. </p> <p> I'm still not used to blosxom and how everything fits together but I thought I'd enumerate the plugins I've installed. </p> <dl> <dt><a href="http://www.insanum.com/downloads/BlosxomV2/categorytree.gz">categorytree</a><dt> <dd>I've actually got this named as 01categorytree, so it runs first, but it gives me the listing of topics I've posted too</dd> <dt><a href="http://www.hecker.org/blosxom/extensionless">extrensionless</a></dt> <dd>I'm a big fan of <a href="http://www.w3.org/Provider/Style/URI">Cool URIs</a>, this helps me almost get there. Bonus points to those who can work out where I don't quite make the magic happen seemlessly. Oh, named 02extensionless.</dd> <dt><a href="http://www.blosxom.com/downloads/plugins/atomfeed">atomfeed</a></dt> <dd>As every good blogger knows, syndication is the name of the game. While you got use the deprecated RSS, <a href="http://atomenabled.org/">Atom</a> is where is it at. I've actually disabled RSS feeds in preference to atom</dd> <dt><a href="http://www.blosxom.com/downloads/plugins/breadcrumbs">breadcrumbs</a></dt> <dd>On permalink posts, you'll see a click-trail. All professional websites have them, so I figured I should too.</dd> <dt><a href="http://molelog.molehill.org/blox/Computers/Internet/Web/Blosxom/Calendar/">calendar</a></dt> <dd>Presents a calendar with all the posts you've done on various days highlighted, so you can quickly determine when someone has been sleeping or has been an insomniac</dd> <dt><a href="http://www.blosxom.com/downloads/plugins/config">config</a></dt> <dd>Comes with the Debian blosxom package, and originates with the author. Allows you to customise configuration dependant on where the post is in your heirarchy and other magic.</dd> <dt><a href="http://my-security.net/bloxsom/directorybrowse.txt">directorybrowse</a></dt> <dd>If you have deep category hierarchies this makes all the elements of the paths clickable. It's cool, you want it.</dd> <dt><a href="http://www.hecker.org/blosxom/plugins/feedback">feedback</a></dt> <dd>Part of the blogging scene is to allow other people to comment upon what you've written. This gives them comments and trackbacks. I've modified this somewhat and still need to fixup how comments are previewed but otherwise this plugin is gold</dd> <dt><a href="http://www.blosxom.com/downloads/plugins/flavourdir">flavourdir</a></dt> <dd>Also part of the <a href="http://packages.debian.org/blosxom">blosxom</a> package, this means you do not have to have your blog entries intermingled with the page templates (known as flavours) used to display them</dd> <dt><a href="http://www.blosxom.com/downloads/plugins/interpolate_fancy">interpolate_fancy</a></dt> <dd>For large plugins, like feedback, you might end with some text on your template that you only want displayed some of the time. This enhances blosxom so your template (flavour) can have conditionals, comparisons and whatnot.</dd> <dt><a href="http://noone.org/blosxom/multcat">multcat</a></dt> <dd>Not everything can be easily catagorised into one thing. This lets you put a post into multiple places. It'd be nice if all the categories a post was under was displayed as part of the category path</dd> <dt><a href="http://www.insanum.com/downloads/BlosxomV2/rendertime.gz">rendertime</a></dt> <dd>Calculates the amount of time the page took to render</dd> <p> On my todo list is to convert from a table based layout to a fluid CSS one. It'll probably be a 3-columned look with fixed-width sidebars since negative margins looks are harder to get right.</p>

Anand Kumria: A walk across the Sydney Harbour Bridge

# metadata <p> I woke, not for the first time today, and there were people all around. Dressed up and talking. And drinking. </p> <p> Ahh! I'd fallen asleep at a bar. <em>Again</em>. Fortunately that is enough off a clue for me to realise that I should go home. Getting home, is where this adventure starts. </p> <p> I started off at <a href="http://www.sydneypubguide.net/pubs/Cruise.aspx">Cruise Bar</a>, which has a great view of the Opera House [<a title="Sydney Opera House in the afternoon" href="/~wildfire/aum/images/opera-house-in-afternoon.jpg">1</a>], [<a title="Sydney Opera House at dusk" href="/~wildfire/aum/images/opera-house-at-dusk.jpg">2</a>], [<a title="Sydney Opera House at night" href="/~wildfire/aum/images/opera-house-at-night.jpg">3</a>] and (somehow) staggered my way to the <a href="http://www.sydneypubguide.net/pubs/Ship_Inn.aspx">Ship Inn</a>. Unable to flag down a cab in this area &ndash; lots of people going home around 23:00 &ndash; I resolved to get myself to North Sydney, where lots of cabs are. </p> <p> For those of you unaware, Sydney Harbour Bridge now has security personnel stationed at all pedestrian entrances and across its length. At least six of them "patrol" the bridge. </p> <p> By "patrol", I mean of course you'll be queried as to why you wish to cross the bridge. <q>Mate [sic], you can't cross the bridge. You aren't allowed here</q>. <q>Mate, are you fucking deaf?</q>. (on radio, to pals)<q>Yeah the fucking wog is crossing, shall I intercept him and hold him?</q> </p> <p> Followed while crossing the bridge. In my case I had (at one stage 3 security personnel behind and adjacent to me and 3 policemen ahead of me). And abused (I was repeatedly cursed at, racially slurred against, by the people from IVS Security) during your walk over the bridge. It amazes me that they even had police waiting to talk to me. Fortunately I know that the best thing you can do when confronted by the police is not to say anything. </p> <p> In this case there is nothing they could do -- since crossing the Harbour Bridge, and not responding to the security guards who harass you is not (yet) a crime. Today, 2 Nov 2005, though the Parliament of Australia is rushing through laws which might mean that I can be "detained" and held incommunicendo indefinitely. </p> <p> These laws &ndash; part of the War on Freedom &ndash; would make the rest of this entry illegal. </p> <p> I've been thinking about terrorism and Australia. How would you get access to restricted locations, determine sensitive areas and generally get information not available to the ordinary public? Become a security guard. </p> <p> In Australia, things like <a href="http://smh.com.au/news/national/braindamaged-man-told-to-pay-up-after-bashing/2005/11/01/1130823210703.html" title="victim of security guards">this</a> are not uncommon. (c.f. David Hooks killed by a security guard; a female security guard shooting someone, etc.). Worse is that security guards often enjoy a fairly close relationship with the Police. Meaning that if you join up, you also get to know some of the procedures that might be applied to deter you. Bottom line: every security guard is a potential terrorist. </p> <p> Terrorists, like modern-day Politicians, seek to curtail the liberty of others for their own purposes. The best way to do this is by planting fear and doubt into the hearts and mind of the general populace. In America, this was done via the September 11 plane hi-jacking; in the UK, by exploding bombs on the mass-transit system there. </p> <p> How, or where, should Australia be targetted? Australians are renowned world-travellers (I believe the figure is that 10% of Australians are outside the country at any one time), so attacking transportation isn't the way to go. You need to go after the life-style. </p> <p> Large community events, like Melbourne Cup day, the various Grand Finals and, of course, Cricket would be the perfect targets. High visibility (the media are already at these venues!), high impact (you are talking 30,000+ people in these stadiums), for minimal cost (a stadium has few seating area &ndash; probably 6 to 8 attackers could bring down most stadiums). </p> <p> Another good location would be to pick your local Westfield shopping centre / mall. Lots of people, lots of fear instilled. Plus we'd be rid of the stupid things. </p>

Tollef Fog Heen: Nokia 770, initial experiences. The software version is 1.2005.42-9

which is what was shipped with it, and I think there might be a newer firmware out there which fixes some of the issues. I just got my Nokia 770 and I must say it's a nice device. Some initial experiences are: All in all, mostly happy, but there are still a bunch of rough edges which should be smoothed away in a few more revisions. I'll see if I can get a development environment up and running on it, as well as getting a newer firmware onto the device (if I can find it; I wonder if the developer rootfs on maemo.org is newer or not..), but all that's for tomorrow.

11 November 2005

Joe Wreschnig: More Python

I’m writing a registration database for Anime Detour, our local anime convention. Normally I would hate this kind of work (does anyone actually like SQL?) but SQLObject, which [info]gesten pointed me towards, is really awesome. It basically turns any SQL database (in my case SQLite) into a Python object database, with classes as tables, instances as rows, and Python class methods for queries. People stuck writing database code should definitely check it out. Another Optimization Lesson
Quod Libet stores a library of your music, like most other players. The most common things the library needs to do, and therefore the most efficient things it should do, are 1) get a list of songs in the library, and 2) check to see if a song is in the library (or equivalently, given some handle, retrieve the song with that handle from the library). Anyone familiar with Python will probably think of a dict keyed to something unique, like the filename or URI. That’s what I did, and that’s what I wrote. When QL saves, it serialize the song list using pickle, and dump it to the library: pickle.dump(library.values(), file). When it loads, it does something like for song in pickle.load(library): if song.valid(): library.add(song) where song.valid() reloads the song if its mtime has changed or removes it if the file no longer exists. So what’s the problem with this code? I sure didn’t see one until this morning, when our Italian translator complained about interestingly long cold cache startup times. The answer’s at a lower level than Python programmers usually have to work at: This sucks for disk cache. library.values() dumps the file in Python dict order, which is not only not meaningful, it’s actually semi-random for security reasons. When I reload the dumped file and iterate through the songs in it, I’m stat(2)ing files in an order designed to be as unpredictable as possible. How is the cache supposed to cope with that? The answer is, it doesn’t. Sorting the songs by filename when saving the dict costs almost nothing (Python out-sorts every other language as far as I know), but saves 10% wall clock time for me when starting - it will probably save even more on filesystems that perform poorly on stats of large files (reiser3), and directory trees that go more than 2 levels deep. Lessons learned: First, CPU profiling is good, but doesn’t have all the answers; profile.py insists the program is slower because of the sorting on exit. Second, ideas that work fine for n=100 don’t work well for n=10000 even if the algorithm you chose scales well with regard to complexity theory. Finally, the fundamentals still matter; fixing slow Python code still makes you consider OS/hardware-level cache effects.

Uwe Hermann: 2005 Machinima Festival This Weekend

The 2005 Machinima Festival will be taking place in New York City at the Museum of the Moving Image in Astoria, NY, starting November 12. Here's what Wikipedia has to say about Machinima:
Machinima (a portmanteau word for machine cinema and/or "machine" "animation") is both a collection of associated production techniques and a film genre (film created by such production techniques). As a production technique, the term concerns the rendering of computer-generated imagery (CGI) using low-end 3D engines (as opposed to high-end and complex 3D engines used by professionals) in video games (typically, engines in first person shooters games have been used). Consequently, the rendering can be done in real-time using PCs (either using the computer of the creator or the viewer), rather than with complex 3D engines using huge render farms.
Have a look at the popular Red vs. Blue if you have never seen a machinima video. Checkout more stuff from the Machinima Archive over at the fantastic archive.org. I won't be at the festival, but I'm getting more and more interested in video in general and especially in machinima, so I'll probably create some films myself eventually. (via Digerati University and Slashdot)

Matthew Palmer: Do we need a licence to *use* our software?

Note: All of this is specific to Australian law. Similar principles may apply elsewhere, but I've got no idea where, if any, they might apply. Also, I'm not a lawyer, nor do I play one on TV, and my writings here (and for that matter, everywhere else) are for entertainment purposes only. If swallowed, do not induce vomiting. In the middle of a cogitation this morning, my thoughts turned (as they occasionally do) to the much loathed EULA for Nobody's Favourite OS. As we all know, this EULA is pretty brutal in the things you agree to allow other people to do to your machine, and the rights you agree to give up. As I was, in general, thinking about issues of copyright law, the EULA got looked at through copyright-coloured glasses. And it was... weird. As we all (probably) know, copyright law is about limiting the actions that can be performed with a work of creation, and giving the author of the creative work the ability to be the sole arbiter of who can perform those actions. The Australian Copyright Council has a nice information sheet on Copyright and Computer Software if you'd like to get the full story. The set of actions which the Copyright holder has exclusive rights to is fairly well proscribed. The statement "All Rights Reserved" doesn't mean "every possible right is reserved", it means "those rights which I can control (by virtue of the legally-protected monopoly of copyright law) are reserved". As far as I can tell, there is no right which allows the copyright holder to control the use of the creative work. It's important to think about what "use" actually means. The Copyright Act and the above info sheet tend to apply the word "use" to include the act of making copies, as well as other dealings (protected or otherwise) in the copyright work, but that doesn't seem particularly useful for this discussion, because I can't think of another appropriate word to use to describe a non-copying action involving the work. So I'll stick with "use" for that, and go with "copying" for any duplication. Obviously, the type of work that we're looking at determines what "using" that work means. A book is read, or perhaps burnt for warmth. A picture is stared at. A computer program is run. I can't find anything in Copyright law that covers reading, burning, or staring, but section 47B of the Copyright Act 1968 (Cth) deals with the "normal use or study" -- basically, the act of using the thing. It says that users are allowed to copy the program into RAM to run it[1]. Goody. So far, it looks like there's no way the copyright holder can stop us from running our legally acquired copies. There are two flies in the ointment, though. The first is s47(2)(b) of the Act:
(2) Subsection (1) does not apply to the making of a reproduction of a computer program:
[...]
(b) contrary to an express direction or licence given by, or on behalf of, the owner of the copyright in the computer program to the owner or licensee of the copy from which the reproduction is made when the owner or licensee of that copy acquired it.
Aaaargh! Does this mean that the copyright holder can force a licence on us, against our will? I really don't know the answer to that. Hopefully, at the very least, the protections of contracts law[2] would apply to such licences. If licences can be treated as contracts, then they can be rejected. If the copyright holder can't restrict the running of a legally obtained copy of the program, then how can they compel the acceptance of a licence? One idea that comes to mind is the process of installation. That is neither an incidental nor an automatic copy, and hence doesn't fall under the allowances of s47. So, without the permission of the copyright holder, making an installation from CD to your hard drive would seem like an infringemnet. On the other hand, the installation program usually runs directly from (for example) the CD, and if it wants to make copies of other copyright material owned by the same person or company as part of it's ordinary operation, then who are we to stop it? But back to the idea of compelling acceptance. Looking at the XPToy Retail EULA for a moment, part of the agreement is that you agree to be bound by the terms by the action of installing, copying, or "otherwise using" the software. But if you don't agree to any of the EULA, I'm not sure how you can agree that you agree to be bound by the EULA by performing an action which the copyright holder cannot restrict you from doing. On the other hand, perhaps I've drunk too much of the GPL "You don't have to accept this licence, but nothing else gives you the right to copy this software" inplied-licence-acceptance kool-aid, and there is provision in law for licences to specify other positive means of signifying acceptance. I know that contracts can be accepted by written agreement between the parties, and with a suitable verbal exchange, so perhaps you can add "Installing, copying, or otherwise using" to that list. I wonder if "You agree to the acceptance of this agreement to give me your first-born child by blinking within 15 metres of me" would be valid? No, I didn't think so either. Does anyone know where the descriptions of permissible means of agreeing to a contract are defined in Australian law? To get back on track, let's assume for a moment that we can refuse the EULA. Can we still use the software? s47(2)(b) says we can't contravene licence terms, but if we can refuse the EULA then it doesn't look like there are any licence terms. So we're back to relying on s47(1), which says copying for running the program isn't a problem. If you can avoid accepting the EULA, and don't do anything otherwise naughty with the software, I can't see how anyone can have any complaint, in Copyright law, with your actions. Of course, the next trick is to avoid clicking-through the EULA "you accept" notice without falling foul of any other provisions, but if we've already knocked the paper-EULA on the head with contracts law or something, then I don't think that your click-through acceptance (coerced, as it were) is going to worth a hell of a lot more. I know the DMCA in the US did a lot to strengthen the power of click-wrap licences; perhaps those provisions got written into AusNSFTA. Of course, this whole thing is based around a lot of conjecture and a lack of real, detailed knowledge of the law. Perhaps there's even some bits of the Copyright Act I've missed. I'd be interested to hear your thoughts on the matter. Do we need a licence to use software we've legitimately purchased? I'm interested in your comments. E-mail me at mpalmer@hezmatt.org.
1. I'm not quite sure why this is so majorly different to a person with an eidetic memory reading a book, but I guess it's better to cover the issue to stop lawyers getting richer. 2. There's all sorts of goodies in contracts law, from what I recall -- prohibitions against coercive contracts, and contracts presented as a fait accompli (AKA "take it or leave it") without any ability or intention to negotiate. Certainly sounds like a EULA to me...

10 November 2005

Christian Perrier: Holy war against Nexenta

Hmmm, dear LWN, Anthony Towns is not alone when claiming that the reaction of the Debian community towards Nexenta after they announced their work was probably overflated and certainly too much aggressive. I remember having done so already and I did it again later. I usually avoid debian-devel flamewars but here, this is not really a flamewar. This was a rude action against people who may have done mistakes, errors and certainly need to talk deeper with the Debian community. Even if the contributors in this thread do not think they have been rude, I'm pretty much sure they have been "perceived" as being rude by outsiders. I'm afraid that such behaviour is very likely to enforce a very commonly feeling among the free software community of Debian being a kindergarten of free software bigots completely disconnected from real life. We know we are not this so we should try to avoid people thinking we are. This is not why I work in this project. When it comes at Free Software, I'm a kind of "bigot" too, but I usually try to not enforce my bigotry to other people by being uselessly aggressive. This also is a key point for Free Software and we should more often think about it. (don't take the word "bigot" as first degree, please...) We (as a community) have been aggressive with Nexenta about this issue, just like we have been in the past with, say, Ubuntu. So, I wish that we'll sing along with Erast Benson at next Debconf just like some did at Debconf 5 with the Shuttleworth gang. I wish I would see more Debian contributors bringing this feeling in -devel, especially our "historical" contributors, just like Ian Murdock did. Don't be shy, people..:-)

Joey Hess: BBS

Sometime over the years, I've managed to forget, or block out, most of my memories of the time in high school when I used BBSes, before the internet. Even though I still have friends from back then, and even, come to think, host a rack of computers at the house of a guy who was once a sysop. Those couple of years (how many?) are mostly a blank, and not something I think about much. I can't remember the first time I used a BBS. I can remember clearly and crisply the first time I used a unix system. A bit of it came back when I didn't pirate the BBS Documentary, an epic 8 part series of interviews with the people who brought us the likes of XMODEM, fidonet, pcboard, and ansi art. Highly recommended. Amazing how just looking at so many of the people immediatly reminds me of the BBSers I knew at the time. Its producer, Jason Scott, also runs textfiles.com, a huge collection of all sorts of text files from the 60's through 90's, which mostly originate from old BBSes. His historical bent in preserving and documenting this stuff really appeals. I poked around the net today, managed to find some docs about one BBS I remembered using, and nothing about a couple of others. Logged into a telnet BBS or two and remembered just how angry fruit salad and silly to use those systems really were, and also how much they probably contributed to my enduring enjoyment of unix, muds, and email. I thought it would be nice to not forget about this stuff, and so I coded up a reminder, merging the ancient plain text files with what's currently new and spiffy (weblogs natch), and creating this webblog which has a random text file posted to it each day. Of course, the subjects range from anarchy, to programming, to phone phreaking, to porn, so view at your own risk, just as if it were 1992, and you were were dialing a number your war dialer had found while you were away at school. Would you like to play a game?

8 November 2005

Martin F. Krafft: Call from Ghana

I just received a call from Ghana. Supposedly I was sent a very special offer yesterday about a business transaction of a whole lot of money. Wow -- actually I only guessed this for I could barely understand a word of the babble. I filter spam, no really, I do. And those mails that get through currently get auto-replied with my telephone number, for I shouldn't be typing <slaps himself>. I have no clue whether one such auto-reply prompted the scammer to call me at this unholy hour. How curious. I told the guy to resend the mail. I mean, www.419eaters.com will dig this (This is not a promise I will carry through... and sorry for the false link. 419eaters.com directs elsewhere than www.419eaters.com does...) Damn, and now I feel somewhat trist witnessing what some people go through just to survive.

Steve Kemp: Things I have never written #1

Coding Mistakes
I broke my debian administration website yesterday. Predictably enough I’d woken up around 9AM and thought that it would be a good time to make significant refactering changes. Tested them on my laptop, committed them to CVS, then updated the live site. Had a quick play to make sure nothing had obviously broken - but didn’t try to leave a comment on an article. Went to sleep and woke up around 4pm to find 15 emails telling me things were broken. Most mails on the site in a single day! Should be fixed now. But I’ll never again make changes before lunchtime, I’m just not good with the whole sleepy-coding thing.
Things I have never coded: 1
Inspired by Joey Hess’s “Ten years of free software”. Things I have never coded part 1. I have never coded a text editor. *shock* In the past I have written simple wrappers around the various text controls in different environments - for example under Windows I once coded a tabbed text editor called MyNotepad, which featured a novel dockable tree-control to the side which allowed navigation and loading of files easily. When I first started working with Java I coded a similar thing, but with the ability to load external Java .class files as plugins. This editor was called Rosetta, inspired by the band Rosetta Stone (who were in turn inspired by the actual Rosetta stone ) At times I think about text editors. I use them daily, obviously, and I love working with some more than others. My editor is usually GNU Emacs but I’m also partial to Vim. I will use both happily; although neither is pleasant without my personal customizations. Simple text editors are a traditional project for coders, and freshmeat is littered with their discared corpses. Probably the only reason I’ve not started - that and apathy. My ideal editor would be:
  • Both curses and x11 based.
  • Scriptable (Lua is love?)
  • Extensible.
  • Portable between (at least) GNU/Linux and Solaris.
  • Modeless.

7 November 2005

Adam Rosi-Kessel: Plamegate Summarized

Following up on last week’s excellent interview with Brent Scowcroft, the New Yorker featured a well written and thought provoking article on the Valerie Plame Wilson affair this week. The article doesn’t necessarily break any new ground, but it’s the best summary I’ve seen so far of the scandal. If you haven’t been following every twist and turn day by day, you’ll probably learn something new. Even if you have, the article puts the whole thing in perspective in a way I haven’t seen elsewhere.

6 November 2005

Philipp Kern: Happy Meal Ethernet

Probably it’s very old, but hey I had a good laugh...
Actually, it is a Sun engineer joke. The 10 Mbps predecessor was a chip called the “Big MAC Ethernet” in this case, it was a mere pun, since MAC stands for Media Access Control, i.e. the Ethernet data-link layer. When they designed the 10/100 Mbps chip later on, they decided to turn the pun into a full-out joke, and they called it the “Happy Meal Ethernet.”
528 static void happy_meal_tcvr_write(struct happy_meal *hp,
529                                   void __iomem *tregs, int reg,
530                                   unsigned short value)
531  
532         int tries = TCVR_WRITE_TRIES;
533         
534         ASD((“happy_meal_tcvr_write: reg=0x%02x value=%04x\n”, reg, value));
535 
536         /* Welcome to Sun Microsystems, can I take your order please? */
537         if (!(hp->happy_flags & HFLAG_FENABLE))  
538                 happy_meal_bb_write(hp, tregs, reg, value);
539                 return;
540          
541 
542         /* Would you like fries with that? */
543         hme_write32(hp, tregs + TCVR_FRAME,
544                     (FRAME_WRITE   (hp->paddr << 23)  
545                      ((reg & 0xff) << 18)   (value & 0xffff)));
546         while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries)
547                 udelay(20);
548 
549         /* Anything else? */
550         if (!tries)
551                 printk(KERN_ERR “happy meal: Aieee, transceiver MIF write bolixed\n”);
552 
553         /* Fifty-two cents is your change, have a nice day. */
554  
[Taken from drivers/net/sunhme.c in linux-2.6]

Andrew Pollock: [code] Obfuscating email addresses with JavaScript

So I got pet peeved by Carlos Laviola in relation to by recent pondering about how MacOS X's SSH agent starts up on login. Perfectly reasonable grounds for complaint. I have had people contact me in relation to blog posts in the past, so it's obviously not impossible. People know I'm a Debian developer and can put two and two together and wind up at db.debian.org. Anyway, I'm the first to admit that my blog probably has too many of the Weblog Usability Top Ten Design Mistakes (something for me to work on). To date, I've been avoiding plastering my email address on my website because I didn't want to get it harvested. I try and use a per-list email address for this reason as well, and I haven't enabled blog comments because of comment spam, and because I haven't been clever enough to implement comments with Blosxom full stop. So I started getting an idea for reversibly encrypting my email address on my blog after reading about Hashcash for Wordpress the other day. I first started playing around with the Vernam cipher in High School, when I wanted to easily reversibly obfuscate some data for something. I'd read about this cipher in a magazine or something and seen it implemented in Pascal (it's not exactly hard). So I happened upon the idea of encrypting my email address with the Vernam cipher. Turns out another chap's already got a page for encrypting and decrypting on the fly with JavaScript. It even generates the JavaScript for putting in your own web pages. I had to use a different key to avoid getting dollar signs in the encrypted string, as this confused the tripe out of Blosxom (and me for a while when I tried to figure out what was going wrong). Then I thought it'd be nice to explain to people who had JavaScript disabled what they might be missing out on, so I fiddled around with some DOM stuff, and had some text get displayed if JavaScript was disabled. When JavaScript is enabled, this text is replaced by the decrypted text. So of course, like the Wordpress Hashcash, this is largely relying on the inability of spam bots to grok JavaScript. Once they can, this obfuscation technique is all for naught. Meanwhile, you can email me bit more easily now if you get the urge. View the source of my blog for an example of the implementation.

5 November 2005

Anthony Towns: Britney's Memory Management

One of the things about the whole money thing and free software is the question of whether it’ll take all the fun and spontaneity out of hax0ring. As it turns out, that doesn’t even work when you try; so instead of doing dak work last weekend, like I’d planned and like the market was indicating, I ended up hacking on britney until about 5am Sunday morning, leaving the dak stuff to be spread over the week, instead. (After the last post, dak might seem cursed, but trust me it’s not. More on that RSN, but not just yet) For those playing along at home, britney is the name of the scripts used to update Debian’s testing distribution; basically it automates some of the hard problems of Debian release management. Naturally, this is a pretty tricky job – there’re over 200,000 packages in Debian unstable (spread across eleven architectures), with fairly complicated sets of interdependencies amongst them. It gets complicated enough, in fact, that the core analysis britney undertakes isn’t just too processor intensive to do in perl or python, it’s too memory intensive to use standard malloc for its data structures. (Cynical and Coding, and the UQ CS228 class of ‘98 will probably have some idea of the fun to come at this point…) The problem is that britney uses an absurd number of linked lists to resolve dependency issues, with each entry in the list being an independent block of a dozen or so bytes; and adding the usual malloc overhead to this can effectively double the memory usage. Worse, britney also likes to reuse memory quite a lot, does a fair bit of backtracking, and generally acts like the prima donna she is. Up until last week, britney’s memory was managed by the use of a parallel bitfield indicating whether memory was free or not: so britney would first allocate a 128kB block using standard malloc, note it’s all free, then every request for 12 or 52 bytes would result in some bits being twiddled; and every free would twiddle the bits back, so they could be reused later. This means two things: one is that the free invocation has to include the size of the memory to be freed as well as the address, and the other is that finding an appropriate sized block of freed memory can be awkward, leading to some degree of fragmentation. This fragmentation seemed to lead to britney having a gradual memory leak, which would mean that if the release managers were doing some complicated transitions gigabytes of memory would end up being used and OOMing; or, since britney runs on ftp-master and it’s probably not a good idea to have the OOM killer start on the machine that ensures the Debian archive’s integrity, the ulimit is reached, and britney aborts unhappily. Unfortunately, though, the use of a “roll your own” malloc means you can’t use the standard memory checkers to see what’s going on, so you’re left with guessing and hoping. And as a consequence the memory leak’s been around for ages, causing fairly regular minor annoyance. This changed last week when Micha Nelissen (neli) got into the act:
<neli> why does it need so much memory ?
<aba> neli: because it needs to check how the changes affect the installability count
<neli> aba: ok…but still does not seem like a big deal
<neli> how large trees are we talking then?
<aj> it has to do a lot of backtracking
<aj> how large is the longest dependency tree in debian?
<neli> backtracking only takes time, not space, right?
<aj> you need a list of things to backtrack over
<aba> neli: it also consumes memory, at least with the current dpkg-implem ntation
<aba> (well, there are ideas how to avoid this memory fragmentation, but that’s something else)
<aj> (it’s not actually memory usage, it’s memory fragmentation)
<neli> hmm, bad memory manager ?
<aj> imperfect, *shrug*
After poking around at getting britney to run locally, and doing some basic analysis on how it was used, neli decided to rewrite the memory manager to use chunk-size pools – so that a separate pool would be used for 4 byte allocations, for 8 byte allocations, for 12 byte allocations, etc. That’s possible due to two factors: one is that the special memory allocation is only needed for data structures which are all made from fairly small sizes, and are a multiple of the word size. It also means that fragmentation can be avoided completely – since you can use the “free” elements to store a free list taking up no extra space. Happily, that change also made the memory allocation much simpler. (It also shows the benefits of a fresh look at code; I’d been thinking of doing something similar for ages, but always been stopped because I couldn’t figure how to make it cope with the various different sized blocks I’d need. As it turned out though, I’d solved that problem ages ago when I wrote a separate allocator to deal with strings, which would’ve required my malloc to cope with a much larger variety of sizes) What it didn’t do was actually solve the memory leak. Which was pretty confusing, since the old memory checker had some tests to ensure that memory wasn’t really being leaked, and if the memory’s not being lost due to a missing free, or being lost to fragmentation, where is it going? At this point, the real benefit of having a simpler malloc implementation came across; because suddenly it was plausible to add some debugging code to allocate a separate pool for every memory allocation, and to report how much memory is being used at any point, per line of code. That gave me output like:
pool 8B/1:751; 1962683 used 1965960 allocated (99.8% of 22 MiB)
So I knew that line 751 (of dpkg.c), was allocating 8B chunks, had used up to 22MiB in the past, and was currently using 99.8% of that. (Actually, I made an off by one error initially, so the “8B” above is actually 12B, as you can see if you divide 22MiB by 1965960) That let me see two “leaks”. One turned out to be fairly easy to diagnose; as an optimisation, when I say “package foo is installable”, I note that “but we used bar to see that, so if we later update/remove bar, note that we’ll have to see if foo is still installable”. So the datastructure for bar ends up with a linked list of all the packages, foo, that relied on it. But I don’t check that list for dupes, so if I note that both bar and baz were required for foo to be installable, then update bar, when I recheck foo, I’ll add it to both bar’s and baz’s lists; which is fine for bar, whose list I cleared when I updated it; but not so fine for baz, because it’s now got two entries for foo. Having already added a check for dupes when trying to see if my guess was right, extending that check to skip the addition was pretty easy. The other leak required a little more investigation. It was in a fairly tight loop which could reasonably be using a fair amount of memory; but by the end of the loop it should all be freed. Adding some more debug code to the allocation functions confirmed the problem:
<aj> pool 8B/11:1231; 1618157 used 1703936 allocated (95.0% of 13 MiB, 9.05% current)
<aj> so it looks like ~9% of those allocations are never freed to me
<aj> 9.05% = used/alloc
<aj> where used is incrememnted on b_m, decremented on b_f
<aj> alloc is incrememneted on b_m, never decremented
The code was meant to either add the allocated block to a larger list that’s being traversed, or to free it immediately – the problem turned out to be that there were some nested ifs, and an internal if was lacking an else that should have freed the block. Fixing that changed the results to:
pool 8B/11:1228; 160 used 131072 allocated (0.1% of 1 MiB, 0.01% current)
Which both dropped the leak – only allocating a maximum of 130,000 nodes instead of almost 2,000,000 – and resulted in almost all the allocations that had ever been made, having been freed once britney had been running for even a fairly short while. As it turned out, though, the cure for the first leak was worse than the disease – checking for duplicates in a linked list turned out to take too long, and the memory wasted in that section wasn’t that big a deal. Using a red-black tree or similar instead would’ve been a solution, but so far doesn’t seem necessary. There haven’t been any OOMs since, happily; and even better, the reduced bloat seems to have made the overall checking a bit faster. Sweet.

4 November 2005

Adam Rosi-Kessel: Scowcroft on Bush

Fascinating New Yorker interview with Brent Scowcroft, National Security Advisor to Bush 41. I wonder how the author, Jeffrey Goldberg, gets this degree of access: he’s apparently emailing back and forth with Bush 41, having coffee with Colin Powell, and engaging in frank discussion with Scowcroft for a significant period of time. This sort of reporting is the antithesis of what you see in most newspapers, where the reporter probably spends no more than a few hours piecing together information that is widely available. This is also consistent with everything I’ve seen in the New Yorker for the past few months I’ve been subscribing—high quality writing and primary source information that you won’t pick up just from reading blogs. In any case, it’s interesting to see all these conservative ideologues from the Reagan-Bush era turn on the neoconservatives. If Brent Scowcroft thinks the war in Iraq is misguided, does the current administration have any hope at all?

Steve Kemp: Holidays + Xine + Stats

Yesterday
I missed a holiday
I managed to fail to go away on holiday for four days by virtue of being asleep and missing the train. That sucks. Although on balance probably for the best, I was very tired.
xine-ui bug triage
I did a minor amount of triage upon the xine-ui package. There’s been an annoying bug in the package for about 40/50 days - where if you right-click upon the screen the GUI would crash. This had been reported four or five times, so I merged all the bug reports together added a patch which I’d tested. Then I mailed the maintainer asking if they’d object to an NMU to fix it. Today I got a go-ahead, so I’ll be making an upload shortly.
Debian Admin webstats
Almost more hits upon the website in the first four days of this month than in last month combined. Wow. We’re averaging close to 50,000 hits a day. When I think things like that I get all paranoid and have to remember that it doesn’t matter how good the writing is ..,

3 November 2005

Joe Wreschnig: GNOME Performance Day + 3 = Python Performance Day

To whoever decided it would be a good idea to make Python’s gettext.ngettext search the filesystem for the domain’s mo files every time it is called (potentially one “J. David Ibanez”), please don’t go near any standard libraries ever again. You are personally responsible for almost 30% of the time spent loading Quod Libet’s album list, and probably a proportional amount of time wasted elsewhere in the program. For people using gettext.py, here is something to replace gettext.install with:
def install(domain, localedir=None, unicode=False):
    import __builtin__
    t = translation(domain, localedir, fallback=True)
    __builtin__.__dict__['_'] = unicode and t.ugettext or t.gettext
    __builtin__.__dict__['ngettext'] = unicode and t.ungettext or t.ngettext
(Python 2.4 users may want to have the codeset kwarg as well. Update: Fixed a thinko where I used “self” and meant “t”. Submitted upstream.) Now with added bonus of not having to import ngettext yourself in every module. (Yeah, using __builtins__ is kind of ugly, but I’m just going for minimum interference with existing code.) Before:
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1851    0.020    0.000    1.070    0.001 gettext.py:475(ngettext)
After:
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1851    0.000    0.000    0.010    0.000 gettext.py:345(ungettext)

2 November 2005

Uwe Hermann: Initial Linux support for the 5g video iPod - video sync using gtkpod / libgpod

My video iPod OK, so I spent some fun time playing around with my 5g video iPod — time for more serious action now. I have created two patches today which add support for the video iPod to gtkpod, a GTK+ based, platform independent GUI for Apple's iPod.
These initial patches allow you to sync m4v video files to your iPod and watch them there. I will add support for all other video formats which work on the iPod, soon. The patches will be sent to the gtkpod maintainers, of course, in the hope that they can be included in the next release. Note: This is pre-alpha, barely-tested code! Use at your own risk! Installation instructions: I get a "Destroying mmap buffer" error every time I sync the iPod, but that's probably a gtkpod bug, and it's non-fatal anyways. If you happen to own a video iPod, please test the patches and report whether they work! Thanks!

Wouter Verhelst: Quadra 700 arrived

Today, a UPS delivery guy delivered a largish box, containing the Quadra 700 that had been donated to me by Sebastiaan Couwenberg (thanks!). The box was much larger than I expected, however. At first, I was afraid; if it ended up very large, I wouldn't have any space to put it anywhere. Fortunately, on opening the box, I found that it was, in fact, not very large, as the case is the same as that of the IIci (which is the smallest case I have—people who went to DebConf5 may remember what it looked like, since it stood in the hacklab the whole time); instead, the box contained more than I expected. Aside from the Quadra, the box also contained a keyboard, a three-button ADB mouse (I didn't even know those existed in the first place), and a monitor. Whee. I had four macs (of which one has a broken LC040, so is not usable), but only two ADB keyboards (of which only one is in perfect working order), one ADB mouse, and one monitor (which beeps annoyingly if it's been powered on for more than a few minutes). With this, that amount has suddenly doubled, which is very welcome. I'll probably move this monitor to the office, and move the one at the office home some time. Not just yet, though.

Jaldhar Vyas: National Novel Writing Month

Once again it is November, National Novel Writing Month participants have one month to write a 50,000+ word novel. I was going to take part last year but didn't follow through. I had a good excuse though, we were having a baby at that time. This year I am going to try again. The genre is science fiction again and the plot is the same: time travel, telepathic dogs, deep philosophical ruminations on the nature of humanity, and new for this year, robot yogis.

Next.

Previous.