Search Results: "nma"

20 October 2007

Jordi Mallach: You might get an email from me tonight

Sometime in August, I said I would watch the Inbox Zero talk later on that day. Well, I finally did today. And I'm ready to mass-murder my (now not so) fat inbox folder and start from scratch, and becoming a good boy. In fact, I've been on probation for a few weeks. While I wasn't watching the talk (which is pretty insightful and fun, and useful if you also have these horrid mail handling problems) I did roll up my sleeves a few times and worked on reducing the problem. After a few rounds of fighting, things were looking slightly better. I deleted TONS of spam which still was sitting in there. I deleted entire threads of list mail which for some reason wasn't being filtered properly. I archived a lot of random, misc email. I even replied to some job offers, for a change. I fixed my .procmailrc a little to get rid of lots of useless stuff that appears in my mail. It got better, but not entirely better. I went from the 6600~ which was probably the figure when I said Enough! to around 2580. It's still a lot, and I can still get rid of a lot more with easy pattern searches in mutt. The good news is that, for the first time in ages, the number of emails in the mailbox has stayed stable for more than a month. I tell you: I'm proud! So Merlin gets asked in the talk what to do when you've been a naughty boy for a long time, and you've ended up with this HUGE mailbox you can't handle anymore. His answer was what some people suggested in blog comments: put it aside, start from zero. Merlin calls it mail-DMZ, and that's probably what I'll do in a few hours, admittedly with a sentiment of guilt deep in my chest. And from that point, I'll have my mailbox be a TODO list. Delete. Defer. Delegate. Respond. Do. Simple! Other Planet Debian participants like joeyh commented that something that really helps is reducing the number of times you poll for email. For me, that means
set daemon      1800            # Pool every 30 minutes
when it was 5 minutes before. I hope I won't find myself issuing awaken commands often... I remember when, more than five years ago, having more than 100 mails made me feel bad and go cleanup. After some vacation, it went up to 150. Then Christmas came along, 300, until I found myself nearing 7000 last summer. Before moving my junk to a demilitarised mailbox, I'm having some fun replying to some email. The first one in my mailbox is from a member of a Catalan "Mallach" family.
From: Conchita Broquetas <familia_mallach_broquetas@yahoo.es>
Subject: Hola!
To: jordi@sindominio.net
Date: Sun, 17 Jun 2001 16:55:17 +0200 (CEST)
who discovered there was a "Jordi Mallach" other than his brother in the Internet. Apparently we had an exchange on where our families came from (Mallach is all but a common surname... anywhere, and my family has always wondered where it came from). So that's more than 6 years ago. I think I'd love to get a reply to some email sent by me years ago which has been sitting for years in a mailbox, because "I need to reply to this sometime". I think the Mallach-Broquetas are getting one tonight. If you think I'm dumping random thoughts on a vim buffer, it's probably due to me feeling sad today. Sorry, but I feel like typing, and I don't have a typewriter with me. Speaking of sad, nothing beats the next email which sat for some dramatic 6 months in my messy inbox until I found out in the worst of the possible scenarios. Let's go back to late February, 2004, when I had no job, and I didn't have a clue on what to do with my life.
From: Mark Shuttleworth <mark@hbd.com>
Subject: New project to discuss
To: Jordi Mallach <jordi@debian.org>
Date: Sun, 29 Feb 2004 18:33:51 +0000
[...]
I'm hiring a team of debian developers to work full time on a new
distribution based on Debian. We're making internationalisation a prime
focus, together with Python and regular release management. I've discussed
it with a number of Debian leaders and they're all very positive about it.
[...]
I'm not sure if I totally missed it as it came in, or I skimmed through it and thought WTF?! Dude on crack or I just forgot I need to reply to this email , but I'd swear it was the former. Not long after, no-name-yet.com popped up, the rumours started spreading around Debian channels. Luckily, I got a job at LliureX two months later, where I worked during the following 2 years, but that's another story. I guess it was July or so when Ubuntu was made public, and Mark and his secret team organised a conference (blog entries [1] [2] [3] [4] [5]), just before the Warty release, and I was invited to it, for the same reasons I got that email. During that conference, probably because Mark sent me some email and I applied a filter to get to it, I found the lost email, and felt like digging a hole to hide for a LONG while. I couldn't believe the incredible opportunity I had missed. I went to Mark and said "hey, you're not going to believe this", and he did look quite surprised about someone being such an idiot. I wonder if I should reply to his email today...

17 October 2007

Sven Mueller: CPU feature flags and their meanings

Since I never really found a nice overview of which CPU flags (see /proc/cpuinfo) mean what, so I gathered some information using the web, with the most notable sources being the BOINC FAQ entry on CPU Register Acronyms at [1] and the output of the nice little (though seemingly mostly unmaintained) cpuid utility. See my results at [2]. Any suggestions for enhancements and completions are highly welcome, just leave a comment to this post. [1]: href=”http://boincfaq.mundayweb.com/index.php?language=1&view=176
[2]: http://blog.incase.de/index.php/cpu-feature-flags-and-their-meanings/

Chris Lamb: Missing notes in the Mozart s Dissonance quartet K. 465?

The second movement of Mozart’s String Quartet in C «Dissonance», K. 465 has an interesting two bars where it appears that the violin theme is accidentally missing. As highlighted in red on the score, the violin part is devoid of the crotchet/four quavers that the other parts present - the other “missing” bar is at this section’s mirror in the sub-dominant, bar 75. Some printed editions have added the missing notes, claiming that Mozart made a mistake (or overruling him on musical grounds!), but it seems bizarre that Mozart—who even likened the composition of the “Haydn” quartets to a long, labourious fatigue (”lungha e laboriosa fatica“)—would make such an error. The preface to the Neue Mozart Ausgabe claims:
It is unthinkable that Mozart [could] have made a mistake or from absent-mindedness made a slip of the pen no less than four times in such an obvious and important detail.
(The preparation of the original first edition, which Mozart himself presided over, presumably accounts for the other two.) At least one scholar has claimed that the notes aren’t missing at all; they are simply contained within the cello’s notes. I don’t find this explanation particulary satisfying. The NMA goes further by stressing its wish that the original version should be used in performances, which seems to suggest that adding the notes is (or at least, was) a common practice, but I cannot find many recordings with the added notes: my Leipziger, Emerson, Alban Berg, Ysa e, Italiano and Amadeus Quartet interpretations all omit the notes, whilst only the Hagen Quartet add them.

10 October 2007

Cyril Brulebois: Linking on hppa

Problem present in openscenegraph 1.9.x and 2.x series: bug #425837. Looking at the build logs of unstable or experimental for the hppa architecture, there's a linking problem around. Shorten error message:
/usr/bin/g++ -fPIC -shared -Wl,-soname,libosgUtil.so.6 
    -o ../../lib/libosgUtil.so.6.0.0 "many *.o"
    -L/build/buildd/openscenegraph-2.2/build/osg/lib  -losg
    -lOpenThreads -lGLU -lGL -lSM -lICE -lX11 -lXext -lm -lpthread
    -Wl,-rpath,/build/buildd/openscenegraph-2.2/build/osg/lib 
/usr/bin/ld: CMakeFiles/osgUtil.dir/Optimizer.o(.text._ZNSt8_Rb_tree 
     IjSt4pairIKjSt3setIPN3osg9Texture2DESt4lessIS5_ESaIS5_EEESt10_S 
     elect1stISA_ES6_IjESaISA_EE9_M_insertEPSt18_Rb_tree_node_baseSH 
     _RKSA_("unmangled name"): cannot reach 0000393f__ZNSt10_Select1 
     stISt4pairIKjSt3setIPN3osg9Texture2DESt4lessIS5_ESaIS5_EEEEC1Ev+0,
    recompile with -ffunction-sections
/usr/bin/ld: final link failed: Bad value
First, just in case demangling is needed (that's not the case, but imagine), there's a nice tool to get the signature back (output skipped, it is very huge, that C++!). That's c++filt from the binutils package:
c++filt _ZNSt8_Rb_treeIjSt4pairIKjSt3setIPN3osg9Texture2DESt4lessIS\
5_ESaIS5_EEESt10_Select1stISA_ES6_IjESaISA_EE9_M_insertEPSt18_Rb_tr\
ee_node_baseSH_RKSA_
Then, one tends to trust the compiler. Added the following to the cmake command in debian/rules:
-D CMAKE_CXX_CFLAGS='-ffunction-sections'
But not much better. Oh wait, there's a quite interesting string in the build log now: cannot handle R_PARISC_PCREL17F, which looks like quite arch-dependant and perfect to be searched through the internets. Some old bugreports came out: bug #334959 and bug #416496 and the solution: use -mlong-calls. From http://www.projectblackdog.com/3rdParty/gcc/HPPA-Options.html, the relevant parts: Generate code that uses long call sequences. This ensures that a call is always able to reach linker generated stubs. [ ] It is normally not desirable to use this option as it will degrade performance. However, it may be useful in large applications, particularly when partial linking is used to build the application. It looks like it might do the job. And indeed it does. Conditionally added for the hppa architecture. And -ffunction-sections isn't even needed. Thanks to the http://www.parisc-linux.org/ folks for the access to their cluster, which really helped finding out a fix very quickly! And it looks like the number of blockers for the transition to testing has been reduced. \o/

9 October 2007

Chris Lamb: Top 10 interactive shell anti-patterns

In general, if you’re doing a repetitive task by hitting lots of keys, you’re doing it wrong. Not only are you wasting time, you’re wearing out your keyboard and damaging your wrists and fingers. Here are the ten most common anti-patterns (actually amelioration patterns) that I commonly see in other people’s line editing:
  1. Repeating a command by retyping it
    Press Ctrl-p and Enter, or “!!“. Zsh users get “r” as well. You can even get the command n times before, use “!-1“. Using the arrow keys is obviously flawed - find out how to unmap them in your shell.
  2. Manually changing back to your previous directory
    Give “cd -” a whirl.
  3. Typing a long command (or sequence of commands) excessively often
    Obviously wrong, but I see it so often it’s worth mentioning. Try using an alias and put it in your shell’s startup file. If the command is parameterised, you could construct a simple function. If you are writing software, look into the build systems available for your language - the basics of GNU Make can be mastered within 20 minutes or so, and have many other benefits too.
  4. Opening another shell when the current process blocks
    (e.g. You realise the command you started is going to take a lot longer than you thought) Pause the current process with Ctrl+z and then put the job in the background with bg. fg will bring it to the foreground again. Fewer shells mean you stay focused on what you were trying to achieve.
  5. Searching history by grep’ing ~/.bash_history, or Up Up Up … etc.
    Use CTRL+r (or “/” in vi-mode) for search-as-you type. You can immediately run the command by pressing Enter.
  6. Adding a prefix to a command with Up Home $command Space
    (e.g. You ran a command that really needed sudo). Try: $prefix !!
  7. Changing a command with Home Right Right Right Right … BkSpace BkSpace … etc.
    (e.g you accidentally ran chown instead of chmod) Try: $new_command !*
  8. Retyping significant parts of the previous line
    $ command arg1 /long/path/to/file
    $ command2 arg2 /long/path/to/file
    $ command3 arg1 arg3 /long/path/to/file
    Try using !$ to get the right-most argument on the previous line (you can also use !:2 to get the second argument, etc.):
    $ command arg1 /long/path/to/file
    $ command2 arg2 !$
    $ command3 arg1 arg3 !$
  9. Using Home/End to move to the beginning/end of the line
    This is how you completely ruin your wrists. Use Ctrl+a and Ctrl+e.
  10. Hitting tens of keys to make a substitition
    (e.g. you made a trivial mistake in the middle of your previous command). Use ^foo^bar. If you forget the other nine, try this one - stop punishing yourself for making mistakes! :)

25 September 2007

Simon Richter: suddenly, holidays

Well, still in the planning stages... The general idea is to get a largish house in Denmark for one or two weeks, share the cost among ten people, and live a life of debauchery for one or two weeks, probably in the first or second week of January.

16 September 2007

Gintautas Miliauskas: Opening files quickly in Vim

My Python development environment consists of a GVim window for editing code and a gnome-terminal for running the unit tests. This works out well, but leaves some integration to be desired. In particular, jumping to a test failure point is a little cumbersome. I used to do it this way: copy the filename from the traceback, switch to vim, then type :e, paste the filename with middle-click (now I know I can use * instead) and press Enter, then enter the line number and press G. That is barely acceptable; this particular wart has even contributed to pushing a ex-co-worker towards Emacs (the horror!). I have written a small vimscript function to make the aforementioned use case slightly easier. Now to jump to a failure point, just triple-click the corresponding line in the traceback (that selects the whole line), switch to Vim and invoke the function, which scrapes the clipboard for a filename and line number and opens it in the active buffer. Installation: paste the OpenFileFromClipboard function in your ~/.vimrc and bind it to a key by adding the following lines to your .vimrc:
nmap  :call OpenFileFromClipboard()
imap  :call OpenFileFromClipboard()
These commands bind the key F4 to our function. The first command handles normal mode, and the second handles insert mode (hence the to momentarily escape the insert mode). You can of course change the shortcut to whatever you like. The function should handle following types of references from the clipboard: I hope someone finds this useful.

31 August 2007

Michal &#268;iha&#345;: World clock applet

Being far away from your home adds you need to know what time is there and whether you can safely call people not waking them up in the middle of night. So I looked for some Gnome applet that would show me time in another time zone. I expected this to be easy, but unfortunately I didn't find anything in Debian. Few minutes of Googling revealed something, but both applets I found look quite unmaintained. After a bit of testing I decided to give World Clock Applet 0.0.0 a try. It seems to work so far and installation only needed few tweaks. As I hate to use something not in Debian packages, I packaged this beast. For now it is available only in my repository, as I'm pretty sure it would not pass any license checks :-).

26 August 2007

Christian Perrier: Back...and mail read

Less than one full day to read 8000+ mails. Not that bad. Among these were like 2000 spams that hadn't been detected by my spamassassin+CRM114 setup on my mail server, but properly identified by CRM114 on my laptop. Interesting thread in debian-devel after I reported bugs about the use of "Homepage: " in packages descriptions and Christoph Berg objected to it. Apparently, this could lead to the support of a "Homepage:" field in debian/control which is Good. New samba upstream release (3.0.25c) on its way. Steve Langasek did a release of the package while I was away, Peter Eisentraut did some bug triaging and No l K the prepared the release toay, searching for the bugs that are fixed. No real problem building the new version, except for the Python bindings which are nearly unmaintained (we are seriously considering to stop providing python-samba so please speak up *and* come helping if interested). The D-I l10n-sync script was hosed for 2 weeks because of a broken Swedish translation file (I hate poEdit for this, see #420685). I really should begin seeking for a backup for D-I l10n handling as Dennis Stampfer is now apparently completely MIA. Nothing really important apart from all this. Probably time now to begin preparing a possible trip to India for FOSS.in which I really would like to participate to, if I can find a way to fund the travel. Also time to think deeper about the proposed Extremadura i18n meeting which hasn't met a huge success, probably because we really want it to be focused on *one* goal this time (DDTP/Pootle).

25 August 2007

Joachim Breitner: TTF-Glyph in pdflatex output

For a project of mine, I had the dire need of getting the Unicode character (U+26B0 COFFIN) in a PDF file created with pdflatex. I could find no latex package that provides this or a similar character, so I had to do it myself.There are some HOWTOs on how to use a TrueType font in pdflatex, but all of them thought that you are trying to use the font for your regular text, not just for the one strange glyph. So based on these, here is what I did:All in all you need to keep the files burial.enc, burial.sty, burial.tfm and t1burial.fd in the directory of your TeX file. I did not check how to install the files globally.If you think this is done horribly wrong, please feel free to tell me how it should be done instead.

10 August 2007

Julien Danjou: On media players, xmms and audacious

Last month the new thread I was afraid about has started. Called Considerations for 'xmms' removal from Debian, the maintainers of the xmms package proposed the removal of it.

I used xmms (and, before, x11amp) for something like 9 or 10 years. I know, I love it. I can't bear other
players. Amarok is heavy, rhythmbox seems like
a joke to me. I like to load my 6500 files playlist in one shot, press 'j' and jump to the song I want. I don't
see how it could be easier to use a music player.

Following the thread, I must admit that, yes, xmms is old, gtk1.2, unmaintained, etc. I had to switch, sooner is better.

So I use now Audacious. At least I try to. Last time I tested it, the search (jump, 'j' key) function was  not working. No it is, it works like xmms, and I'm
happy. I know that upstream author of audacious dislikes being compared to xmms, but, screw you, you're like xmms, and I like it, so I like audacious for this.
The plugins and the interface is like xmms, so it's great also.

However it's buggyyyyyyy. Third day of use, serious bug reported as #436557. It segfaults sometimes, or simply blocks
reading a file.

The information loading 'on demand' is so crapy compared to xmms. I mean, it's fucking slow! When I put shuffle on and I lick 'next song please', then
it hangs reading informations. xmms was doing what in a better way.

However, dear audacious-author-that-already-hates-me-for-comparing-xmms-and-audacious, I really think it'll be a real alternative for old xmms users
like me and a lot I know (yes, I know a lot of people, damn it!). Developement seems to be very active, so I'll continue to report bug and use it.

Yes, I believe in audacious.
 

7 August 2007

Neil McGovern: And the winner is...

MJ Ray posted a couple of short summaries as to how the election would have turned out if alternate voting systems had been used. A couple of people asked about others, so here's a nice long list:

Borda,
Borda Elimination,
Minmax,
Nanson,
Ranked Pairs,
Condorcet (SPI),
Condorcet (Debian):
Bucklin:
IRV,
Pluralty:
Most of these seem to come out in favour of the result we achieved with Condorcet. Plurality (aka: First past the post) and IRV put heavy emphisis on the voters first choice. It doesn't really make sense to compare results from a condorcet ballot with either of these methods. Bucklin is rather meaningless in a multi-winner election.

In answer to "is this type of Condorcet ever likely to elect someone who polarises views", it's possible, but unlikely. IRV and Pluralty are the ones to go for if you want the majority of people unhappy, unlike the others, which produce the majority of people happy.

6 August 2007

Julien Blache: Good bye Linbox

As some of you may know, I’ve been working with Linbox for the past 3 years, on and off, part time and full time, depending on the time of the year. I won’t be working with Linbox anymore after Mandriva, which has bought Linbox back in June, decided Linbox wouldn’t go ahead in the Enterprise VoIP business. I have been, for the past 2 years, the architect of Linbox’ VoIP solution. This unfortunate and ill-advised decision of stopping the development of a successful product at its beginning will effectively leave the current customers out in the cold, as technical support will probably be erratic at best. Looking back in the mirror, I’ve done a lot of things, small and big, during these 3 years: And, more importantly: I’m especially proud of that; the solution was ready for that moment, and my deployment plan proved to be the right one and flexible enough to account for everything that wasn’t ready in time (missing network infrastructure, things that had been forgotten on the client side, things that didn’t go as planned and last minute changes to accommodate users’ needs). The customers were very happy and enthusiastic with regard to their new VoIP infrastructure - so much that there was more to come. And more to come means more business for a company that definitely needs it, and is now turning that business down. So it’s all over now, and overall I’ve had a good time working there with the technical team. They’re all very talented, and we were 3 DDs working there - that figure is now down to 1 (yes, one, as in 3 - 2 = 1). I’ve been able to produce a really great free (as in speech) Enterprise VoIP solution that I liked quite a lot. I had great plans for the LIPS, but couldn’t carry out much of that until it was integrated into the Linbox Management Console. In the last weeks, I’ve had confirmation that my plans were right and I was going the right way. That’s history now, and I’m looking at what I’ll be doing next. It’s good because I can look for a job that either involves VoIP or not; it’s good to change after a while. It sucks because looking for a job sucks.

3 August 2007

Maximilian Attems: linux-2.6 bugs cleanup part I

xorg and openoffice.org started with a cleanup of their bug reports. It is really great that compared to 2-3 years ago major cores of the Debian OS in unstable are quite in sync with upstream. Thus it is easy to forward to upstream the interesting part of bugs. The linux-2.6 bugs count reached that weekend almost 850 open bugs. Seeing that it gets unmanageable I'll decided to get it down to a target of 100 bugs. I'll blog from time to time about the progress. The process consists of pinging quite some bug reports against old Linux images and closing a huge swap of duplicate or no longer relevant bug reports. I expect the signal to noise ratio getting better once the bug count gets denser. The current side effect was to forward 1 patch upstream and to get 2 easy low hanging fruits fixed in latest linux-2.6 trunk. Thanks to enabling CONFIG_BLK_DEV_IO_TRACE trunk gains support for the blktrace(8). blktrace does direct IO block layer tracing - see also blktrace guide.

24 July 2007

MJ Ray: Early Tour de France Audience Figures

Bloomberg: Tour de France TV Audiences Rise in Europe Even After Scandals (tip tdfblog ) reports audiences are up 6% in France, 11% in Spain and 40% in Denmark (to over 800,000). Italy's RAI reports 1.2million viewers, while ARD/ZDF averaged 1.4million until they pulled the plug over half a dope test. In the UK, the BARB Weekly Summaries show the tour's London-Canterbury Stage 1 charting with 178,000 viewers on itv4. That's up from 143,000 for 2006's stage 1 (up 24%). Last year's itv4 coverage seems to have peaked at 197,000, so it'll be interesting to see how later stages fare, as details are announced. Stage 1 was also shown on the more widely available (analogue+digital) itv1 channel. The itv1 coverage didn't chart, so it must have had less than 3.41 million viewers, but I can't see exactly how many. British Eurosport's reported audience for Stage 1 increased from 84,000 last year to 118,000 (up 40%). Their 2006 peak was 100,000 for the last Thursday highlights, so that's already broken. They've been advertising pretty widely, with really annoying Franglais adverts that mispronounce the race name ("Tardy France" eh?). There was also an overspill into other channels, which we don't usually see. Two of my favourites: Graham Jones: What do the Tour de France and a Victoria sponge have in common with your social networking web site? Channel 4: Tour de France's UK appeal (video feed) mms://a1167.v15478c.c15478.g.vm.akamaistream.net/7/1167/15478/v0004/origin.channel4.com/news/2007/07/05_bike.wmv

23 July 2007

MJ Ray: Has an easy-to-use UK map survived the "if it isn't broken yet, keep adding features" fad?

Recently, online mapping seems to be going through a period of "if it isn't broken yet, keep adding features until it is." I'm looking for a UK mapping web site which must include contour data (useful for bicycles), be usable without JavaScript and cookies (useful for mobile browsing) and be easy to write a search form for (useful for web links and bookmarklets); and should include aerial photos, postcode search and other countries. I used to use Multimap but it recently started requiring JavaScript and ditched the OS maps which showed the contours. Streetmap is still usable, but the visible copy of the beta site makes it look like they're about to make the same JavaScript-hungry mistake (emailed). Google Maps works without JavaScript and cookies (despite its whinging on the front page) but doesn't have contour data. And it's Google, who I don't like for other reasons. OpenStreetMap, Maporama, Mapblast and Ordnance Survey all seem to require JavaScript (OS despite their own accessibility policy - emailed). Map24 just seems broken in ways I've not debugged. So, besides Streetmap for now, is there an easy-to-use UK web map with contours?

20 July 2007

Uwe Hermann: Retiring the sparc32 Debian port... or not?

According to Jurij Smakov's announcement, the Debian port for 32bit SPARC machines is about to be retired. This is really sad in my opinion, as we should rather support more architectures instead of less architectures. After all, Debian is "The Universal Operating System" [1]. Now, I know that my opinion doesn't matter much in this case, but many other people who own sparc32 boxes seem to feel the same, judging from the thread which was started by the announcement. Also, I do realize that nobody wants to retire the port just for fun. To my understanding there is one major problem which needs to be sorted out in order to "save" the sparc32 support in Debian (and also in Linux!): There is no Linux kernel maintainer for the sparc32 Linux code at the moment! This seems to be the root of the whole problem. It makes maintaining a Debian port for sparc32 really hard, as you can surely imagine. Also, there seem to be too few people who actively work on the surrounding toolchain stuff (gcc, binutils, etc) which is also very important. My suggestion would be to not drop the Debian support for now, but rather set the status to "needs help" or something and actively search for contributors and/or maintainers. Heck, list it on Unmaintained Free Software, or write a "call for help" Slashdot article, post the issue on all Linux-/Debian-/SPARC-related mailing lists etc. etc. (or write funny blog posts, heh). I guess if two or three experienced SPARC developers would step up and take care of the kernel and toolchain maintenance for sparc32, there would be no reason to drop it anytime soon. Anyone?

9 July 2007

Matthew Palmer: Hell is other people('s code)

I've been working (part-time) on an existing Rails application for the last month or so, getting comfortable with it, modifying some sections to support needed functionality, and beginning an all-out, carpet-bombing "shock and awe" assault on it's test suite. However, a significant portion of the system is (or rather was, since I've already gutted a lot of it) a chunk of rather messy and unpleasant auto-generated code. I've always been a bit iffy about code generation tools, ever since my first encounters with them whilst working on some $DEITY-awful access application years ago. (First encounters with anything Microsoft usually have that effect on me, though). Since then, I've never found any reason to change my mind, and dealing with this particular chunk of auto-generated code has pushed me over the edge into "wild-eyed extremist" territory. Please note that when I say "code generator", I'm talking here about programs or wizards or whatever that create a block of code that you're then expected to tweak to suit your conditions. If it's just a mechanical transformation of an input format to an output format, where a human is never expected to maintain the output by hand, that's not code generation in my book -- that's just a compiler being used for it's intended purpose. I like compilers. I'm fairly sure you do too. Code generators, though? EVIL. Consider what you get out of your generator: A big blob of code in your application that you then have to understand and maintain. It's like you gave a commit bit to some random person who dropped a 5000 line change into your tree and then ran away into the night, cackling. If there's bugs in the generated code (and remember, there's always bugs in software), when they get fixed upstream you're up the creek unless you haven't modified the code at all (and thus can regenerate), or you're willing to apply the necessary patches to your modified version, often by hand. Hand-patching is error-prone, and if you've modified the code at the same place that has to be patched, things can get unpleasant. In the case of the generator I'm dealing with at the moment, I'm not even blessed with it being decent code. It's ugly code, in every possible sense of the word. There's inconsistent formatting, poor commenting, it uses some totally whack coding constructs[1], the hard-coded text strings are ungrammatical, it's got very few (and poorly covering) test cases, the methods are huge and unwieldy, and it's got security bugs (not so hot for something that's supposed to be guarding your application). In short, it looks like some quick-and-dirty internal hack that escaped one night and is now wreaking havoc on the world. There's probably some really good code generators out there. I've been poking around a bit, and there's some written for Rails by people who I know produce good code. However, no matter how good the author of the code generator is, the very best you can hope for is solid, clean code that is the equivalent of some portion of your application having been coded by some member of your team who you (and nobody else) has ever met, who didn't follow your team's coding conventions, and who has never looked at any other part of your application to make sure that everything hung together in a consistent manner. Which you now have to maintain. I've read a lot of books, articles, blog posts, and mailing list messages, and participated in no shortage of "why software sucks" discussions with other programmers, but I've never heard anyone advocate that the way to clean code, minimal bugs, and happy programmers was to drop a big chunk of unknown code right in the middle of things. Before you start charging up the e-mail-delivered tasers, ready to fry my delicate braincells for the twin crimes of Xenocodophobia and a vicious case of Not Invented Here syndrome, though, please understand that I'm not against code reuse in the right place. That right place is a library, component, or other abstract, documented, fairly static, and presumably-replaceable chunk of code. By using a library, you get a relatively simple interface to somebody else's complexity. This is a good thing, for all the reasons that everyone should already be able to recite. Items such as a comprehensible interface, minimal learning curve, and so on. Things you don't get with generated code because, pretty much by definition, the entire chunk of code is you "interface". There are some times, though, when what you want to do can't be done in a library. Either the thing has too many tentacles to be able to easily encapsulate behind an abstracted interface, or you need to modify it's behaviour in too many places to be able to get away with a few simple callbacks to get the job done. Hence, it might be tempting to fire up the code generator to get yourself out of a hole quickly. Don't do it though. Don't succumb to the temptation of saving yourself a little bit of time by firing up a code generator. What you're doing there is just making pain for yourself, by inheriting a big chunk of code that you don't fully understand, probably doesn't solve your problem particularly well, and which you (or whichever poor slob gets the job after you) will have to maintain into perpetuity -- most likely by gradually rewriting large pieces of it so that it fits your application better. The output of a code generator is likely to be the least maintainable code in your tree -- either by virtue of the fact that it's crap code, or at the very least because you just don't understand it. The general principle of good codebase hygiene is that you get rid of unmaintainable code quickly, so it doesn't infect everything else (a la the "broken window theory"). With that in mind, why would you ever consider deliberately introducing a huge chunk of unmaintainable code into your application? The closest I can come to a defence of code generators is something like Rails' scaffolding, where the controller and views for a set of simple CRUD operations on a table are auto-generated. The key word there, though, is scaffolding. It's very name suggests that it's temporary, to be replaced with something more robust and useful as soon as is reasonable. The default scaffolding is ugly as sin, besides, which encourages you to replace it, and -- as of Rails 1.1 (I think), there's a 'scaffold' method which creates the scaffolding output at runtime, so you never, ever need to generate scaffolding code any more. Anyone planning on producing any significant piece of their application through the use of code generators is, in my book, committing a crime against software decency.
1. My favourite whack code construct thus far has been this gem:
 case somevar
   when 17
     do_something_here()
 end
Because, you know, if statements are for people who know how to program, or something.

7 July 2007

Martin F. Krafft: Hacker tools in Germany

I am sure you've heard that "hacker tools", including nmap and other system administrastion essentials, may be considered illegal in Germany as of now. It'll depend on whether judges determine that e.g. nmap is a tool primarily used to do harm, so we all have not become criminals overnight, but there will be complications and ridiculous showdowns in courtrooms. I was only one of thousands of protestors, when this bill was first discussed by our politicians. Back in October 2006, I wrote an email to Ilse Aigner, the spokesperson for education, research and the estimation of consequences of techynology (whatever that may be) of the Christian Democratic and Christian Socialist Unions, who is a member of the German Bundestag. She's the Bundestag representative for my hometown. Surprisingly, I got a reply from her secretary, which I shall quote in full below:
im Auftrag von Frau Ilse Aigner ich habe mich bez glich Ihres Anliegens bei unserem Referenten der CDU/CSU-Arbeitsgruppe f r Recht erkundigt. Ich wurde darauf hingewiesen, dass die Bedenken Ihrer Branche hinsichtlich des Refentenentwurfs eines Strafrechts nderungsgesetzes zur Bek mpfung der Computerkriminalit t bekannt sind. Auch hat der Bundesrat eine Pr fbitte ge u ert. Zwar ist der Referent der Meinung, dass die Gefahr der Illegalisierung schon jetzt nicht best nde, trotzdem wolle man aber im laufenden Gesetzgebungsverfahren alle Bedenken beseitigen. Seien Sie versichert, dass Sie auch in Zukunft weiterhin Ihre Arbeit ganz legal aus ben k nnen.
That last sentence says: rest assured that you may continue to exercise your profession legally in the future. In the spring of 2007, it seemed as if all protests were overheard, the Bundestag pushed the new legislation 202c StGB, and the Bundesrat drew in their horns and failed to appeal the decision. I wrote another email to the secretary of Ilse Aigner asking whether I can still "rest assured", but this time, no response came back. And now the law has been passed. Politics as we know it. On the topic of whether the Debian project now has to provide a non-German archive for Germany, I find myself in the middle of the swamp of German legislation. On the one hand, publication or distribution of "hacker tools" has been made illegal, in addition to their (ab)use. On the other hand, however, the law only makes tools illegal which are (a) primarily used for cracking, and (b) are used with malevolent intentions. It's the "yes or no?" "maybe." bullshit which makes it impossible for people to do their job in Germany, if they actively want to stay on the legal side. A good example is the tax system where you have three options: do it yourself with minimal time investment and pay way more taxes than you have to, or let a tax advisor do it, or try to do it right yourself. If you do the latter, it's like walking a thin ridge in absolute darkness, except you won't be told immediately when you fall off. I think Debian should not take any action. We're not malevolently or intentionally distributing tools primarily used for cracking, so we stand good chances of getting by with it. Apart, Debian is not a legal entity in Germany anyway, so who are they to sue? NP: Overhead: Metaepitome Update: Thomas Jollans writes in that Debian can't be sued, but the German mirror operators can, with which I have to agree. Then the solution is obviously to move the German mirrors. That's a topic for this thread.

6 July 2007

Patrick Winnertz: German law

Hey for everybody who doesn’t already know it: The upper house of the German Parliament (Bundesrat) decided today that in germany now programs like nessus and nmap are illegal.. since only hacker will use them. This means that not only the use of that programs is illegal, but having them installed already. Mh… I think I’m now one of the many persons who is doing, when the law is published, something illegal… having nmap (and nessus) installed.
Time to think about emigration to another country, better than this one. Keep hacking! ;-)

Next.

Previous.