Bottle Plugin Lifecycle

If you use Python‘s Bottle micro-framework there’ll be a time where you’ll want to add custom plugins. To get a better feeling on what code gets executed when, I created a minimal Bottle app with a test plugin that logs what code gets executed. I uesed it to test both global and route-specific plugins.

When Python loads the module you’ll see that the plugins’

__init__()

and

setup()

methods will be called immediately when they are installed on the app or applied to the route. This happens in the order they appear in the code. Then the app is started.

The first time a route is called Bottle executes the plugins’

apply()

methods. This happens in “reversed order” of installation (which makes sense for a nested callback chain). This means first the route-specific plugins get applied then the global ones. Their result is cached, i.e. only the inner/wrapped function is executed from here on out.

Then for every request the

apply()

method’s inner function is executed. This happens in the “original” order again.

Below you can see the code and example logs for two requests. You can also clone the Gist and do your own experiments.

https://twitter.com/riyadpr/status/617681143538786304

Übergewicht senkt Demenzrisiko

Ein weiter Beweis dafür, dass der Verein zur Pflege des Wohlstandsbauches einen wichtigen Beitrag zur Volksgesundheit leistet. Wissenschaftler haben die Gesundheitsdaten von fast 2 Mio. Briten über 20 Jahre ausgewertet und kommen zum Ergebnis, dass Übergewicht das Demenzrisiko senkt.

Facebook Tracking People Who Have Opted Out of Tracking

Facebook specifically and individually tracks all people, even those who aren’t FB users. Using the opt-out mechanism you’re even worse off, since setting the opt-out cookie makes you uniquely identifiable (again).

During the opt-out process, Facebook sets a long-term identifying cookie and then uses this to track visits to pages that have a Facebook social widget. In other words: “for those individuals who are not being tracked by Facebook (e.g. non-users who have never visited a page on the facebook.com domain, or Facebook users who clear their cookies after logging out from Facebook), using the ‘opt out’ mechanism proposed for the EU actually enables tracking by Facebook” (emphasis in original).

When you opt-out …

[…] Facebook promises to stop collecting browsing information, or use it only specifically for the purpose of showing advertisements.”

So, of what use is it then?!?

No, You Go First

Bruce Schneier talks about how security companies sat on knowledge and research data about military-grade Regin malware for at least six years. They only decided to share their knowledge because the Intercept was about to publish an article about it. Their arguments for why they withheld their knowledge until now range from “our customers asked us not to disclose what had been found in their networks” to “we didn’t want to interfere with NSA/GHCQ operations”. :/ It’s safe to say that they sit on a bunch more.

They Don’t Care About Your “Online” Privacy

Messenger apps show your friends’ online status. Anytime you open the app, they’ll notify the service that you’re “online” at the moment. Now everybody else can see it in their contact lists.

And with everybody I mean anybody! If you have a phone number you can check that person’s online status as often as you want from wherever you want (no need to be friends or anything).

So did a group of researchers at the Friedrich-Alexander-Universität Erlangen-Nürnberg. They used this “feature” to “find out how frequently and how long users spent with their popular messenger” on a random sample of 1000 people in different countries for over eight months.

Looking through the project’s website should make it clear how little the creators of those apps care …

Moreover, we were able to run our monitoring solution against the WhatsApp services from July 2013 to April 2014 without any interruption. Although we monitored personal information of thousands of users for several months — and thus strongly deviated from normal user behaviour — our monitoring efforts were not inhibited in any way.

… and that they don’t want you to be able to care.

Unfortunately, affected messenger services (like WhatsApp, Telegram, etc.) currently provide no option for disabling access to a user’s “online” status. Even WhatsApp’s newly introduced privacy controls fail to prevent online status tracking, as users still cannot opt-out of disclosing their availability to anonymous parties.

Programming is Meaningless

Researchers seemingly have found a way to tell-apart students which will do well in computer science classes and those who won’t. More eloquently put they’ve devised a way  “[to] separate programming sheep from non-programming goats.” 😀

And they come to an interesting conclusion:

Formal logical proofs, and therefore programs – formal logical proofs that particular computations are possible, expressed in a formal system called a programming language – are utterly meaningless. To write a computer program you have to come to terms with this, to accept that whatever you might want the program to mean, the machine will blindly follow its meaningless rules and come to some meaningless conclusion. In the test the consistent group showed a pre-acceptance of this fact: they are capable of seeing mathematical calculation problems in terms of rules, and can follow those rules wheresoever they may lead. The inconsistent group, on the other hand, looks for meaning where it is not. The blank group knows that it is looking at meaninglessness, and refuses to deal with it.
Saeed Dehnadi and Richard Bornat, 2006, “The camel has two humps (working title)”

I have accepted it. -.-

Limits to Growth

In 1972 the Club of Rome commissioned a study on growth trends in world population, industrialisation, pollution, food production, and resource depletion which was eventually published as a book called “The Limits to Growth.” They simulated different scenarios predicting what would happen until 2100 depending on whether humanity takes decisive action on environmental and resource issues. 40 years later the world pretty much matches the worst prediction.