Python modules use operator overloading in two different ways
In Python (as in elsewhere), there are at least two different thingsthat people use operator overloading for. That there's more thanone thing makes a difference because some patterns of designing howoperator overload work aren't sufficiently general to handle boththings; if you want to serve both groups, you need to design a moregeneral mechanism than you might expect, one that delegates morepower to objects.
The first use of operator overloading is to extend operators sothat they work (in the traditional ways
Yubico fails to care that people give you email addresses for specific purposes
A while back, Yubico had a little security issue that forced it to replace anynumber of Yubikey 4s, including mine. In order to do this, theyrequired people to give them an email address so they could sendyou some necessary information; following my usual practice I gave them a tagged, individualizedaddress. Today I received email to that address, received from theserver of a domain called 'mktomail.com', that started out like this:
Subject: Passwordless authentication is here
Yubico scales across enterprise
How we're going to be doing custom NFS mount authorization on Linux
We have a long standing system of custom NFS mount authorization on our current OmniOS-basedfileservers . This system has beenworking reliably for years, but our next generation of fileserverswill use a different OS , almostcertainly Linux, and our current approach doesn't work on Linux , so we had to develop a new one.
One of the big attributes of our current system is that it doesn'trequire the clients to do anything special; they do NFS mountrequests or NFS activity, and provided that their
One reason why Python doesn't let you overload the boolean AND and OR operations
Recently I read Kurt Rose's DISappearing and (viaPlanet Python), where Kurt noted that Python doesn't have __...__ methods that let you override boolean and and or operations onyour class objects. As it happens, there's a really good reason forthis, which is that Python would require a new fundamental data typein order to make it really work.
Boolean and and or have the extremely valuable property ofshort-circuiting evaluation, where if you write, say
Firefox turns out to need some degree of 'autoplay' support
When I wrote some notes about Firefox's current media autoplaysettings , I said, about the centralfunction in Firefox that decides whether or not media can autoplay:
Since I don't want videos to ever autoplay, [...] I may someday trymaking the entire function just immediately return false.
I did this experiment and I can now report that the result is afailure. Completely disabling IsMediaElementAllowedToPlay() from AutoplayPolicy.cpp ,ie making it always return false , results in a Firefox that won
Modern Unix GUIs now need to talk to at least one C library
I've written before about whether the C runtime and library area legitimate part of the Unix API . The questionmatters because some languages want to be as self contained aspossible on Unix (Go is one example), and so they don't want tohave to use anything written in C if at all possible. However, Irecently realized that regardless of the answer to this question,it's essentially impossible to do a good quality, modern Unix GUIwithout using at least one C library.
Why you can't put zero bytes in Unix command line arguments
One sensible reaction to all of the rigmarole with ' grep -P ' Iwent through in yesterday's entry in order to search for a zero byte (a null byte) is to ask why Ididn't just use a zero byte in the command line argument:
fgrep -e ^@ -l ...
(Using the usual notation for a zero byte.)
You can usually type a zero byte directly at the terminal, alongwith a number of other unusual control characters (see my writeup
Using grep to hunt around for null bytes in text files
Suppose, not entirely hypothetically , that you'vedeveloped a suspicion that some mailbox files have zero (null) bytesin them. Null bytes are not traditionally found in mail messages,or indeed in any text format, and their presence is not infrequentlya sign that something has gone wrong (in email related things, anobvious suspect is locking issues). So if you suspect null bytesmight be lurking you want to at least check for them and perhapscount them, and once you've found some null
An interaction of low ZFS recordsize, compression, and advanced format disks
Suppose that you have something with a low ZFS recordsize ; aclassical example is zvols, where people often use an 8 Kb volblocksize . You have compression turned on, and you are usinga pool (or vdev) with ashift=12 because it's on 'advanced format' drives or you're preparing for thatpossibility. This seems especially likely on SSDs, some of whichare already claiming to be 4K physical sector drives .
In this situation, you will probably get much lower compressionratios than
You probably need to think about how to handle core dumps on modern Linux servers
Once upon a time, life was simple. If and when your programs hit fatal problems , they generallydumped core in their current directory under the name core (sometimes you could make them be core. Menu