Apologies for a question that seems very basic/trivial but I don't understand the following behaviours:  &gt;&gt;&gt; id_1 = id(256) &gt;&gt;&gt; id_2 = id(256) &gt;&gt;&gt; id_1 == id_2 True &gt;&gt;&gt; id_1 = id(257) &gt;&gt;&gt; id_2 = id(257) &gt;&gt;&gt; id_1 == id_2 False  &gt;&gt;&gt; id_1 = id("ab") &gt;&gt;&gt; id_2 = id("ab") &gt;&gt;&gt; id_1 == id_2 True &gt;&gt;&gt; id_1 = id("aa") &gt;&gt;&gt; id_2 = id("aa") &gt;&gt;&gt; id_1 == id_2 False &gt;&gt;&gt; id_1 = id('  ') &gt;&gt;&gt; id_2 = id('  ') &gt;&gt;&gt; id_1 == id_2 False  &gt;&gt;&gt; id_1 = id(('A', 'Z')) &gt;&gt;&gt; id_2 = id(('A', 'Z')) &gt;&gt;&gt; id_1 == id_2 True &gt;&gt;&gt; id_1 = id(('A', 'Z', 'AA')) &gt;&gt;&gt; id_2 = id(('A', 'Z', 'AA')) &gt;&gt;&gt; id_1 == id_2 False   What is the difference between the special cases which always give the same object reference/address given by the builtin function id (The once I saw are 0-256, both inclusive, 'a'-'z', 'A'-'Z')?
Why does the following behave unexpectedly in Python?  &gt;&gt;&gt; a = 256 &gt;&gt;&gt; b = 256 &gt;&gt;&gt; a is b True           # This is an expected result &gt;&gt;&gt; a = 257 &gt;&gt;&gt; b = 257 &gt;&gt;&gt; a is b False          # What happened here? Why is this False? &gt;&gt;&gt; 257 is 257 True           # Yet the literal numbers compare properly   I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100.  Based on the above, I can hypothesize that Python is internally implemented such that "small" integers are stored in a different way than larger integers and the is operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not?
Isomorphism between $\mathfrak o(4,\mathbb R)$ and $\mathfrak o (3,\mathbb R) \oplus\mathfrak o (3,\mathbb R) $ Express symmetric polynomial $\prod_{i < j} (X_i+X_j)$ in terms of elementary symmetric functions Exercise: Define a polynomial $\Sigma(X_1,\ldots,X_n)$ as \begin{align*} \Sigma(X_1,\ldots,X_n) = \prod_{i &lt; j} (X_i+X_j) \end{align*} This is a symmetric polynomial, quite clearly. I want to express $\Sigma$ as a polynomial in the elementary symmetric functions, for $n=2,3,4$. Case $n=2$ is trivial: $\Sigma(X_1,X_2)= \sigma_1 = X_1+X_2$. Case $n=3$ is easy. I write $\Sigma$ as follows: \begin{align*} \Sigma(X_1,X_2,X_3) = (\sigma_1 - X_1)(\sigma_1 - X_2)(\sigma_1 - X_3), \end{align*} then apply  formally, obtaining \begin{align*} \Sigma(X_1,X_2,X_3) = \sigma_1^3 - \sigma_1 \sigma_1^2 + \sigma_2 \sigma_1 - \sigma_3 = \sigma_2 \sigma_1 - \sigma_3. \end{align*} The case $n=4$ seems harder to me, and I'm unable to work it out. I hope there is some trick to avoid unnecessary computations. My attempt is to write down $\Sigma$ completely: \begin{align*} \Sigma = (X_1+X_2)(X_3+X_4)(X_1+X_4)(X_2+X_3)(X_2+X_4)(X_1+X_3) \end{align*} and then multiply factors in groups of two, obtaining: \begin{align*} \Sigma = (\sigma_2 - X_1X_2-X_3X_4)(\sigma_2 - X_1X_4 - X_2X_3)(\sigma_2 - X_2X_4-X_1X_3), \end{align*} but it doesn't seem to help much. How can I solve the exercise? Number of connected components of the complement of a compact Let $X$ be a connected, locally compact space and let $K$ be a compact subset of $X$. Is the number of connected components of the complement $X\setminus K$ finite? If it is not, are there some hypotheses over $X$ for finiteness of connected components? Using CLI, how do I change the user's profile picture? A similar task for changing the desktop background, can be achieved using the following script:   FILE="/backgrounds/background.png" gsettings set org.gnome.desktop.background picture-uri "$FILE"   How would I achieve the same result, but with the user's avatar/profile picture? Solving the diophantine equation $y^{2}=x^{3}-2$ It is known that the diophantine equation $y^{2}=x^{3}-2$ has only one positive integer solution $(x,y)=(3,5)$. The proof of it can be read from the book "About Indeterminate Equation" (in Chinese, by Ke Zhao and Sun Qi). But the method I have known of solving this problem is algebraic number theory.  My question:      Does there exists an elementary method for solving the diophantine equation $y^{2}=x^{3}-2$?   I have gotten an elementary method by the assumption that "$x$" is a prime. That is, we can get a conclusion from the equation that $3\mid x$. Since $x$ is a prime we get the only solution $(x,y)=(3,5)$. But if $x$ is not a prime, the answer seems to be difficult.  Thank you for your help. Table fixed header and scrollable body If I am shooting the 8-ball for a win, and my opponent has a ball near the pocket I'm aiming for, can I call something like "8-ball off the 2 ball into the corner pocket"?  I thought this was allowed, but a friend says this is an automatic loss and that the 8-ball must never touch another ball before going into the pocket.  Various pool rules aren't clear for me on this scenario. UTF-8 all the way through I have a question on Holder space.Is the space $C^2(\mathbb{R}^n)$ embedded in $C^{1,\alpha}(\mathbb{R}^n)$? I think in the bounded domain case, this should be true. But what if in the case where the domain is not bounded? Thanks for any hint! How to delete blank lines starting from line 5 I have this:  sed -i '/^$/d' temp_spec.rb   which is stripping blank lines and works well.  How can I make it only do this for lines 5-999 (or ideally 5 to end-of-file).  I tried:  sed -n5,999 -i '/^$/d' temp_spec.rb sed '5,999!d/^$/d' temp_spec.rb   but neither worked (no errors). Why would my TV image turn black when electrical appliances turn on? Show that $\ker \hat{T} = \text{ann}(\text{range } T)$ This is an old exam problem: Let $V$ and $W$ be finite dimensional vector spaces over a field $F$ and let $T: V \to W$ be a linear transformation. Define $\hat{T}: W^* \to V^*$ by $(\hat{T}(f))(v)=f(T(v))$. Here, $U^*$ denotes the dual vector space $U$. Since $\hat{T}$ is a linear transformation prove $\ker \hat{T} = \text{ann}(\text{range } T)$ where $\text{ann}(Y) = \{g \in U^* : g(y)=0 \text{ for all } y \in Y \}$ for a subspace $Y$ of vector space $U$.  I'm really not sure how to start this problem. Any advice would be great! I am trying to solve an integral in $k$-space where I want to calculate the ratio of the average energy of an arbitrary electronic band ($E(k)=k^n)$ to the square of average group velocity of electrons($v_g   = k^{n-1})$ approximately in the form of this expression given by $$L=\frac{\frac{\sum_{\mathbf{k}}k^{n}}{\sum_{\mathbf{k}}1}}{\left(\frac{\sum_{\mathbf{k}}k^{n-1}}{\sum_{\mathbf{k}}1}\right)^2}\;.$$  Now, I want to do this for $d$-dimensions, so I convert this sum to integral.  $$L=\frac{\dfrac{\int_{0}^{k_f}k^{n} d^d k}{\int_{0}^{k_f}1d^d k}}{\left(\dfrac{\int_{0}^{k_f}k^{n-1}d^d k}{\int_{0}^{k_f}1d^d k}\right)^2}$$ where $d^dk  = \dfrac{d \pi^{d/2}}{\Gamma(\frac{d}{2}+1)}k^{d-1}dk$ is the volume element in $d$-dimensional space.  I want to get a simple expression for $L$ and how it depends with $k_f,n$ and $d$. any physical insight into this integral could also be helpful. Python is quite cool, but unfortunately, its debugger is not as good as perl -d.    One thing that I do very commonly when experimenting with code is to call a function from within the debugger, and step into that function, like so:  # NOTE THAT THIS PROGRAM EXITS IMMEDIATELY WITHOUT CALLING FOO() ~&gt; cat -n /tmp/show_perl.pl 1  #!/usr/local/bin/perl 2 3  sub foo { 4      print "hi\n"; 5      print "bye\n"; 6  } 7 8  exit 0;  ~&gt; perl -d /tmp/show_perl.pl  Loading DB routines from perl5db.pl version 1.28 Editor support available.  Enter h or `h h' for help, or `man perldebug' for more help.  main::(/tmp/show_perl.pl:8):    exit 0;  # MAGIC HAPPENS HERE -- I AM STEPPING INTO A FUNCTION THAT I AM CALLING INTERACTIVELY   DB&lt;1&gt; s foo()  main::((eval 6)[/usr/local/lib/perl5/5.8.6/perl5db.pl:628]:3): 3:      foo();     DB&lt;&lt;2&gt;&gt; s main::foo(/tmp/show_perl.pl:4):     print "hi\n";     DB&lt;&lt;2&gt;&gt; n hi main::foo(/tmp/show_perl.pl:5):     print "bye\n";     DB&lt;&lt;2&gt;&gt; n bye     DB&lt;2&gt; n Debugged program terminated.  Use q to quit or R to restart,   use O inhibit_exit to avoid stopping after program termination,   h q, h R or h O to get additional info.      DB&lt;2&gt; q   This is incredibly useful when trying to step through a function's handling of various different inputs to figure out why it fails.  However, it does not seem to work in either pdb or pydb (I'd show an equivalent python example to the one above but it results in a large exception stack dump).  So my question is twofold:   Am I missing something? Is there a python debugger that would indeed let me do this?   Obviously I could put the calls in the code myself, but I love working interactively, eg. not having to start from scratch when I want to try calling with a slightly different set of arguments. Cannot remove a repository that complains it has no public key I wanted to remove and reinstall the software-center package.  I removed it, but now I can't reinstall.  I tried these commands without success:  sudo apt-get update sudo apt-get install software-center   How can I reinstall software-center?    When I performed the install command this is what I got:  $ sudo apt-get install software-center Reading package lists... Done Building dependency tree        Reading state information... Done Package software-center is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'software-center' has no installation candidate I use Ubuntu 18 and have little experience with Linux commands. I have two files:  file 1:  a,txt1,v1 b,txt2,v2 c,txt3,v1 d,txt4,v2   file2:  a,txt5,v2 b,txt6,v1 c,txt7,v1 d,txt8,v2   I want to print the 1st and 3rd column values where the the 1st column value is identical and the 3rd column value has changed from v1 to v2. So my expected output should be:  a   The second query is for the 3rd column values that has changed from v2 to v1. So my expected outcome:  b Show that there exists a $c\in \mathbb{C}$ such that $f(z)=c \bar{z}$ for all $\vert z\vert=1$. The problem is:  Suppose that $f(z)$ is continuous on a domain $D$ that contains the unit circle, and that $f(z)$ satisfies: $$\vert f(e^{i\theta})\vert \leq M \; \forall \theta \, \in [0, 2\pi )$$ and $$\bigg \vert \int _{\vert z \vert=1} f(z) \text{d}z \bigg \vert =2\pi M $$ show that there exists a $c\in \mathbb{C}$ such that $f(z)=c \bar{z}$ for all $\vert z\vert=1$.  I've tried lots of different approaches such as defining a function $g(z)=\frac{f(z)}{\bar{z}}$ and trying to show that $g'(z)=0$ so that $g$ is constant on the circle, or trying to use some bounding theorems for analytic functions to show that $g$ is constant but this requires $g$ to be analytic. Some other methods were using the Cauchy-Riemann equations but I couldn't find any reason why $g$ should be analytic.  Any help would be greatly appreciated, thanks! I love the subset of collective nouns known as the terms of venery. These are collective nouns specific to a particular group of animals. Some of the more inventive examples are: a murder of crows, a crash of rhinos, a mischief of mice, and a puddling of ducks (specifically swimming ducks).  Is there a standard for these group names and is there a central reference for them as with other zoological taxonomy?  I can see in the Wikipedia articles that the practice has its origins in Medieval Hunting tradition, but the Kangaroo (Mob), for instance would have been unknown at that time, so how do new collections come into being? Order of general- and special linear groups over finite fields.