I'm trying to implement super() per  SO answer.  I have the following class:  class Collection():     """returns a collection curser from mongodb"""       def __init__(self, db, collection_name):         self.db = db         self.collection_name = collection_name          if not hasattr(self.__class__, 'client'):             self.__class__.client = MongoClient()          self.data_base = getattr(self.client, self.db)         self.collection = getattr(self.data_base, self.collection_name)   and the following subclass:  class User(Collection):     def __init__(self, db, collection_name):         super(User, self).__init__(db, collection_name)   Calling the Collection class works fine:  agents = Collection('hkpr_restore','agents')   Calling the subclass:  user = User('hkpr_restore','agents')   I get an error:  Traceback (most recent call last):   File "main.py", line 37, in &lt;module&gt;     user = User('hkpr_restore','agents')   File "filepath/user.py", line 35, in __init__     super(User, self).__init__(db, collection_name) TypeError: must be type, not classobj   What am I doing wrong?
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?
Does it have or has? How to provide translations for a WordPress TinyMCE plugin? I know that I can get my translations into JavaScript doing:      $MyTranslations = array(         'translation1' =&gt; __("Some String 1", "MyTranslations"),         'translation2' =&gt; __("Some String 2", "MyTranslations")     );     wp_localize_script( 'jquery', 'my_translations', $MyTranslations );   But looking at some of WordPress TinyMCE plugins they use calls like this:  { title : ed.getLang('advlink.link_desc'), ... }   How is WordPress getting their translations into getLang()? Am I supposed to do it this way or do I just use my first bit of code and access the variables directly like:  { title : my_translations.translation1, ... } I have a cheap Chinese made tablet from Dubai called the Crony Dubai (www.cronydubai.com). It has a micro B, mini HDMI and a USB labeled as "Host" as well as a micro SD slot. It came with a micro B to USB adapter in box, and its running Ice Cream Sandwich. Is there a way to load Ubuntu on it? Also the tablet is very buggy and crashes often, would that be due to the tablet or the OS? What is an observer in quantum mechanics? My question is not about (pseudo) philosophical debate; it concerns mathematical operations and experimental facts.  What is an observer? What are the conditions required to be qualified of observer, both mathematically and experimentally? How to find a good topic for a PhD research proposal? In many countries an application for a PhD position includes a written research proposal, so my questions is what are some advises/strategies to come up with a good topic/idea for a PhD research proposal and how can one assess the quality/fruitfulness of an idea? As an undergraduate student one just doesn't have the experience to foresee which ideas might have promising research results and which probably won't have. (And I doubt that potential supervisors have the time to comment on every idea of every potential applicant in cases where it is possible to establish some kind of contact before the actual application.) Can two PS4s log in to the same PSN account? Both myself and my boyfriend have PS4s.  Can I just get a single PSN account and sign both consoles into the same account, or do I need to get two separate accounts? Why is my "Committed" memory so much higher than my actual RAM space? I have run two virus scans and neither of them have found anything so far (Malware Bytes and Avira Rescue). During gaming I will get Windows popups saying that my system is low of memory and recommends closing the game. This can also happen while browsing. My computer seems to become sluggish a lot and will hang up often, such as when clicking a link from a messenger program to open in my browser.   I am unsure what is causing this. My memory usage on the processes tab doesn't add up to such a high percentage of my actual memory.    As a side note, is my Disk Usage supposed to spike up to 100% sometimes? Research seems to say so. Is there any way to create multiple insert statements in a ms-access query? Clock shows wrong time after switching from Ubuntu to Windows 10 I have dual booted Windows 10 and Ubuntu 16.04 in UEFI mode (secure boot off). My time in BIOS is correct.  When I boot into Ubuntu and then boot into Windows 10, it shows the wrong time. I have to correct it manually or by the internet in Windows 10, and when I reboot into Windows 10 then it is not a problem. The clock will show the correct time. And then when I reboot to Linux the clock is correct, but switching back to Windows 10 the clock messes up again. Windows 10 doesn't shut down properly I have visited tons of websites and watched dozens of Youtube videos, yet I can't find a solution to my problem.  I recently upgraded my laptop to Windows 10, and now it won't shutdown properly.  I have turned off fast startup and sleep mode from power options.  Here is what happens:   Start menu > Power > Shut down It exits windows and apparently turns off (black screen) The power lights are still on and my computer apparently doesn't shutdown. How can I force a long string without any blank to be wrapped? I have a long string (a DNA sequence). It does not contain any whitespace character.  For example:  ACTGATCGAGCTGAAGCGCAGTGCGATGCTTCGATGATGCTGACGATGCTACGATGCGAGCATCTACGATCAGTCGATGTAGCTAGTAGCATGTAGTGA   What would be the CSS selector to force this text to be wrapped in a html:textarea or in a xul:textbox? How can one set the executable bit on files using umask? According to documentation, a umask of 000 should work, but in practice this only works on directories.  Also open to other methods of automatically setting +rwx on a particular user's created files if you have any. If a function $f(x)$ is Riemann integrable on $[a,b]$, is $f(x)$ bounded on $[a,b]$? I am trying to testfor a player holding a diamond sword named Notch's Legendary Sword. How can I do that? Who ever gets the best answer will be able to get the first look at my NEW adventure map! an example of a non-abelian group $G$ containing a proper normal subgroup $N$ such that $G/N$ is abelian. it VS. this Vs. that given the 2 PDE  $$ \Delta u-au_{tt}+u_{t}=0$$  and $$ \Delta u + Du*Df=0 $$  here $ \Delta u $ is the Laplacian $ Du= grad(u) $ is the gradient and * means scalar product $u_{t} = \frac{\partial u}{\partial t}$  my doubt is what term should i include to get the linear part of the equations $ u_{t} $ and $Du*Df $ from the Euler Lagrange equations in $ R^{n} $ thanks Where is the GRLESS key? Tracking the questions you've recently viewed or visited On your user profile page there are six (6) tabs; stats, activity, reputation, favorites, prefs and accounts.  I would like to see in a new tab, maybe named 50 latest viewed questions, which would contain the 50 latest viewed questions.  This would help when I want to follow a question but don't want to bookmark it or add it to my favorites list.   Sometimes, or a few hours later, I can't even find it again. I think this would be good for when you're viewing questions at work and want to check it up at home but can't because it's not in the same browser history. I have a file with a number of lines in a file filename.  I want to count how many lines start with character 'a', with 'b' and so on in one go.  What command i should execute.?