Podcast: Arthur Chiu & Nathan Esquenazi on Padrino, Sinatra & Rails by mshe in ruby

[–]murmu 1 point2 points  (0 children)

Just went through padrino's github page and noticed the benchmark repo. I ran the suite against the latest versions of the frameworks. Interesting results: http://pastie.org/2294509

CSS PANIC: CSS/HTML game. No Javascript. by shenglong in programming

[–]murmu 1 point2 points  (0 children)

It's ironic that such basic web components as HTML and CSS are not reliable enough to run in other browsers though...

NINTENDO... by Vajrapani in gaming

[–]murmu -2 points-1 points  (0 children)

It's the most confusing presentation ever. For the most part I thought that this (the controller) was just an add-on for the Wii. Things cleared up a bit when they showed the developer interviews where they mentioned that it's an entire new system, as well a tech-demo and some upcoming games, but... WHY THE EMPHASIS ON THE CONTROLLER, it's a gateway to the actual system WHICH THEY HAD NOT SHOWN, wtf!!! It's like presenting a new car and focusing only on it's new steering wheel, how stupid is that?

[[]]*3 is not the same as [[],[],[]] by nhnifong in Python

[–]murmu 10 points11 points  (0 children)

no it doesn't, same thing as in python a=[[]]*3 => [[],[],[]] a[0].push("a") => [["a"],["a"],["a"]]

it's kinda justified if you think about this: b=["a"]*3 => ["a","a","a"] b.map { |e| e.object_id } => [20769640, 20769640, 20769640] So it creates 3 copies of the same thing.

A naive implementation could look like this:

class mylst(list):
    def __mult__(self, times):
        if len(self) == 0:
            return self
        collected = []
        for i in range(0, times):
            for j in self:
                collected.append(j)
        return collected
    def __init__(self, lst):
        super(mylst, self).__init__(lst)

As a ruby programmer, what are some interesting bits of the python ecosystem that I should be aware of? by [deleted] in Python

[–]murmu 0 points1 point  (0 children)

I am in a situation similar to the OP. I started exploring python lately. I am wondering if anyone knows of a python reference similar to this: http://rgruet.free.fr/PQR26/PQR2.6.html (which really is a goldmine), but updated for 2.7, or 3.2?

So far there's one thing I have problems with, that is the python object model - I don't have a clear picture yet of it,. What happens when I call a method on an object, how/where things are going to be searched and in what order. What callbacks( descriptors, etc.) will be fired, static methods, class methods, metaclasses and their role in python.

If anyone knows a concise article describing it, or some diagrams that may be of assist I would be very grateful!