When you want to log something, C pre-processor macros __FUNCTION__ and __LINE__ are quite helpful (althogh the first is a GNU extension for GCC, AFAIK). Python have the __name__ pseudo-variable with the current namespace, but isn’t quite helpful when you want to find where things are going. Fortunately, you can “emulate” __FUNCTION__ and __LINE__ in Python, using the inspect module.
def __line__ (): caller = inspect.stack() return int (caller) def __function__ (): caller = inspect.stack() return caller
Yes, both are now functions and not pseudo-variables. But it works.
Hoje, vindo para o trabalho, resolvi ler um dos tantos cartazes colados pela cidade sobre a “micro-camêra do 007”. O mais engraçado é que ninguém deve ter percebido que eles tem “o tamanho de um esqueiro” (sic).
>>> a = 1 >>> b = 1 >>> c = 1 >>> print a==b==c True
Man, it feels SO good not having to put a lot of ‘&&’ on your code…
Transformers. Live action.
I just increased my geekness a few weeks ago when I completed “Neuromancer“, Willian Gibson most famous work.
Now, I couldn’t read it without seeing the main character (Chase) as the main character of “Hackers”. Actually, Neuromancer really looks like a clash between “Hackers” and “Bladerunner”. Add a little bit of “Matrix” and “I want to be John Malcowich” and there you have it.
There are some pieces around the end, when you have people in zero-g in an acid trip that you can’t really understand what is going on. Other than that, the story moves nicely. But I wouldn’t recomend it, as the confusing parts took a great deal of the climax of the book.
Well, let’s see what I will find next to improve my geekness…
[And “Geek += 1” ’cause that’s one of the books listed on Top 20 Geek Novels]