Search Results: "xam"

14 June 2007

Marc 'Zugschlus' Haber: Please test exim4 from experimental

I have uploaded exim4 4.67-2 to experimental. Lots of changes and improvements. Quite some changes have gone into the Debconf stuff (for example, the split/unsplit config question is not asked first any more), and into update-exim4.conf (including input sanitazion, transformation of input to lower case, and getting rid of the DEBCONFsomethingDEBCONF stuff in the configuration). I’d like you to test the experimental package before I upload to unstable (probably on sunday). Please report your findings.
exim4 (4.67-2) experimental; urgency=low
  - update-exim4.conf:
    - finally get rid of the DEBCONFfooDEBCONF stuff. That information
      is now passed to the configuration by ue4c by directly setting exim
      macros in the configuration. This has caused both the configuration
      and ue4c to be much shorter.
    - run with -e, -C and -u.
    - convert input read from update-exim4.conf.conf to lower case
    - barf if strange characters are found in ue4cc. Closes: #400294
  - Remove superfluous “x$foo” = “xbar” constructs from scripts
  - Add routers to reject mail to accounts with low UID.
    Closes: #400790.
  - Make daily cron job barf if /usr/bin/mail is not found. Have
    exim4-base recommend mailx. Closes: #427960
  - Have all -daemon packages provide exim4-localscanapi-1.0 and
    exim4-localscanapi-1.1 as requested by Magnus Holmgren while fixing
    #426425. Also include exim4-localscan-plugin-config script with
    exim4-dev. Thanks to Magnus for helping with this. Closes: #428274
  - remove /etc/exim4/email-addresses symlink and document this.
    Thanks to Josip Rodin. Closes: #420578
  - introduce conf.d/250_exim4-config_lowuid which optionally allows
    to reject (or alias away) mail to low-uid accounts that are not
    listed in an exception list. Thanks to Dominic Hargreaves,
    Marc Sherman and Ross Boylan. Closes: #400790, #307768, #331716
  - remove versioned depends on cron, since the version we need is
    well before sarge.
  - Add cron   fcron dependency. Fcron is going to be removed again
    at the first sign of trouble. Closes: #381806
  - remove move_exim3_spool debconf template. Closes: #391762
  - replace openssl gendh with openssl dhparam. Closes: #413235
  - adapt docs, README and manpages
  - have Hilko fix the lynx-dump postprocessing to repair generating
    README.Debian text version. Thanks!
  - increase README.Debian generation robustness. Thanks to Hilko.
  - debconf:
    - Partly apply Christian Perrier’s patch for reviewed
      templates and control file. Closes: #426980
    - Other minor template changes.
    - get rid of “mails” in debconf templates, use “messages” instead.
      Re-word local_interface debconf template. Other minor changes.
      Thanks to Jens Seidel and Christian Perrrier. Closes: #394976
    - re-work exim4-config.config logic to have split/non-split config
      asked last instead of first. This partly addresses #410756.
    - Add exim4-daemon-heavy.templates, exim4-daemon-light.templates
      and exim4.templates to POTFILES.in
    - Re-Word dc_other_hostnames debconf template.
      Thanks to Hans G. Ehrbar. Closes: #421860
    - translation updates:
      - French
      - Ukrainian. Closes: #427793
      - Bulgarian.
      - Thai.
      - Galician.
      - Swedish.
      - Punjabi.
      - Indonesian.
      - Italian.
      - Khmer.
      - Traditional Chinese. Closes: #428072, #428069.
      - Portuguese.
      - Simplified Chinese. Closes: #428072, #428069.
      - Marathi
 -- Marc Haber <mh+debian-packages@zugschlus.de>  Wed, 13 Jun 2007 14:00:38 +020
0

MJ Ray: Saying that Green is Good

I was asked:
"How can I change the ways I communicate to set a good example of green-ness to company employees? Does anyone have some ideas? This is rather outside of my knowledge field. I guess anything that decreases carbon footprint is probably good?"
Most of this is obvious. We know we should be doing it, but sometimes the usual "too hard" excuses get in the way. Just doing it and making it clear why you're doing it is the biggest step. Like hand-correcting a small error in an internal note instead of reprinting, using both sides of the paper or 2-up printing, or moving to electronic communication instead of paper where possible. Two of my consumer co-operatives ( the Cooperative Group and the Phone Co-op ) take it a stage further: communicate it to others and persuade them to take similar action. tCG does this with its Climate Challenge pledge and Climate Doctor online Q+As. Phone Co-op ask customers to switch to paperless billing and put profiles of green companies into their (online) newsletters. Two more asides: Carbon footprint is not the only aspect of green-ness. It's the most important and popular just now, but there are things that reduce carbon footprint but aren't very green (nuclear power, for example). Greenwashing is a danger. I feel that communicating that you're very green when you're not really will cause you more trouble in the long run than accurately communicating limited green-ness. How else would you practice green communication?

Christine Spang: Impressions

The Real Cambridge is quite a lot different from the US Cambridge. There are vast stretches of green grass everywhere. People drive little brightly-coloured Volkswagons on the wrong side of the street, and in some places one can be walking down the middle of the street and not realize that vehicle traffic can go there too until a car creeps up behind you, trying to get through. Everywhere that’s not explicitly marked “no cycles” (the colleges, historic important buildings, etc.) features dozens of locked up, often step over-framed commuter bikes, decorated with panniers and front baskets. I still find it vaguely nerve-wracking being in a British vehicle, since I’m always expecting cars traveling in the opposite direction to come wheeling towards me. But I have yet to step off the curb and almost get hit by a double-decker bus because I looked in the wrong direction before starting across. The Cam River is frankly quite puny. Walking alongside it you can witness such events as crew boats nearly crashing into tour boats, and apparently a sort of crew racing called “knocking” is often used because of the river’s narrowness. It’s also not very deep, as can be proven by the periodic punt hires along its shores. And here punting is not to procrastinate (very much an MIT-ism) but to propel a punt , which is a flat-bottomed boat with square ends, by pushing a pole against the bottom of the river. It’s difficult to go six hours without being offered a cup of tea, especially if one is visiting many different people. And I have no idea how people can manage to get drunk off of beer, because a pint is quite enough to fill my stomach and leave no room left for more. So much liquid! And the prices of everything here are just about the same as in the US–except in pounds sterling, not dollars. Which means things really cost twice as much. But since the only things I really need to buy are food, drink, and miscellaneous (like anti-death-by-hay-fever-histamine), things will work out alright. Things have been awesome so far, and the local free software-Debian-Ubuntu-GNOME crowd has made me feel right at home. Maybe someday I will actually swap Cambridges for a while. I’ve gotten to see a bit of Cambridge University here too. Since Hanna’s (really awesome) dad is a fellow of King’s College, we got to go in and look around even though it’s exam season and the general public isn’t allowed in — there’s always a person in funny academic robes standing at the gate and shooing away tourists. Right through the gates there is a large, pristine mowed lawn. It’s in such a condition because no one is allowed to walk on it — unless they’re a fellow of the college. Flaunt that. Her dad also supervises the Cambridge end of CME, so we crashed an end-of-the-year garden party for that this past afternoon. And Saturday it’s off to Scotland, which should be just as awesome! And with more people and more Debian! I’m excited.

13 June 2007

David Pashley: Atomic in-place rewriting of files with backup in perl

In my article on Perl's IO::Handle objects I talked briefly about IO::AtomicFile and IO::Digest. I've just had reason to use these very useful modules to create a script which edits a file in place. These modules allowed me to do the rewrite atomically and optionally make a backup if the contents have changed. The example assumes you have a function called perform_rewrite that takes two file handles as the first two parameters.
use File::Copy;
use IO::File;
use IO::AtomicFile;
use IO::Digest;
sub rewrite_file  
   my $file = shift;
   my $sub = shift;
   my $input = new IO::File($file,'r');
   my $input_md5 = new IO::Digest($input, 'MD5');
   my $output = new IO::AtomicFile($file,'w');
   my $output_md5 = new IO::Digest($output, 'MD5');
   $sub->($input, $output, @_);
   if ($input_md5->hexdigest ne $output_md5->hexdigest)  
           copy ("$file", "$file.bak");
           $output->close();
     else  
           # we haven't changed so don't bother updating
           $output->delete();
    
   $input->close();
 
rewrite_file("/foo/bar", \&perform_rewrite, $baz, $quux);
Read Comments (0)

Mario Iseli: Organize stuff and prepare for Debconf

Hello World :) Debconf (16.6.2007) is getting closer, in 77 hours I will take the train to the airport in Geneva and then fly to Edinburgh. I didn’t really organize anything yet so it becomes stressful.
* Today I organized a kilt from a friend, looks quite funny, I will wear it on Saturday.
* Wednesday I want to prepare my private notebook and maybe even my IBM x60s from the office.
* Wednesday I want to prepare my digital camera and clean the memory stick.
* Wednesday I’ll organize 95 for the LPI exams.
* Wednesday evening I’ll go out with some friends to have party (several of my friends go to the Greenfield festival Thursday evening and I go to Debconf, time to celebrate)
* Thursday evening I will leave work early and go to Biel to buy some clothes for me, cheese for madduck and the othere Cheese’n'Wine participiants, chocolate for ana, cookies for Joerg. (If you also want something from .ch, please ping me on IRC)
* Thursday after shopping I need to go to a business dinner in a Mongolian BBQ restaurant.
* Friday I need to organize some W-Lan cards for the airport in Geneva in a Swisscom-Shop.
* Friday I would like to bring a friend a birthday gift.
* Friday I would like to go to have a drink with my ex-girlfriend.
* Friday night I need to prepare my baggage including all technical stuff. So you see, several tasks I have to do (this weren’t all of them) and I hope to be able to do all of that ;) See you in Teviot, Saturday afternoon!

12 June 2007

Biella Coleman: Housebreaking Your Health Insurance

Are you having trouble with your health insurance? Are they stalling on paying a bill? Denying a claim? Not telling you what the heck is going on?? Well you can and should take action to eliminate some of the mystery and move forward, and possibly win fight against the health insurance company. Thanks to my unpleasant ordeals with BCBS of NJ, I have compiled some handy resources and tips to get you started. Good luck and I welcome any other tips that you think should be here. Please email them to me at biella(at)gmail(dot)com Can’t get a straight answer when dealing with health insurance representatives on the phone? Are different representatives providing different and contradictory information? Does talking to the representatives leave you with a pounding headache? Then the following may be helpful: 1. Ideally you should tape record all conversations. If this is not possible, get the name or employee number of the person you are talking to and write down what they told you along with the time and date. If they have agreed to something, make sure they send it to you in writing. This sort of documentation may come in handy later when you are trying to contest or prove something. Is your insurance company flip flopping on a claim? For example telling you that the claim is still being “reviewed” but sending you statements that indicate it has not been paid and never will be? What action can you take to inch things forward? The following may help: 1. Most states have a Department of Banking and Insurance and they are there to help you. Many (perhaps all) provide a service for filing a complaint against your health insurance company and other insurance and banking companies too. When I used the service in NJ , I got assigned an investigator and their service was prompt and helpful. It was my experience that even though they were not able to resolve my issue, the insurance company started to make firm decision on many claims and this alone has been helpful. Before this, it was impossible to get a clear answer from them as to the state of all sorts of claims. They said “NO,” & you think they should say “YES, YES, YES, YES!!!!” In other words, appealing a denial: 1. This site has some great information on how to avoid a denial and what you can do to fight one. 2. Included on their site is the Health Insurance Laws and Benefits Tool which will provide specific information about your rights in different states. For example, you will want to know if there is an external or independent grievance system to appeal your plan’s decisions. In the case of NJ, which is the state I am fighting, the tool provided the following helpful information:
Does New Jersey require an external or independent grievance system to appeal your health plan’s unfavorable decisions? Yes, for all health plans.

On what grounds can you file your external grievance?
Investigational treatment appeal, medical necessity. What is the status of the external grievance panel’s decision?
Binding. External grievance systems allow you to take a dispute with your health plan to a doctor or review board unaffiliated with your health plan. Thus, both you and your health plan receive an impartial ruling on its decision to deny coverage of services or treatment. Additionally, you can file a complaint against your health insurer with your state’s department of insurance.
Additional Helpful Information and Resources 1. The message boards on lawyers.com are a great place to hit for information. I have found folks there helpful.
2. You many want to blog about your experience as you may get an unexpected response directly from your insurance company. I think there are pro’s and cons to blogging about your experience but it does provide a public face to your ordeal and allows you to chronicle exactly what has transpired.
3. If your cases is particularly shocking, do not hesitate to hit the local media.
4. If your claim has been denied by an external review panel, you may not have much luck suing but if there is no external review panel, you can and should also try Small Claims Court or other legal action. Further, even if your claim was denied by an external review board, you may have other options for suing, for example, due to their bad faith handling of a claim. And on that note, here is a great legal resource covering the topic.

Antti-Juhani Kaijanaho: Benja on denotational semantics

My friend Benja Fallenstein got carried away in the comment section of my latest post on recursion and wrote a tutorial on how it all relates to denotational semantics. It’s a shame it is buried somewhere in the comments, so I am reposting the comment here with Benja’s permission. The tagline is, Denotational semantics tutorials. It s the new monad tutorials!
Benja Fallenstein writes: Having read and understood [the] entire post, I can now summarize Antti-Juhani s complaint in a way that programmers with no theoretical background will understand: The definition is an infinite recursion. Sure, it s self-referential, but since it recurses forever, it doesn t actually define what recursion is! :-) That said, I find it kind of a pity to introduce all this theory without talking about why it nicely models the real world. Antti-Juhani argues that this pretty much the definition of popularized science, but I have to admit that, as definitions go, I like recursion: see recursion better. :) So let me have a quick go. [UPDATE: Didn t turn out to be quick at all. This is, in fact, as long as Antti-Juhani s original post. Proceed at your own peril.] All of this comes from denotational semantics, which is concerned with what expressions in a programming language mean and which ones mean the same thing. For example, 7 denotes the number seven, 7+2 denotes the number nine, and 5+4 also denotes the number nine. Now, here s the knotty problem. If we have f(x) = if x = 0 then 1 else x*f(x-1) then f(4) denotes the number twenty-four, but what does f(-2) denote? So, denotational semantics introduces a new, special value, recurses forever. An expression of type integer either denotes an integer, or, like f(-2), it denotes recurses forever. Now, about these partial orders. (Reminder: A partial order says, for every pair (x,y) of elements of a certain set, that x is smaller than y, equal to y, larger than y, or incomparable to y.) Here is Benja s guide to what the partial orders of denotational semantics mean: Let s say that you write a program where, in one place, you can plug in either x or y. If you can write such a program that prints foo when you plug in x and prints bar when plug in y, then x and y are incomparable. If you can t do that, but you can write a program that prints foo when you plug in y, and recurses forever when you plug in x, then x is smaller than y. If every program you can write will do the same thing whether you plug in x or y, then x and y are equal. (We ignore details like out-of-memory errors and *how long* a program takes to do something.) Examples: - 5 and 7 are incomparable. Proof: if ___ == 5 then print foo else print bar . - f(-2) f(2). Proof: if ___ == 2 then print foo else print foo if you plug in f(-2), this will loop forever, if you plug in f(2), it ll print foo . - (5+2) = 7. Whatever program I write, it will do the same thing, no matter which of these expressions I plug in. Now, with expressions of type integer, the resulting partial order is: Recurses forever is smaller than everything else. All other values are incomparable. Recall from Antti-Juhani s post that the bottom element ( ) is defined to be the smallest element of a mathematical universe (if such a beast exists). Since recurses forever is smaller than everything else, it s the bottom element of this universe. That s what denotational semantics calls it. (Haskell, too.) Of course, this partial order is kind of boring (the technical term is flat ). It gets more interesting when we consider functions. In general, we can talk about functions from values of type S to values of type T, where we already know the partial orders of S and T. In particular, we can talk about functions from integers to integers. Now, if you can find an x and a program that prints foo when you plug in f(x) and bar if you plug in g(x), then you can write a program that prints foo when you plug in f, and bar when you plug in g. (Exercise! ;-) ) Further, denotational semantics wants applying a function to a parameter and then doing something with the result to be the *only* way you can get information about a function. No f.get_function_name, please. (If your programming language has that, you can t map the functions of your programming language 1:1 to the functions of denotational semantics.) By my rule above, this implies that f = g if and only if f(x) = g(x) for all x. Since formal theories can t have fuzzy stuff like my rule, denotational semantics takes this as the *definition* of the partial order on functions. The bottom element of this mathematical universe, then, is the function that always returns bottom, no matter what it is given or in other words, a function that recurses forever, no matter what parameter you pass to it. (Side note. Denotational semantics allows only monotone functions that is, if x = y, then f(x) = f(y) for all f, x, and y. That s an example of how all these definitions allow us to make formal statements about the real world. In the real world, if you can find a function f and a program that prints foo when given f(x) and bar when given f(y), then you have a program that prints foo when given x and bar when given y so if f(x) and f(y) are incomparable, then x and y must be incomparable, and the other way around, if x and y are comparable, then f(x) and f(y) must be comparable, too. (This reasoning doesn t exclude the case that x = y and f(x) >= f(y). If you really care, prove it yourself. :) ) This ends the side note.) Recall, now, Antti-Juhani s definition of recursion: An equation of the form x = some expression (which may contain x), interpreted as a recursive definition, defines x to be the smallest value satisfying this equation. The models constructed in denotational semantics have the property that for any equation of this form, the set of values satisfying it does have a smallest element, so x is well-defined no matter what the equation is. It s important to note that this does not mean that x has to be bottom, because there are equations to which bottom is not a solution. Let s look at a slightly simpler example than the one Antti-Juhani gave. f(x) = if x = 0 then 0 else f(x-1) We have f(0) = 1, but bottom(0) = bottom, so f can t be bottom. The equation has more than one solution, though. It is satisfied by a function that returns 0 for x >= 0 and returns bottom (recurses forever) for x 0; but it is also satisfied by a function that returns 0 for every input. And by an infinite number of functions that return 0 for some negative inputs and bottom for others. We want the first of these solutions, of course, because that s what we get if we interpret the equation as a computer program, and computer programs are what we re trying to model. But we re in luck: The first solution is smaller than all the other ones, because for all inputs, they either return the same value, or the solution we want returns bottom and the solution we don t want returns 0 (and bottom 0). The point of it all is, of course, that when we interpret an equation as a computer program, we always get the least value satisfying the equation (if we use a partial order that follows my rule, above). And that, my friend, is denotational semantics.

Antti-Juhani Kaijanaho: On recursion

Note: This entry has been edited a couple of times (and might be edited in the future) to remove errors. Thanks to Benja Fallenstein for critique. My previous post about recursion drew some comments. This is a topic that frequently confuses me, and there is a lot of confusion (some of it mine) in the blog post and its comments. On reflection, it seems prudent to examine what recursion really is. Consider the following recursive definition: 0 is an expression; if T is an expression, then sT is an expression; nothing is an expression that doesn’t have one of these two forms. Now, it is clear that 0 is an expression. It is equally clear that sssssK is not an expression. In some applications, it makes sense to consider infinite expressions like “…ssssss0“; that is, an infinite number of ss before the final 0, and in others it doesn’t. Is that infinite utterance and expression? It does have one of the forms given in the definitions, so it is not forbidden from being an expression, but neither is there anything in the definition requiring that it is. It is helpful to do this a bit more formally. Let us translate the self-referential definition into a set equation: The set of expressions is the set E that satisfies the equation

E = 0 ∪ se e ∈ E

But this definition is bogus! There are more than one set E that satisfies the equation, as remarked above, and thus there is no “the set E”! We need to fix the definition in a way that makes the set E unique. The key question is, do we want to regard the infinite utterance discussed above as an expression. It is simplest to just say “the set of expressions is the smallest set E that …” if we want it to not be an expression, and if we want it to be an expression we should say “the set of expressions is the largest set E that …” Let us make the following definitions:
Consider the set equation S = … S …, in which the set S is alone on the left-hand side and occurs at least once on the right-hand side. This equation is a recursive definition of the smallest set S satisfying this equation, and a corecursive definition of the largest set S satisfying this equation.
Thus, a definition like

E = 0 ∪ se e ∈ E

is not recursive because of its form; it is self-referential. By itself, it is an ambiguous and thus bogus definition. We use the words “recursive” and “corecursive” to indicate the intended method of disambiguation. A rather nice example of this can be seen in the treatment of algebraic data types in strict (ML-style) and nonstrict (Haskell-style) functional programming languages. Consider the declaration (using Haskell syntax)
data IntList = Nil   Cons Int IntList
This can be read as a set equation as follows:

IntList = Nil ∪ Cons n x n ∈ Int ∧ x ∈ IntList

Now, as a recursive definition, it is restricted to finite lists as found in ML, but as a corecursive definition, it also allows infinite lists as found in Haskell. (It unfortunately fails to address the question of bottom-terminated lists, which also can be found in Haskell.) As it happens, the technique is not limited to set definitions; but to generalise it, we need to discuss a bit what we mean by the terms “smallest” and “largest”. In a set context, a set is smaller than another set if it is the other’s subset. Notice how this makes the ordering partial, that is, there are sets that are not comparable (for example 1 and 2 ; neither is smaller than the other, but neither are they equal). A collection of sets does not necessarily have a “smallest” set (that is, one of the sets that is a subset of all the others). However, we can always find the lowest upper bound (”lub” or “join”) of a collection of sets as the union of the sets, and the greatest lower bound (”glb” or “meet”) as the intersection of the sets, and if the lub or glb is itself a member of the collection, it is the smallest or largest set of the collection. Haskellists will find things instantly familiar when I say that the smallest element of a mathematical universe (if it exists) is called bottom and is denoted by ⊥; somewhat less familiar will be that the greatest element (if it exists) is called top and is denoted by ⊤. A partial function is any function that needs not be defined everywhere. For example, f(x) = 1/x is a partial function on the reals (it is not defined for x = 0). We can form a partial ordering of (partial) functions having the same domain and codomain by specifying that f is smaller than g if f(x) = g(x) for all such x that f(x) is defined. Sometimes it will make sense to specify that f is smaller than g if f(x) is smaller than g(x) for all such x that f(x) is defined. Now, it happens that all collections of functions have a lub; and in particular, the partial function that is defined nowhere is the smallest function (the bottom function). Now, with this definition of “ordering” of functions we can apply the definitions of recursion and corecursion to functions. For example, consider f(x) = f(x) + 1. The bottom function (defined nowhere) qualifies, since undefined + 1 is undefined; thus it is the smallest solution to the equation and thus this equation is a recursive definition of bottom. However, consider f(x) = if x = 0 then 1 else x*f(x-1): any solution to this equation must have f(0) = 1 and thus the bottom function is disqualified. In fact, the smallest solution is the factorial function, and thus the equation is a recursive definition of factorial. In the comments to my previous entry, I was asked whether the Haskell definition “ones = 1 : ones” is recursive. Of course, the question in itself is nonsensical; whether it is a recursive definition or something else (such as corecursive) depends on what the programmer intends. I will interpret this question as whether the equation is a recursive definition of the intended result, the infinite list of all ones. First, observe that we can order Haskell lists (including the special “undefined” list) partially as follows: l1 is smaller than l2 if l1 is undefined, if they both are empty lists or if a) the first element of l1 is smaller than the first element of l2 and b) the tail (the list with the first element removed) of l1 is smaller than the tail of l2. The undefined list does not qualify as a solution for “ones = 1 : ones”. No finite list qualifies either. The infinite list of all ones does qualify, and it is the only solution; hence, the equation is a recursive definition of the infinite list of all ones; it is also a corecursive definition of the same list. Finally, let us consider the question that started it all: what should we make of the definition “recursion: see recursion”. First, note that a equation x = x admits all elements of the universe as a solution; hence, the proper reading of “recursion: see recursion” as a definition is that it is ambiguous and hence bad. It is a recursive definition of the bottom element of the universe (whatever that might be for a dictionary), and a corecursive definition of the top element of the universe (whatever that might be). In any case, it does not define recursion (unless of course, the concept of recursion is the smallest or the largest concept in the universe of concepts).

Michael Prokop: Error handling: ENOSPC

Hopefully fuzz testing is well known nowadays, right? But did you check how smart your software can handle ENOSPC - the ‘No space left on device’ error? I like stress testing software (to be honest: no, not really). Yesterday I debugged a problem regarding zsh history writing on ENOSPC. Usually I use the grml Linux live-cd for stress testing (often running inside Qemu, Virtbox, VMware,…) like in:
dd if=/dev/zero of=/tmp/home.lo count=1000
losetup /dev/loop1 /tmp/home.lo
mkfs.ext3 /dev/loop1
mount /dev/loop1 /home
mkdir /home/grml
chown grml: /home/grml
Now after restarting the shell session of user grml I can play with ‘No space left on device’ situations. (Notice: I adjust the count=… according to what type of application I want to test.) Too many applications don’t really cope with the ENOSPC situation. Firefox for example is very funny, depending on the situation it either just segfaults when trying to start up, or decides to not start up at all and just exits with ‘1′. See the relevant strace output:
mkdir("/home", 0700)                    = -1 EEXIST (File exists)
access("/home", F_OK)                   = 0
mkdir("/home/grml", 0700)               = -1 EEXIST (File exists)
access("/home/grml", F_OK)              = 0
mkdir("/home/grml/.mozilla", 0700)      = -1 ENOSPC (No space left on device)
access("/home/grml/.mozilla", F_OK)     = -1 ENOENT (No such file or directory)
exit_group(1)                           = ?
Opera also just exits when already running and receiving an ENOSPC - I encountered data loss (for example the transfer history got lost) more than once. Very "funny" to see how applications like dillo, joe, wireshark,… behave in the ENOSPC situation. Not. Oh, your application handles ENOSPC just fine? Then continue testing with read-only filesystem, using NFS, removing files randomly,…

MJ Ray: Wide Roads and Redway Route Types

Floris Bruynooghe commented:
"My experience is that European (including UK) drivers can't cope with wide roads, resulting in even more dangerous behaviour. Wide roads with on-road cycling lanes are probably pretty good. But they need to be clearly separated by a double line sort of like in Belgium, combine that with UK quality road surface (on average) and you might have someting usable. The cycle lanes on UK A roads are a joke though, a very good example of how not to do it."
I assume this means the converted edge strips that you see on some fast roads (note: not all edge strips have been marked as cycle lanes and you especially shouldn't use unmarked ones). There's one of those in Milton Keynes, alongside the A5D dual carriageway. My main complaint against them is that they are too narrow and you get HGVs passing close enough to pull you around. Also, you have to cross every slip road/ramp which is a fairly unpleasant experience at busy times. Redway Route Types The unique Redway network was built in several phases. To be fair, I can't recommend the original network for anything other than low-speed connecting use, but the later, straighter additions (the "cross-city Redways" mentioned in the 1998 paper and my introduction a couple of posts ago) to the original plan early in the 1990s improved matters immensely. Although the different types are mentioned in the introductions, this difference seems entirely ignored by the accident data, which is my main complaint against the papers. There's no way of comparing like with like, as far as I can tell. You can split the accident data for 60/70mph grid roads from the 30/40mph link roads and 30mph estate roads, but you can't split the long-distance maybe-40kph cross-city Redways from the maybe-20kph estate Redways. Based on my years cycling around the city, I expect that the difference between grid Redways and grid roads is pretty small and that local Redways are far worse than local roads, but I can't prove or disprove that from his data. What's more, none of the studies I've seen differentiate between construction phases or route types, which is like only having combined accident figures for the Fosse Way and the M1. It suggests interesting topics for further studies, but how can anyone draw useful conclusions about cycle track design in general from it?

11 June 2007

Ingo Juergensmann: proftpd and SQL uid

Hmmm, maybe I'm missing a point, dear lazyweb, but it seems as if proftpd in Etch is somewhat broken.
Ok, I have a setup with proftpd, SQL backend (psql) and quota. First the SQL backend:


Table "public.users"
Column Type Modifiers
---------+------------------------+-----------
userid character varying(30) not null
passwd character varying(80) not null
uid integer
gid integer
homedir character varying(255)
shell character varying(255)
clear character varying(80)
Indexes:
"userid_pkey" PRIMARY KEY, btree (userid)
"users_uid_key" UNIQUE, btree (uid)
"users_userid_key" UNIQUE, btree (userid)


Proftpd.conf:

[...]
RequireValidShell off
DefaultRoot /home/%u
AuthOrder mod_sql.c
#PostgresInfo localhost dbadmin dcf1330 vftp
SQLAuthTypes Plaintext
SQLAuthenticate users* userset
SQLConnectInfo vftp dbadmin dcf1330
SQLDefaultGID 65534
SQLDefaultUID 65534
SQLMinUserGID 2100000
SQLMinUserUID 400000000
#SQLUserInfo users userid clear "uid" "gid" homedir shell
SQLNamedQuery userinfo FREEFORM "SELECT userid, clear, uid, gid, homedir, shell
SQLUserInfo custom:/userinfo


The problem is now, that those files that are uploaded by ftp get owned by uid 65533 instead of the uid defined in the SQL table, whereas the gid is being set correctly. Example:


-rw-r--r-- 1 65533 2101 14838 2007-06-11 15:34 front.jpg


Both, uid and gid, have the same value within the database (exampel is "2101" here), but only gid will be used correctly by proftpd when uploading files. I would prefer to use usrquota instead of grpquota, though.
I'm appreciating tips to solve this problem or to confirm that this is a proftpd bug! :-)

Joey Hess: re: debootstrap

Steve wrote about reconciling debootstrap changes between Debian and Ubuntu, noted that there's a general problem that Sarge's debootstrap cannot install Etch, etc, and pondered splitting the package and uploading the Ubuntu version to Debian. Actually, if you look at the etch, lenny, and sid scripts, you'll find that they're all the same (symlinked). Barring something unexpected, I don't expect this will change, since debbootstrap now needs to encode little distro-specific info in the Debian scripts. So it should be possible to ship a debootstrap in lenny that will install lenny+1 (and lenny+2 if we have the name decided). Or perhaps even generalise it so that debootstrap can be asked "please try to install the Debian codename called "foo" even if you don't have explicit support for it". This is not true of Ubuntu because they have not switched to a priority-based package selection like Debian has. Debootstrap has to be manually changed to change the lists of packages to install for each new version of Ubuntu. This is a great example of the kind of change that I keep ranting about where pulling patches back and forth just isn't good enough. Though running in the opposite direction from the usual for me. They have all our debootstrap patches, and that wasn't good enough; someone needs to tell them about the benefits of priority-based package selection. If you look in /usr/lib/debootstrap/scripts/, you'll also see that debootstrap already includes scripts for old versions of Ubuntu. Adding additional scripts is trivial (although you should take care not to bloat the udeb with them). Uploading Ubuntu's package to Debian after the minimal review Steve suggested gives me the shivers (especially after reading the diff), but then I'm one of the lucky ones who gets to deal with the fallout very time debootstrap breaks.

Enrico Zini: libept

libept 0.5.3 hit unstable I prepared a new toy to play with at Debconf and uploaded it to unstable:
Package: libept-dev
Description: High-level library for managing Debian package information
 The library defines a very minimal framework in which many sources of data
 about Debian packages can be implemented and queried together.
 .
 The library includes four data sources:
 .
  * APT: access the APT database
  * Debtags: access the Debtags tag information
  * Popcon: access Popcon package scores
  * TextSearch: fast Xapian-based full text search on package description
 .
 This is the development library.
Package: ept-cache
Description: Commandline tool to search the package archive
 ept-cache is a simple commandline interface to the functions of libept.
 .
 It can currently search and display data from four sources:
 .
  * The APT database
  * The Debtags tag information
  * Popcon package scores
  * A fast Xapian-based full text index on package descriptions
Yes, this finally brings lots of very cool data sources about packages together. Try this one:
# Check if all data providers are active and give instructions on how
# to activate those that aren't
ept-cache info
# Follow the instructions to activate everything
# Show all GUI image editors, sorted by popularity, in reverse order
ept-cache search image editor -t gui -s p-
If you have the Xapian data provider enabled, the results of a search are given in relevance order, the most relevant first. And also, searches are done with proper stemming, so if you look for image editor it will also find image editing, although it would score image editor higher. It's also quite lovely to work with it in C++. I'll improvise here a few examples: Print name and short description of every package
#include <ept/apt/apt.h>
#include <ept/apt/packagerecord.h>
using namsepace std;
using namespace ept::apt;
void playWithApt()
 
    // Apt data source
    Apt apt;
    // Parser of package records
    PackageRecord rec;
    // Iterate all package records
    for (Apt::record_iterator i = apt.recordBegin();
        i != apt.recordEnd(); ++i) 
     
        rec.scan(*i);
        cout << rec.pakcage() << " - " << rec.shortDescription() << endl;
     
 
Show all image editors
#include <ept/debtags/debtags.h>
#include <set>
using namespace ept::debtags;
void playWithDebtags()
 
    // Apt data source
    Apt apt;
    // Parser of package records
    PackageRecord rec;
    // Debtags data source
    Debtags debtags;
    if (!debtags.hasData())
        return;
    set<Tag> tags;
    tags.insert(debtags.vocabulary().tagByName("works-with::image:raster"));
    tags.insert(debtags.vocabulary().tagByName("use::editing"));
    tags.insert(debtags.vocabulary().tagByName("role::program"));
    set<string> results = debtags.getItemsHavingTags(tags);
    for (set<string>::const_iterator i = results.begin();
        i != results.end(); ++i)
     
        rec.scan(apt.rawRecord(*i));
        cout << rec.pakcage() << " - " << rec.shortDescription() << endl;
     
 
Print all package names, sorted by popularity
#include <ept/popcon/popcon.h>
#include <algorithm>
using namespace ept::popcon;
// STL comparator
struct PopconCompare
 
    Popcon& popcon;
    bool operator<(const std::string& pkg1, const std::string& pkg2) const
     
        return popcon[pkg1] < popocon[pkg2];
     
 ;
void playWithPopcon()
 
    // Apt data source
    Apt apt;
    // Popcon data source
    Popcon popcon;
    vector<string> sorted;
    if (!popcon.hasData())
        return;
    // Get all package names in the vector
    copy(apt.begin(), apt.end(), back_inserter(sorted));
    // Sort it by popularity
    sort(sorted.begin(), sorted.end(), PopconCompare(popcon));
    // Print it out
    for (vector<string>::const_iterator i = sorted.begin();
        i != sorted.end(); ++i)
        cout << *i << endl;
 
Search for image viewer, but we don't want to view kernel images
#include <xapian.h>
using namespace ept::textsearch;
void playWithXapian()
 
    TextSearch textsearch;
    vector<string> wanted;
    vector<string> notwanted;
    Xapian::Enquire enq(textsearch.db());
    // This will tokenise the search query into terms, stem them
    // and OR them together in a query.  Xapian will score higher
    // those results in which more ORed terms match, which is what
    // we want.
    Xapian::Query want = textSearch.makeOrQuery("image viewer");
    Xapian::Query dontWant = textSearch.makeOrQuery("linux kernel");
    enq.set_query(Xapian::Query(Xapian::Query::OP_AND_NOT, want, dontWant));
    // Print the top 20 results, with their relevance percentage
    Xapian::MSet matches = enq.get_mset(0, 20);
    for (Xapian::MSetIterator i = matches.begin(); i != matches.end(); ++i)
     
        // The get_data() of a document is the package name
        cout << i.get_document().get_data() << " ("
             << i.get_percent() << "%)" << endl;
     
 

David Welton: Dunbar's number and online communities

It's widely known that online communities tend to follow a certain pattern if they are successful. They get larger, and beyond a certain point, they start degrading. Slashdot, digg, reddit, usenet - there are countless examples. My idle thought for the day: how might one go about reconciling the vastness of the internet with Dunbar's number.
Dunbar's number, which is 150, represents a theoretical maximum number of individuals with whom a set of people can maintain a social relationship, the kind of relationship that goes with knowing who each person is and how each person relates socially to every other person.
The ideal system would work to expose you to all the new and interesting things you can find only by interacting with a large group of people, yet keep the actual community aspects (comments, for instance) small, in order to facilitate happier, more interesting and productive communities, rather than the vicious circle turd-flinging matches that a lot of popular sites seem to descend into. I don't have a clear idea of how that might be accomplished at a practical level, but the idea interests me as a way to create something that grows a lot, yet doesn't become unpleasant.

Joachim Breitner: Visualizer for Anagrams

For my uncles wedding my brothers and I did a show where we took his name and use its letters to create a bunch of new words that are part of a speech about him. This was visualized on a projector by a program by me that let s the letter swirl around, forming each built word, as well as some special effects (such as rotating one letter around to show another).The program is written in Haskell, using gtk2hs and Cairo. You can find the sources in my darcs repository (Browse via DarcsWeb). To build it on a debian machine, this should work:
apt-get install darcs gtk2hs libghc6-cairo-dev libghc6-gtk-dev libghc6-mtl-dev happy
darcs get http://darcs.nomeata.de/anapres
make
./anapres examples/RolandHochzeit.anapres
I can also provide pre-compiled binaries, if you want.There is a very simple text file format that describes the sequence of words and special effects, but so far it is only tested with the one example file (the one from the wedding).If you want to try this and have any kind of trouble, do not hesitate to contact me. I m also interested in bug reports and patches, of course.

Antti-Juhani Kaijanaho: Recursion that isn t

Joey’s recent post reminded me of the old joke about an entry in a dictionary:
recursion see recursion
Non-geeks can stop reading here: if you didn’t understand the joke, you won’t understand what’s coming next either. I mean, sure it’s a funny joke, but it doesn’t quite work. Technically, it’s not even an example of recursion, as the base case is missing. Perhaps it’s co-recursion? — but it isn’t, as it’s not progressing. Why can’t we say instead,
recursion if you do not understand it, see recursion
It would still be funny, and it might actually work.

Russell Coker: Prius vs small non-hybrid car

In response to my comment and post about the cost of driving to work there was a comment on the blog post I responded to suggesting that a small car is better value for money than a hybrid car. The claim was made regarding a Nissan Pulsar, but to investigate this I decided to compare the Prius with the Corolla Hatchback, as far as I can tell the Corolla Hatchback is the nearest non-hybrid car to the Prius that Toyota sells (being similar in size, weight, and performance). Comparing cars of different make adds extra variables into the equation. Unfortunately the Toyota web site fails to provide specifications for the Prius and only provides a PDF file with minimal information on the Corolla, but it is enough for some minimal calculations. A car company run by intelligent people would publish the specs on all their vehicles and provide a search form to compare selected models. The Standard Performance Evaluation Corporation has a good search method that allows easy comparison and ranking of items in their database (here is an example). It would be good if Toyota would permit us to compare models in their car range in a similar manner. According to the Toyota web site the Prius uses 4.4L/100Km when driving in the city and the manual transmission version of the Corolla Hatchback uses 7.4L/100Km (7.7 for the auto). For the average 16,000Km that an average Prius owner drives that would save 480L of petrol which would save about $700 at current petrol prices. The Corolla Ascent Hatchback (the cheapest of all Corollas) is $21,000 while the cheapest Prius is $37,400. If you compare the Prius with the cheapest Corolla then it’s a $16,400 price difference. If you save $700 per annum then it won’t cover the interest on a $16,400 loan or match the interest rates earned by a bank term-deposit if the $16,400 was invested. So it seems apparent that at current petrol prices (NB petrol prices are expected to increase) and with average Prius driving patterns a Prius will not be more economical than a cheap Corolla. Currently the Commonwealth Bank of Australia offers 6.05% interest on term deposits of between $10,000 and $25,000. This means that $700 per annum would be the interest on a term deposit of $11,500. If we compare the Corolla Ultima Sedan at $32,000 with the Prius at $37,400 the difference in price is less than $11,500 - but the cars have incomparable sets of luxury and safety features. The Prius i-tech appears to have a super-set of the luxury and safety features of the Corolla Ultima Sedan but at $46,900 is again going to cost more for the average Prius driver. The Prius is a very quiet car to drive, there is almost no engine noise (when driving at speeds where the Petrol engine is operating there is usually more noise from other vehicles) and no gear changes (handy if passengers are consuming hot or sticky drinks). It has a good set of safety and luxury features and is also a prestige car (no-one will say “oh wow, you’ve got a Corolla”). If you assign a dollar value to these features then a Prius may be the most economical car that meets your requirements! Finally, let’s keep in mind the fact that petrol prices are steadily increasing. If you save $700 by driving a Prius this year then you may save $1000 next year. There is also the option of converting a Prius to a plug-in hybrid which will be a useful option if petrol prices hit $10/L! Also the amount of money saved will depend on the use of the car. If you are running a courier or taxi business then a Prius will probably be a lot more economical than a Corolla due to the greater distances travelled and the travel in the slow city traffic that the Prius was designed for. PS All prices are in Australian dollars and concern products on offer in Australia, I would like to see comments from other people who perform the same calculations for their countries.

10 June 2007

Daniel Burrows: Dear Lazyweb: Mercurial Python API

So, in the midst of trying to convert some Darcs repositories to Mercurial repositories (see here for the reason), I hit an "interesting" bug: tailor processes "rename" patches by deleting the renamed file. A little debugging later, I get to this simulation of what tailor does:


>>> from mercurial import hg,ui
>>> uio = ui.ui(debug=True,verbose=True)
>>> r = hg.repository(ui=uio, path='.', create=True)
>>> f = file('A', 'w')
>>> f.write('Some data\n')
>>> f.close()
>>> r.add('A')
>>> r.commit(text='Add A')
A
'i\xe9\xb4\xc8\x9d\xb8\xeb\xbe\xb1k\xae\xb1\x182\xa9ao\x80\xd0'
>>> r.copy('A', 'B')
B does not exist!


Huh? Of course B doesn't exist, that's why I want to create it! So, we look at the code in localrepo.py to handle copying...


def copy(self, source, dest, wlock=None):
p = self.wjoin(dest)
if not os.path.exists(p):
self.ui.warn(_("%s does not exist!\n") % dest)
elif not os.path.isfile(p):
self.ui.warn(_("copy failed: %s is not a file\n") % dest)
else:
if not wlock:
wlock = self.wlock()
if self.dirstate.state(dest) == '?':
self.dirstate.update([dest], "a")
self.dirstate.copy(source, dest)


Double huh?


  1. Why is this method checking whether the destination exists before it does anything? It appears to me that this is actually necessary; just disabling this test leads to a crash later.
  2. How does mercurial work at all with such huge breakage in its core code? Does /usr/bin/hg use a different implementation of the repository code than mercurial.hg?
  3. Why, in the name of $DEITY, is this a warning and not a fatal exception? One example of what happens when you don't signal to your users that you're ignoring them is this bug: tailor happily goes ahead and removes the original file, safe in the knowledge that mercurial has copied it to the new location. Except, of course, that mercurial hasn't actually copied it. Whoops.


I'm hoping that someone will tell me that it's just too late at night for me and I'm being an idiot. Please tell me this. It would make me very sad if code like that was in my VCS.


:-( --- sad Daniel

Adam Rosi-Kessel: Hospital Thoughts

Hospital CEO Paul Levy is seeking responses to some remarkably frank comments on competition in the hospital industry:
…Please remember that health care is not like other industries, in which companies are rewarded in the marketplace for being the high-quality, low-cost provider. That situation does not yet exist in the health care system. So, am I better off being a industry leader with regard to that approach, or am I better off biding my time and continuing to follow the traditional path until there is a real sign of change in the marketplace?
As I’ve written before, this kind of openness is refreshing and potentially a brilliant business strategy. (It may continue to be so even once every one is doing it.) Paul’s comments and receptivity to feedback remind me of my numerous concerns about Children’s Hospital Boston, which, as far as I know, has no analogous public forum. I’ve sent in comment cards, but they may just drop into a black hole. Two principal complaints about Children’s Hospital: television and food. There are TVs everywhere, including in the waiting rooms. They are always on, even if no one is watching them. On one occasion, we were the only ones in the waiting room. When we attempted to turn the TV off, the staff told us we couldn’t. When we went in examination rooms and our daughter was unhappy, the first response by the medical staff was often to turn on a TV. Our daughter (just over two years old) has never watched TV, and doesn’t find it comforting. Research indicates that TV is not good for young kids, and especially not infants:
Babies are glued to television sets these days, with 40 percent of 3-month- olds and 90 percent of 2-year-olds regularly watching TV, according to a University of Washington study released Monday. …”While appropriate television viewing at the right age can be helpful for both children and parents, excessive viewing before age 3 has been shown to be associated with problems of attention control, aggressive behavior and poor cognitive development,” Frederick Zimmerman, the UW study’s lead author, said in a news release…. The American Academy of Pediatrics recommends no television for children younger than 2, and only one to two hours a day of quality programming for older children.
Recently, we had to stay over in the hospital for a night. There were no private rooms available, so we requested at least not to be stuck in a room where the TV would always be on. They looked at us like we were from Mars. (In the end, our roommate’s TV was always on. The three month old patient didn’t care, but his private nurse wanted to watch TV.) Why is a pediatric healthcare facility encouraging TV for infants? The food complaint is similar: so much of the hospital food provided for children is high in fat, refined sugar, white flour, and artificial ingredients. I was looking for a fruit-juice popsicle for our daughter (what she eats at home), and the only options the hospital could offer had high glucose corn syrup as the first ingredient after water. Again, this is not rocket science — these are not appropriate foods for one- and two-year old children. I realize in both cases (TV and food), the hospital is just mirroring popular culture in an attempt to provide familiarity for most kids, but I wish they would at least provide an option for those families whose kids don’t watch TV and eat a high-sugar diet.

Mark Brown: Not so bad

It’s not unknown for people maintaining Debian packages via sponsorship to become frustrated with the process sometimes - a feeling sometimes shared by sponsors who find that the person they’re just nodding through packages. This sort of frustration with process gets pretty depressing at times so it’s a bit of a shock to see us being held up as an example a better way. Of course, the two cases covered here not the same at all but it is still good to see things like that. It looks like we may well continue to make progress with this thanks to proposals like having Debian Maintainers as well as developers - another iteration of ideas like sponsorship which was originally developed to work around a process problem that people were seeing at the time with NM.

Next.

Previous.