For the following example, is there a way to get the type of a and b as int and string?   class test(object):     def __init__(self):         self.a = 1         self.b = "abc"  test_obj = test() for var in vars(test_obj):      print type(var) # this just returns string type as expected (see explanation below)
How do I find out a name of class that created an instance of an object in Python if the function I am doing this from is the base class of which the class of the instance has been derived?  Was thinking maybe  might have helped me out here, but it doesn't seem to give me what I want. And short of parsing the __class__ member, I'm not sure how to get at this information.
A real $2 \times 2 $ matrix $M$ such that $M^2 = \tiny \begin{pmatrix} -1&0 \\ 0&-1-\epsilon \\ \end{pmatrix}$ , then : A real $2 \times 2 $ matrix $M$ such that $$M^2 =  \begin{pmatrix} -1&amp;0 \\ 0&amp;-1-\epsilon  \\   \end{pmatrix}$$ (a) exists for all $\epsilon &gt; 0$. (b) does not exist for any $\epsilon &gt; 0$. (c) exists for some $\epsilon &gt; 0$. (d) None of the above is true.  Attempt: I couldn't think of any theory base to prove / disprove the existence of such a matrix. Could someone please give me a hint on how to go about this problem? Thank you very much for your help in this regard. How do I remove duplicates from a C# array? I have been working with a string[] array in C# that gets returned from a function call. I could possibly cast to a Generic collection, but I was wondering if there was a better way to do it, possibly by using a temp array.  What is the best way to remove duplicates from a C# array? Advanced search criteria for bounty questions? All active questions with awarded bounty can be seen in the Featured tab. However, there seems to be way to make searches to the contents of any particular question tab.  I realize that this is pretty much a duplicate of  but it has no clear answer whether there are any plans of supporting bounty searching or not.  So, could there possibly be a hasbounty:1 advanced search criteria? How do I iterate over a range of numbers defined by variables in Bash? This is a generic inquiry on the common practice/standard for determining the acceptable values of RMS when georeferencing topographic maps.  Is there an absolute value?  Some literature suggests that it should be "less than or equal to 1/2 of the side of a cell which make up the total resolution of the image." How do I end a Tkinter program? Let's say I have this code:  from Tkinter import *  def quit():     # code to exit  root = Tk() Button(root, text="Quit", command=quit).pack() root.mainloop()   How should I define the quit function to exit my application? I noticed that after joining a table to a shapefile the headers of each fields in the table used for the join are changed by QGIS and they are attributed to a different name.  For instance, I had a shapefile with vegetation_codes and a table with vegetation_codes and veg_definition (these were the headers). After joining the table to the shapefile and also saving the shapefile and creating a new one, the vegetation_classes header was changed into vegetati_1.  Is there a way to keep the original headers?  I am using QGIS Dufour on Windows 7 and the table that I join to the shapefile is CSV (tried with dbf as well and the problem is the same). Proving an entire, complex function with below bounded modulus is constant. How would I show that an entire function $f$ with the property $|f(z)| \geq 1$ must be constant?    I'm aware of Liouville's theorem, just not sure how to apply it here. Detect init system using the shell How to correct for small p-value due to very large sample size Combining php arrays I have the following arrays in PHP (okay they are a bit bigger but the idea is what counts).  $array1 = array(1 =&gt; 'a', 2 =&gt; 'b'); $array2 = array(3 =&gt; 'c', 4 =&gt; 'd');   Essentially I want to combine the two arrays as if it were something like this  $array3 = array(1 =&gt; 'a', 2 =&gt; 'b', 3 =&gt; 'c', 4 =&gt; 'd');   Thanks Proof of the duality of the dominance order on partitions Could anyone provide me with a nice proof that the  $\leq$ on partitions of an integer $n$ satisfies the following: if $\lambda, \tau$ are 2 partitions of $n$, then $\lambda \leq \tau \Longleftrightarrow \tau &#39; \leq \lambda &#39;$, where $\lambda&#39;$ is the conjugate partition of $\lambda$ (i.e. the transpose of the set of 'dots' which $\lambda$ represents).   I feel like there must be a nice clever and concise/intuitive proof of this, but all I can come up with is an ugly brute force approach based on the definition of sums of the components $\lambda_i$. Could anyone suggest a particularly nice way to obtain this result? Many thanks. Direct product of abelian groups Let $G_1,\dots,G_n$ be groups. Prove that the direct product $G_1\times\cdots\times G_n$ is abelian if, and only if, each of $G_1,\dots,G_n$ is abelian. To prove that the direct product is abelian is straightforward but what I don't understand is the converse. How to add home directory path to be discovered by Unix which command? If we have a point charge and outside of it we have a non-conducting Gaussian sphere, then Gauss's law says that the net flux should be zero. I agree that the total field lines coming in are equal to the number of field lines coming out, but isn't it true that the magnitude of the electric field at those segments of the sphere where the field is coming in is greater than those where it is coming out? So when we integrate, wouldn't these areas, having a greater electric field, contribute more to the net flux? I don't see why they would cancel each other out. Can I leave South Africa before my 90 days expire, and return after a few days to stay for another 90 days? How many times can an Australian leave and re-enter South Africa (90 days at a time without a visa) in a year, and do they need to be out of the country for a certain period of time before they re-enter?  I want to be in South Africa for as long as I can, however as an Australian without a visa I can only stay for 90 days at a time. What I would like to do is simply leave South Africa and go to another country in Africa for a few days, before returning with a new 90 day allowance.    Is this possible, or must I wait a certain period before re-entering South Africa/is there a limit to the amount of times I can do this in one year? Does there exist a function $f: \mathbb{R} \to \mathbb{R}$ having the following properties?   $f(x) = 0$ for all $x \le 0$. $f(x) = 1$ for all $x \ge 1$. For $0 &lt; x &lt; 1$, $f$ is strictly increasing. $f$ is everywhere $C^\infty$. The sequence of $L^\infty$ norms $\langle \left\lVert f \right\rVert_\infty, \left\lVert f' \right\rVert_\infty, \left\lVert f'' \right\rVert_\infty, \dots \rangle$ is bounded.   If we impose only the first four conditions, there is : for $0 &lt; x &lt; 1$, define $f(x)$ by $$ f(x) = \frac{e^{-1/x}}{e^{-1/x} + e^{-1/(1-x)}} = \frac{1}{1 + e^{1/x - 1/(1-x)}} $$ However, the derivatives of this function appear to grow quite rapidly. (I'm not sure how to verify this, but it seems at least exponential to me.)  If such a function does not exist, what is the smallest order of asymptotic growth that the sequence $\langle \left\lVert f \right\rVert_\infty, \left\lVert f' \right\rVert_\infty, \left\lVert f'' \right\rVert_\infty, \dots \rangle$ can have? Are files created in "/storage/emulated/0" supposed to appear in "/storage/sdcard0"? From what I guess, internal storage is available by every user. If emulated storage is a storage location, made for a specific user, are files created in /storage/emulated/0 supposed to appear in /storage/sdcard0? I assume no, because files that are user created should show up in emulated only, otherwise files created by the user would be available for all other users to see. Enumeration within self defined environment My self defined environment having a symbol at the beginning and at the end works fine for text without enumeration. When including enumerate the symbols are not there where desired. Is it possible to have the first symbol directly in front of &quot;1.&quot; i. e. in the same line and the ending symbol in the same line as the last line of the enumeration? With \ignorespacesafterend and \unskip I did not succeed. \documentclass{article} \usepackage{amssymb} \newenvironment{myenv}{$\blacktriangleright$}{\hfill$\blacktriangleleft$}  \begin{document} There is a text.  \begin{myenv} And an example \end{myenv}  Here is another text.  \begin{myenv} \begin{enumerate} \item A \item B \end{enumerate} \end{myenv}  \end{document} How can I handle the warning of file_get_contents() function in PHP?