Why this code:  result_list = [[]]*14 result_list[3].append('sdfda') print(result_list)   is output:  [['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda'], ['sdfda']]   but i expect:  [[], [], [], ['sdfda'], [], [], [], [], [], [], [], [], [], []]   I want to insert elements by index...but this example of code insert the element in all list of list
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?
Install Ubuntu on Intel Mac I've recently taken up a position in an all Mac workshop - We have Intel based Apple machines. Can I dual boot Ubuntu on my machine, if so how? Currently Running: macOS Catalina 10.15.1 Issue: Ever since I upgraded to Catalina, macOS is not allowing me to change read and write permissions on system protected files, hence, I am not able to tweak the system as per my likes and dislikes. Steps Tried To Solve The Issue: SIP, always remains . So, no question arises regarding any conflict with system integrity protection. I have also tried to force change the permissions on the system files I want to edit using certain brute force commands, which I can't recall the name of, right now. But, I have tried. As of now, I am still unable to change read and write permissions on system protected files and resources. remote ssh tcpdump command, through a gateway, to be opened, in realtime, in Wireshark, on local machine I (Host A - Windows based using plink) am trying to connect to a remote linux server (Host C), through a gateway linux server (Host B), and run this tcpdump on Host C to be piped all the way back to Host A (through Host B I assume), and opened, in real time, with Wireshark on Host A:  Below is what I saw as the command when not using a gateway ("direct remote fetch").  So, how would I make this work going through my gateway host B scenario above?  Host A$ plink.exe -ssh -pw abc123 root@Host C "tcpdump -s0 -U -n -w - -i eth0 not port 22" | "C:\Program Files\Wireshark\Wireshark.exe" -k -i - I'm looking for an idiom or saying that I could use when people are focusing too much on small details and not seeing the big picture.  A couple that come to mind are "being penny-wise and pound foolish" and "rearranging deck chairs on the Titanic". However, the former doesn't fit what I'm thinking of because the present activity might not be wise. The latter implies too much about impending doom.  For example, let's say some company is spending all their time refining a small detail in their product, while ignoring a major opportunity shift in the industry. What phrase could I use there? Prove Inverses not need be Unique if Associativity fails Let $M=\{x, y, z\}$ be a set and let $\circ$ be a binary operation on $M$ such that the identity element is $x$ and $y \circ y = x = y \circ z$. Prove that inverses need not be unique if associativity fails given the multiplication table below.  $x \circ x = x, x \circ y = y, x \circ z = z$  $y \circ x = y, y \circ y = x, y \circ z = x$  $z \circ x = z, z \circ y = x, z \circ z = x$ Let $f$ and $g$ be entire functions and $g(z)\neq 0$ for all $z\in \mathbb{C}$. If $|f(z)|\le |g(z)|$, can we say $f$ is constant?  Liouville theorem says that an entire bounded function is constant, but g is not given bounded here. So I think it should be false. What else can we say about $f$? Accessing class members on a NULL pointer I was experimenting with C++ and found the below code as very strange.   class Foo{ public:     virtual void say_virtual_hi(){         std::cout &lt;&lt; "Virtual Hi";     }      void say_hi()     {         std::cout &lt;&lt; "Hi";     } };  int main(int argc, char** argv) {     Foo* foo = 0;     foo-&gt;say_hi(); // works well     foo-&gt;say_virtual_hi(); // will crash the app     return 0; }   I know that the virtual method call crashes because it requires a vtable lookup and can only work with valid objects.   I have the following questions    How does the non virtual method say_hi work on a NULL pointer? Where does the object foo get allocated?   Any thoughts? Suppose we have a random variable $X \sim f(x|\theta)$. If $\theta_0$ were the true parameter, the the likelihood function should be maximized and the derivative equal to zero. This is the basic principle behind the maximum likelihood estimator.   As I understand it, Fisher information is defined as   $$I(\theta) = \Bbb E \Bigg[\left(\frac{\partial}{\partial \theta}f(X|\theta)\right)^2\Bigg ]$$  Thus, if $\theta_0$ is the true parameter, $I(\theta) = 0$. But if it $\theta_0$ is not the true parameter, then we will have a larger amount of Fisher information.   my questions    Does Fisher information measure the "error" of a given MLE? In other words, doesn't the existence of positive Fisher information imply my MLE can't be ideal?  How does this definition of "information" differ from that used by Shannon? Why do we call it information? I did an upgrade today to the latest version of ubuntu. Everything looked good and fine only for me to discover that I cannot find my applications after clicking the 'Show Applications' icon. The same applies when I search for an application in the search bar, I do not see it. It shows me an endless search.  These are the screenshot images of the problem:      In the meantime, I access my applications from the menu at the top bar and also use the terminal to run applications with CLI. Dissolve (merge) polygons QGIS based on attribute values only when are adjacent $\Bbb Z^\ast$ What is this notation? What does $\Bbb Z^\ast$ mean? I would think some subset of the integers but I cannot find a definition. Thank you. When computing the covariance matrix of a sample, is one then guaranteed to get a symmetric and positive-definite matrix?  Currently my problem has a sample of 4600 observation vectors and 24 dimensions. How to escape quotes in shell? The cardinality of $\{f\subseteq\mathbb R^2\mid f\colon\mathbb{R\to R}\text{ is a function}\}$ is strictly greater than the cardinality of $\mathbb R$ Are partitions to the inner/outer edge significantly faster Some linux dual/multi-boot tutorials / general partitioning tutorials say that the inner side of a hard disk is faster than the outer side so partitions towards the outside tend to be slower while some say that the exact opposite is true.  Which side is actually faster?  Is the difference noticeable?  How are the partitions physically placed on the disk as compared to the partition listing order-for example gparted shows a logical ribbon layout of the partitions. Are the partitions shown to the left side of this ribbon near the outer or inner edge of the disk physically?  Are there software benchmarks like testing some disk intensive stuff for the first time on identical vanilla installs of the same OS but on different partitions, inner and outer?  EDIT: Links   ctrl + f for "slower" on this page   Says outer side is faster   Says inner side is faster   Says outer side is faster(not about dual-booting) Would you recommend using a  or a  field, and why (using MySQL)?   I'm working with PHP on the server side. Euler's equations of rigid body motion from least action principle I would like to derive Euler's equations of rigid body motion from least action principle.   Suppose we are in free space so we have no gravity so Lagrangian is equal to kinetic energy.   $$ L = T = \int_M \rho(x)(x\cdot \Omega_B)^2 d^3x $$  where $\rho$ is density, $\Omega_B$ is angular velocity bivector in reference body frame and $M$ is the rigid body.  The action principle says(if I haven't messed up something) that   $$ 0 = \frac{d}{ds}\bigg|_{s=0}\int_0^T \int_M \rho(x)[x\cdot (\Omega_B(t)+s \delta \Omega(t))]^2 d^3x $$  for every $\delta \Omega$ with zero ends i.e. $\delta \Omega(0)=\delta \Omega(T) = 0$. I should get these equations:  $$ I(\Omega_B) - \Omega \times I(\Omega_B)=0 $$  where  $$ I(\Omega) = \int_M \rho(x) (x\wedge (x\cdot \Omega)) d^3x. $$  But I can't see where I would get the time derivative of $\Omega_B$ from the action principle. Can someone tell me what I'm doing wrong? I guess there is some trouble with that $\delta \Omega$ can't be completely arbitrary. I have a scenario where i want to calculate sum of column   SAL|CAL|TAG|VAL 12.11"|"1.1"|"2.1"|"1.1 13.11"|"1.1"|"2.2"|"2.2 14.11"|"1.1"|"2.4"|"2.4   My below code not giving output giving output as 0.00  I need output for this column CAL VAL  awk -F'|' '{T+=$2} END { printf "%.2f\n", T }' demo.txt   output :  6.7 5.7 Why is everything floating in space so cold? Of course there is pretty hot stuff too. For example Suns.  But isn't the vacuum of space the perfect containment for heat? And shouldn't the rare collision with particles even heat up an object that floats around in space?  Why aren't they hot from time to time? Is it because they loose their heat by radiant heat?  And if so does radiant heat emission always occur until the object is the same temperature as the surrounding or does it depend on other factors? Is it possible to produce a context free grammar for Tikz path? node? Even further, I would be happy to see a definition of the tikz language in the usual manner programming languages such as Java and Pascal are defined.   The reason I ask is that I keep getting mysterious error messages for the tiniest typos. Essentially, incorrect use of the underlying languages leads to a "crash" of the compiler. This crash sometimes gives useful error messages, but sometimes they are hard to decipher.