Search Results: "rul"

23 February 2007

Simon Richter: Threads

Miriam, coroutines have the same problem as threads, futures and all the other interesting concepts out there: they are perceived as a magic bullet when they are merely one tool in the great toolbox. Whether a tool is appropriate depends on the job. Postgres, for example, handles each connection in a separate process, which adds a lot of complexity to their internal structures as all concurrent accesses need to be handled properly. However, SQL's transaction and isolation semantics make a single-threaded implementation almost as hard to implement, so the correct answer was to use threads. The biggest problem with threads is data consistency, and this is where almost all negative examples originate: some variable was not declared volatile, some lock not held long enough, some set of locks taken in the wrong order. A rule of thumb should be: if your threads need to interact, then you should not be using threads. If you have to compute something which will take longer, it is absolutely fine to start a new thread, but then you will have to protect the inter-thread communication appropriately. What is appropriate depends on the problem again; in most cases it will be message queues which allow the other thread to handly the request when it is in a safe state. Coroutines come in at a point where "you should not be using threads", by essentially allowing me to write a producer-consumer model as if it were threaded, and then letting the compiler build a nonthreaded version from that. In the C++ world, most algorithms can not be combined directly because they are written as a consumer/producer loop and cannot be suspended -- coroutines will make that possible.

21 February 2007

Gunnar Wolf: Back from [VAC]?

On January 13, I sent a mail to debian-private saying I'd be on a semi-vacation until around February 10 - And yes, for over a month I've basically not touched my packaging, and for around three months my general profile in Debian has been really low. I sent this message because the Institute I work at moved, and I got the task of taking care of everything related with electrons flows carrying information (namely, voice and data networks).
It's not that I'm really-really-back now - Work is still too absorbing, users still come too often to me expecting me to solve their problems. I can often try to do so on the data network, but I'm far from even having access to the voice equipment (I've done my hardest effort not to get such access, because that'd instantly turn me into the phone operator for life). However, for the first time in many weeks, today I had some quiet time, I catched up with some mailing lists, and... Well, I expect to work on my QA page.
Boy, team-maintainership rules! pkg-perl friends, thanks for saving me from the creepy bugs sometimes too often. I expect to pick up work I haven't even looked at since I committed to doing so with the pkg-ruby-extras team as well, specifically, getting mongrel in shape and into Debian, despite our deep differences with its author. This will make Rails roll smoother and faster in Debian. And of course, there is Debconf. After last year's burnout, I think I recovered - I'm not a core organizator anymore, but I'm back to work my way to Edimburgh ;-)
As for my local activities (Mexican Free Software conferences, meetings and people): Partly because so I decided and partly because so it happened, I've been off the hook with the local community since before Debconf 6. Before, because I was too busy to think about anything besides it, and after, because I was burnt out and somewhat bitter at several facts. I've been to few regional or local conferences, also because I knew that between last October and today I'd be too tied up at work. But last week we had both CONSOL and BarCamp Mexico. Somehow I managed to be at both (well, at CONSOL I was only enough time to do my two talks, for which I miraculously managed to get prepared, and BarCamp was during the weekend). Both were very positive for me, and I'm willing again to find some time to devote to promoting and developing Free Software in our country.
Oh! One more note: Thanks to Sergio Mendoza for pushing me and for co-discussing on the subject, we are getting small but tangible results pointing to a Debian-UNAM project. Not much to see yet, besides having received the domain authority, which for now just means a nicer name for Nisamox, Mexico's main (and only long-running) full Debian mirror.

Alexander Schmehl: Note to myself:

When experimenting with rewrite rules for your Apache, don't test them with firefox / iceweasel; it's cache might fool you. Update: Niall Donegan pointed out, that you can circumvent this problem easily by installing the Web Developer toolbar (Debian package: iceweasel-webdeveloper) which offeres the feature to disable the the browsers cache. Thanks!

18 February 2007

David Pashley: Ogg Player Redux

After my last post on music players capable of Ogg Vorbis playback, I was recommended: I can discount the iHP120 straight away as it's a HD based player and will be too large for what I want. Update: I'm intentional avoiding any Apple products. iRiver t10
iRiver T10
90GBP will get me a 2GB device. Several people have claimed it works as USB mass storage, although I've seen someone say American versions wouldn't work. iRiver have a firmware updater to convert it to UMS, so I might need to find a Windows installation. It has good battery life of around 45-50 hours from a single AA battery, which is good. It's got good reviews for its sound quality and its rugged construction might make it good in the gym. Kingston K-PEX100
Kingston K-PEX100
A 2GB model will set me back around 65GBP. It's a touch larger, but thinner than the T10. Looks like a UMS device. It can be expanded with miniSD cards, which seems a nice feature. It only has a 17 hour battery time using the internal rechargable, which seems a bit low, considering my CD player will do 120 hours off two AA. Reviews have mentioned that the build quality is a little budget and a couple of firmware bugs, but hopefully these have been fixed now. Samsung's YP-U2
Samsung YP-U2
Can only find a 1GB unit for 60GBP, although there is a 2GB unit available. Battery life is only 14 hours from the internal rechargable battery. It's smaller than the iRiver T10 and is a UMS device. I've seen reviews complain about the audio quality of this device. I think the lack of battery life and audio problems will rule this one out. Cowon iAudio U3 and T2 I wasn't recommended any particular models, but the two I'm considering is the T2 and U3.
iAudio T2
The T2 is a necklace style player, which is rather unusual, but I can pick up a 2GB model for around 100GBP. Battery is around 12 hours using the internal rechargable battery. Looking at the reviews, the supplied headphones make up the actual necklace part and you have to remove that to use your own headphones, which is what I'll be doing, having just bought some Shure E2Cs. They also say the controls are a little confusing.
iAudio U3
This is the most expensive of the products I've looked at at 115GBP for the 2GB model. Battery life is around 20 hours. Reviews have been very positive. Not sure if it's worth the extra price though. Update: Apparently the 2GB model can only be charged via USB, where as the 1GB model comes with a charger too, Also, I read in a review that it has doesn't do gapless playback, which is very annoying. Why don't players do gapless playback? Summary I think my top choice is the iRiver T10, although each of the others have their plus points. The K-PEX is expandable, the T2 is small and the U3 gets good reviews. I think I've discounted the Samsung. I will try and find each of the players in a local shop to have a play before I go out and buy one. If you have any comments on any of these players, or you have another product to recommend I'd be very interested. Oh, and continuing my trend of discovering bands that have split up, I've been getting into At The Drive-In. :S
Read Comments (13)

15 February 2007

Biella Coleman: I cite, you cite, I rant

Since there are few topics about academic etiquette than get me as excited as the norms of citations, I was quite fascinated by Joseph Reagle’s blog entry on the topic, a discussion that spanned a summary of Helen Nissenbaums’ work on the subject to his own wrangling with how he should recognize others who have independently reached similar conclusions as his own. Citations fascinate me because they are one of the few tangible inscriptions that reveal just how much of our work is indebted to others; it is stimergic (and if you don’t know what that is, read Joe’s entry as his moral wrangling over citations had to do with this term, his use of it and the discovery that someone else came up with it also). Despite the fact that all disciplines use them, we use them slightly distinctly. Lawyers use them in lawyerly-like ways: they cite the crap out of everything (it is kinda annoying but kinda helpful) and this makes total sense: they are covering their asses (lawyers know how to do this well), they are following the logic of their own practice as case law is quite citational, and well, law professors usually have one if not two research assistants, and this I am sure helps them in covering their citational bases. Another big difference in practices of citations is between a conventions that includes the name of the person you are citing in the body of the text and those that stuff all that data in a footnote. I can’t stand the later convention, not only because it is a pain in the neck to have to go back to the footnote JUST to see who the heck the author is citing but I think the credit should be right there, springing off the page so that the politics of collaborative recognition are, well, very evident (and I do understand that if you are citing a buttload of folks, that sometimes it is just better to do that in footnotes and sometimes with history they are citing way to may folks to really do it effectively in the body of the text). Joe raises some fundamentally thorny questions of who and how do we cite given that we may come up with an idea with the power of our own little brains, only to find out (gasp) that others, past and present and very unknown others, say something similar. On the whole, I tend to try to make clear, as Joe did in the example he provided, where I am totally taking the idea from someone to apply to another idea of mine and where I have an independently crafted idea and I am citing others so as to support my own position, which usually only strengthens my own argument. And what I find is that just because a cohort of folks may be working on similar topic (open souce, hackers), since we do so from our own perspectives and methods, most of the research will be original, though not as much as we tend to perform to our superiors. Also I sometimes find myself with an idea, which I consider as my own, but where I am so in need of a citation because it is an idea that seems at an intuitive level to be right on but it is hard to truly substantiate with the data I have (I am in that position right now and am desperate to find someone who says what I say and thus have a means to support what otherwise seems like a lofty idea…) And in fact, one thing that bothers me about citations is that we don’t seem to take seriously that the date of publication may not just tell us when something was published but help us gauge if something can become “dated.” What I mean is that when (and I guess if) I publish my book on hackers and Debian, it will not be a reflection not of some timeless aspects of hacking but firmly based out of the time period (roughly 10 years give or take 3 or 4) that I was either researching and writing about the topic. And while you can and should cite folks who wrote stuff in the past because that stuff still matters (a lot of what Steven Levy says for example still holds water) a lot changes. And yet I can’t stand how folks then cite someone as wrong when in fact all that went wrong is that time does what it does best: MOVE FORWARD and social phenomenon change along with the passing of new moons. This is not as likely to happen in the hard sciences but sure as heck happens with anything in the so-called human realm (which is why it bothers me that the social sciences and humanities model our citational and journal practices so similarly to the hard sciences, when it seems there are enough differences to warrant more differences than there are but that is a whole other topic). So now I try to note where my analysis diverges because the context so radically changed and really leave critique for those things I can safely and fairly disagree with on its own terms.
Finally, Nissenbaum’s article seems so interesting (I have not yet read it but now will) because it confronts how our practices of citations may or may not (or should) change in the face of a proliferation of access to work due to electronic media (she flags: wildcat publisher, grey literature, preprints). But I have found that, at least in anthropology journals, and especially in the anthropology of science, technology, and medicine, authors are mostly citing other anthropologists, as if a whole scholarship on a topic was non-existent, which seems more odd today when it has gotten easier to mine and find this stuff. They only cite “non-anthro others” when these folks are so standard, it would look horrible not to do so, but there is not a move to branch out, which I find a real shame and why I sometimes get really down on disciplinary journals (and why I am quite content to be joining an interdisciplinary department). And to be clear, I don’t fault individual authors, it seems that this is the unstated expectation and if that is what is going to get you in a journal, and that is what gets you tenure brownine-points, then you do as everyone else does. And that brings me to the final point which is the problem with standards in citational practices. So for example in the field of science studies, everyone must and usually does cite Bruno Latour. And as Chris Kelty reminded us, there is *very* good reason to. But I find what happens is that once a person is flagged and gets cited ad nauseum (which is mostly a decent but not full proof baramoter for judging good work), it become self-perpetuating reality/cycle because everyone else is doing it and it seems weird if you don’t (and I have sometimes seen some articles just awkwardly cite famous people in their discipline when it made little sense to do because, I think of this phenomenon). So all of a sudden, it becomes all Microsoft-Windows like: you cite, they cite, and it becomes “standard” who you cite and you can’t seem to escape the default. But alas, there is always an escape hatch, because one of the gems in academia is discovering that one theorist or book relate x to y and z topic that for some reason everyone else overlooked (because they were busy citing Latour,) to bathe some topic in a wholly new light and then a whole group of folks become unfashionable and the cycle begins, yet again…. The solution? If we only had a couple of research assistants like the lawyers, well maybe we could branch out a little and cover our bases a little..

Jordi Mallach: Tunisia

Last month, Bel n and I managed to secure our trip to Tunisia on the very last moment. So, planning trips on the very last moment isn't nothing new around this place, but we made a big effort to take things to the limit. I can't remember why exactly, but on January 31 we were *so* close to fucking everything up before it started, when we packed our stuff just a pair of hours before having to leave to the train station. My luggage was prepared in a rush, so while I think I took everything I thought I'd need, I didn't really select my clothes too much. The idea was to have our suitcases mostly empty to bring back stuff from the markets: smoking cachimbas, lamps, leather stuff, etc. At that time I didn't know that would end up being a great strategy. Anyway, like 9 minutes before the train's departure we were stuck in Nuevo Centro without a taxi and at that point I really had lost hope about being on time. For some reason, there were no taxis in the area, when it's normally a place where there's tons of them. Suddenly one appeared, we rushed in and I asked the taxi driver to please fly to the station. Happily, we got an incredible green wave around the avenues, he drove us at like 80 Km/h and we even had to wait for a few minutes at the station. In Barcelona, we prepared our small New Year's Eve dinner with my cousin Laia and Marc, and while the plan was to go to sleep pretty early to be in good shape to go to the airport next morning, the bottles of wine and cava emptied quite fast, and around 4:30 we were quite drunk when we decided it was enough. When some annoying sound woke us up next morning, it was really late, so we again rushed out to the empty streets of Barcelona, sneaked into a regional train, without knowing it was the only way to get in time in El Prat airport, and after some initial confusion trying to find the travel's agency desk in the wrong terminal, we managed to check into our flight, being the very last to do so. With all the rush, I couldn't get some clothes from my suitcase transfered into my hand luggage, which I really wanted to do after my nice lost luggage experience during Debconf 5 in Helsinki. Anyway, chances are small that your luggage gets lost, right? But of course, Murphy is always vigilant, and this was a great opportunity to fuck me up. After a short but horrible (due to our really bad hangover) to Tunis/Carthage airport, we were in the long security/passport check. When Bel n picked up her bag and mine didn't appear, I tried to tell myself hey, it'll appear, no worries! . After 15 minutes, the stupid suitcase was nowhere to be found. Apparently, another two pieces of luggage had the same luck, which made us contact a group of four Uruguayans who were missing one of them. Nothing too terrible; it'll surely come on tomorrow's flight. After reclaiming our lost luggage, we went out to the parking where a bus was waiting for us, and on the way there, the six of us nearly fell into the first Tunisian scam, involving a dude selling jasmine flowers at 2 each. The bus took us down to Jasmine Hammamet, the most touristic place in Tunisia. Valencians might have an easy imagining the atrocity of the area by picturing what twice Marina d'Or plus Benidorm including Terra M tica would look like. Kilometres and kilometres of a disgusting Who can build the most horrible giant hotel right next to the beach contest. So it was pretty clear we had to spend as little time as possible in the area. We soon learned about how transport works in Tunisia. The cheapest is to use the public busses and the luagge collective taxis, we soon found out. Our first morning there, our guide Rejeb, working for Iberojet and Solplan touroperators, gave a talk where he advised us against travelling alone, specially around the South, while he offered organised trips around the country for every day of the week. Although we expected this danger! speech, we decided to book the two day trip to the South and Great South of the country, basically because it was the best way to see many places in a short time, even if it meant having limited time in each destination. We wandered around Jasmine Hammamet and discovered Carthage Land, sort of a Disneyland set in the age of Anibal and Carthage's empire, which was inside a newly built medina complex. This was a really bad place to practice the art of haggling, as the place was so desert, merchants really tried hard to get you buy something. Again, we were close to fucking up after our first negotiation, but we finally decided we weren't so interested. Lucky, we later found out the price was outrageous. Sadly, we spent way too much time in that tourist trap, and we found it was too late to go to the real Hammamet town to see a real medina and real stuff, so we had a long walk around the immense beach until sunset. On Wednesday, we did organise a bit with the Uruguayans and some others we had met: Mar a and Santi Kuchi Kuchy , Cristina and Pedro and an Argentinian family, and managed to hire a van driver to drive us all over the North. For quite a good price, we were taken to a few ruin sites in Carthago, now mostly a residential area, and it was really impressive. While the condition of many of the remainings is not optimal, it was exciting to see things which had been built by Phoenicians and Romans 2,000 years ago. I really enjoyed the remainings of the Antonine thermal baths of the city. It had been a huge building right next to the sea; one of the standing columns helps figuring out how big it had been. Right next to this site, the Presidential Palace dominated the whole gulf. Military places are treated zealously in Tunisia, and it is against the law to take pictures of any bit of it, not even a barbwire of the fence. The Palace had a great Tunisian flag waving over it, and many signs advised you against taking pictures in that direction. I couldn't resist.


The ruins of the Roman Antonine Baths After Carthage, we went to Sidi Bou Said, a small touristic town, which had the peculiarity and beauty of having all windows and doors painted in a beautiful light blue colour. Our last stop for the day was in Tunis, where we visited the most amazing medina of the whole week. Unlike the new medina in Jasmine Hammamet, this one was literally packed with people going up and down the maze of very narrow streets. Every few metres you'd come across a new, attractive smell coming from the few salons de th or spice, leather or perfume shops. Here we finally started developing our haggling skills, and managed to get a few items for reasonable amounts.


Streets of Sidi Bou Said Back at our hotel, everyone tried to get a quick dinner and go early to bed, as next morning we were taking a bus for our trip around the South. There was time to call yet another time to the Airport, to find out that one of the luggage pieces had been found. While there was no news about my suitcase, we shared a taxi to the airport to pick the found suitcase, and see if mine was actually there by any chance. Unluckily, it wasn't, so I wouldn't have any clothes for the desert visit. Some people in the group were kind enough to lend me some t-shirts and pants. For my underwear, I actually resorted to using some of Bel n's (no kidding, it was way too sexy :P), while mine dried up after some manual washing. The alarm clock went off at 5:15 or so, and soon after we were ready in the hall with our small bags. When the bus was ready to pick us up, the guide said we weren't allowed in, as we weren't on the list. WTF? We were nearly the first ones to book and pay for it! So he finally let us in, for a short while, until he realised there was no space for everyone, so he demanded that we got off. Of course, we didn't, and a long and very disgusting argument started between the guide, us and a few people who had seen us pay for our trip, and were trying to support us. To make a long story short, we ended up stepping down when I noticed the bus driver calling the police, and after Rejeb, our guide, told us the other bus would be waiting for us at the travel agency if we quickly took a taxi there. We of course knew that was a fantasy to get the bus moving, but dealing with the police at 6:30AM wasn't on my list of activities for the day, so we finally gave up to let the rest of the people get in time to their visits, as they were very tightly scheduled to make everything fit in two days. Nobody was waiting for us at the travel agency, but we were promised our money back, which did happen in the evening; our plans for Thursday and Friday were a bit broken though, and the rest of the morning was spent looking for alternatives. When we had managed to book a new trip in a different agency for Saturday, we took the bus to Nabeul, the capital of the province, well known for their medina specialised in pottery. In Nabeul, we lived a tourist trap which I found to be quite original. Not having walked 3 metres into the city walls, some young dude stops us and tells us that he knows us, as he works in the restaurant of our hotel . I totally didn't remember his face at all, but why not? So he quickly tells us Nabeul has good carpet workshops, and her sister is working in one which is regulated by the Government, and you can only visit two days a week. Coincidentally, Thursday is one of them! So he literally grabs us by the arm and takes us to one of the streets perpendicular to the main market street, and we enter a carpet shop. To the right, his sister probably being like 45 years older, is knitting a nice carpet on the loom. And a few seconds after, we're taken upstairs, where a Teletienda show starts before us. Without being asked if we want to buy a carpet, some other dude starts to unroll carpets and more carpets before us, talking in some very basic Spanish. While we're offered jasmine tea, which is really nice, Ali the brother quickly excuses himself and vanishes, leaving us with the salesman, which continues unrolling more and more before us, now helped by someone else. When 10 minutes later we convince them that we won't buy any carpet, he asks a donative for his young employee, who has unrolled and will now roll back a zillion carpets. Back in the hotel, we have dinner with a pair of Catalans from our flight, and when we tell us about the carpet place, they tell us they went over the same story like one hour before us! On Friday, we got some advice on other places to visit, and decided to go up to Cape Bon and visit Kerkuan, the only important remainings of a Punic city which, when conquered by the Romans, was destroyed to the grounds, but not rebuilt on top (they were busy with Carthage). Romans did an excellent job when destroying cities, and the result is a site which still lets you see perfectly how a small town (around 1,500) looked like 2,000 years ago.


Ruins of a Kerkuan neighbourhood, with their red bathrooms nearly intact To reach Kerkuan we had taken the bus up to Nabeul and then our first luagge to Kelibia, where we took a taxi (after no less than half an hour arguing in French with the taxi driver to settle on a rate for a ride to Kerkuan and then to the tip of the Cape in El Haouaria. Luagges are undoubtedly the best way to travel medium distances for very little money, while getting mixed with locals. During our ride up North, we chatted with a nursing student from Kelibia who was going back to her town for the weekend. She was really open, like most of the people we found in Tunisia, and we ended up exchanging our post addresses; we still need to send her a postcard from Val ncia soonish. This area wasn't so touristic, so the roads, while totally acceptable, weren't as good as the highway from Tunis to Sfax we were used to. We had seen some bits of the local driving skills , but the luagge driver performed some of the most extreme overtakings I've ever seen. These happened every three of four minutes, so after a while I was actually amused about what was going on. We would overtake two lorries on one go when there was absolutely no visibility; if things went too far, people would just slow down to let the overtaker get back into his lane on time, and those coming ahead would just use their headlamps to make them know it was just a bit too close. The taxi driver, annoyed at us, took us to Kerkuan but didn't wait for us; he immediately left, leaving us without any transportation in the middle of nowhere. After a visit at the site, we walked around 2.5 kilometres back to the main road, where we decided it was too late and risky to continue the journey up to El Haouaria, so we waited on the road gutter for a taxi. The first one which stopped was, to our surprise, the same bastard who left us one hour before, who stopped, laughing at us a little. Luckily some other taxi came by in the correct direction, and soon forgot about that man. After a taxi, luagge and bus ride, we were back in Hammamet, and the desert group had already got back from the two day trip. We were asked over and over what happened, what did we do, etc. People who hadn't talked to us before would come over and see; we were really surprised about the warm welcome we had. After dinner, we improvised a customes party, and many people managed to dress up in Tunisian/arabic fashions using bed sheets and so on. We had to wake up at 5AM next morning, but didn't go to bed until 2AM. Nothing could go wrong this time. We had our tickets, we had confirmed we would be going on Sunday the night before, so at 6:15, our new guide came in, and came straight towards me. He said something in German, and after I told him I spoke absolutely no German, he said huh, well you know the bus is full of Germans, and my indications will be in German? . Pretty incredible, but again a fuckup by the agency. My ticket said, clearly: Sahara safari. Bus + 4x4. (ALL). Turns out ALL meant Allemand, not everything included , although we had requested English pretty clearly. This was quite a minor problem though, after having no clothes for a whole week and having been left behind two days before. I think we were really lucky getting that German group, though. We were only 16 people on the minibus, making the stops a lot faster than the normal ones, where 55 persons need to get out and in of the bus. We had our own Routard guide for Tunisia, so we could read about the places we were about to visit before getting ther. Also, I surprisingly knew much of what our guide was talking about, just missing the details he talked about oil production in Tunisia compared to Spain's, among other topics . When the landscape was becoming drier and drier, Bel n and I spotted something dark far away ahead in the completely straight road. As it became bigger, I started thinking it might be the #1 place to visit for me in Tunisia: El Djem's impressive Roman amphitheatre. When we got off the bus, I was totally excited. Before me, the walls of an incredibly well preserved, huge Roman building; in fact, the best Roman ruins in the whole continent. El Djem's amphitheatre was the third biggest of the Roman empire with 35,000 seats, only surpased by Rome's and Capua's. It remained mostly intact until the 17th century, when some of its stones were used to build the city and some of the treasures taken to the Great Mosque of Kairouan, but when it took more damage was during two consequent wars, when the Turks didn't have many problems to blow part of the wall away using cannons to end up a siege of the city.


The Roman amphitheatre of El Djem The underground tunnels are intact, and it's difficult to not have flashes of Gladiator while walking under the arena's trapdoors. Sadly, there was little time to spend there, and we had to continue the journey after just 45 minutes. I would have spent half of the day there. From here, the landscape truly started to get drier and more desertic. The south of Tunisia is a giant olive field, until you reach the Great South, where it's dry enough that the only thing that grows in the land are rocks. Hours later we arrived in Matm ta, the very famous troglodyte village of small holes in the ground. Although I was curious about being there, watching how organised and massive tourism has destroyed these Berber's ways of life dissapointed me greatly. Our guide stopped the bus in one of the pits, which was decorated with white and light blue. In the first room, an old woman was grinding something in a small, stone mill. The dwellers of the few pits still used by their original inhabitants now make a living by letting people into their homes and getting dinar as a payment for taking photographs. What the woman was doing was just a bit of theatre, part of the show. After this first room, we got into the middle of the pit, which had a series of other passages to some rooms, some of which were simply open so we could get in and have a look. I felt a little bit like violating someone's privacy, and wondered how much the house had changed in the last years.


Inside a troglodyte underground house in Matm ta After our visit, we continued up the mountains of Matm ta, and after going by a giant "WELCOME TO MATMATA" sign drawn in white in the middle of a mountain, Hollywood style (!), we stopped for a brief photo-stop (sic). Indeed, the view was quite impressive, and is universally famous as one of the filming spots of Tatoonie scenes in Star Wars: A New Hope. Speaking of famous places, a few minutes later we stopped at the top of one of the hills, were we'd have lunch in the Hotel Sidi Driss, a place of pilgrimage for Star Wars fans, as it was the troglodyte pit which served as the Skywalker's home. The place is full of references to the film saga, and one of the open pits is full of set pieces stuck into the walls. We were served couscous, which wasn't bad, but was cooked and served in the most genuine fast-food fashion. Everyone there gets couscous to eat, apparently, and it's the same in many other touristic places in the area.


Matm ta's lunar landscape From here, our journey headed straight West, in the middle of the rocky desert, until after some time, you could start to see lines of palm tree branches planted here and there, a sign that rocks would soon disappear, being replaced by sand and dunes. As when we were approaching El Djem, at some point a huge, dark spot appeared on the horizon. Douz, probably named after some 12th French batallion which stayed there, is a small town in the very limit of the Sahara desert, built right next to a huge oasis, exclusively dedicated to palm tree plantations, making dates production a big source of income, along with, of course tourism. The travel agencies use Douz as the starting point for several-day trips into the desert, camel rides and stuff like this. Our guide offered us getting a camel and carriage ride in Tozeus for 20 dinar, but Bel n and I declined. He didn't seem to be too happy about it, and had no problem commenting this in German and Arab with the driver (Spanisch and Spanien were clear to me). We learned that the agency (or the guide) makes around 3 Dinar for everyone who contracts the camel rides, after speaking to one native young kid who worked in the camel place. While our German trip mates got dressed in berber fashion, we opted to walk into the desert and play around in the sand on our own. I discovered a few desert insects which were unlike anything I've seen anywhere, and their diminute trails were all over the dunes. Looking West, the view was astonishing, with only thousands of kilometres of yellow dunes ahead us.


The evening sun over the dunes After they came back, we were taken to our hotel, which was really impressive. After leaving our stuff in our room, we headed back to the desert, which was like 300 metres away, to see the sunset over the Great Dune . There's a street which literally serves as the frontier between the rocky ground and the sand desert. From there, you could see many lines of palm tree branches, which are planted by locals in a futile attempt to stop the inexorable advance of the desert. Women in Douz and other towns in the desert limit spend their days sweeping the entrances to their homes, as sand gets in really fast. A small village next to Douz even had to be abandoned and rebuilt in some other place, with the old one being finally devoured by the dunes. When it got dark, we still had some time to kill before dinner, and we discovered a hammam in our hotel. I got in, and saw there was a bored young man inside. He informed us about the prices, and after some short deliberation, we realised we'd spent half of the camel money in some Arab relaxation; while I got a really cool massage, Bel n enjoyed a Turkish bath. I spoke to the guy for a while, and he said not that many people used that hammam. He actually handed the list of services since 2002, which easily fitted in one piece of paper. People don't know what they are missing; he explained that most of the hotel's clients just showed no interest in the baths. I wonder how Fins or Norwegians would react, given their sauna culture. The dinner and breakfast in that hotel was absolutely awesome, and I actually ate too much to have an easy sleep. Next morning we had to be ready at 5:30. That's pushing my limits. The bus started crossing the Chott Jerid when it was still quite dark. The chotts are dry, salt lakes in the middle of the desert, which during some seasons do get some water, sometimes from the underground. The Chott Jerid is the biggest of the three chotts in the area, and the views are fantastic. It's like a giant, totally flat muddy sea which reflects light creating dangerous mirages of oasis-like dark patterns. Before the construction of the recent road that links Douz and Tozeur, crossing the chott was so risky that many people died in the attempt. We had the unique opportunity to see the sun rise over the salty horizon.


Sunrise at the Chott Jerid Again, on our way to Tozeur, we were offered a carriage ride for ten dinar, and again we declined. The guide then asked us if we had no money or what. So in Tozeur we basically wanted to walk around the oasis fields, and ended up talking most of the time with some old man who sold drums and desert roses. On a 4x4, we went up North to Chebika, a really cool town with a small oasis of thermal water, which I guess was around 40 C. The short walk to the wall where the oasis surfaced was packed with children who insistently begged for money or offered necklaces and other items. It was difficult to make them understand you didn't want anything. We then went up the mountain behind Chebika through a road which had its own piece of history. It seems that during WWII, Rommel suffered an Allied siege in Chebika, with a range of mountains behind their backs. The Allies gave him one month to surrender, and he took his time to answer. During that time, he ordered his engineers to design and build a road which would let them escape Chebika through the steep mountains, and they managed. When the ultimatum expired, the Allies apparently found out Chebika had been abandoned by the Germans, including tanks and most of their equipment. So, on the way up, a few kilometres away from the Algerian border, there was another typical visit to the biggest oasis waterfall in Tunisia, which was several metres high.


The oasis at Chebika Our Sahara trip would soon end, and after lunch we headed Northeast on our way to Hammamet. On our way back, we stopped in Kairouan, one of the key Islam pilgrimace spots, with the Great Mosque as the biggest attraction. Unluckily, as we arrived after lunch, we didn't had a chance to see it. Apparently it is really impressive. We haggled a bit for a pair of babouches and a small leather couch in the medina. We came back to our hotel around 7, and found most of the people around the hall. After the obligatory update on how it went, we went to bed as we were exhausted, and of course we had to get up really early to head to the airport. The airport was at that early time of the morning a total chaos, and while people stood in the checkin lines, I tried to find out what was going on with my still lost luggage. I went back to the lost luggage window, which would be closed for 5 more minutes. When they finally opened, they told me once again they had no clue about what was going on with my luggage. I finally understood they had no clue: my tracking number wasn't in their database. I asked them if I could have a look at the unreclaimed luggage storage room. They kindly opened a small door for me, and invited me to go inside and have a look. The view was gross: hundreds of lost bags all over the place. As I was in a bit of a hurry (I actually had to get back to Barcelona), I asked him where to find the bags of one week ago, and he nearly bursted into laugher. Okay, I had to look all over the place, scanning every piece of luggage in an attempt to spot mine. There were bags of absolutely every type in there. In one of the corridors, I sensed a disgusting smell, and figured out some poor guy may have food or something in one of their lost bags, which was rotting in that horrible room. So wrong: soon after I found myself nearly stepping on a puddle of shit, as if someone had literally dumped it right there. Oh my... luckily my search was nearly over and unsuccessful, and I got back to Barcelona with the hope of finding my bag in El Prat. After looking in their two storage rooms I realised I'd probably not see the luggage again, which is a real pain in the ass. A few hours of train later we were back in Val ncia, with a feeling of having spent 3 or 4 weeks in Tunisia, not just 8 days. Really a great place to visit, not only for their cultural treasures, both current and ancient, but for the openness of their people. I hope I'll be back at some point!

Erich Schubert: iCalendar is broken by design

Seriously, RFC2445 is on crack. No wonder that few apps handle recurrence rules properly. Let me give you some examples straight from the RFC:
RRULE:FREQ=YEARLY;INTERVAL=2;BYMONTH=1; BYDAY=SU;BYHOUR=8,9;BYMINUTE=30
These are tons of events: at 8:30 and 9:30 every other year, every sunday in january. That's not precisely what I'd call a yearly frequency... I mean, we're talking about every sunday in januar. I'd more call that like... weekly. And yes, this is the official solution:
"every Sunday in January at 8:30 AM and 9:30 AM, every other year"
Note that you can not do 8:30 AM and 9:00 AM. You could do 8:00 AM, 8:30 AM, 9:00 AM and 9:30 AM (using BYMINUTE=0,30). Pure crack.
Everyday in January, for 3 years:
DTSTART;TZID=US-Eastern:19980101T090000 RRULE:FREQ=YEARLY;UNTIL=20000131T090000Z; BYMONTH=1;BYDAY=SU,MO,TU,WE,TH,FR,SA or RRULE:FREQ=DAILY;UNTIL=20000131T090000Z;BYMONTH=1 Isn't that totally on crack? Using FREQ=YEARLY for everyday in january? Notice how the semantics of "BYMONTH" change? In the first case, it's creating multiple events (BYMONTH=1,2 would name january and february independently); in the second case it's used to filter out individual days. Let me explain that a bit more: FREQ=YEARLY;BYDAY=MO,WE means every Monday and Wednesday. See how the modifier makes about 104 recurrences out of a single year? FREQ=HOURLY;BYDAY=MO,WE means every hour, but only on Monday or Wednesday. In this case, the modifier reduces the hourly events by throwing out all that are on other weekdays, reducing the number of recurrences. Again, this is not my weird reading, but the RFC says:
BYxxx rule parts for a period of time which is the same or greater than the frequency generally reduce or limit the number of occurrences of the recurrence generated. [...] BYxxx rule parts for a period of time less than the frequency generally increase or expand the number of occurrences of the recurrence.
(Note that I didn't find any details on if they consider a week to be be "less" or "more" than a month, since there is no obvious subset relationship, but a week can overlap two months, and a month usually overlaps five weeks... So if I have FREQ=WEEKLY;BYMONTH=1;BYDAY=WE, is that Monday in every week overlapping January? Every week completely contained in January? If I'd want every Monday in January, I'd use FREQ=DAILY;BYMONTH=1;BYDAY=MO...) Intersecting or joining two RRULE specifications is usually impossible (try to write one rule that is 8:00 and 9:30 every day for convincing yourself that a join won't work, and try to intersect FREQ=DAILY;INTERVAL=3 and FREQ=YEARLY;INTERVAL=2...) Anyway, I'm truly not suprised that my mobile and probably many other applications don't handle recurring events completely (that is when importing from iCal they often just lose the repetitions). My own implementation is doing okay. There are still a few missing features (BYSETPOS e.g. which can be used to say "the second to last tuesday or thursday each month"; should be trivial to add however, just picking the appropriate indexes out of a list), and some odd corner cases to dig in the specs and resolve (e.g. "every other week on friday, starting saturday march 3" - are we talking in business weeks, or intervals of 7 days here? When talking in weeks, is it friday in the week containing march 3, or following march 3, since that day itself is not a friday!) Some of these details probably vary heavily from iCalendar-supporting application to another... e.g. FREQ=DAILY;BYHOUR=8;UNTIL=20070215T000000Z does this include a recurrence on 2007/02/15 at 8:00 (which is past the UNTIL time, however the hour of the UNTIL field is not used in presence of BYHOUR). If you ever design a language for specifying recurrences, please: Consider something like (intersect (repeat daily interval=3) (union (repeat weekly monday) (repeat monthly 1) ) ) (i.e. every 3 days, if they fall on the first of the month or on a monday) Also spend some time thinking about alignment: "Every monday in a week containing the 15th of a month." - months and weeks are not aligned; assuming a week being defined as Monday-Sunday, this can be any day between the 9th and 15th of the month (in fact you could specify this in iCalendar, but it's probably easy to come up with an example that is too difficult to represent in iCalendar RRULEs, albeit trivial to calculate.)

13 February 2007

David Welton: Trawling for reading material

Yep, time to stock up on some new books. I'm interested in: That's certainly a broad range, but the reason I'm writing here, is that I'm looking for books other people like me considered a good read, and not just an idea I can glean from the wikipedia summary of the book. Yoav seems to share some of my tastes, for instance. Some of the books I'm considering: What I've already read, and would recommend to others: http://www.dedasys.com/freesoftware/ (under 'Recommended reading')

8 February 2007

Erich Schubert: Calendaring in a semantic wiki

... is the working title of my diploma thesis. Tomorrow I'll hold the introductory presentation on my topic in the research seminar. This is to explain my project to other members of the working group, so they can give me feedback and suggestions. What I'll be doing: Where I am: Difficulties: Fortunately, we have a rather strong research group here in Munich. There are experts for query and transformation languages (e.g. Xcerpt, SPEX - Querying XML Streams), temporal calculations (Computational Treatment of Temporal Notions, CTTN) and time modeling Calendar and Temporal Type System CaTTS); and I'm also working closely together with the author of IkeWiki and Xcerpt. And of course they're all nice people to work with!

7 February 2007

Stefano Zacchiroli: vim-script news

vim-scripts maintenance Mixed research meeting in which universities get in touch with big companies are fun, especially at the end, when the planning phase is reached and different, often conflicting, interests show up: academic fellows pulling the blanket from one side (trying to postpone deadlines, planning paper submissions, ...) and industry hard-workers pulling it to the opposite site (which results when, press releases, ...) But the mutual presentations at the beginning of those meetings are sooooo boring, especially when you (as an academic) have to listen at the company presentation: buzzwords, organizational charts, quadrillions of $ invested in R&D in the last years, bla bla bla. What's better to occupy that time slots than Debian hacking? So this morning I proudly uploaded a new version of vim-scripts (7.0.5) which is itself proud to be the version with the longest changelog entry in the package history (49 lines). Among the most notable changes you can find: Enjoy vim-scripts now!

6 February 2007

Rodrigo Gallardo: Failed training session

I went to the bookstore yesterday, hoping to advance in my Honya Budo training. I actually expected to reach “The feeling of the touch”. I succesfully dodged the powerful alure of a book of photographs by Juan Rulfo, a collection of maps showing the advance of european knowdledge of asian cartography from atiquity, and a collection of MC Escher engravings. Alas, the power of a cheap (MXN30) edition of Pirandello’s Six characters in search of an author proved too much for me. Back to square one, I go.

3 February 2007

Adam Rosi-Kessel: Weather Methodology

Can someone explain weather methodology? Yesterday’s forecast: Predicted Weather This morning’s forecast: This Morning s Prediction Actual conditions: Actual Weather Apparently, they don’t teach Cromwell’s Rule in meteorology school. (HT to Steve, a statistics major in college, for the reference.)

1 February 2007

David Nusinow: Bits From The XSF

This has been a little overdue, but here it is. Lots of less than glamorous stuff has been going on in the XSF, and a few more exciting things are in the pipeline.

Among the less glamorous stuff, our resident release junkie/alpha porter, Steve Langasek, fixed #392500 which was our major RC bug on the alpha arch. Aside from that bug, there's been a whole host of bug triage by our newest team member, Brice Goglin. Brice has taken on the unenviable task of going through the massive list of bugs owned by the XSF. I've been traditionally less than responsible about handling bug reports like I should, and Brice is dealing with the mess I've left behind. Before he started, we were at over 2000 outstanding bugs, and as of this writing we're down to 1646 bugs, which is a huge amount of work. Hopefully this will go a long way towards making our little corner of the BTS usable for mere mortals. Aside from that, there's been an enormous amount of small cleanups and bug fixes by the whole team, most notably Julien Cristau (who's been doing more actual release management than yours truly), Thierry Redding, and Drew Parsons. Perhaps most important among these are miscellaneous last minute driver fixes that will enable a fair number of people to actually run Etch without backports. Michel D nzer has continued to be his usual awesome self, responding to the tough DRI bugs that the rest of us are terrified to approach.

Some of the more exciting stuff from a user perspective has been the various updates and new packaging going on. Thierry has taken on mesa, which is an incredibly daunting task, and he's done and incredible job of it so far. He and Julien cooperated on getting the newest mesa release, 6.5.2, in to experimental. That's a huge step on the way to getting the 7.2 release in to the archive. Thierry has also packaged up the newest compiz and some additional plugins ported from beryl, both of which are waiting in NEW right now for our overworked ftp masters to find time to have a look at them. Speaking of beryl, we also have that more or less complete and packaged. Our second-newest XSF member, Shawn Starr, has taken on beryl, and done a great job of getting the packages ready for experimental. They came back from review with a few minor comments, so he's busy getting those last issues resolved, so beryl should be winging its way over to NEW again for re-review soon. Finally, Josh Triplett and Jamie Sharp, who are both Debian and XCB developers, have put XCB in to experimental for you to test and play with. Expect to hear more about this when the Lenny development cycle starts.

The other huge thing that's been going on, and what I've been devoting most of my time to (aside from reading all the mail from Brice's bug triage), is transitioning the XSF over to git. Thierry has written major chunk of infrastructure to help move us over. I've done most of the conversion locally, and have been putting things up on git.debian.org as I go. As of now, we've got a very large chunk of X in git now, and using svn for those bits is officially closed. I'm hoping to complete the move in the next two weeks or so. If you want the above software that's not yet in the archive (beryl, compiz, compiz-extra, etc) you can clone it from the git repositories and build away. The other major thing that I've been doing is writing up a XSF git policy. This required a lot of input from the team, and we had to come up with a reasonable way of working the archive so that we could easily work with an upstream that was also using git, which as far as I know is a unique situation right now. It's in pretty good shape right now and we're just starting to put it in to real use. I've proposed a talk for Debconf on the XSF roadmap for Lenny, and I'll be sure to talk about our experiences using git if it gets accepted. In addition, we've all been learning the ins and outs of git, which is a whole other post in itself. I think that the XSF will end up being a really good resource for people in Debian who are looking to use git, as we'll have a lot of real world experience with a tool that relatively few people actually seem to know. Since I think git usage will only grow in the future, hopefully this will end up being valuable for Debian as a whole.

30 January 2007

Todd Troxell: Or-ing procmail rules

Is there no better way to OR procmail rules than these horrid kludges?

For now I'm going with the DeMorgan Rule method, because it's more efficient and to the point that the alternative kludges. I still feel a little dirty writing things this:
      :0
      * ! condition1
      * ! condition2
                      # official procmail no-op. MUST LEAVE SPACE
      :0 E
      action_on_condition1_or_condition2    
It would be nice to have a recipe flag that means "OR the conditions below"

26 January 2007

Biella Coleman: Low-tech solutions in a pinch and in the tropics

Recently I complained about using dial-up in PR and I believe in response to my post, Joey Hess provided some great tips for making the dial-up experience a little more bearable. He, of course, was providing a set of solution to constraints, which is what the likes of Joey Hess do a lot of their waking (and according to a recent IRC conversation, even dreaming) hours. I as an academic am not involved so much in the business of finding real hard solutions but when I go to Puerto Rico, that is what I DO spend a lot of time doing. And I came up with 3 solutions this year, 2 of which I was particularly proud of (one of which may be useful to the blog readers), so I thought I would share them here: As I wrote about a few weeks ago, my mom has been plagued with a problem of choking on her saliva because she is not swallowing. It causes her and those around her a lot of angst. I tired many things but when I stopped trying and just started watching and observing to see when it seemed to be worse, I finally noticed that if she wore her dentures, the problem, while not totally resolved, was like 70-80% better. With her dentures, she would never choke on her spit and often times there would be not spit. I think the dentures changes the shape of her mouth so that she can swallow with less effort. I was pretty proud to notice this because it was the overwhelming problem of the season. Now, there is, of course, another problem. She loathes wearing those teeth and well, it has been a battle to convince her it helps (I think she sort of knows but does not want to admit it) but she is wearing them a lot more than she used to…. Maybe I will come up with a long-term solution to that problem later but I have failed in all of my attempts while still there which stretched from begging, to coy deception, to outright bribery. So in PR, we have an awesome mutt, who goes by one of three names, Isabela, Gordita (look at her tummy in the pictures to see why we call her chubster ) and Pucha. She is literally the joy of the house and she truly revels in this role. She is, in fact, like a hovercraft of love , in the sense that she will hover over you, as you are, for example, trying to get work done, and she will whimper, or lift her little paw, or more audaciously butt her head against your hand, until you assume the position and pet her, or preferably hug her. And she wants demands this sort of attention for as long as you can humanely sustain it. Ok this is not the problem part (though it can be a problem when trying to complete work and I usually just give up and give in to her or kick her out of the room). The problem was that the pucha would routinely despoil the same spot on the floor, usually every day, usually in dramatic response to leaving her in the house alone for more than 10 minutes. And I know this is willful because she is otherwise quite potty trained. She just likes to remind those who shower her with affection and love that she wants it to rain harder. The problem was that she was soaking and thus really rotting the wooden trimming (and poking around led me to discovering the third huge problem, termites, but more on that soon) and this had just had to stop. Giving her a light whallop in her chubby behind never helped (maybe she was too well padded?) and obedience school seemed like way too much effort and money. Eventually, I just threw her little bed right where she peed, and vualla, she stopped peeing there and thankfully she did not have the cojones to find another spot. I am not sure if this is long-term solution, but for now I am satisfied. Through the pucha, I found out that the wooden trimming in our house was ingested with termites. This caused a mini-heart attack, because well, termintes are a bitch to eradicate and they are a real problem in the tropics. I called the exterminators just to find out some information on termites and they assured me that once I ripped out the molding (which was my low-tech solution), I would not be putting the other wood in danger by accidentally flinging one of the little chubby white grubs over to another piece of wood and there is a lot of wood at home. Thankfully, since that is unlikely, with some help , I proceeded to tear most of the molding out only to disover a cornupia of bugs living there. It was so so so so so gross, really, gross that of course I am not replacing the trimming with wood but with some other bug-resistanant material. But that will have to wait till another trip.

25 January 2007

Steve Kemp: Tell you, might not believe it, but

I would like to have a simple way of mirroring a webpage, including any referenced .css, .js, and images. owever to complicated matters I wish to mandate that the file will be saved as “index.html” - regardless of what it was originally called. This appears to rule wget out, as the –output=index.html option trumps the –page-requisites flag (which is used to download images, etc which are referenced.) Is there a simple tool which will download a single webpage, save it to a user-defined local filename and also download referenced images/css files/javascript files? (Rewriting the file to make them work too) Using Perl I could pull down the page, and I guess I could parse the HTML manually - but that seems non-trivial - but I’d imagine there is a tool out there to do the job. So far I’ve looked at curl, httrack, and wget. If I’m missing the obvious solution please point me at it .. (Yes, this is so that I can take “snapshots” of links added to my bookmark server.)

24 January 2007

Adam Rosi-Kessel: Castigating Cully

Last week I decried a senior Pentagon official’s attack on lawyers providing pro bono representation to Guantánamo detainees. I suggested that villifying the partners of some of the largest firms in the country was probably not the wisest political move, and was likely to backfire. As it turns out, it appears I was right. See the editorial in this week’s Massachusetts Lawyers Weekly:
…Headlines in print and online were unanimous: “Why Cully Stimson Is Wrong.” “The rightwing assault on the legal system.” “Cully Stimson Should Pick Up His Medal of Freedom and Go Home.” “Law deans respond to unethical Bush lawyer.” And perhaps the most eloquent rebuke of all came from Harvard Law Professor Charles Fried. In an op-ed that ran in the Wall Street Journal, Fried declared that “Stimson showed ignorance and malice in deploring the pro bono representation of Guantanamo detainees by lawyers in some of the nation’s leading law firms.” The former Supreme Judicial Court justice continued: “It is no surprise that firms … on Mr. Stimson’s hit list are among the most sought-after by law school graduates, and retain the loyalty and enthusiasm of their partners. They offer their lawyers the profession at its best, and help assure that the rule of law is not just a slogan but a satisfying way of life.” …What could have been a disaster for the bar turned into an all-out celebration of what lawyers do.

23 January 2007

Yves-Alexis Perez: Xfce 4.4 released.

Ok, so now everybody knows, Xfce 4.4 has been released, the final version is now out since sunday.

During sunday I worked to package it, and by the time the release was announced, packages were (mostly) ready in our svn. It runs fine (no real changes since 4.4rc2 so there's no urgency).

4.4 won't be uploaded to unstable soon, because of the freeze status. It may be uploaded to experimental in the future.

I've made/uploaded preliminary packages to my repository. There are there packages for ppc and i386. ppc packages are built against gtk 2.10 from experimental, and they run fine (except mousepad with line numbers activated, known bug in gtk 2.10.7). i386 packages are built against gtk 2.8 except gtk2-engines-xfce, built against gtk2.10 because it now uses in the packaging a call to a module only present in gtk 2.10.

If you want to install Xfce 4.4 on i386 via my repository and don't wan't to switch to experimental gtk 2.10, you can do as follow:

apt-get source gtk2-engines-xfce
dpkg-source -x gtk2-engines-xfce_2.4.0-1.dsc
cd gtk2-engines-xfce-2.4.0
vi debian/rules


Now you just have to remove the call to dh_gtkmodules.
Then:

vi debian/control


In the Build-Depends: line, change the dependency from gtk 2.10 to gtk 2.8. (libgtk2.0-dev (>= 2.8) should be ok).

Then just rebuild the package as usual:

apt-get build-dep gtk2-engine-xfce
dpkg-buildpackage -rfakeroot -us -uc


As alway, don't use those packages if you want stability. Current i386 packages are not up to date (as I can't rebuild quickly for this arch), and they can change at anytime. If you still want to test, don't report bug on Debian BTS but rather on IRC (#debian-xfce@freenode).

Happy testing!

22 January 2007

Julien Danjou: DeFuBu contest #6

Bug Welcome to this 6th issue of the DeFuBu contest, the monthly (even if I'm late) championship of the funniest bug reported to the Debian BTS. The challengers How the vote has been done Three Debian related people voted for these bugs, Mohammed Adn ne Trojette, Pierre Habouzit and Florent Bayle Full ranking Bugs Challengers The winners Notes To participate, simply drop me an email with a bug number. About DeFuBu

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. :-(

Next.

Previous.