Search Results: "mak"

12 June 2007

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).

MJ Ray: National Solar Week (18th - 24th June)

Maplin Electronics wrote:
"Maplin Electronics has launched National Solar Week (18th - 24th June) providing solar advice online and in store for eco-minded shoppers who want to do their little bit for the environment without making major changes to their lives or bank balance! The solar advice day on Thursday, 21st June [...] the government should show a commitment to the environment [...] By removing VAT on all energy-efficient products, the Government can do their bit too. We're committed to making solar technology affordable and amenable to every customer, so we're counting on you to sign our petition and pledge your support."
A tax break for renewable energy seems like a good idea to me. I recently increased the insulation of my home. Southern Electric run a funding scheme and it was charged only 5% VAT, so tax incentives for energy-efficiency are obviously possible. I've done the insulation before things like installing renewable energy collectors because the tax breaks make insulation much more attractive. Finally, I took the Co-operative Group Climate Challenge yesterday, but there seems to be little detail about it online, apart from Sam's announcement. I'll probably comment more on tCG's strange web services elsewhere soon.

Wouter Verhelst: Linux Magazine on the DPL election

I bought me a copy of Linux Magazine last week or so, which contained an article on the DPL election. The parts that talked about me said something approximating
Apart from being a developer, Wouter Verhelst also represented Debian at FOSDEM
and
In his platform, Verhelst criticised organizational failures
I'm frankly stunned that "representing Debian at FOSDEM" is what really makes me stand out as a Debian Developer; especially as I don't, actually, represent Debian there -- I merely organize the Debian presence. Also, I went through great pains in trying to make it clear in my platform that I didn't want to criticise anyone. I guess that didn't quite come out right, then OTOH, I'm sure it's hard for a journalist to condense my platform into a single sentence, just as it is hard to describe who a person is in the same amount of text. But it's still... strange.

Adam Rosi-Kessel: Coulton on Mix-a-Lot

Via Digiphile, the inimitable Jonathan Coulton (mentioned here before) performs my new favorite version of Baby Got Back: I hesitate to embed the original Sir Mix-a-Lot version. Instead, here’s a link. Potentially not safe for work. Also via Digiphile, Love 2.0, perhaps the first variation on the 09F0 meme to make me laugh out loud.

11 June 2007

John Goerzen: "You just never know when you're dealing with rodents"

The day after Memorial Day, when I got into my car, it reeked. A strong, foul odor greeted me that morning. It had rained a lot during the long weekend, and I hadn't driven the car. I figured it was just some water sitting somewhere. It ought to evaporate soon enough. The smell seemed to be coming from the vents, so I figured I could help it evaporate by running the fan as much as possible.

I've been dealing with the smell ever since then: windows open, fan on full blast, as often as possible.

This morning I noticed a chewed Kleenex with rodent droppings attached to it in the glove box. I also noticed Kleenex bits and more rodent droppings on the floor mat below the glove box.

So I have a more sinister enemy here.

I dropped by the mechanic over lunch to make an appointment. I explained the symptoms. He looked as me suspiciously.

"But how would a rodent get in there? Hmm... I forget -- do you live in the country?"

"Yes, I do."

"Oh, well that would explain it then."

It reminded him of other rodents he's done battle with -- pack rats that have chewed up wires and hoses, including one that was still alive and in the vehicle when he started working on it.

So I asked him how expensive this was going to be.

"Well, I don't know. It could be easy, or it could be interesting. You just never know when you're dealing with rodents."

He promised to call me if it looked like it might be interesting.

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;
     
 

MJ Ray: Views on textarea Sizes

Matt Palmer wrote:
"Aaah, OK. I have no idea whether [pingbacks] work or not; they're deeply in the black magic category -- never used them."
They're just a remote procedure call. Shouldn't be black magic at all, but a surprising number of blogs seem to do them brokenly, while supporting the more complicated (but just as spammable) comment and trackback systems. On size:
"40x20 would be a good size for me. I'm not sure why people would complain that the comment box is too big, unless perhaps it interfered with the good layout of the page."
I don't think it interfered with the layout. I'll increase the size again Real Soon Now. Josh Triplett commented:
"For me, the size of the edit box doesn't matter much, because I don't use it. I just click the little "edit" button next to it that the Firefox^WIceweasel extension It's All Text provides, and then type my comment in Emacs. :)"
James commented:
"I use the resizeable form fields extension so I don't have a problem with small textareas, but http://www.sabadelli.it/edoardo/projects/javascript/form.element.resize has a script that'll make it resizeable for everyone."
Well, everyone who lets web site scripts use their CPU and electricity... Thanks for all the helpful comments.

Evan Prodromou: 22 Prairial CCXV

Is it just my California liberal bias showing, or is the Mister Wong logo inappropriate? It makes me cringe each time I see it on a Web page. tags:

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.

Russell Coker: Easy Search Engine Optimisation in Wordpress

The first thing you need is to have meta keywords in the pages. The solution I discovered for doing this is the All In One SEO Pack, this automatically makes the categories of a blog post become meta keywords, allows adding arbitrary meta keywords when editing the blog post, and supports keywords for the entire blog. It also re-writes the titles to have the title of the post appear before the title of the blog in the <TITLE> tag which is rumored to be a good thing to do. The next thing you want to do is to create a Google sitemap. A sitemap is an XML file that describes all the URLs in your web site which tells Google (and other search engines) the last change dates of all the URLs and the change frequencies (or how often they should be checked for changes). Note that the format is called Google Sitemaps because Google invented it, other web search engines also use the same format. To generate my sitemap I use the Google Sitemaps Generator which tells earch engines to index my main blog page daily and the category pages weekly (which is configurable). It also has an option to notify Google of changes by pinging the Google service. Having multiple names for the same web page hurts you when it comes to search engines. Having two separate pages at the top of page 2 is not nearly as good as having one page on page one! To solve this problem I use the Permalink Redirect plugin to make sure that each page has only one URL pointing to it. This plugin also allows redirecting the feed URL to feedburner.com. Feedburner serves the feed data (thus saving you some bandwidth if you are on a slow link) and also tracks statistics on it which are interesting. Under the Writing section of the Options menu there is an option to enter a list of URLs for update services that can be notified of every post. I use http://rpc.pingomatic.com/ and http://rpc.technorati.com/rpc/ping. The Update Services entry in the Wordpress Codex has more information on how this works. Social networking sites such as digg.com can direct a large amount of traffic to your site if you write about a popular topic. The Share This plugin is the simplest way I found of adding social networking hooks to Wordpress (I tried a few others that had both less functionality and less ease of use). Finally before publishing a post, I often check the Google Adwords Keyword Tool. This often gives me ideas on how to make the meta tags and title match what people are searching for.

Antti-Juhani Kaijanaho: Nixforce, cease and desist

Update Amazingly, they seem to have complied with this notice by taking down my content :) Nixforce, you are republishing (parts of) my blog without permission, and without indicating that you are republishing stuff written elsewhere. You are required to do all of the following, or cease and desist from republishing my content: If you do both, you have my permission to continue republishing my content. Additionally, you should verify that you have the legal right to republish content by the other authors. (This has been mailed to their contact email address.)

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.

John Goerzen: Tourists

Today as we were getting ready to head out, Terah said to me, "There are people on our yard with cameras and I don't know who they are!"

I looked out and they looked friendly, so I went on out and said hi.

I'm glad I did, too, because these weren't just any random people with cameras. The group included Ed, who grew up in what is now our house. He's probably in his 70s or 80s now. His wife, son, and daughter-in-law were along, too. They had all driven up from Oklahoma and wanted to see the old farm. Ed's family had sold it to my grandparents back in the 40s.

They apologized for tresspassing. I told them, "I don't mind as long as you share a few stories."

Ed told us that he remembered the second story and kitchen being added on to the house when he was about 10, shortly after it was moved to its present location. He remembered his dad building the elevator that still stands on our property. It is quite the marvel of engineering and craftsmanship. I learned that its first power source was an engine from a Model T.

Ed kept looking at the house smiling. A few years ago, maybe 2 or 3, he got to see the place for the first time in 40 years. But it wasn't doing so well then already. He said we had done a wonderful job restoring it. He remembered, back before there was a sidewalk, sitting on the porch letting his feet dangle in the mud. Or sitting out there Sunday evenings making ice cream.

I invited them to take a quick look inside. They politely declined, not wanting to impose. Terah and I assured them that it would be fine, though we did need to leave in a few minutes. They came inside and Ed started describing the place to his family.

He pointed to the oak floor in the living room. "Is that original?" I told him, "Yes, it is; we added on about 2 feet to it but the rest of it is original." He said that he helped lay that floor. I asked him something I had been wondering for awhile: did they put the oak floor on top of a pine floor? He smiled and said, "Yes, we sure did!"

We came to the office. He asked if the wood ceilings were original. Yes, I told him they are. He confirmed what I had heard about the reason for a burned spot on the office floor: that someone had opened a wood stove and a live log fell out. He also asked if we had taken out the chimney. Yes, we did, but we saved the bricks. "Ah! We had a chimney fire in there one time! We all thought the whole house might burn down." I told him that the bricks still were marked from that.

He told me of one time he was standing on the north side of the house, idly throwing stones at it. His sister was playing piano at a window, in what is now the office. One of Ed's stones went through the window and hit her (but didn't hurt her seriously). "Boy did I ever hear about breaking that window!" One of his relatives asked, "What about hitting your sister?" "Well, that wasn't as bad as the window."

This isn't the first time something like this has happened. It's really neat to hear stories about the place and learn about its life before it came to be in my family.

I was glad I went out and said hi to our visitors instead of ignoring them or chasing them off.

Good things can come from strangers sometimes. I think I'm going to gather up a batch of photos and send them to Ed and his family, along with a few questions for them!

Evan Prodromou: 21 Prairial CCXV

It was warm tonight, so I made nachos and a big salad for dinner. I took the opportunity to capture my Nachos recipe for you to enjoy. Yes, nachos are a really easy food to make, but so many people make them so wrong, I figured I should write a recipe for people to get them right. tags:

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

DebConf team: Yet another camera (Posted by Holger Levsen)

We’re sitting in Teviot, the network is up and running and everyone here is happily hacking. So we can make detailed and concrete plans about the video setup now. And we just realized, that seven cameras are just not enough ;-) If possible we would like to use eight cameras, because we’ll be switching between three cameras in the two main talk rooms, plus another camera in each BOF room. So if you happen to have another DV camera, please get in contact with us (to make sure we don’t end up having fourteen cameras…) and then bring it with you. That way, we won’t have to switch equiqment around and the people operating the cameras will always know what to expect in a certain venue.

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.

Christine Spang: And Straight On Til Morning

My internal clock is finding it hard to believe that it’s light outside right now, which might have something to do with the fact that I’m sitting in Shannon, Ireland. Since I only got maybe two hours of sleep on the plane, I wonder if I’m going to crash horribly later today. I haven’t flown internationally since 2000, so I was a little paranoid about it being a horrible nightmare, but so far it hasn’t been. I haven’t managed to trip any metal detectors yet, though I did accidentally leave my laptop in my bag when I sent it through the scanner at Logan. The security people were nice enough about it, however. I’m not carrying much in terms of carry-ons, so things have been smooth. I completely forgot that “long-haul” flights serve meals. Aer Lingus has a standard meal offering consisting of “chicken” or “beef”, neither of which are very good for vegans. Apparently if you call their reservations office in advance of your flight you can order special meals, of which vegan vegetarian is an option. But I definitely don’t remember this being mentioned at all (or at least very prominently) during the booking process, so I never thought of checking. I had just written off being able to eat the airline food and brought granola bars and snacks. Apparently this was a wrong assumption. I was originally going to FlyGlobespan, but ended up changing my mind after experiencing their entirely broken website which didn’t allow me to make a booking, and waiting a week for a response to their “feedback form” and never getting any, all the while watching their fares creep up as every day passed. Luckily the flight I ended up getting wasn’t too much more expensive, and even allowed me the flexibility to fly into London and out from Glasgow, making it easier to accomplish my plans of visiting Dafydd Harries, Hanna Wallach, and Matthew Garrett in the “other” Cambridge before ending up at Debconf!

Russell Coker: submissions for LCA and other conferences

In this post I recommended that job seekers not publish their CV. In a comment Gunnar suggested having a special CV for conferences. I think that Gunnar’s idea is good and have started writing my conference CV at http://etbe.coker.com.au/conferences. When I complete it I will make it part of every submission for speaking at a conference. The LCA 2008 call for presentations is now open. One of the most interesting, noteworthy, and slightly controversial items is the suggestion that people submit a video. I think that the video submission is a great idea, either a video or testimony from audience members from past presentations should be required for all submissions (NB I’m not involved with organising LCA2008 so my opinion means little in this regard). The reason is that I have attended many presentations which fell far short of their potential due to poor speaking skills. I’ve been to great presentations by people with strong accents, by people with speech impediments, by people who are incredibly shy, and by people who just don’t have a clue about public speaking. However my observation is that if a speaker has more than one of these disadvantages then the presentation is likely to fail. I have previously written at length about how to give a good presentation to a technical audience (such as is found at LCA). Dave Hall blogs about Should I do a presentation at LCA 2008. He mentions lack of a web-cam as a disincentive, but I am happy to lend him my digital camera (which makes really high quality movies) to solve this problem. In fact I have considered recording some short Linux talks at the SGI office during lunch breaks (Dave and I both work for SGI). Dave also mentions a nightmare scenario about a laptop not working with presentation hardware. My post about getting laptops working for presentations will hopefully help some people in this regard. I’m not sure if I’ll make an offer for LCA this year, I haven’t been doing much cutting-edge work recently. Maybe I’ll just offer some talks for mini-confs, I could probably get several offers accepted by mini-conf organisers if I try.

Russell Coker: costs of driving to work

Mark Greenaway expresses surprise that someone could spend $8000 per annum on petol. I own a 1999 VW Passat 2.8L that does 12.8L/100Km (based on my average driving habits - I record the amount of petrol purchased and the distance driven). I spend an average of just over $60 a month on petrol, so I’m approaching $800 per year. I catch the tram and train to work most days (probably drive to work less than 10% of the time) and use my car very little apart from that (most places that I drive to are close to my house). If I was to exclusively drive to work then that alone would make my petrol expenses approach $8000 per annum. If I was to shop at locations that weren’t so convenient or do recreational driving then the petrol expenses could be significantly greater. The $1000 a year I spend on public transport doesn’t seem so expensive! The http://www.smh.com.au/news/national/hybrid-cars-the-go-as-fuel-price-rockets/2007/06/09/1181089388315.html about the increase in sales of hybrid cars due to fuel price increases. In that article they note that Toyota representatives claim that Prius drivers travel more than the average 15,000 KM per annum. Recently the RACV magazine published an article based on the CNW report (the bogus report paid for by Exxon which claims that the Jeep Wrangler is better for the environment than the Toyota Prius). In response to this I reviewed all adverts for second-hand Prius and Wrangler’s on www.drive.com.au to determine how much these vehicles are driven. I counted a 2006 model as a 1yo car for the purpose of the average. On the 29th of April when I looked at the web site there were 90 Prius and 127 Wrangler on sale for which both the model year and the distance driven were published. Of these vehicles the average distance driven per year for the Prius was 15995Km, and the average for the Wrangler was 11,658Km. Someone who purchases a Prius instead of a V6 car (such as my VW Passat) can expect to save at least 7L per 100KM (based on the assumption of 12L/100Km for a V6 and 5L/100Km for a Prius - this is a conservative estimate, the savings could be greater). That would be a saving of at least 1120L of petrol per annum for the average Prius owner, giving a saving of >$1500 per annum with current petrol prices. Over the 20 year life of the vehicle the average Prius owner can expect to save at least $30,000 on petrol at current prices - but we do expect petrol prices to increase…

Next.

Previous.