Search Results: "spa"

27 January 2007

Wouter Verhelst: Rock. Or not.

A week or two ago, one of the hard disks in rock utterly broke down. In itself, this wasn't a problem, since the disk was part of a 3x40G RAID5 set. Moreover, I knew it was dying, and was preparing to buy me a new disk anyway; the fact that it broke down only sped up matters. No worries. However, there's one slight problem with rock: it's a pretty old SMP box, and because of some bug somewhere (which I still need to hunt down), it can't run anything later than 2.6.12 in SMP mode. The new disk was a 80G disk, to replace a 40G disk. I wasn't very happy about the RAID5 array, but since I needed more disk space than what a RAID1 or RAID10 array on three 40G partitions would give me, I didn't have much choice. One of the disks in the RAID5 set was a 80G, too, however, with a 40G partition dedicated to the RAID5 set; so rather than doing ugly things with two disks only halfway committed to the RAID1, I decided to convert the RAID5 set to a RAID1 one. When you use LVM-on-RAID, as I do, that's pretty easy: you just create the new array (in degraded mode, on the new disk); add it to the volume group; use pvmove to move all data to the new array; use vgreduce to remove the old array from the volume group; and finally, repurpose the freed-up space to make sure the RAID1 set is no longer degraded. Which is all nice, except that on 2.6.12, when pvmove locks the entire volume group, you can't write to it anymore, which is quite painful if things like /var and / are on that volume group; gives you a nice deadlock. So I compiled me a 2.6.19.2 kernel with SMP support explicitly disabled, in order to be able to do the pvmove dance without much issues. That worked. I only forgot to do one rather important thing: to regenerate the initrd after all data had been moved; mainly because it took quite a while for the RAID1 resync to finish, and I had other things to do by then. Yesterday, we had a power failure, and obviously rock failed to come up again. By doing some utterly ugly things with the sarge d-i and forcing the yaird-generated initrd into a debug shell, I was able to boot the box properly again, and had it running 2.6.12. Which took all of three hours, or so. By then, it was kinda late, so I went to bed. This morning, my brother woke me to say he couldn't reach the Internet. Since rock is my gateway, I got suspicious. Running dmesg showed me a number of warnings from the kernel, where it said that it didn't properly understand some of the hashing stuff in some directory inodes. As a result, several files had been corrupted—including /var/lib/dpkg/status and /var/lib/dpkg/status-old. The file with 'extra' information that aptitude maintains, however, /var/lib/aptitude/pkgstates, still existed and was readable. So I downloaded me a one-week-old Packages file from snapshot.debian.net, and wrote this perl script:
#!/usr/bin/perl
open(APTITUDE,"</var/lib/aptitude/pkgstates");
open(STATUS,">status");
open(PKGS,"<Packages");
my $pkgent;
my $aptent;
my %aptitude;
my $i;
my $key;
my $val;
while(<APTITUDE>)  
	if(/^$/)  
		$aptitude "Package:" . $aptent-> "Package"  . "\n" =$aptent;
		$aptent =  ;
	  else  
		chomp;
		($key,$val) = split /:/;
		$aptent-> $key  = $val;
	 
 
close APTITUDE;
while(<PKGS>)  
	if(/^$/)  
		$aptent = $aptitude $pkgent->[0] ;
		if($aptent-> "State"  == " 1")  
			print STATUS $pkgent->[0];
			print STATUS "Status: install ok installed\n";
			for($i=1;$i<$# $pkgent ;$i++)  
				if(!($pkgent->[$i] =~ /^(Filename Size MD5sum)/))  
					print STATUS $pkgent->[$i];
				 
			 
			print STATUS "\n";
		 
		$pkgent = [];
	  else  
		push @ $pkgent , $_;
	 
 
close PKGS;
close STATUS;
... which generated a somewhat valid status file, that I copied to its right place. Yeah, that's an ugly hack, but at least I don't have to reinstall rock now. Phew.

Daniel Burrows: Sandisk doesn't want your money for a music player unless you run Windows

I bought a Sansa e280 last weekend to replace my aging and bulky Neuros (the last straw was when I lost the charger for the Neuros). It's nice to have such a small, light music player, and having 8GB of space is a big bonus. But when I went to the Sandisk web site to get a new firmware, I discovered that they only provide a .exe of a magic firmware download program. This is despite the fact that, as you can find by searching on the Web, the actual firmware upgrade procedure is just "copy the firmware file onto the device".

So, I wrote to support, mentioning that I don't have a running Windows installation and asking if they could provide an alternate means of updating the firmware. Here's the response:


Please be informed that your Sansa e280 is supported on Windows XP. If the operating system of your computer is not Windows XP, if you have just bought your Sansa e280, we do recommend that you contact the store where you purchased it and inquire about replacements that can be supported on your operating system or if that store honor refunds, please do ask for it. Please do provide the proof of purchase and packaging for verification purposes.


Now, I can work around this problem -- but after reading that brush-off I think I might just take their advice; as it happens, I saved the packaging just on the offchance something like this came up. Can anyone recommend a decent, small, flash-based media player that works well with Linux? Must-have features are:



I still haven't made up my mind: I might hang onto the e280 out of inertia and wait for the Rockbox guys to figure it out (it looks like they're making pretty good progress). But if there's a better vendor out there that actually wants my money, I'd love to hear about them.

25 January 2007

Gustavo Franco: The truth that hurts

The follow up of my previous blog post: FLOSS in Brazil turns out to be a joke, was published today on Linux.com written by Bruce Byfield, with the name: Brazil's FOSS utopia image at risk.

Some of those who simple ignored my blog post are the ones calling and mailling me now. I don't like answer calls during the workhours, i prefer answer emails and i'm doing that a lot lately. I'm glad that Carlos Morimoto (Kurumin fame) mailed me open to discuss changes in their website and distribution to inform better their users what's free software into Kurumin distribution, where's the source code, what exacly isn't free software and the reasons. Let me inform you that Kurumin isn't maintained by a company as Bruce wrote, the only error in the article so far, IMHO.

What about the free software initiatives in your country? Do they really fit with what the gov't is spreading everywhere over the press? Do they really fit with what people write on their company website? Let the world know the truth, even if that hurts.

Update: I've just visited plurall.net website and some hours after the Linux.com article, that was translated and published in some Linux related brazilian websites. They managed to setup a svn repository and put the code there. The announce into their site states in Portuguese "Finally, after some technical problems we've published the Plurall source code at: http://svn.plurall.net/plurall_boot_server". Looking into the source now...

Gon ri Le Bouder: Hum! WTF

root@clp120s105751 # hostname
-d
root@clp120s105751 # uname -a
SunOS -d 5.10 Generic_118833-17 sun4u sparc SUNW,Sun-Fire
root@clp120s105751 #

Andree Leidenfrost: linux.conf.au 2007 Gleanings

I was fortunate enough to attend lca2007 last week and to meet Bruno Cornec, the Mondo Rescue project leader, for the first time in the flesh.

The conference was pretty cool, and I found the quality of the program to be generally impressingly high: Excellent topics, superb presentation skills, humor and genuine passion for the topic at hand. The atmosphere and organisation were great, too - extremely well done, 7 Team!

My personal two highlights were:
Apart from the conference as such, it was super cool to meet Bruno. We had a number of good conversations and did some nice hacking, burning the midnight oil a couple of times. And HP gave me a (used) zx2000 (which Bruno carried all the way from France to Sydney!) to enable me to work on the (Debian) Itanium port of Mondo Rescue - thank you HP and Bruno! Bruno's talk was well received, and it was great to actually meet people that use the software that I spend quite a bit of time on. :-)

Finally, there is the Linus phenomenon (so you can tell this is my first
Linux conference) - he amazingly is basically left in peace: People who know him obviously talk to him and he participates vividly in discussions and so forth, but everyone else does the business as usual thing - no autographs, no photos, no nothing. I was (positively) impressed and refrained from asking him to sign my copy of Just for Fun (just kidding).

Finally, finally, I propose to find an alternative for the term 'awesome' next year. ;-)

Russell Coker: presentation laptops

I suggested in a previous blog entry that conferences should provide computers that speakers can use for their presentations. The reason for this is that getting one computer working with the beamer in each room is an easy task, while getting the laptop of every speaker to work is much more difficult.

It seems that my idea has been rejected by almost everyone who read it, so I'll document some tips for getting a laptop working.
 SZ:    Pixels          Physical       Refresh
*0 1400 x 1050 ( 474mm x 356mm ) *50
4 640 x 480 ( 474mm x 356mm ) 50
5 800 x 600 ( 474mm x 356mm ) 50
6 1024 x 768 ( 474mm x 356mm ) 50
8 1280 x 960 ( 474mm x 356mm ) 50
9 1280 x 1024 ( 474mm x 356mm ) 50

Firstly there is the command xrandr which can be used to change the resolution without logging out. Above are the most useful lines produced by running xrandr with no options on my Thinkpad T41p. The left column is the index to the list of resolutions. For example I run xrandr -s 9 to use mode 1280x1024 and xrandr -s 0 to use mode 1400x1050. This takes much less time than editing an X config file!

The next thing to note is that my Thinkpad has a refresh rate of 50Hz, apparently most beamers expect at least 60Hz, this explains why I have had ongoing problems in getting my Thinkpad to correctly work for presentations for the entire time that I have owned it. If you own such a Thinkpad then I recommend that you just bring another laptop to do your presentation on the assumption that the display possibly won't work and probably won't work properly! I had developed this habit anyway after repeated problems in getting my Thinkpad working (occurring on a number of occasions in several countries). It's good to now know the reason for this (thanks Keith).

When setting the resolution there are often tweaks that can be used. For example in my talk for the Debian Miniconf of LCA 2007 I used mode 800x600 (I think - Keith set it up and I didn't look closely after verifying that things basically worked). Even though the beamer didn't have good support for a low refresh rate it worked when the resolution was low enough. Fortunately the xrandr program allows changing resolution fast enough that all 13 resolutions could be attempted in about a minute.

The support for better display detection and configuration is steadily improving. Hopefully this year the problems will be solved (which means that for the Debian and RHEL releases in 2008 the problem will be solved).

A possible work-around is to use Xephyr (the replacement for Xnest). In a previous blog entry I described how to get Xephyr going for use by Xen images. It seems to be a common symptom of display synchronization problems that the edges of the screen will be clipped. The most common work-around for this is to not use the full-screen mode of OpenOffice - which means that instead of having a small amount of text clipped there is a large amount of OpenOffice menus etc on the screen. As Xephyr accepts any resolution it should not be difficult to arrange for it to use 98% of the screen space and then run the presentation full-screen in the Xephyr window. This will be particularly useful for programs such as MagicPoint (my favorite presentation program) which don't support a windowed mode of operation.

If you have any other suggestions on how to solve or work around display problems with laptops then please leave comments.

24 January 2007

Eddy Petri&#537;or: pppoe testers needed (ppp-udeb)

(Stop the tests for now, it seems I made a mistake. Will fix it tonight and make an update.)

I have been working recently on an update to the ppp-udeb package (responsible for configuring PPPoE networking in D-I and the target system).

I think I have finished fixing the last bad bits from the ppp-udeb package[*], but currently I am unable to do a test of a complete installation due to bug #407702 in qemu. Still, I am confident it should just work.

So I am asking if there are people interested in testing the image I have prepared with the new ppp-udeb package. The image can be downloaded from:



http://users.alioth.debian.org/~eddyp-guest/ppp-2.4.4rel-5/mini-with-ppp-udeb-20070124.iso



(Security concerned people can check the signature and md5sums and go on, if they trust me :-) )

How to test

In order to test, just boot the image (no boot parameters are needed) and try to do a basic installation via PPPoE.

What should be (or would be nice to be :-) ) checked:

Please respond as soon as possible (eddy.petrisor at_sign gmail.com).

[*] I did some tests myself but I can't test everything due to bug #407702 in qemu; some screen shots I made in qemu can be found at http://users.alioth.debian.org/~eddyp-guest/ppp-2.4.4rel-5/screen%20shots/


Update: thanks to some people that did the test, I found out that I made some wrong assumptions in my code. I will make another image tonight and make another call. This will hopefully fix the issue.

Evan Prodromou: 4 Pluvi se CCXV

The server that this site is running on is a Debian sarge machine with some backports.org packages for things that I just have to have up-to-date. This has been a pretty successful strategy for me for running servers... except for one thing. If you're running any PHP code, you really need to have an opcode cache like eAccelerator running on your server, too. Otherwise, every single hit to a PHP app loads and compiles every single PHP page it uses before executing. For any kind of load, and any kind of non-trivial app, it's just not a question. But there's not an eaccelerator package in sarge or in backports.org, so I built my own, which I have to keep up-to-date with PHP packages coming down the line from backports. Today, I upgraded from PHP 5.1.x to PHP 5.2.x, and I rebuilt eaccelerator, and... blammo. Segfaults all over the place with MediaWiki, and Drupal decided it wasn't going to save sessions any more. Turning off eaccelerator was enough to solve the problems with MW, but I had to track down this Drupal-PHP-5.2 bug and apply the patch to make Drupal work again. Of course, performance is sucking because there's no opcode cache. I kind of hate that kind of day. tags:

xcache Update to that: I tried out xcache, and it seems to be working fine. So, y'know, hopefully that project keeps working in the future. tags:

Pirates So, probably the most interesting thing about getafirstlife.com is that the image chosen to represent analog reality is a bunch of kids dressed like pirates. That is one of the selling points of First Life, I guess. tags:

Goethe I had a really good class at the Montreal Goethe Institute yesterday. I'm continually impressed by the facilities there. My class did a little tour of the building, including the half-size movie theatre, the huge reading room (with the day's German newspapers), and the big library. They even have a TV going with the Deutsche Welle satellite feed coming in. It's a pretty cool thing to have this kind of resource in Montreal. tags:

Mon pays Speaking of great resources in Montreal, Amita June and I went for a walk through Parc LaFontaine today. It was a balmy -8C (18 F) and the sun was shining on the snow. They've opened up the pond for skating, and there were about a dozen people lazily twirling around on the ice. Well... they looked lazy. They were probably working pretty hard. Our stated purpose for the walk was to get to the Biblioth que centrale-jeunes on the other side of the parc. The main Biblioth que Centrale shut down about a year ago when the new Grande Biblioth que opened down by UQAM. But they've kept the children's library open, and Amita June's just at the age where she can actually enjoy it. It was really a very nice library. There were a ton of books in good shape, lots of open tables, and a couple of billion toys, blocks, and games to play with. Amita and I both got library cards, which should be pretty fun to use, and we played around with the different books and such. They also have story-time hours at 10AM each weekday, so we'll be going back soon. Amita's favourite part of the library, though, was a big rock dove they had. It had a nice cage with water and toys and mirrors and stuff, but it seemed to like walking around on the shelves better. Amita followed it around making dove noises -- coo ca coo! Our trip back across the parc was pretty nice, too. The kids in the school there were out for recess, and they had built some epic-scale snow forts and were involved in an 18-sided snowball fight as we passed. There was also a passel of kids from a nearby garderie (daycare) who were making Inukshuks out of hardened snow. By the time we got home, we were pretty exhausted, but glad to have gotten some winter outdoor time. tags:

Wouter Verhelst: Ian Murdock on Solaris...

If you want another example, one from a company who any developer would agree is an outstanding engineering organization, here's one: "Sun has maintained binary compatibility between operating system releases for nearly a decade, enabling existing Solaris applications to run unmodified on Solaris 10. This means that Solaris applications developed 10 years ago will run on Solaris 10 unchanged, taking full advantage of new and advanced Solaris features."
Yes, it's true that there is outstanding backward binary compatibility in Solaris. However, if you're going to try use that as an argument in favour of Solaris, try again. Have you ever actually used a Solaris system? If you're going to say that backwards compatibility is good and that we should incorporate backwards compatibility into Linux somehow, then please do not point people towards the two ugliest operating systems on the earth with a lot of garbage baggage for the sake of backwards compatibility...

Martin F. Krafft: A good interface for selection?

I am working on a script to help me switch mail profiles from within vim, because mutt's profile abilities are seriously limited (even with muttprofile). The script will have three modes: manual, menu, and auto. In manual mode, you tell it something like switch-profile debian and it converts an existing mail to use my Debian profile. In menu mode, it displays a menu of available profiles, and in auto mode uses heuristics defined by the profiles to determine which one to use. My problem at the moment is menu mode. What I want is a good selection interface that (a) works over most any terminal, and (b) allows quick and dependable keyboard-driven selection. So far, I've had multiple ideas:
  1. A simple shell script that would assign [0-9a-z] to the profiles and then expect me to press one of the letters to select the profile I want (also see ssft). I don't particularly like this because if I added a profile to the presumably alphabetically sorted list, I'd have to relearn which keys to press when doing quick (subconscious) selection.
  2. debconf, which comes with multiple interfaces, but doesn't really seem made for the task. In the end, it would probably end up giving the same experience as (1) above.
  3. A method which I've implemented in the script (run it with the --menu option), which is reminiscent of "autocomplete". I need to add arrow selection and I have to figure out how to actually access $result from outside the while loop (this method doesn't work, because I need stdout for the interface and I have not managed to figure out using file descriptors 3 and above), but I already like it very much, although it seems rather brittle so far.
Do you have any other ideas? Or do you know of a tool/library I could use for this? I'd much rather have this work without having to install a separate package, but there's also no point in reinventing the wheel. PS: I am using POSIX shell for this even though Perl or Python would be much better suited, simply because it's faster and available everywhere. NP: Man on Fire / Habitat Update: Jan Hudec points me to Vim's console-menus and now makes me ponder whether I want a vim-only solution, or one that could be used by friends of other editors too. And Simon Huggins is trying to get me to use htag, which I'll have to check out.

23 January 2007

Erich Schubert: Boycott adea solutions

... for being stupid spammers. Obviously they polled some blog search engine (maybe Google's blogsearch) for some keywords like Java, tried to guess the name from that and grabbed email addresses they could find. I just received this stupid "job application offer":
Good Afternoon Planet,

I represent a major Airline in Dallas, TX. We have 3 openings for C Developers with Java, Unix, Sybase and Oracle skills. Basically our client is doing a 2 year migration from C to Java and needs C language Guru's.
This "major Airline in Dallas" (Southwest? Amerian Airways? I don't know.) should maybe be looking for a different company to do their development. The company they are using right now, Adea Solution, obviously: One more quote:
**I apologize if you are not looking. We have a system here that pulls information from the web and does not distingish between those who are current and those who are not.**
If you know that your system is crap, just don't use it. Instead of spamming. If I were looking, I wouldn't put "I'm currently not looking for a job" on my homepage. And I'd probably try to get in touch with someone professional.

Erich Schubert: Boycott adea solutions

... for being stupid spammers. Obviously they polled some blog search engine (maybe Google's blogsearch) for some keywords like Java, tried to guess the name from that and grabbed email addresses they could find. I just received this stupid "job application offer":
Good Afternoon Planet,

I represent a major Airline in Dallas, TX. We have 3 openings for C Developers with Java, Unix, Sybase and Oracle skills. Basically our client is doing a 2 year migration from C to Java and needs C language Guru's.
This "major Airline in Dallas" (Southwest? Amerian Airways? I don't know.) should maybe be looking for a different company to do their development. The company they are using right now, Adea Solution, obviously: One more quote:
**I apologize if you are not looking. We have a system here that pulls information from the web and does not distingish between those who are current and those who are not.**
If you know that your system is crap, just don't use it. Instead of spamming. If I were looking, I wouldn't put "I'm currently not looking for a job" on my homepage. And I'd probably try to get in touch with someone professional. [Update: their homepage appears to be unreachable... looks like someone else was even more annoyed than I...]

MJ Ray: In blogspace...

"In blogspace, everyone can hear you vacuum the cat." - Me, just now.

22 January 2007

MJ Ray: Driving: Fear the Councillor

If any planners want to see the impact of your short-sighted regulations, please visit Bowthorpe
"planning regs mean you only have to provide one space per home. Hence families with two cars, or couples who work in opposite directions and need two cars, often have to block their roads without meaning to do so."
Surely short-sighted would be to cater for today's car parking requirements? Thanks to climate change, oil decline and other reasons, it looks like there won't be as many cars tomorrow. Two-car households may be a temporary problem. If people are parking inconsiderately, bring in a one-car-per-house permit system with edge-of-zone car parks (and let two-car houses buy permits from car-free houses). If you build roads big enough for today's peak use, then in the future, there will be oversize roads for the traffic levels when that land could have been better used for housing. Ah, criticising the barking policies of Antony Little... blogging like it's 1999.

Jacobo Tarr&#237;o Barreiro: Annoying dialog boxes

So I installed Eclipse to do some web development in Java, and this dialog box appeared: This Eclipse build doesn't have support for the integrated browser. I didn’t know what it was, and that was already reported twice (one, two), so I just clicked on Ok , and Eclipse worked correctly. But the next time I started Eclipse, the same box appeared: This Eclipse build doesn't have support for the integrated browser. This time I pressed Cancel to see what happened. Eclipse did not load. So I ran Eclipse again and… well, I’ll spare you the dialog box. Needless to say, I was less than impressed. Now I’m hoping it will eventually get bored of always saying the same thing when starting Eclipse, and graduate to small talk: What a crazy weather. They say it'll snow this week, at last. About time. If not, it could at least take advantage of the fact that it’s being run on a Debian developer’s computer and show this: How about a nice game of Mao?

Uwe Hermann: Unmaintained Free Software progress

Unmaintained Free Software new main page Yet another Unmaintained Free Software update: Thanks to Matthias (again), we now have a wonderful new main page in the wiki, which looks a lot better than the old one which I had created a long time ago... The nice icons were created by David Vignoni for the Nuvola icon theme for KDE 3.x. They're available under terms of the GNU LGPL. Many other things in the wiki are currently undergoing a long-overdue update and fixing phase. I plan to upgrade the MediaWiki installation we're using, and some new MediaWiki extensions will be added, too. Oh, and I created and installed a nice favicon for the site, based on the project logo. If you ever wondered how those things are created, here's one possibility:
  1. Create two PNG images, one 16x16, one 32x32 pixels.
  2. apt-get install icoutils
  3. icotool -c foo16x16.png foo32x32.png > favicon.ico
  4. Place the resulting favicon.ico file in your DocumentRoot. Done.
I'm sure there are other and better ways to do it, but this was the first I came up with after a quick apt-cache search favicon.

Evan Prodromou: 1 Pluvi se CCXV

I managed to miss the Igloofest by Piknic lectronik this weekend, which was kind of a bummer since it seemed like it would be such an awesome event. But with a downturn in the temperature -- another -20C day yesterday, with wind chill bringing it down to -28C -- it was just too hard to justify bringing a 1-year-old to an outdoor event. We did manage to do some fun things this weekend, anyways. Saturday was our first day house-hunting. We're planning to buy an apartment or condo in the Plateau Mont-Royal this year, before July 1. July 1 is the traditional Moving Day in Quebec -- the day that every renter in the province either renews their year-long lease or moves to a new apartment. We're going to move out of Renterhood this year altogether, and get into the fun of home ownership. Wish us luck. Anyways, we saw a great place this Saturday, and we plan to do some more house hunting over the next few weeks. We're going to make a decision about whether to stay in our current apartment or not before March 1, when we begin our big road trip down to Austin for South by Southwest. tags:
 

Bruncher This afternoon we had a great bruncher with friends at our (current) apartment. We invited over Jeremy and Lina and their two girls Syvlie and Clea, who arrived at our door like an advertisement for a skiing school. I love talking to the girls -- they're really smart and sweet people. We also had over Maj's friend Emmy and her husband Stef, as well as their daughter Isadora. Emmy is originally from Oaxaca (city), and Stef is German. They moved here a few months ago, and Maj and Amita June met Emmy and Isadora at their playgroup. This was the first time I met Stef; I got to use my German introduction lessons for this week on him. Guten Tag! Ich hei e Evan! Freut Mich! Isadora speaks Spanish with her mother and German with her father. She'll grow up bilingual, but unfortunately not speaking either of the languages of the bilingual city she's living in. My guess is that she'll probably be pretty expert at four languages by the time she's 10 or so. Maj cooked today, and made a really great smoked salmon gratin, white bean vegetable soup, and hors d'oeuvres. I put together a green salad to round it out. We opened up a couple of bottles of crispy vinho verde and had a very nice afternoon time. The kids got along great; Sylvie and Clea are several years older than Amita and Isadora (one day apart!), but they were really gentle and nice with the little ones. tags:

21 January 2007

Daniel Burrows: How to Breathe, Functionally (part 2)

In a previous post, I pointed out some ways that you can acheive the "compute this, now save it and compute this, ..." style of coding in a functional language such as Haskell without going mad. This is a continuation of that post.

There's one other purely syntactic feature of Haskell that I rather like for readability: Haskell lets you define variables after you use them.


GoToTheNextTrickyBit someVal
where someVal = DoThisAndThisAndThat...


Although it isn't always appropriate to do this, there are times when I find it extremely intuitive to define my variables after they're used. For instance, to take a "practical" example, compare


mailTo customer =
let customerName = getCustomerName customer
customerAddr = getCustomerAddr customer
in
makeMailingTo customerName customerAddr


with


mailTo customer = makeMailingTo customerName customerAddr
where
customerName = getCustomerName customer
customerAddr = getCustomerAddr customer


I don't know about anyone else, but when I read the first definition I mentally go "huh. Why are we extracting the customer name?", then skip down to where the name gets used, and finally re-parse the name in that context. The "where" form lets me write the code in the same order that I would read it, giving the code a natural flow. It's very important, of course, to keep the number of auxiliary definitions small; otherwise you leave too many "open questions" for the reader of your code to carry around as she works her way down to the definitions.

But it isn't all roses at the low syntactic level. IMO, the biggest practical problem with writing Haskell code is the syntactically significant indentation.

Python, of course, also has significant whitespace -- but it works mainly because it's extremely simple. Any line ending in a ":" introduces a new block, and statements within a block have the same amount of indentation. In contrast, Haskell's rule...well, just read that link above. You can write code that has the same meaning under any indentation, but it's not idiomatic to do so -- and worse, since the statement terminators are not obligatory, a missed terminator might work fine, might change the meaning of your code, or might fail to compile in an obscure way.

A side effect of the complicated indentation rules in Haskell is that the Emacs Haskell mode doesn't work very well at indenting my code. It usually chooses an indentation that I don't want, and often one that doesn't even compile. I'm sure Emacs could do better, but I would be willing to live with a little more punctuation if it meant that the code was easier for programming tools to process correctly. Functional coding advocates assert, correctly IMO, that side-effects are problematic because even smart programmers will write more bugs in their presence. I think the same logic should apply to syntax: making the language harder for humans and machines to parse has negative overall effects, even if it is possible with sufficient effort to parse it correctly.

I think that conceptually, Haskell is a great language -- the problems I see with it are issues of syntax, tool support, libraries and speed (laziness has a high price). Oh, and also the fact that, as with most programming languages that are pleasant to use, you can't get a real paying job writing in it unless you have a PhD. :-(

20 January 2007

Erich Schubert: The end of the world 2.0 is near.

I'm convinced the Web 2.0 bubble will impact soon. Granted, some will survive, some will struggle - but some will just blow up. Time to sell for these. There are several reasons why I believe this will happen "soon": Many people have been keeping an hungry eye on YouTube, Rapidshare and others. It's just a matter of time until some of these predators goes for the kill. My predictions for the post-web2.0-bubble time:

Eddy Petri&#537;or: HOWTO test PPPoE without having PPPoE (long)

I don't have an ISP which uses PPPoE or more than a laptop on my desk, but still, thanks to free software, I can test PPPoE installations (to some degree).

I have set up with qemu machines a virtual LAN that is made totally in user space via a TCP socket on port 1234. I needed this in order to test the changes I am working on for the ppp-udeb Debian installer module that supports (or should I say, should support) configuration of PPPoE connections.

These are the tools whose authors and maintainers deserve kudos:


This is the tutorial I followed to configure the PPPoE server http://www.freeantennas.com/PPPoE-Server-HOWTO.html, but until then I had to make the network.

In case someone is interested, here's how I did it (these are Debian centric instructions, but I don't see anything that would stop someone to do the same even on a windows machine).
I won't repeat that tutorial, but now I can create a virtual machine (well, I'll use an existing virtual machine) and test my custom D-I images and test the changes done in ppp-udeb.

Rock on!

Next.

Previous.