I have four Dictionary , two are (dictionary within Dictionary), declaration shown below      Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt; dict_set = new Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt;();     Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt; dict_Reset = new Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt;();     Dictionary&lt;string, string&gt; set_value = new Dictionary&lt;string, string&gt;();     Dictionary&lt;string, string&gt; Reset_value = new Dictionary&lt;string, string&gt;();   I want to first add elements in dictionary set_vlaue and Reset_value. once the values are added then i am adding these dictionaries to other two dictionaries as shown below.  dict_set.Add(condiName, set_value); dict_Reset.Add(condiName, Reset_value);  set_value.Clear();  Reset_value.Clear();   the values are getting added , but after adding set_value and reset_value dictionaries  , i want to clear these two dictionaries set_value and reset_value,but problem occurs that when set_value and reset_value are cleared the data from dict_set and dict_reset is also cleared..  can any one help me , to how to create deep copy of dictionaries in this case...
I've got a generic dictionary Dictionary&lt;string, T&gt; that I would like to essentially make a Clone() of ..any suggestions.
Where should I post my sum-up of the answers, as the OP? Sometimes as the OP (question asker), after reading through all the answers, I have my own sum-up about them. I want to tell people and all further readers about my feeling and comprehension about my desired answer and how all the answers helped towards solving my problem.  Where's the correct place to put that information? Things I've considered:   Edit into my question: No because that's not part of the question A comment under the question: I dislike that due to limited formatting in comments and its subject to removal (though the latter won't be the case) A comment under the highest-scored or the accepted answer: Still the same reason above. This is, for the time being, the place I'm posting that. A separate answer: Those thoughts probably don't qualify as an answer Variance of dot product When reading a proof I came across the following step:  $$\operatorname{Var}(x^Ty) = x^T\operatorname{Var}(y)x$$ $x$ and $y$ are column vectors. How can you derive this? Prove: If $a\mid m$ and $b\mid m$ and $\gcd(a,b)=1$ then $ab\mid m$ Prove: If $a\mid m$ and $b\mid m$ and $\gcd(a,b)=1$ then $ab\mid m$  I thought that $m=ab$ but I was given a counterexample in a comment below.  So all I really know is $m=ax$ and $m=by$ for some $x,y \in \mathbb Z$. Also, $a$ and $b$ are relatively prime since $\gcd(a,b)=1$.   One of the comments suggests to use , i.e., $aq+br=1$ for some $q,r\in\mathbb{Z}$. Any more hints?  New to this divisibility/gcd stuff. Thanks in advance! Interview Question Asked In yahoo Can you find the smallest positive number such that if you shuffle the digits of the number in a particular order, the shuffled number becomes twice the original number.  Source:   I understand the answer is $125874 =&gt; 251748$  $251748$ is twice the $125874$ and have same digits $1,2,4,5,7$ &amp; $8$  but how to solve this non programmatic ? Wikipedia mentions several English words that have been :   Anime comes from animation and has been reborrowed into English to mean Japanese-style animation. Puroresu comes from professional wrestling and is a term for Japanese-style professional wrestling. Kosupure comes from cosplay (an abbreviation of costume play) and refers to the practice of dressing in costumes of anime and video game characters.    Do you know other examples of word reborrowings from Japanese or other languages back into English, or vice versa? How to determine if Javascript object is an event? Evaluating $\int_{0}^{1}\int_{0}^{1}\sqrt{x^{2}+y^{2}}dxdy$ using polar coordinates. I want to evaluate the integral $\int_{0}^{1}\int_{0}^{1}\sqrt{x^{2}+y^{2}}dxdy$ using the substitution $x=r\cos\theta$ and $y=r\sin\theta$ where the Jacobian is given as $|J(r, \theta)|=r$ and thus $dxdy=rdrd\theta$.  I need to set the range for $r$ and $\theta$. For $\theta$, it seems obvious that it ranges from $0$ to $\frac{\pi}{2}$ to cover all parts of the rectangle. But I am confused with the range for $r$. Would it be OK to set minimum $r$ as $0$ and maximum $r$ as $\sqrt{2}$, which is the diagonal of the square domain? I think I am confused with the fundamentals of integration. Can I remove receipts from imported products from my passport? I have recently imported books into Canada from Japan.  As I bought in excess of 5000¥, the purchase was tax free and the receipt was stapled to my passport and stamped.  Since I've now come back to Canada and no issues occurred with my imports, Is it safe to remove the receipts from my passport?  As it was stamped and stapled, there will remain a trace that something was there. Could this cause problems when I return to Japan at a later time? I have a complex embedded Linux software running on a gentoo derivative, on which a certain piece of code gets executed regularly every ~84 minutes. Sweeping through the main code to find places where this code might get executed was unsuccessful, and crontab also seems no possible explanation.   My question: Is it possible, by modifying the code in question, to find out which other process/code/file/service started it in the first place? Are there some information in the /proc directory I can use? Or is it impossible to find out the process that executed the given code? Prove $\frac{1+a^{2}}{1+b+c^{2}} +\frac{1+b^{2}}{1+c+a^{2}} +\frac{1+c^{2}}{1+a+b^{2}} \geq 2$ For positive integers Numbers  $a, b, c $ prove that  $$\frac{1+a^{2}}{1+b+c^{2}} +\frac{1+b^{2}}{1+c+a^{2}} +\frac{1+c^{2}}{1+a+b^{2}} \geq  2$$ This inequality above take long time to prove it and still couldn't complete it.  How I can prove this inequality?  Any hint will help. Thanks I have  experience where empty spaces cause unwanted effects. It is not easy to trace the cause of these unwanted effects. In order to eliminate any doubt, I often overuse % as follows.   \usepackage% [% left=3cm, right=3cm% ]% {geometry}   or  \newcommand{\mycommand}% {% This is my command.% }   I got an extreme example that will break what Leo Liu said     In fact, only spaces which would be   output have to be removed by comment.   The following code does not produce output, but we cannot remove the % and leave a blank line between two elements of a list below.  \newpsstyle{gridstyle} { gridwidth=0.4pt, % griddots=0 }   Shortly speaking, where are the necessary places to be appended with % to remove unwanted spaces? Here the lower box dimension and the upper box dimension are exactly what Falconer talks about in his book "Fractal Geometry". I already know that the upper box dimension is finitely stable since $N_\delta(A\cup B)\le N_\delta (A)+N_\delta(B)$, where $N_\delta(A)$ is defined as usual, and Falconer gives an example to show the box dimension may not be countably stable. (We know that, however, the Hausdorff dimension is countably stable).  But now I want to find the example to show the lower box dimension may not even be finitely stable.It seems that we can use von Koch curve to illustrate this, but what is the explicit explanation for this? Since the lower box dimension is monotonic, we need to find set A and B and show that   $\underline{\dim}_B(A\cup B)&gt;\max\{\underline{\dim}_B(A),\underline{\dim}_B(B)\}$. Let $a,m,n \in \mathbf{N}$. Show that if $\gcd(m,n)=1$, then $\gcd(a,mn)=\gcd(a,m)\cdot\gcd(a,n)$. Let $a,m,n\in\mathbf{N}$. Show that if $\gcd(m,n)=1$, then $\gcd(a,mn)=\gcd(a,m)\cdot\gcd(a,n)$.  Proof:  Let $u,v\in\mathbf{Z}$ such that $\gcd(m,n)=um+vn=1$. Let $b,c\in\mathbf{Z}$ such that $\gcd(m,a)=ab+cm$. Let $d,e\in\mathbf{Z}$ such that $\gcd(a,n)=ad+en$.  So $\gcd(a,m)\cdot\gcd(a,n)=a^2bd+cmen+aben+emad$.  Where do I go from here? What is the best way to increase my reputation and privileges? I'm not sure if this is a stupid question, but here goes anyway... I have only recently started learning PHP and Javascript and I'm reasonably proficient. One of the reasons I'm so proficient is because I LOVE Stack Overflow and find most of the solutions to my dilemmas here.   But I've found that I never get the chance to ask a question because it has normally been asked many times before and when I go through the unanswered questions to try and help someone else, they are generally WAY over my head.  So I'm not sure how to get more privileges. I can't even vote up answers that I like or that helped me. I can't comment to thank someone for their solution. It is most tragic and demoralising... How do I change the situation? Is there any way to get the ID of the element that fires an event?  I'm thinking something like:    $(document).ready(function() {   $("a").click(function() {     var test = caller.id;     alert(test.val());   }); }); &lt;script type="text/javascript" src="starterkit/jquery.js"&gt;&lt;/script&gt;  &lt;form class="item" id="aaa"&gt;   &lt;input class="title"&gt;&lt;/input&gt; &lt;/form&gt; &lt;form class="item" id="bbb"&gt;   &lt;input class="title"&gt;&lt;/input&gt; &lt;/form&gt;     Except of course that the var test should contain the id "aaa", if the event is fired from the first form, and "bbb", if the event is fired from the second form. Sophomore's dream: $\int_0^{1} x^{-x} \; dx = \sum_{n=1}^\infty n^{-n}$ In the solution of the so-called , one of the key steps is to compute $$\int_0^1 x^n (\log x)^n~\mathrm dx$$ using the change of variables $x = \exp\left(-\frac{u}{n+1}\right)$ to obtain the Gamma function.  This substitution to me, looks like it was pulled out of thin air. Can someone help me motivate it? How would I have thought of this substitution? How to revert to GNOME Classic Desktop? I'm used to GNOME Classic and personally don't want to change to anything else, but it seems there is no more GNOME Classic in the Oneiric release. After apt-get installed gnome-session and all, though there comes back the GNOME Classic option in the session listbox, however, after logged in, it seems not the expected one.  There is no System menu in the top bar, and I couldn't customize panels at all. I want to change the appearance(theme), but I can't find Appearance menu at all. And much more differences to my previous experience of GNOME classic shell.    There are multiple valid answers for this question spanning over several versions of Ubuntu. For your convenience an index of each below:    and up      &amp; What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a new string, but is there a better way? Is it possible to follow a user automatically? I've been looking around and I can't seem to find an automatic (i.e. buzz- or Twitter-like) way to follow users inside Stack Exchange. Why haven't the developers added such a feature? It could help beginner users follow other beginners with the same interests. We would be able to learn from each others' questions and pitfalls. Also, it would reduce double posting. How to remove illegal characters from path and filenames? I need a robust and simple way to remove illegal path and file characters from a simple string. I've used the below code but it doesn't seem to do anything, what am I missing?  using System; using System.IO;  namespace ConsoleApplication1 {     class Program     {         static void Main(string[] args)         {             string illegal = "\"M&lt;&gt;\"\\a/ry/ h**ad:&gt;&gt; a\\/:*?\"&lt;&gt;| li*tt|le|| la\"mb.?";              illegal = illegal.Trim(Path.GetInvalidFileNameChars());             illegal = illegal.Trim(Path.GetInvalidPathChars());              Console.WriteLine(illegal);             Console.ReadLine();         }     } }