I am trying to call the __init__() method in a superclass, where said method takes arguments, but it doesn't seem to be working. Please see the code below:  &gt;&gt;&gt; class A:         def __init__(self, param1, param2):             self._var1 = param1             self._var2 = param2  &gt;&gt;&gt; class B(A):         def __init__(self, param1, param2, param3):             super(B, self).__init__(param1, param2)             self._var3 = param3   &gt;&gt;&gt; a = A("Hi", "Bob") &gt;&gt;&gt; a._var1 'Hi' &gt;&gt;&gt; a._var2 'Bob' &gt;&gt;&gt;  &gt;&gt;&gt; b = B("Hello", "There", "Bob")  Traceback (most recent call last):   File "&lt;pyshell#74&gt;", line 1, in &lt;module&gt;     b = B("Hello", "There", "Bob")   File "&lt;pyshell#69&gt;", line 3, in __init__     super(B, self).__init__(param1, param2) TypeError: must be type, not classobj &gt;&gt;&gt;   I have never been able to get this to work. What am I doing wrong? I would ideally like to use super() over A.__init__(self, &lt;parameters&gt;), if this is a possibility (which it must be).
In Python 2.5, the following code raises a TypeError:  &gt;&gt;&gt; class X:       def a(self):         print "a"  &gt;&gt;&gt; class Y(X):       def a(self):         super(Y,self).a()         print "b"  &gt;&gt;&gt; c = Y() &gt;&gt;&gt; c.a() Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt;   File "&lt;stdin&gt;", line 3, in a TypeError: super() argument 1 must be type, not classobj   If I replace the class X with class X(object), it will work. What's the explanation for this?
Why are all of Mr. Shirley's gifts the same? jQuery not working in Wordpress 3.5 $f(x)$ is a strictly increasing, and continuous, function on $[0,+\infty)$. Consider the integral,  $$\int_0^a f^{-1}(x) dx.$$  Reasoning  The interval $[0,a]$ is "reflected" across the line $y=x$ onto the interval $0 \leq y \leq a.$  $f(x)$ and $f^{-1}(x)$ are symmetric across the line $y=x$. So, the integral is equivalent to the area bounded by $y = 0$, $y=a$, and $f(x)$.  So, "integrating $f$ along an interval on the $y$-axis" is the same as integrating $f^{-1}$ along the same interval on the $x$-axis?  Question  Is my reasoning correct? How many elements does the ring $ℤ[X]/(X^2-3,2X-4)$ have? Describe the structure of this ring. I'm making exercises to prepare for my ring theory exam:     How many elements does the ring $ℤ[X]/(X^2-3,2X-4)$ have? Describe the   structure of the this ring.   I find it always difficult if the ideal is generated by two elements.   I thought about someting like this. $X=2$ and $X^2=3$. Therefore $4=3$ therefore $1=0$. As $2=1$ then $X=0$. And then everyting seems to become $0$.   I'm not sure if I'm allowed to see it this way, but this is the first thing that comes to my mind. Upper bound on $\chi(G)$ for a triangle-free graph I'm struggling with the following question;     For every graph $G$ such that $K_3 \not\subseteq G$ (i.e. $G$ does not contain a triangle), prove that $\chi(G) \leq 2\sqrt{n} +1$ (where $\chi(G)$ denotes the chromatic number).   Any hints? I really cannot see the connection between the triangle-free nature of $G$ and a chromatic number being bounded above by $O(\sqrt{n})$. How to disable the touchpad? I want my touchpad to be disabled when I use my mouse. How can I do that? touchpad-indicator has stopped working on 11.10. It used to work on 11.04. Gnome3 is not a solution as I don't like it and find it buggy. Convert web page to image Let $n&gt;0$ and assume that $\chi^{(n)} \in \mathrm{Irr}(G)$ for every $\chi \in \mathrm{Irr}(G)$. Show that $G = H \times A$, where $A$ is abelian and $(|H|, n) = 1$.  $\chi^{(n)}$ is defined by $\chi^{(n)}(g) = \chi(g^n)$. $\mathrm{Irr}(G)$ is the set of all irreducible characters of $G$.  Here are the hints in the book:   Let $d = (|G|,n)$. Show that it is no loss to assume that $(|G|/d,n) = 1$. Let $A = \bigcap_{\chi \in \mathrm{Irr}(G)} \mathrm{ker} \chi^{(n)}$. Show that $A = \{g \in G | g^n=1\}$ and $|A| = d$. Let $H = \bigcap \{\mathrm{ker} \chi | \chi \in \mathrm{Irr}(G), \chi^{(n)} = 1_G\}$. Show $|G : H| = d$.   Hint 1 and 2 are easy, and it is easy to deduce the result from the hints. As for hint 3, I have proven that $\{ g \in G | (o(g), n) = 1 \} \subseteq H$, and that $|G : H| \mid d$. And I am stuck here.  Can anyone help me? What does the 'B' (or bonus) mean on a basketball scoreboard? Bash: Syntax Error on @() How to count number of words from String using shell According to "Moving Around Other Creatures" (PH p. 191 / SRD p. 92):     You can move through a nonhostile creature’s space. [...] another creature’s space is difficult terrain for you.    Whether a creature is a friend or an enemy, you can’t willingly end your move in its space.   So it's possible for Alice to , the only penalty being that the ally's space counts as difficult terrain to enter.  If an enemy adjacent to the ally's space has readied a grapple against Alice and is successful, then Alice (unwillingly) ends her move in her ally's space.  Do allied characters in the same space suffer any negative effect?  Now the rest of Alice's allies do the same thing.   Is there a limit to the number of characters that can be stacked on a space?   What if Alice's ally was the one with the readied grapple?  Can you stack an ally on your space by readying a grapple to prevent them from leaving? How do I select background music for my RPG campaign? Music is an essential component of my games. When running games set in the Star Wars universe, the music of John Williams adds a new dimension to the experience, both for me and for my players. Now that I'm starting a fantasy campaign, I'm a bit more uncertain about which music to use.  How do I create a soundtrack suitable for using in a fantasy campaign?  Specifically:   What sort of characteristics make for good back ground music? What makes for bad background music? What should I look for to get a fantasy feel? Which genres/sub-genres support fantasy games? What are good sources for fantasy background music?   A few notes:   Because the music will be used in the background of game sessions, most of the tracks should be one minute or longer, to avoid repetitive loops. Likewise, soundtracks with a variety of themes are preferred, so that they can easily support different modes of the game: exploration, combat, and chases, to name a few. Orchestral or acoustic music is preferred over music with vocals or electric instruments. Don't count non-printing characters, HTML comments or other content not displayed toward minimum character requirements A follow-up to , and an extension of .   shows that it is possible to circumvent minimum character requirements using null bytes.  Can we exclude such non-printing characters as ASCII NULL and other control characters from counting toward minimum character requirements?  Edit: Users have demonstrated that , unmatched or invalid HTML tags, and other content that is not displayed after Markdown parsing can be used to bypass such requirements as well.  Can we cover this case as well, except for links? Topology: Proof that a finitely generated cone is closed In Batman #1 in the New 52, when we visit the Batcave for the first time, we see a dinosaur:     What... is up with that? It is a completely awesome cave decoration - but what else is it? Is it a non sequitur or is it a call back to an earlier storyline? I imagine it's the latter – a life-size T-rex model is an expensive piece of decor, even for Bruce Wayne.  Bonus points: are there any other relics from past storylines visible in this Batcave?  Update: here's a shot of the other panel that gives us a view of the "showroom" (including the huge dice). Why is Newton's method not widely used in machine learning? This is something that has been bugging me for a while, and I couldn't find any satisfactory answers online, so here goes:  After reviewing a set of lectures on convex optimization, Newton's method seems to be a far superior algorithm than gradient descent to find globally optimal solutions, because Newton's method can provide a guarantee for its solution, it's affine invariant, and most of all it converges in far fewer steps. Why is second-order optimization algorithms, such as Newton's method not as widely used as stochastic gradient descent in machine learning problems? I recently read this , which stated:     For scientists trying to design a compound that will attach itself to,   and modify, a target disease pathway, the critical first step is to   determine the electronic structure of the molecule. But modeling the   structure of a molecule of an everyday drug such as penicillin, which   has 41 atoms at ground state, requires a classical computer with some   $10^{86}$ bits—more transistors than there are atoms in the observable   universe. Such a machine is a physical impossibility. But for quantum   computers, this type of simulation is well within the realm of   possibility, requiring a processor with 286 quantum bits, or qubits.   Along with this resource estimate for penicillin, I've also seen  of the number of qubits required to model the ground state of caffeine (160 qubits). Given that the above report offers no reference(s) (probably in the name of business intelligence) and much Internet searching and looking into the quantum chemistry literature has come up short, my question is: Where are these resource estimates coming from – is there a journal article that published these numbers? I would really like to identify the methodology and assumptions used in making these estimates. I want to make a JavaScript application that's not open source, and thus I wish to learn how to can obfuscate my JS code? Is this possible? A compact Hausdorff space that is not metrizable Is there an example of a compact Hausdorff space that is not metrizable?  I was thinking maybe the space of continuous functions $f: X \rightarrow Y$ between topological spaces $X, Y$, might work, but I'm sure I'm missing some conditions.