Why I hate vendors, printers edition
(I was going to call this 'why I hate printers', but that turns out tonot be quite accurate.)
Some people here need to buy a new printer, and they need it to hookinto our general printing system. Our print system has what I think ofas undemanding requirements; what we need is printers that will acceptPostScript sent to them over the network (we would like for them to haveACLs and so on, but it isn't essential). We normally use HPs,
The historical background of the *BSD 'base system' versus Linux
One of the periodically cited differences between Linux and the *BSDsis the *BSD idea of the 'base system'. In the *BSD world, this is thesource tree for the kernel, the core runtime libraries, and whateveruser level programs the *BSD considers sufficiently important andcentral; it is maintained (and distributed), essentially as a unit,by the *BSD's developers. Linux has no similar concept; the kernel ismaintained and distributed by one group, the usual runtime library by
When and where I fell out of love with Firefox
Okay, the title of this entry is a little bit of an exaggeration;I was never really in love with Firefox. But I certainly spent along time being comfortable with it and that's pretty close. Whatstarted me thinking about this is the widely-spread article Everyonehates Firefox updates ,which casts Firefox's frequent updates in a very dim light.
For me, this is part of the story but not all of it. Actually, Firefoxupdates don't particularly bother me by themselves (
The CPython bytecode difference between iteration and looping
Because I feel like it, today I'm going to show you the differencein CPython bytecodes between the two variants of 'repeat N times'that I talked about in my entry on the periodic strangeness ofidiomatic Python . Both are going to be infunctions (because that's the common case of where Python codeis).
First, the iteration version:
def iter(max): for _ in range(max): pass
The core bytecode of the function looks like the following (notethat
A nice illustration of the cost of creating and destroying objects in Python
Here are two functions ( they may look familiar ):
def xiter(max): for _ in xrange(max): passfrom itertools import repeatdef riter(max): for _ in repeat(None, max): pass
The first thing that makes these functions interesting is that xiter() runs about 1.25 times as slowly as riter() , once you test with alarge enough max to drown out startup effects. This is interestingbecause these functions are almost identical, both in
How not to write kernel messages
Suppose that you reboot your Ubuntu 12.04 Linux machine and see, amongthe kernel boot messages, the following:
Yama: becoming mindful.
Perhaps you've heard something about Yama andwould like to understand what this means, perhaps you're looking forboot anomalies in general because of an odd problem you're having, oreven perhaps you'd just like to understand your kernel's boot sequence.Is this message helpful?
Of course not. For most people this is completely opaque
Ubuntu 12.04 and symbolic links in world-writeable sticky-bitted directories
We're in the process of upgrading from Ubuntu 10.04 to Ubuntu 12.04,and today we ran into a serious surprise. If you have a symlink in aworld writeable directory that has the sticky bit set so that only theowner of a file can delete it (for example, /tmp ), only the owner ofa symlink can dereference it. Everyone else will get EACCES on anyoperation that attempts to do so, including things like attempting to stat() the
Learning something from not testing jQuery 1.8's beta releases
I was reading the jQuery 1.8 release announcement when I ranacross this gem:
We don't expect to get any bug reports on this release, since therehave been several betas and a release candidate that everyone has hadplenty of opportunities to thoroughly test. Ha ha, that joke nevergets old. We know that far too many of you wait for a final releasebefore even trying it with your code. [...]
Since we use jQuery a bit andI'm one of those
Linux ps's problem with login names
I generally like the usual Linux verions of various utilities, GNUismsand all; at least they work reliably under many circumstances . The Linux version of ps is not one of thoseprograms. Unfortunately, for reasons that I believe are at least partlypolitical, Linux ps is a mess; as one example, the major distributionshave had to fork procps (and theoriginal main code hasn't seen a release for several years).
One irritating example of this mess is how ps treats login names,specifically how it
The theoretical legality of shadowing builtins in Python
Here is a variant of an example I wrote a few years ago :
eval = evalclass A(object): file = file
This creates a module-level eval name binding that is the same as thebuiltin eval , and a class variable A.file that is the same as thebuiltin file . All of this works in CPython because of how names andscopes are used in the CPython bytecode .Which leads to the theoretical question: is this actually 'portable' inthe sense that this behavior is required