Concerted action against freely accessible sheet music and song lyrics
MPA President Lauren Keiser expressed extreme annoyance to the BBC about the allegedly illegal sites with guitar licks and sheet music templates and would prefer to see their operators behind bars. Basically, music is subject to copyright not only as a concrete performance, but also in any printed notation.
Soon you'll end up in jail if you accidentally fart to the beat of "All My Ducks" ...
UCI's response to the Grand Tours' ranking idea of the three major tours:
"As the only actor in this reform who does not want to defend or promote its own economic interests, the UCI will never share such a superfluous and dangerous vision that harms the development of cycling," said an official statement. The introduction or amendment of the regulations is solely the responsibility of the international federation.
You can already see how the UCI troops are forming to infiltrate the offices of the three major tour organizations and arrest the ringleaders. After that, there will be a penal camp for recalcitrant tour organizers who do not want to submit to the UCI. Maybe they will also get support from 'Mad Eye' Serlet?
The US of A, Land of the Free and the Stupid, is once again playing the top bully:
Even experienced summit participants from Western Europe are shocked behind the scenes by the boorish behavior of the American chief negotiators, who act here like John Bolton at the UN, and "hide their academic education well."
I am shocked at most by the naivety of politicians who are so surprised by America's behavior - as if the current reports do not speak a very clear language that the current US administration does not give a damn about the wishes of others and that international law does not have a particularly important status for them. Why should they behave differently at the climate summit?
Even more shocking, however, is how Merkel is constantly talking about how relations with the USA need to be improved - I would be happy about that, but please only with a next, possibly rational administration that is accessible to arguments. The current one is not coalition-capable, to use a term that is often used here for something as harmless as the PDS ... (fear of pale-red marked Ossies, but want to be with something like Bush - I call that shocking)
A rather ugly - but still useful - monkeypatch:
# monkey-patch for auth.users
from django.models.auth import User
def user_pre_save(self):
if not self.password.startswith('sha1$'):
self.set_password(self.password)
User._pre_save = user_pre_save
Put this into your model file (or somewhere else that is loaded early on) and you will be able to set passwords in the admin by entering clear text passwords. If the password starts with 'sha1$', it is seen as already encrypted and nothing happens. If it doesn't start with that string, it is converted using the standard Django function for password encryption.
No, this isn't something that should go into core - it's far too ugly for that. But at least it allows you to set passwords through the admin, without requiring the user to calculate the actual password hash.
Sony caught in another DRM snafu
Stop me if you've heard this one before. A record label uses DRM to sort of keep its customers from copying the music. It turns out that the software poses a threat to the user's PC. So the label issues a patch... which opens up another security hole. If you guessed that the label in question is Sony, you'd be correct. If you guessed that I'm recapping last month's rootkit debacle, you'd be wrong.
Oh well. Rarely so stupid at Sony. Will they ever learn?
Oh, and the fact that I probably won't get an Aibo offered now is, to be honest, pretty irrelevant to me.
Frequently used: SystemExit. A Python exception that many people don't know. The special thing about this exception: it is not an error. It also does not occur unexpectedly. It is simply triggered by sys.exit. The idea behind this is that you can insert an end processing in the dynamic flow (e.g. some file cleanups), without linking into global exit processing (with all the problems that entails).
The problem is that many programs and libraries install a global exception handler. One that catches every error and sends it nicely formatted by mail, logs it somewhere or something similar. I do this all the time. It also works great - except when you actually want to initiate an early end in your program. Then nothing works anymore - because you get corresponding errors for a non-error.
This becomes particularly critical in connection with multiple processes. If you start a process during operation, you also want to terminate it without executing any subsequent code. You can best see this in an example program:
import signal
import os
try:
pid = os.fork()
if pid:
print "Elternprozess", os.getpid()
else:
print "Kindprozess", os.getpid()
sys.exit(0)
except:
print 'Fehler aufgetreten in Prozess', os.getpid()
print "Das darf nur der Elternprozess ausführen", os.getpid()
This code simply has a global error handler that catches errors in a rather unspecific way. Within the code, a parallel process is started with fork. However, since SystemExit is treated like all other exceptions, the child process is not terminated correctly - a process copies the entire state of the parent process, including return addresses, open error handling, files, database connections and so on.
This is of course fatal - because here sys.exit is caught. So there is an error message for the quite normal sys.exit(0) call. And even worse: since SystemExit is not treated separately, it continues normally afterwards - and the child process runs into code for the parent process. Code runs double, which can have critical results under certain circumstances.
If you can fully control the entire software stack, the solution is simple:
import signal
import os
try:
pid = os.fork()
if pid:
print "Elternprozess", os.getpid()
else:
print "Kindprozess", os.getpid()
sys.exit(0)
except SystemExit:
raise
except:
print 'Fehler aufgetreten in Prozess', os.getpid()
print "Das darf nur der Elternprozess ausführen", os.getpid()
This simply re-raises the SystemExit - i.e. triggers it again - without making a message. In most cases, Python's standard handling will then kick in and convert the SystemExit into a normal termination.
But what to do if you have several stacked variants of the wrong error handling? I had something like this with Django and FLUP (the FCGI/SCGI server for Python). In Django I changed it, then the error hit in FLUP. What do you do then?
The solution is a bit more brutal:
import signal
import os
try:
pid = os.fork()
if pid:
print "Elternprozess", os.getpid()
else:
print "Kindprozess", os.getpid()
os.kill(os.getpid(), signal.SIGTERM)
except:
print 'Fehler aufgetreten in Prozess', os.getpid()
print "Das darf nur der Elternprozess ausführen", os.getpid()
Ultimately, the process simply commits suicide - it sends itself a SIGTERM, i.e. a termination signal. The same one you would normally send from the shell. However, you must then ensure that any necessary post-cleanups are either already done, or then run in a SIGKILL handling routine - otherwise you may have problems (e.g. database transactions should already be committed).
With this solution, you also have to be careful that no open resources block the process - otherwise you may produce zombie processes. Often it is better for such multiprocessing to start a management process much earlier in the system - outside the error handling chain - and then use it to start processing processes. However, this then has the disadvantage that processes started in this way do not inherit the environment of the parent process. Therefore, you usually have to make more preparations to perform the desired actions. Incidentally, Apache pursues a similar approach - there the processes are created from a very early basic state, so that they come as resource-free as possible.
Is she alive? At least there are rumors about it. However, sentences like this one make me a bit irritated:
Leiter des Dharma-Projekts soll Bertrand 'Mad Eye' Serlet sein, Senior Vice President of Software Engineering bei Apple, der auch schon an der Entwicklung von iCal und iSync beteiligt gewesen sein soll.
I mean, come on, what kind of names are these? Mafia? Mercenaries? Lost Wild West figures?