Django model field: Checking "if field is not None" vs. "if field"
Why is "if not someobj:" better than "if someobj == None:" in Python?
the problem of using "~\\" and blank line Recently,I found the code that cotains the"~\\" and blank line always shows the warning imformation "Underfull \hbox (badness 10000) in paragraph at lines"  \documentclass{ctexart} \usepackage{color} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{epstopdf} \hfuzz=\maxdimen   $(A \pm  B)^{-1} \neq A^{-1} \pm B^{-1}$,$(A \pm  B)^* \neq A^* \pm B^*$~\\  $|(A^*)^*|=|A|^{n^2-2 n+1}$~\\  \end {document}   I add the code:  \tolerance=10000 \hbadness=10000 \begin{document}   However,fail to solve it! How to delete column/field in PyQGIS? Solving trigonometric equations of the form $a\sin x + b\cos x = c$ Suppose that there is a trigonometric equation of the form $a\sin x + b\cos x = c$, where $a,b,c$ are real and $0 &lt; x &lt; 2\pi$. An example equation would go the following: $\sqrt{3}\sin x + \cos x = 2$ where $0&lt;x&lt;2\pi$.  How do you solve this equation without using the method that moves $b\cos x$ to the right side and squaring left and right sides of the equation?  And how does solving $\sqrt{3}\sin x + \cos x = 2$ equal to solving $\sin (x+ \frac{\pi}{6}) = 1$ I came across this strange code snippet which compiles fine:  class Car {     public:     int speed; };  int main() {     int Car::*pSpeed = &amp;Car::speed;     return 0; }   Why does C++ have this pointer to a non-static data member of a class? What is the use of this strange pointer in real code? Mysterious! Beamer itemize has no bullets after adding a few packages this is my first time using beamer.  I copied a template from the sharelatex page on Beamer  Which works, and \begin{itemize} shows bullets     But after adding a few more packages that I need, all the bullets are gone!    What is going on and how can I fix this?  \documentclass{beamer}  \usepackage[utf8]{inputenc}    \usepackage{amsmath}  \usepackage{amsthm}     %Theorem Environment  \usepackage{amssymb}  \usepackage{multirow}  \usepackage{cancel}  \usepackage{amsfonts}  \usepackage{graphicx}  \usepackage{subfigure}  \usepackage{upgreek}     \usepackage{mathtools}  \usepackage{thmtools}  \usepackage{enumitem}       %Information to be included in the title page: \title{Sample title} \author{Anonymous} \institute{ShareLaTeX} \date{2014}  \begin{document}    \frame{\titlepage}    \begin{frame}  \frametitle{Sample frame title}  \begin{itemize} \item  This is a text in first frame.  \item This is a text in first frame. \item This is a text in first frame.  \end{itemize}  \end{frame}  \end{document} "wait more than" vs. "wait FOR more than" If you make him wait (for) more than ten minutes, he'll just walk away.  I found both instances on Google Books:  and . So I'm a bid confused. This question relates to a discussion on . Euclid's proof of the infinitude of primes is an indirect proof (a.k.a. proof by contradiction, reductio ad absurdum, modus tollens). My understanding is that Intuitionists reject such proofs because they rely on the Law of the Excluded Middle, which they don't accept. Does there exist a direct and constructive proof of the infinitude of primes? Perform feature normalization before or within model validation? What is the right way to consistently mangle bash terminal? I'm on OSX 10.11.1 and occasionally my bash terminal gets mangled. It often happens when I accidentally cat a binary file. The result can be seen on the image below. The output becomes weird, and I can't type ascii characters anymore.    Even though this happens occasionally, I couldn't find a way to consistently reproduce the issue. Online search recommends doing cat /bin/*, but that works sporadically, only after a couple dozen tries.  I want to do this so I can find an easy solution how to handle this in tmux.  How do I consistently get bash to a "mangled" state? Is there maybe a magic unicode character that can do this? I want to do something like:  MyObject myObj = GetMyObj(); // Create and fill a new object MyObject newObj = myObj.Clone();   And then make changes to the new object that are not reflected in the original object.  I don't often need this functionality, so when it's been necessary, I've resorted to creating a new object and then copying each property individually, but it always leaves me with the feeling that there is a better or more elegant way of handling the situation.  How can I clone or deep copy an object so that the cloned object can be modified without any changes being reflected in the original object? How do I get useful SQL Server database performance statistics? We currently have several shared SQL Server servers and instances in our organization. They are going with a different architecture where business units will get their own SQL Server instances. We have SQL Server 2008R2.  In the past, databases were put on servers in a more or less random fashion -- business use and disk space were the main drivers.  I've been tasked with coming up with a plan for allocating our 50+ databases across 3 servers (one instance per server). My criteria for divvying them up is as follows:   Business critical db's should be spread across the servers. i.e. avoid lumping a bunch of business critical db's all one server.   For the remainder of the non-mission critical db's, consider: a. Disk space usage b. I/O usage -- memory, CPU, etc.     1 and 2a are easy for me to figure out. I know how to get data file sizes.   My question is with that last bit - 2b. I do not know how relevant this is, what specific stats to look at, or how to get them.   Frankly, I'm not 100% sure how to phrase this question! I think I basically want to know is, "How 'busy' is this db -- however you define 'busy'?" Or maybe, "How does this db impact the performance of the server?"  I mean, disk space is important -- but it could (in theory) have a ton of rows or binary objects in there that are not written very often, so it has little impact on the performance of the server. I think I would want to know how much impact a db within a date range.  Is there a way to get these kind of general stats? I'm not looking for expensive queries, detailed user stats, or query optimization here. I'm aware of the SSMS reports, but they seem to be more real-time. The end goal is to divide up our current databases into evenly balanced buckets, and I would think performance is one way to do that.  Thoughts? Wisdom? Any other ideas on how to divvy up the db's?  Thanks! Tom How do I sort a dictionary by value? Async call generates " Error: Can't wait without a "fiber", even with _wrapAsync Initializing C# auto-properties I'm used to writing classes like this:  public class foo {   private string mBar = "bar";   public string Bar {     get { return mBar; }     set { mBar = value; }   }   //... other methods, no constructor ... }   Converting Bar to an auto-property seems convenient and concise, but how can I retain the initialization without adding a constructor and putting the initialization in there?  public class foo2theRevengeOfFoo {   //private string mBar = "bar";   public string Bar { get; set; }   //... other methods, no constructor ...   //behavior has changed. }   You could see that adding a constructor isn't inline with the effort savings I'm supposed to be getting from auto-properties.  Something like this would make more sense to me:  public string Bar { get; set; } = "bar"; Approximating commuting matrices by commuting diagonalizable matrices Suppose the matrices $A$ and $B$ commute. Do there exists sequences $A_n$ and $B_n$ of matrices such that   $A_n \rightarrow A$, $B_n \rightarrow B$.  Each $A_n$ is diagonalizable  and the same for each $B_n$.  For every $n$, $A_n$ commutes with $B_n$.    Moreover, it would be nice if the following property was additionally satisfied: if $A,B$ are real, then $A_n,B_n$ can be chosen to be real as well. Find the minimal polynomial for $\sqrt[3]{2} + \sqrt[3]{4}$ over $\mathbb{Q}$  I havent covered galois theory, this is an exercise from the chapter algebraic extensions in gallian.  I can see that $\sqrt[3]{2} + \sqrt[3]{4}$ $\in \mathbb{Q}(2^{1/3})$, after this I am clueless.  Need hints will finish the proof. Can a full version of Ubuntu be Installed on a USB Drive? How do I create a deb package for a single python script? I have a single python script that I want to distribute as a deb package. It is a  which shows local date in Unity panel. I did follow  but I could not create a deb package because it fails.   Can someone give me a step-by-step instruction on what I should do? As far as I know this script depends on python-appindicator.   NOTE: I do not want any links to Debian/Ubuntu packaging instructions. I have seen most of them. I don't find them beginner friendly. Update to Windows 10: What is going to happen to my data and apps? I have Windows 8.1 Update, if I update to Windows 10 when it becomes available what is going to happen to my data and apps?  Of course I have to do a backup, but I wonder if the data will be overwritten or not. How to disprove this fallacy that derivatives of $x^2$ and $x+x+x+\dots\quad(x\text{ times})$ are not same. Possible Duplicate:          \begin{align*} x^2 &amp;= \underbrace{x + x + x + \dots + x}_{x \text{ times}}, \\ \therefore \frac{\mathrm{d}}{\mathrm{d}x} (x^2) &amp;= \frac{\mathrm{d}}{\mathrm{d}x} (\underbrace{x + x + x + \dots + x}_{x \text{ times}}) \\ &amp;= \underbrace{1 + 1 + 1 + \dots + 1}_{x \text{ times}} \\ &amp;= x. \end{align*}  But we know that $$ \frac{\mathrm{d}}{\mathrm{d}x} (x^2) = 2x. $$  So what is the problem?  My take is that we cannot differentiate both sides because $\underbrace{{x+x+x+\cdots+x}}_{x \text{  times}}$ is not fixed and thus $1$ is not equal to $2$.