Let a be a 2-dimentional list with each element being a set. For example, let a be a (3,3) list, I initialize as follows a = [set()] * 3 a = [a] * 3  I now want to assign a[1][1] with another set. I do a[1][1] = set([1,2,3])  But in doing this, not only a[1][1], but also a[0][1] and a[2][1] are assigned to this new set. It's so weird to me. How does this happen? How should I correct it? Thanks!!  I set a to be a 2D list array because I want a to work like a = cell(3,3) as in Matlab.
I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?
Linux: Case-INSENSITIVE Filesystem Remove Reviewer and Steward badges Badges should encourage good behaviour. But what when a badge encourages more bad behaviour than good?  We hear it all the time - robo reviewers, badge-hunters. The review system fights with that users that only want badges and not want to help.  There are many suggestions how to find such robo-reviewers or how to make it difficult to robo-review. But why not cut them off at the source? Don't make them want to review for badges at all.  Remove the Reviewer and Steward badges! The Custodian Bronze badge should suffice to bring a user to the review system. And we really only want users doing reviews who want to help and not doing it for the badges. LaTeXiT is cropping the pdf I am using LaTeXiT (pierre chachatelier, www.chachatelier.fr) - latex equation editor for Powerpoint for mac.  It's producing pdf that appear to be "cropped" on top (see attached) - I've tried already with changing the "margins" option (Preferences>General) but unsuccessfully - don't think that's the problem.   Any hint?   Thanks I would like some help with this exercise.  Suppose that $f_1,\ f_2 \in V^*$ and that $\text{Ker} f_1 = \text{Ker} f_2$. Show that $f_1 = k f_2$ for some scalar $k$.  I expect your suggestions.  Thanks! Java FileReader encoding issue I tried to use java.io.FileReader to read some text files and convert them into a string, but I found the result is wrongly encoded and not readable at all.  Here's my environment:   Windows 2003, OS encoding: CP1252 Java 5.0   My files are UTF-8 encoded or CP1252 encoded, and some of them (UTF-8 encoded files)  may contain Chinese (non-Latin) characters.  I use the following code to do my work:     private static String readFileAsString(String filePath)     throws java.io.IOException{         StringBuffer fileData = new StringBuffer(1000);         FileReader reader = new FileReader(filePath);         //System.out.println(reader.getEncoding());         BufferedReader reader = new BufferedReader(reader);         char[] buf = new char[1024];         int numRead=0;         while((numRead=reader.read(buf)) != -1){             String readData = String.valueOf(buf, 0, numRead);             fileData.append(readData);             buf = new char[1024];         }         reader.close();         return fileData.toString();     }   The above code doesn't work. I found the FileReader's encoding is CP1252 even if the text is UTF-8 encoded. But the JavaDoc of java.io.FileReader says that:     The constructors of this class assume   that the default character encoding   and the default byte-buffer size are   appropriate.   Does this mean that I am not required to set character encoding by myself if I am using FileReader? But I did get wrongly encoded data currently, what's the correct way to deal with my situtaion? Thanks. I need to get a nice picture about how electron moves around nucleus? I find concept of probability and orbitals quite difficult to understand? A fly in an accelerating car A fly is flying around in a car, the fly never touches any surface in the car only fly’s around in the air inside the car. The car accelerates. does the fly slam in to the rear window. or does the fly continue to fly uninterrupted? How Do I Apply to Become a Marketplace Creator? So I wanted to make some minecoins and I also heard that anyone become a marketplace creator could but I don't know where to apply. I'm in Minecraft Pocket Edition 1.14.30. Can you tell me where I can apply? Choice of ECC curve on USB token I would like to get a USB token to secure my keys. My use case is protection of 3 GnuPG keys that I will be using 10 times per day at least. I plan to create a new key ring from scratch. Because ECC seems more future-oriented than RSA, this is what I chose to use. I'm wondering which USB token to choose as well as which curve.  On  it is said that many people think curves recommended by the NIST or defined by Brainpool have a doubtful origin; therefore, they recommend the non-standardized Bernstein’s Curve 25519. On  one poster says that    He is not aware of any profound criticism of Brainpool curves, and Bernstein’s Curve 25519 is hard to protect against side-channel attacks when implemented in embedded devices.   As a result, I'm a bit lost as to which key/curve to choose. Inverse of a Positive Definite Let K be nonsingular symmetric matrix, prove that if K is a positive   definite so is $K^{-1}$ .   My attempt:  I have that $K = K^T$ so $x^TKx = x^TK^Tx = (xK)^Tx = (xIK)^Tx$ and then I don't know what to do next. Prove $\frac{a+b+c}{abc} \leq \frac{1}{a^2} + \frac{1}{b^2} + \frac{1}{c^2}$. So I have to prove $$ \frac{a+b+c}{abc} \leq \frac{1}{a^2} + \frac{1}{b^2} + \frac{1}{c^2}.$$  I rearranged it   $$ a^2bc + ab^2c + abc^2 \leq b^2c^2 + a^2c^2 + a^2b^2 .$$  My idea from there is somehow using the AM-GM inequality. Not sure how though. Any ideas?  Thanks How to remove selected commit log entries from a Git repository while keeping their changes? I would like to remove selected commit log entries from a linear commit tree, so that the entries do not show in the commit log.  My commit tree looks something like:  R--A--B--C--D--E--HEAD   I would like to remove the B and C entries so that they do not show in the commit log, but changes from A to D should be preserved. Maybe by introducing a single commit, so that B and C become BC and the tree looks like.  R--A--BC--D--E--HEAD   Or, ideally, after A comes D directly. D' representing changes from A to B, B to C and C to D.  R--A--D'--E--HEAD   Is this possible? if yes, how?  This is a fairly new project so has no branches as of now, hence no merges as well. Assign multiple keyboard shortcuts for one action Troubleshooting why Powerbank Doesn't Charge Cell Phone I have powerbank that provides 5v (presumably regulated) power, as typical of most usb interface powerbanks. I have been trying out my powerbank with different phones. It works on all except one. I have tried it with various USB cables, making sure I didn't overlook anything foolish. Then, I looked at the AC adapter of the phone that it didn't seem to be compatible with. The adapter read: 5.4v DC output. The device's official website or manual doesn't tell me what the input voltage should be. So I have the following questions   Is the fact that the device's AC adapter creates a DC 5.4v output enough to assume that, this is the correct voltage for my cell phone? If 5.4v is the input voltage, then when I attempt to power it with a 5v power bank, am I hurting it? Thus far, it just seems to be non-responsive when I try this. It seems another explanation is polarity mismatch. I'm aware that laptops have a polarity correction feature, which could explain why I can charge this phone via my laptop. Is there any other way to tell if polarity is an issue, given that I don't have access to detailed product information (unless the official website is updated, or something)   So that's the gist of it, I'm not sure why my powerbank isn't charging my phone. And I'm having difficulty troubleshooting the underlying problem by myself. Any tips big or small will be appreciated. I would like to open all chapters of my PDF ebooks in the same window but neither evince nor okular seems to be capable of doing that (at least not out-of-the-box).  Is there a way to work this out? Alternatives to "and/or"? For $p$ prime, show that $\Phi_{p^n}(x) = 1 + x^{p^{n-1}} + x^{2p^{n-2}} + \dots +x^{(p-1)^{p^n-1}}$ Well I attempted to try this but I failed to solve it: So $$\Phi_{p^{n}}(x)= \frac{x^{p^{n}} - 1}{\Phi_{1}(x) \Phi_{p^{2}}(x) \dots \Phi_{p^{n-1}}(x)}$$  Now I'm just stuck here. I saw a result somewhere on the net that said $\Phi_{p^n}(x) = \Phi_p(x^{p^{n-1}})$. I would just use that, but I don't see why that result is true or know how to show that's true.  How do I approach this? Let $p\in[1,\infty]$, $a\in\ell^\infty$ and $$T:\ell^p\to\ell^p\;,\;\;\;x\mapsto ax.$$ Note that $\left\|T\right\|=\left\|a\right\|_{\ell^\infty}$. It's easy to see that if $a\in\ell^1$, then $T$ is nuclear and hence compact.  Can we more generally conclude that $T$ is compact?  Assume $p&lt;\infty$. The intuitive approach would be to define $$T_n:\ell^p\to\ell^p\;,\;\;\;x\mapsto(a_1x_1,\ldots,a_nx_n,0,\ldots)$$ for $n\in\mathbb N$ and to show that $\left\|T_n-T\right\|\to0$. Now, $$\left\|(T_n-T)x\right\|^p=\sum_{i=n+1}^\infty|a_ix_i|^p\tag1$$ for all $x\in\ell^p$ and $n\in\mathbb N$. The right-hand side of $(1)$ clearly converges to $0$ as $n\to\infty$, but this only yields convergence in the strong operator topology. On the other hand, if $(a_n)_{n\in\mathbb N}$ would be nonincreasing and $a_n\to0$ (e.g. $a_n=\frac1n$), then $$\left\|(T_n-T)x\right\|^p\le|a_{n+1}|^p\left\|x\right\|_{\ell^p}^p\tag2$$ for all $x\in\ell^p$ and $n\in\mathbb N$ and we could immediately conclude $\left\|T_n-T\right\|\to0$. EDIT: Maybe the general result can be obtained from the convergence in strong operator topology (which holds by $(1)$) by noting that $\ell^p$ has the approximation property; but I'm not sure whether this is true. Why am I seeing a bomb icon on my files and folders in Ubuntu? Templated check for the existence of a class member function? Is it possible to write a template that changes behavior depending on if a certain member function is defined on a class?  Here's a simple example of what I would want to write:  template&lt;class T&gt; std::string optionalToString(T* obj) {     if (FUNCTION_EXISTS(T-&gt;toString))         return obj-&gt;toString();     else         return "toString not defined"; }   So, if class T has toString() defined, then it uses it; otherwise, it doesn't. The magical part that I don't know how to do is the "FUNCTION_EXISTS" part.