I have a simple task: in addition to measuring the time it takes to execute a chunk of code in Python, I need to measure the amount of memory a given chunk of code needs.  IPython has a nice utility called timeit which works like this:  In [10]: timeit 3 + 3 10000000 loops, best of 3: 24 ns per loop   What I'm looking for is something like this:  In [10]: memit 3 + 3 10000000 loops, best of 3: 303 bytes per loop   I'm aware that this probably does not come built in with IPython—but I like the timeit-memit analogy.
I want to know the memory usage of my Python application and specifically want to know what code blocks/portions or objects are consuming most memory. Google search shows a commercial one is  (Windows only).  And open source ones are  and .  I haven't tried anyone, so I wanted to know which one is the best considering:   Gives most details. I have to do least or no changes to my code.
Cubic polynomial with three (distinct) irrational roots I am looking for an equation     $$x^3+ax^2+bx+c=0, \qquad a, b, c \in \Bbb Z,$$   of degree $3$ that has $3$ different roots.  For an equation of degree $2$ it is easy---for example $x^2-2=0$---but I can't find an example for degree $3$.  if there is a method for finding this kind of Equation I will be grateful. I'm trying to recall the name of a book I read, probably published after 1990, where alien AI infects satellites and a barrier is established, isolating earth from space that maybe slows down time inside of it, relative to the passage of time outside.  Mars or the moon is also colonized in an attempt to flee the now real possibility that the sun will become a red giant and wipe out humanity in the not-too-distant future (as perceived on earth), but the colony gets one of the time barriers as well.  I think the name of the novel was short, "The _______" (one word).  The story focused more on the human cost and followed one particular family, one member of which was somehow also partially infected by the alien AI, but I don't remember as much about them. In this video, a college basketball player steals the ball, races down court, and avoids the defender by throwing a pass to himself off the backboard.    In all the (disorganized) basketball games I've played in, a shot had to hit the rim before the shooter was allowed to rebound. And that looks like a shot to me.  Obviously the officials allowed it, but I couldn't find an explicit mention in the . Is this ruled as a shot, and if so, why is it legal? I'd be interested in the answer for any level of basketball, though NCAA is the most relevant. How do I install the latest  on Ubuntu? I've been looking around, and I can't find anything. Is there a Ubuntu package for node.js, or do I have to compile it myself? Select top 10 records for each category I want to return top 10 records from each section in one query. Can anyone help with how to do it?  Section is one of the columns in the table.  Database is SQL Server 2005. I want to return the top 10 by date entered.  Sections are business, local, and feature.  For one particular date I want only the top (10) business rows (most recent entry), the top (10) local rows, and the top (10) features. Should I upgrade my body or lens first? Defend against flag spam in chat We have incidents where we get 10+ flags from the same room in rapid succession. This happens on multiple occasions and we have reason to believe it's a single user doing this.  I don't think it's of value to allow a single user to flag more then n messages in a small time period.  If we could have some anti-flag spam measures put in place, then that would be great. Have you ever had a case where you felt compelled to include strange things like a double that in a sentence? If so, then what did you do to resolve this?  For me, I never knew whether it was acceptable grammar. However, what I did learn was that it was a logic distractor, could lead to confusion, and therefore should be reworded to avoid this. How can I create a coffee cream effect with Photoshop? Today I would like to create a coffee cup with the cream floral on it as a text by using Photoshop. It looks like you order a cup of hot cappuccino and the bartender will draw a flower with cream on the surface of coffee but now I want to make it like a text to present a tittle.     I just need to do the cream text effect, no need to draw the whole cup of coffee since i can't use some images. So anyone can tell me how to do this cream effect on Photoshop.  Thanks in advance for any feedback! Why are all nonzero eigenvalues of the skew-symmetric real matrices pure imaginary? Assume that $A$ is an $n\times n$  real matrix, i.e. $$A^T=-A.$$  Since $\det(A-\lambda I)=\det(A^T-\lambda I)$, $A$ and $A^T$ have the same eigenvalues. On the other hand, $A^T$ and $-A$ also have the same eigenvalues. Thus if $\lambda$ is an eigenvalue of $A$, so is $-\lambda$. If $n$ is odd, $\lambda = 0 $ is an eigenvalue.  A curious search in Google returns  the nonzero eigenvalues of $A$ are all pure imaginary and thus are of the form $iλ_1, −iλ_1, iλ_2, −iλ_2,$ … where each of the $λ_k$ are real.   Here is my question:     How can I prove the fact that "the nonzero eigenvalues of $A$ are all pure imaginary"? Measuring accuracy of a logistic regression-based model How can I combine two or more querysets in a Django view? I am trying to build the search for a Django site I am building, and in that search, I am searching in three different models. And to get pagination on the search result list, I would like to use a generic object_list view to display the results. But to do that, I have to merge three querysets into one. How can I do that? I've tried this: result_list = [] page_list = Page.objects.filter(     Q(title__icontains=cleaned_search_term) |     Q(body__icontains=cleaned_search_term)) article_list = Article.objects.filter(     Q(title__icontains=cleaned_search_term) |     Q(body__icontains=cleaned_search_term) |     Q(tags__icontains=cleaned_search_term)) post_list = Post.objects.filter(     Q(title__icontains=cleaned_search_term) |     Q(body__icontains=cleaned_search_term) |     Q(tags__icontains=cleaned_search_term))  for x in page_list:     result_list.append(x) for x in article_list:     result_list.append(x) for x in post_list:     result_list.append(x)  return object_list(     request,     queryset=result_list,     template_object_name='result',     paginate_by=10,     extra_context={         'search_term': search_term},     template_name=&quot;search/result_list.html&quot;)  But this doesn't work. I get an error when I try to use that list in the generic view. The list is missing the clone attribute. How can I merge the three lists, page_list, article_list and post_list? My English teacher feels very strongly that exact same is redundant and therefore incorrect. I disagree with her.  She feels that exact should be used in place of exact same, but I have rarely heard someone use exact by itself. For example:     I have the exact same shirt   I have the exact shirt   In the same manner, I believe that she shuns exactly the same as well.  What support is there (if any) supporting the use of exact same or exactly the same? What proof can I provide for using exact same when challenged? Suppose $K \subset L$ is a finite field extension of degree $m$. Is it true that there exists some natural $n$ such that $L$ is isomorphic to a subfield of $M^{n\times n}(K)$, the ring of $n\times n$ matrices with entries in $K$? What is the smallest dimension (as a function of $m$) for which an isomorphism exists?  The example I had in mind was the 2-dimensional extension $\mathbb{R} \subset \mathbb{C}$ with $\mathbb{C}$ being isomorphic to $\{ \begin{pmatrix}a&amp;-b\\b&amp;a\end{pmatrix} : a, b \in \mathbb{R}\}$. I'm trying to use biblatex and when I compile my document I get an error like the following:  Windows  data source C:\Users\&lt;username&gt;\AppData\Local\Temp\par-5061756c\ cache-890efc00b3ca6b775c7d44a325c1349fb2a3a3bd\inc\lib/Biber/LaTeX/recode_data.xml not found in .   Mac  data source /var/folders/v2/rld0ls7d2935gkvqv5hfr1x00000gn/T/par-616c616e/ cache-cdd483146f82a9655ce063f848d5139480fbf872/inc/lib/Biber/LaTeX/recode_data.xml not found in .   Linux  data source /tmp/par-6963617269756d/cache-f37ab610b7d79b2720a8ee3732849c6821705520 /inc/lib/Biber/LaTeX/recode_data.xml not found in . Observe the following results for searching the text "dictionary" on Google:    Notice that there is a custom search box at the bottom of the listing for dictionary.reference.com. Is there any documentation floating around that explains the criterion by which Google decides to display such a search box? I have lecture notes with the claim $(C_b(X), \|\cdot\|_\infty)$, the space of bounded continuous functions with the sup norm is complete.  The lecturer then proved two things, (i) that $f(x) = \lim f_n (x)$ is bounded and (ii) that $\lim f_n \in \mathbb{R}$.  I don't understand why it's not enough that $f$ is bounded. I think the limit of a sequence of continuous functions is continuous and then if $f$ is bounded, it's in $C_b(X)$. So what is this $\lim f_n \in \mathbb{R}$ about? Many thanks for your help. Error message: qgis_core.dll missing I have a fresh install of QGIS 2.4. When trying to open a .shp file I get the error message below.  I've followed their advice and have done several re-installs and also cleared all qgis files from my system (Parallels on Mac OS X 10.6) before those re-installs. I've tried QGIS 2.2 which caused the same problem.  Funnily all worked for a day, the following day and since not anymore...  Has anyone come across this before? Idiom or expression criticizing people who ignore you right after getting what they wanted/ were after How to deal with hierarchical / nested data in machine learning