Microblog: A very long article Wikipedia article on the orientation of toilet paper [Jun 7th, 22:52] [R]

Monday, September 30th, 2013

La horde du contrevent

Translation: [ Google | Babelfish ]

Categories: [ Books ]

ISBN: 9782070342266

© Amazon.fr

Sur un monde où le vent souffle en permance plus ou moins fort et toujours dans la même direction, les hordes se succèdent génération après génération pour remonter le vent et découvir ce qui se cache en Extrême-Amont. La 39ème horde, composée de vingt-trois membres, est probablement la dernière, étant donné que les véhicules modernes semblent plus à même de remonter le vent qu'un group de marcheurs. La horde est en outre poursuivie par des tueurs commandités par une faction du gouvernement qui s'oppose à l'exploration de l'Amont. La horde perd des membres lors de la traversée à la nage d'une mer intérieure peu profonde, souffre du retard imposé par un potentat local (à la solde des opposants aux hordes) qui contrôle l'accès à un point clef sur le chemin, puis dans les montagnes glacées, encore inexplorées par les hordes précédentes. Un group de sept parvient en Extrême-Amont, et se retrouvent devant un précipice et une mer de nuages. Le vent est provoqué par une sorte de volcan d'air, un peu en aval dudit précipice. Apparemment, en Extrême-Amont, il n'y a rien. Six des membres survivants se perdent ou meurent, et seul le scribe de l'expédition survit. Il descend une plante géante qui remonte du précipice, et finit par se retrouve en Extrême-Aval.

[ Posted on September 30th, 2013 at 18:42 | no comment | ]

Sunday, September 29th, 2013

Fuller's Wild River

Translation: [ Google | Babelfish ]

Categories: [ Beer/Fuller's ]


“double hopped pale ale… blend of american hops including Liberty, Willamette, Cascade and Chinook… zesty beer… citrus flavours… bitter finish”

Very flowery, quite nice. Contains malted barley.

Fuller, Smith & Turner, London, England. 4.5% alcohol.

[ Posted on September 29th, 2013 at 21:12 | no comment | ]

Saturday, September 21st, 2013

Cairngorm Trade Winds

Categories: [ Beer/Cairngorm ]


“high proportion of wheat… perle hops and elderflower… fruit and citrus flavours”

Little bitterness, maybe even a bit sweet, with grapefruit flavour. Contains barley and wheat.

Cairngorm brewery Ltd., Dalfaber, Aviemore, Scotland. 4.3% alcohol.

[ Posted on September 21st, 2013 at 19:22 | no comment | ]

Tuesday, September 17th, 2013

Frequently Asked Questions about Time Travel

Categories: [ TV/Cinema ]



Ray, a serious sci-fi geek, and his friends Pete and Toby are at a pub. Ray meets Cassie, who claims to be a time traveler whose job is to find and repair “time leaks” and stop “editors” who kill famous artist just after they produce their best piece to prevent the downfall part of their career. The guys have some trouble believing her, but they end up traveling back and forth through time within the pub, the “portal” being in the toilets. They see themselves in several times, and discover that they somehow become famous. They meet a second time traveler, named Millie, an editor. Millie wants to take the piece of scrap paper containing the idea that will make them famous, but that will eventually lead to their death. They refuse, and Millie kills everyone in the pub. Ray manages to destroy the paper by spilling beer on it, causing all the events to not have happened, but the paper is still soaked. The three friends walk home wondering about the events in the pub when Cassie appears through a big glowing portal. She reveals that they have only fourteen hours to save the Earth, and urges them to go with her to a parallel universe.

[ Posted on September 17th, 2013 at 18:38 | no comment | ]

Sunday, September 15th, 2013

Instantiating Many Objects in Python

Categories: [ IT ]

I have a list of files in a text file, and I want to load this list into some kind of data structure. The list is quite long, and requires to instantiate 100,000 objects in Python, all of the same type. I found out that depending on what kind of object is used, the time it takes to instantiate all these can vary greatly. Essentially, each line of the file is composed of tab-separated fields, which are split into a list with Python's str.split() method. The question therefore is: what should I do with that list?

The object must hold a few values, so basically a list or a tuple would be enough. However, I need to perform various operations on those values, so additional methods would be handy and justify the use of a more complex object.

The Contenders

These are the objects I compared:

A simple list, as returned by str.split(). It is not very handy, but will serve as a reference.

A simple tuple, no more handy than the list, but it may exhibit better performance (or not).

A class named List that inherits from list:
class List(list):
  def a(self): return self[0]
  def b(self): return self[1]
  def c(self): return self[2]
A class named Tuple that inherits from tuple:
class Tuple(tuple):
  def a(self): return self[0]
  def b(self): return self[1]
  def c(self): return self[2]
A class named ListCustomInitList that inherits from List and adds a custom __init__() method:
class ListCustomInitList(List):
  def __init__(self, *args): List.__init__(self, args)
A class named TupleCustomInitTuple that inherits from Tuple and adds a custom __init__() method:
class TupleCustomInitTuple(Tuple):
  def __init__(self, *args): Tuple.__init__(self)
A class named ListCustomInit that inherits from the list basic type but has the same features as ListCustomInitList instead of inheriting them from the custom List:
class ListCustomInit(list):
  def __init__(self, *args): list.__init__(self, args)
  def a(self): return self[0]
  def b(self): return self[1]
  def c(self): return self[2]
A class named TupleCustomInit that inherits from tuple basic type but has the same features as TupleCustomInitTuple instead of inheriting them from the custom Tuple:
class TupleCustomInit(tuple):
  def __init__(self, *args): tuple.__init__(self)
  def a(self): return self[0]
  def b(self): return self[1]
  def c(self): return self[2]
A class named NamedTuple that is made from the namedtuple type in the collections module:
NamedTuple = namedtuple("NamedTuple", ("a", "b", "c"))
A very basic class named Class and that inherits from object:
class Class(object):
  def __init__(self, args):
    self.a = args[0]
    self.b = args[1]
    self.c = args[2]
A variant of the previous that uses the __slots__ feature:
class Slots(object):
  __slots__ = ("a", "b", "c")
  def __init__(self, args):
    self.a = args[0]
    self.b = args[1]
    self.c = args[2]
A old-style class, named OldClass, that does not inherit from object:
class OldClass:
  def __init__(self, args):
    self.a = args[0]
    self.b = args[1]
    self.c = args[2]

The Benchmark

Each class is instantiated 100,000 times in a loop, with the same, constant input data: ["a", "b", "c"]; the newly created object is then appended to a list. This process it timed by calling time.clock() before and after it and retaining the difference between the two values. The time.clock() method has quite a poor resolution, but is immune to the process being set to sleep by the operating systems's scheduler.

This is then repeated 10 times, and the smallest of these 10 values is retained as the performance of the process.

The Results

The results from the benchmark are shown relatively the speed of using a simple list. As expected, the use of a simple list is the fastest, since it requires not additional object instantiation. Below are the results:

  • 1.000 list
  • 2.455 tuple
  • 3.273 Tuple
  • 3.455 List
  • 4.636 Slots
  • 5.818 NamedTuple
  • 6.364 OldClass
  • 6.455 Class
  • 6.909 TupleCustomInit
  • 7.091 TupleCustomInitTuple
  • 7.545 ListCustomInit
  • 7.818 ListCustomInitList


One can draw several conclusions from this experiment:

  • Not instantiating anything is much faster, even instantiating a simple tuple out of the original list increases the run time by 150%
  • The slots feature makes object instantiation 28% faster compared to a regular class
  • Deriving a class from a basic type and adding a custom __init__() method that calls the parent's __init__() adds a lot of overhead (instantiation is 7 to 8 times slower)

[ Posted on September 15th, 2013 at 15:13 | no comment | ]

Sunday, September 8th, 2013

Cairngorm Black Gold

Categories: [ Beer/Cairngorm ]


“nutty roast flavour… four colour of malt make up the grist”

Sweet stout, with a strong roast and caramel taste. Contains barley and wheat.

Cairngorm brewery Ltd., Dalfaber, Aviemore, Scotland. 4.4% alcohol.

[ Posted on September 8th, 2013 at 10:28 | no comment | ]

Sunday, September 1st, 2013

Sunny Republic Beach Blonde

Categories: [ Beer ]


“Calypso & Pacifica hops offer a hint of tropical citrus… upfront bitterness… light malt body”

Just another ale. Contains malted barley.

Sunny Republic Brewing Co., Blandford, Dorset, England. 4.4% alcohol.

[ Posted on September 1st, 2013 at 21:03 | no comment | ]