I'm trying to change the value of a certain element in a 2D array. the 2D array is a num1 by num2 matrix with every element as 0. I'm trying to change the Rth row Cth column of the matrix to 1  matrix = [] def make_matrix(num1, num2):     row = []     for i in range(num1):         row.append(0)     for i in range(num2):         matrix.append(row)  def change_to_one(R, C):     matrix[R-1][C-1] = 1  make_matrix(3, 2) change_to_one(2, 1) print(matrix)   it prints [[1, 0, 0], [1, 0, 0]] instead of [[0, 0, 0], [1, 0, 0]]
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?
Given that $X,Y$ are independent $N(0,1)$ , show that $\frac{XY}{\sqrt{X^2+Y^2}},\frac{X^2-Y^2}{2\sqrt{X^2+Y^2}}$ are independent $N(0,\frac{1}{4})$ It is given that $X,Y \overset{\text{i.i.d.}}{\sim} N(0,1)$  Show that $\frac{XY}{\sqrt{X^2+Y^2}},\frac{X^2-Y^2}{2\sqrt{X^2+Y^2}} \overset{\text{i.i.d.}}{\sim} N(0,\frac{1}{4})$  I was thinking of making polar transformations $X=r \cos \theta, Y=r \sin \theta$  Then I am getting stuck at ranges of $\theta$ Can not move polygons but only vertices of an object by bmesh! Installing Ubuntu 13.04 on a MSATA SSD I am trying to install Ubuntu 13.04 on my 24Gb MSATA SSD. In my laptop, I've also got a 500Gb SATA HDD. I realize that in order for this to work I need to put my /home directory on the 500Gb HDD.   I've tried installing it by creating a ext4 partition on the SSD and a 8Gb swap partition on my HDD. This resulted in an error saying something similar to Cannot install bootloader, please select an other location for the bootloader.   Now before I waste any more time trying to get it to work I'm going to ask a bunch of questions:   Where should I put the swap partition? How big should I make the swap partition? (I've got 12Gb RAM) My 500Gb HDD is currently in Raid mode. Should I change that (to AHCI or IDE)? Where should I put the bootloader if the error message occurs again? How do I make the home directory point to the HDD instead of the SSD? Can I configure Ubuntu to install software/packages on the HDD instead of the SSD? Badge symbol in notification is of the site you're on, not where badge was earned It's so cool that the notification reminds you of the colour of badge you've earned. But I am a little puzzled by the symbols:      Is it feasible to use the symbol from the earned site? At the moment it uses the symbol from the site I happen to be on (as you can see by looking to the left of the dropdown in each case.) Are +1/+1 counters different from +1/+1 effects? Is a +1/+1 counter I get from, say Unleash or Undying different than +1/+1 from something like  or ? Handling circular entity references with Migrate I am using  on a Drupal 6 to Drupal 7 migration right now.  I have three types: type1, type2, type3.  Each of the three types has a entityreference field on it, which is configured to be able to point to all three types.  This means that there can be circular references, and when a particular node is being migrated, the destination node may not exist yet and could potentially be any of the three types.  My migration class looks like this:  class MyNodeMigration extends DrupalNode6Migration {   public function __construct(array $arguments) {     parent::__construct($arguments);      $this-&gt;addFieldMapping('field_legacy_nid', 'nid');      $this-&gt;addFieldMapping('field_the_reference', 'field_the_reference')       -&gt;sourceMigration(array('type1', 'type2', 'type3');   } }  $node_arguments = array(   array(     'class_name' =&gt; 'MyNodeMigration',     'description' =&gt; 'type1',     'machine_name' =&gt; 'type1',     'source_type' =&gt; 'type1',     'destination_type' =&gt; 'type1',     'dependencies' =&gt; array('roles', 'users'),   ),    array(     'class_name' =&gt; 'MyNodeMigration',     'description' =&gt; 'type2',     'machine_name' =&gt; 'type2',     'source_type' =&gt; 'type2',     'destination_type' =&gt; 'type2',     'dependencies' =&gt; array('roles', 'users'),   ),    array(     'class_name' =&gt; 'MyNodeMigration',     'description' =&gt; 'type3',     'machine_name' =&gt; 'type3',     'source_type' =&gt; 'type3',     'destination_type' =&gt; 'type3',     'dependencies' =&gt; array('roles', 'users'),   ), );  $common_node_arguments = $common_arguments + array(   'user_migration' =&gt; 'users', );  foreach ($node_arguments as $arguments) {   $arguments = array_merge_recursive($arguments, $common_node_arguments);    Migration::registerMigration($arguments['class_name'], $arguments['machine_name'], $arguments); }   When I run the migrations, most nodes are fine, but I get a decent amount of Stubs (*) created.  Some of the destination nodes have the entityreference pointing to these Stub nodes.  The source nodes are fine.  What I have uncovered is that the bundle on the destination nodes that are being made as stubs are incorrect, and look like they are all type1.  A node of the proper type does end up being created, but it never gets set as the entityreference target.  Another way to explain this is that I end up with   node: nid=123, type=type1 node: nid=234, type=type1, field_the_reference=123 node: nid=345, type=type2   where it should be   node: nid=234, type=type1, field_the_reference=345 node: nid=345, type=type2   How do I handle this situation?  (*): a "Stub" in the context of this question here refers to a node which is created for the purpose of being a reference target, but does not get its data initially. The term is used throughout the Migrate documentation and source code. How to evaluate  $$\det\begin{bmatrix}1+x_1y_1&amp;\cdots &amp; 1+x_1y_n\\ \vdots &amp; \ddots &amp; \vdots \\ 1+x_ny_1 &amp; \cdots &amp; 1+x_ny_n\end{bmatrix}$$?  I tried factorisation but I have no idea. I could not factor anything out... I need a hint to kick off.   Edit: A conjecture due to multilinearity: if we let $v_j=(x_1y_j,\cdots,x_ny_j)^T$, then my guess would be $$\det\begin{bmatrix}1+x_1y_1&amp;\cdots &amp; 1+x_1y_n\\ \vdots &amp; \ddots &amp; \vdots \\ 1+x_ny_1 &amp; \cdots &amp; 1+x_ny_n\end{bmatrix}=\det(1,v_2,\cdots,v_n)+\det(v_1,1,\cdots,v_n)+\cdots+\det(v_1,v_2,\cdots,1)=\color{red}{0}$$ where $1$ denote $(1,\cdots,1)^T\in \Bbb K^n$,$\Bbb K$ the underlying number field. Introductory biology text for an outsider I'm a maths major and I have an interest in learning biology. I know very, very little; I know how babies are made and that's about it. Could anyone recommend a stimulating text to read for its own sake and also to use to learn biology? I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist? Is there a word for someone that always has to be right? The person gets angry if they are not. Solve the equation $28^x = 19^y+87^z$ in integers Find all primes $p$ such that  $ p^3-4p+9 $ is a perfect square.   I tried a few different values for $p$, namely $2,3,5,7,$ and $11$. The prime $p =2,7,11$ all worked but $p =13$ didn't so it makes me wonder. How can I find all primes such that it is a perfect square?  EDIT: it turns out this is problem P25 in post number #63 at $\sqrt x$ is uniformly continuous Prove that the function $\sqrt x$ is uniformly continuous on $\{x\in \mathbb{R} | x \ge 0\}$.  To show uniformly continuity I must show for a given $\epsilon &gt; 0$ there exists a $\delta&gt;0$ such that for all $x_1, x_2 \in \mathbb{R}$ we have $|x_1 - x_2| &lt; \delta$ implies that $|f(x_1) - f(x_2)|&lt; \epsilon.$  What I did was $\left|\sqrt x - \sqrt x_0\right| = \left|\frac{(\sqrt x - \sqrt x_0)(\sqrt x + \sqrt x_0)}{(\sqrt x + \sqrt x_0)}\right| = \left|\frac{x - x_0}{\sqrt x + \sqrt x_0}\right| &lt; \frac{\delta}{\sqrt x + \sqrt x_0}$   but I found some proof online that made $\delta = \epsilon^2$ where I don't understand how they got? So, in order for $\delta =\epsilon^2$ then $\sqrt x + \sqrt x_0$ must $\le$ $\epsilon$ then $\frac{\delta}{\sqrt x + \sqrt x_0} \le \frac{\delta}{\epsilon} = \epsilon$. But then why would $\epsilon \le \sqrt x + \sqrt x_0? $ Ah, I think I understand it now just by typing this out and from an earlier hint by Michael Hardy . Handling mouse events for tool called by button? I have a dockable window with a 2 buttons that call 2 different tools (Draw Marker and Select Features), What i want to happen is when the user clicks on the relevant button on the dockable window and then clicks on the map, a onMouseUp event is called and it runs code i need to run.   Where does the onMouseUp event need to be placed so this can be done? What word or phrase best communicates the idea that a human (or other sentient being) is easily swayed, particularly between moral good and evil? Words I have found that are close are:   Impressionable - Easily influenced because of a lack of critical ability.   Implies that the subject lacks critical skills, and misses the concept of good and evil.  Gullible - Easily persuaded to believe something   Misses the concept of good and evil    I created a typical angels and demons scenario to demonstrate the polar extremes of the the spectrum. In this scenario, I lack the word to describe the humans, who can be influenced towards either end of the spectrum if impressed upon by an external entity.     The angels are devoted to good, and are immovable in their ideals. The demons are wicked, and will feign morality only to manipulate others. Both prey upon the humans, who are ____________.   I think that the key here is the spectrum of good an evil. Here are examples of other spectra and their associated words, for comparison.   Easily pushed from calm to angry: Temperamental Easily moved from determined to hopeless: Weak-willed Easily influenced by propaganda: Are there any organised resources available from where I can begin my quantum computing studies? Equation mode, labelling equations I have the following   \[K^{-1}\left\|\sum\limits_{n=1}^N a_ny_n\right\|    \leq \left\|\sum\limits_{n=1}^N a_nx_n\right\|    \leq K\left\|\sum\limits_{n=1}^N a_ny_n\right\| (\dagger)\]   But the dagger doesn't appear at the right hand end of the page. How can I Get it so that it does appear on the end of the page? the \hfill command doesn't seem to work. Thank you. There does not exist group $G$ such that Aut$(G)\cong \mathbb{Z}_n$ (for odd $n$) How to execute consecutive commands from history? Suppose I want to execute a sequence of four commands that I have executed before. If the first one is 432 in the command-history, then I could do:  $ !432; !433; !434; !435   I'm curious, is there a more efficient way to accomplish this? Trying to open a http website on any web browser (event telnet) gives a ‘ERR_CONNECTION_REFUSED’ or ‘connection timed out’.  However, the same sites can be opened using https. I tried doing a traceroute and it works fine.  I am new to OS X but have experience with Linux. How do I go about troubleshooting this issue?  Update  I think I've tracked down the culprit to a rule in pf (firewall).  The result of sudo pfctl -s nat is:  No ALTQ support in kernel ALTQ related functions disabled rdr pass inet proto tcp from 192.168.0.101 to any port = 80 -&gt; 127.0.0.1 port 9882   192.168.0.101 is the current ip address of the computer.  I tried to remove the rule with sudo pfctl -F all, but it is back after a few seconds. I didn't find the rule in the default configurations (/etc/pf.conf). And disabling pf with sudo pfctl -d has no effect on it.  Is this a malware issue?