Search Results: "ana"

12 April 2006

Erich Schubert: Python pitfall of the day: <tt>def function(var= )</tt>

I was hunting an odd bug in a python program of mine. Here's a condensed code snippet for explanation:
class odd:
        def __init__(self, a, b= ):
                self.b = b
                self.b["a"]=a
one = odd(1)
two = odd(2)
print one.b["a"]
That code looks reasonable, doesn't it? The parameter "a" is required, but other parameters can be given in a hash. So what output would you expect? The output is 2. The reason is as follows: Python creates an empty hash, and b is a reference to this hash per default. To the same hash each time. So the code is basically equivalent to
class odd2:
        default_for_b_in_init =  
        def __init__(self, a, b=default_for_b_in_init):
                self.b = b
                self.b["a"]=a
and not (as I had expected):
class odd3:
        def __init__(self, a, b=None):
                if not b: b =  
                self.b = b
                self.b["a"]=a
Obviously, both behaviours make sense, and the python way is somewhat consequenter. So be careful when using default values in functions! Non-reference types such as integers are fine, so is None, and of course any outside objects you want to be the same for each call. Don't assume the def statement will create any new object. Even shorter example:
def test(a, b= ):
        print b
        b["a"]=a
test(1)
test(2)
will result in the output
 
 'a': 1 
again there is only a single hash b.

10 April 2006

Uwe Hermann: Stuff

9 April 2006

Joachim Breitner: Wanted: Code Deleter

The recent removal of the “wpasupplicant as a roaming daemon” mode caused a lot of bug reports from people like me who need a complex wireless setup, i.e. several different networks defined in /etc/network/interfaces and a daemon that automatically brings the interface up and down upon availability of one of these networks, and guessnet to decide which network from /e/n/i to use. This setup worked very nice with wpasupplicant+ifplugd+guessnet, but now it does not any more.In the following discussion on pkg-wpa-devel mailing list, I argued in favor of reducing wpasupplicant to do just that: Providing WPA support. Analogous to the wired roaming support (please read my post for a in depth justification), and to continue to have one /e/n/i entry per location (and not device), we then need to create a separate daemon, e.g. “wifiroamd”, that will do this:The functionality is all there already, in wpasupplicant, tested and proven good. What needs to be done is to remove all non-roaming-code and create this wifiroamd. So if anyone is looking for a nice project, or likes to delete code, or for any other reason interested, please step forward and help us out here.BTW, in all these consideration, I think of /e/n/i as “network” definition, not device or interface definitions. If that’s a very uncommon PoV, I invite you to discuss that, either here, or my mail, or on the pkg-wpa-devel list.

Dirk Eddelbuettel: Race That' Good For Life 2006

Participated in the 25th annual Race That's Good for Life 5k race in Oak Park this morning, just as I had in 2003, 2004 and 2005. Near ideal conditions: sunny, no wind, temperatures in the 40s. I was afraid my legs were a little too tired: I had some rest after the Shamrock Shuffle last weekend but did a 12 miler after work on Thursday and 9 miles with two Boston-bound friends at Waterfall Glen -- 'hilly' territory for around here in Chicagoland -- yesterday morning. So while I didn't feel all that fresh, I also managed to run a pretty silly race of a way-too-fast first mile at 5:50 followed by 6:44 and 6:40 to average a pace of 6:19 minutes/mile with which I broke 20 minutes for the first time ever: 19:36. That's 50 seconds faster than last year, which was already a PR. Now I'm ready for a nap ;-)

Andrew Pollock: [life] Movie of the year

Tonight Sarah and I went to see Inside Man, and conveniently managed to end our search for a half-decent cinema in the Bay Area at the same time. The AMC Mercado 20 in Santa Clara definitely has the best seating of all the cinemas we've been to so far. Century Cinemas, are so... last century by comparison. Anyway, back to the movie. Bloody excellent. I knew I wanted to see it from the moment I saw a trailer. It reminded me a little of The Thomas Crown Affair, a movie I enjoy for its plot. The movie was littered with hilarious one-liners that cracked up the audience. Denzel Washington was brilliant, and the plot was first-rate. Definitely one to see again, and definitely one to own.

8 April 2006

Julien Danjou: Time Management for System Administrators

I just found this book. Amazingly enough, if you read this book, your entire life will be transformed instantly and all of your problems will be fixed. You'll be better looking, too! I should read it...

Erich Schubert: Apple's backstab on Windows

Apples latest move - BootCamp - can turn out quiet bad for Microsoft. By allowing users to install Windows XP additionally to OSX on it's newer machines, many people will buy a Mac (because of it's design, and the ability to try out OSX while still having Windows available). They'll install Windows. But one time or another, Windows will fail them, and they boot up their OSX. And eventually notice that it's better, prettier, easier to use. And they'll see the price of buying Windows licenses. If Microsoft doesn't manage to launch Vista before christmas, and offer something relevant for the users with Vista (a prettier UI and a malware detector isn't enough, and noone believes Microsofts security promises anymore), they'll lose quite a bit of the christmas sales. I wonder when Dell and Samsung will start selling PCs with OSX, too, now that it's no longer an either-or decision.

Neil McGovern: Choosing a CMS system

Well, I volunteered at the last SPI board meeting to re-do the SPI website, as it was old and outdated.

So, I posted a message over to spi-private and spi-www asking for ideas.

The main one that came up was using a CMS. Now, I've had a look at various CMSs in the past, and none of them have come up trumps. Also suggested were other options such as using Embperl and svn (which I use for the Debconf site), but this isn't user friendly enough for many people, and a wiki, but I'm not convinced a wiki is the best thing for a static site.

The main issue that I saw with using a CMS for the SPI site is the requirement for it to be truly multilinugual. Unfortunately, this does sort of knock out a SPI Project, Drupal. Another less important issue is the storage engine. Ideally, this should be postgres, as it's another associated project :) Thirdly, the software should be free (as in DFSG, not beer).

So, this leaves a few options. After many hours googling and lots of suggestions from the lists, I had a short list. This leaves one which I've found, Plone. It has issues, but it's the best I've found. Namely, it requires Zope. This means that every time you change it's skin, the entire Zope server requires a restart. Not even a reload, but a full restart. However, it's multilinugal facilities are very good, and it has a nice management interface. It does have lots of plugins that extend it's functionality, which is nice.

One of the problems I'm having at the moment is to get news items to have a 'Effective Date' of 1998, as the management interface only seems to go back to 1999, and I need to put old items on there. I also need to work out how to run it under Apache, and possibly use postgres as a storage engine.

So, all in all, Plone wins the day, due to it's ability to host multilinugal sites, and it having a management interface that doesn't suck.

For those that want a sneak preview, see the testbed, but don't expect it to work perfectly :)

Erich Schubert: Proof of concept virus for Linux and Windows

Many IT news websites have been reporting that there is a new proof-of-concept "cross-platform" virus for both Windows and Linux. This is largely overrated. There are a couple of reasons why this type of virus poses no threat to Linux users: So overall, this threat is very theoretic. However, the Linux community should consider defense mechanisms for this. Debian can already verify the integrity of most of its files via md5sums, but some tools (e.g. prelink, to improve application start times) will modify the applications and thus the md5sums. A couple of measures we could/should probably do: These measures could make it even less attractive to write attacks against Linux software. I can't assess the potential security issues we might "inherit" from the Windows platform by offering the Mono C# implementation. This basically means that some of the to-come malware for Windows will run on Linux, too. Only if users try to run their Windows shareware, of course. [Update: another win32+linux virus, from 2001. Noone cared, nothing happened.]

7 April 2006

Gerfried Fuchs: untangle

/me wonders why people seem to prefer a webbased, flash game when we have the very same thing in our sgt-puzzles package called untangle. Wasn't Debian and sort of Planet Debian about mainly free software, back then, somehow?

Wouter Verhelst: DFSG vs GFDL

One of the things that has kept Debian in heated discussion over the last few years is the question whether the GFDL, or the GNU Free Documentation License, is free according to Debian's own DFSG. We've had three votes on the subject, with the final one decisively saying it's conditionally free. Or so I thought. Yesterday, Josselin Mouette proposed another GR on the subject, since he believes there's a conflict between GR 2006 001 and the current text of the DFSG. Sigh. At least he isn't trying to reverse the effect GR 2006 001. But still; no, the GR does not conflict the text of the DFSG. I used to think otherwise, but got swayed by the discussions on -vote that occurred prior to GR 2006 001, especially (strangely) the one that happened as a result of Anton Zinoviev's amendment, which ended up as choice #3 on the ballot. At the the time, I was supportive of the original proposal to throw out all GFDL-licensed documents, even though I disliked doing so (for obvious reasons); but I felt that the arguments about the DRM clause did hold. This was wrong, and it took me an insult to see it. Quoting Anton, myself, and Craig Sanders:
This clause disallows the distribution or storage of copies on DRM-protected media only if a result of that action will be that the reading or further copying of the copies is obstructed or controlled. It is not supposed to refer [to] the use of encryption or file access control on your own copy.
No; however, as written it can be interpreted as such.
only by nutcases with an agenda. normal people (including lawyers and judges) wouldn't have such an insane and insupportable interpretation. that's because normal people rely on facts. and evidence. they don't just make up whatever crap they need to suit their argument.
Craig's way of saying things did not immediately have the intended effect; and had I not grown tired of the discussion, I probably would've missed it. But the fact that I stopped following the discussion gave me some time to think about it, and as such, Craig's argument had a chance to sink in. When I was finally swayed, I failed to attribute it to Craig, however, instead thinking it was an argument by Anton that did it. The point is this: the mere fact that you're able to construct an interpretation of a license which is logically sound and complies with everything, does not mean that it is a sane interpretation. Lawyers and judges, strange people though they might be according to some jokes, are still people; human beings. If you come up with an interpretation that nobody in court came up with on the first reading of a given text, then chances are rather high nobody will follow you. That's what really matters: whether something you claim will hold in court. Not whether something you claim holds up to your own argumentation. And yes, claiming that doing chmod -r, or storing something on an encrypted filesystem is somehow restricting distribution, seems a little far-fetched. After all, when I'm storing something on my own hard disk, or even in the privacy of my home-directory on a large shared fileserver, I'm not engaging in a distribution of any kind.
From WordNet (r) 2.0 (August 2003) [wn]:
  distribution
      n 1: (statistics) an arrangement of values of a variable showing
           their observed or theoretical frequency of occurrence
           [syn:  statistical distribution ]
      2: the spatial property of being scattered about over an area
         or volume [syn:  dispersion ] [ant:  concentration ]
      3: the act of distributing or spreading or apportioning
      4: the commercial activity of transporting and selling goods
         from a producer to a consumer
Definition 3 and 4 seem to require an active action by the originating person; when someone copies a file from your $HOME, you didn't distribute the file to them; they took it from you. In our culture of sharing is good, you should share!, I missed it; but a court would probably see copying without asking for permission more as stealing, rather than distributing. After all that, the arguments about the DRM clause being too broad seemed a bit weak to me; and given that the FSF had already agreed on it being a bug which needed to be fixed, as they had for the other arguments against the GFDL (apart from the Invariant sections, which are not being discussed here), made me decide that the big giant insane problems with the GFDL are not so much of a problem as most people seem to claim.

6 April 2006

Mike Beattie: Planarity

Seriously, I'm not just responding to only you Erich.. Anyway, that's an evil thing to post on a Friday (for me). I can see I'll get no work done now. *sigh*. Oh, I found an example of your solution: Planarity Solution

Enrico Zini: Converging to a solution

Sustain a discussion towards solving a problem is sometimes more important than solving the problem. I can't decide if this is trivial or counterintuitive. Anyway it's been quite enlightening when it came out. I once took this note:
I found that with my projects, when someone posted a mail about a problem I would work maybe some days to find a solution, and just post the solution at the end. However, now I realised it's more costructive to have the problem-solving process itself happen online. This way, instead of keeping people waiting in silence for a few days they can get quicker feedback and extra informations, and they also have a chance to participate to solving the problem before I manage to. For example, when I have to interrupt to go home or sleep, someone else can pick it up and do another step. Plus, the entire problem-solving process remains documented, which will provide more written information for future readers.
This note was from a few months ago; however, I still fail to do it. Bad habits are sometimes hard to change. Please kick me about it :)

Erich Schubert: Planarity

Planarity is indeed an addictive flash game. I just did level 13 in 19:30 minutes. What are your scores like? This game was also featured in that cool Multi-Touch touchscreen video you might have seen some month ago. There is however a rather generic approach that will lead you to a solution rather reliably. Don't just move around random vertices, instead pick one and move it into the center, now grow the solution from that center node. The higher the level, the less space you'll have, so keep it dense! Always look at all "new neighbours" first, where to place them best to avoid having to swap them later. But by just walking around clockwise around the "convex hull" of what you've built so far, you get a pretty good network. I guess you can even prove it that you'll be able to solve it in O(n) that way when done right. In level 13 I this worked quite good for me, except I ran out of space some time. I then picked a random outer node, moved it to the very upper left, and moved the "covex hull" to the borders of the screen. From time to time you'll see you've made a mistake, but this can usually be solved by mirroring some group in your network. Update: Level 14 in 18:13 Minutes. Looked like this: Planarity screenshot with a small problem at the top edge of screen due to lack of space there. Update: Level 15 in 14:01 Minutes. The schema works perfectly, you have to touch each node at most twice (once when discovering, and maybe switch place with a sibling when discovering the new neighbours). All changes are local, and you don't actually look at the lines, just at the colored nodes. Unless of course you run out of space and have to rearrange.

Steve Kemp: With self-inflicted wounds

Debian Planet : When flaming on mailing lists isn’t enough. Calm down? Take it to email? Call each other on the phone? Please.

Andrew Pollock: [tech] Ubuntu Live CD. Nice. Very nice.

My laptop has developed a bung hard drive. After a couple of days of rest, it managed to boot again, but I don't trust it, and have (after much angst) managed to convince Dell to send me a new hard drive. I was initially going to try and borrow a 2.5" SATA USB hard drive enclosure from somewhere to attempt to rescue the data off the disk, but I thought to myself, why bother, when I can just boot off a live CD and skip mucking around? So here I am, writing this post SSHed from the 5.10 live CD, and it Just Workstm. I'm quite impressed. It dealt with the SATA hard drive. It dealt with the SATA CD-ROM. It dealt with the wireless (albeit it associated with the wrong access point), and it dealt with the video. It took a little while to boot, but not as long as the SuSE live CD I once experimented with. Overall, very slick. Nice job guys. Now if I can just rescue my data...

5 April 2006

Adeodato Sim : grep-dctrl -s Source:Package

I just wanted to say thanks to Antti-Juhani Kaijanaho, the author of grep-dctrl, for implementing a fix for my wishlist bug #355960. Now it is possible to obtain the value for a field (eg. Source) from some other field (eg. Package), when the former is not present. For example, to obtain a list of source packages that need to be rebuilt in a MusicBrainz transition: grep-dctrl -FDepends musicbrainz -ns Source:Package. Formerly, one would have to list binary packages, and do some juggling to get the list of sources. I think regular grep-dctrl users will surely appreciate this capability. NP: Almod var & McNamara, Suck it to me

Clint Adams: Dis ingenuity and dat ingenuity

Matthew, are you suggesting that all the heated discussions and flamewars about how to respond to the deaths of developers didn't happen, or that they were caused by three insane weirdos who are technically part of the community we love so much more than Ubuntu, yet not reeeeeally part of the community? Do you recall discourse about certain actions potentially cheapening our honoring of the memory of Joel Klecker? Which position then fell in the realm of this common sense to which we should aspire?

Clint Adams: Do I earn frequent blogger points by doing this?

Matthew,
1) I say "The Debian project believes that works under the GFDL, with invariant sections, are non-free". Someone is insulted, because they believe otherwise. Is my statement incorrect? Should that person feel insulted?
That statement would seem reasonable given the outcome of a project-wide General Resolution. If the individual believes that the process by which said outcome was reached was flawed beyond a reasonable point, that person might feel frustrated. If it is widely held that such was flawed beyond a reasonable degree, and the speaker advancing that position were widely regarded as being obviously deceptive, then that person should feel insulted.
2) I say "The Debian project believes that it is a shame that a member has died". Someone is insulted, because (for whatever reason) they disagree. Is my statement incorrect? Should that person feel insulted?
If you are basing your statement on a mailing list discussion in which no one was obliged to participate; which excluded anyone who didn't subscribe to that mailing list, anyone who refused to participate in said discussion for whatever reason, and anyone who quite correctly failed to recognize said discussion as a decision-making process; and which was generally shameful and embarrassing; then you are manufacturing consensus out of your ass. Yes, that statement is incorrect. Yes, we should all feel insulted. Trying to argue that we should just spout meaningless platitudes (no matter how strongly a tiny minority might mean them) at a whim is insane. The Debian project condemns the U.S. head of state for being a retard; everyone with whom I discussed this today agrees. I know that Debian's about technical excellence, but what harm can a simple political statement do? Maybe we should darken our website to show our support for those who died at the Gulf of Tonkin. If it's in poor taste to vote on whether or not the project believes something is a shame, then I think it's probably in poor taste to pretend that that was decided in some other manner.

Clint Adams: Batman was running Wesley Willis amok

Matthew, you continue to be disingenuous. If you, in your official capacity as Debian representative, expressed condolences to the GNOME advisory board with regard to the death of GNOME's UI, I bet that some of the people not laughing might be angry with you. Now how many of them need to speak up before you'd acknowledge them as people and not rabid stick figures?

Next.

Previous.