Assume I have a struct Point with public int's x and y. I want to change a value and I can. But once I store it in a dictionary, I can no longer do so. Why?  MWE:  using System; using System.Collections.Generic;  public class Program {     public struct Point     {         public int x, y;          public Point(int p1, int p2)         {             x = p1;             y = p2;         }     }      public static void PrintPoint(Point p)     {         Console.WriteLine(String.Format("{{x: {0}, y: {1}}}", p.x, p.y));     }      public static void Main()     {         var c = new Point(5, 6);         PrintPoint(c);                                          // {x: 5, y: 6}          c.x = 4;  // this works         PrintPoint(c);                                          // {x: 4, y: 6}          var d = new Dictionary&lt;string, Point&gt;()          {             { "a", new Point(10, 20) },             { "b", new Point(30, 40) }         };          foreach (Point p in d.Values)         {             PrintPoint(p);  // this works         }          PrintPoint(d["a"]); // this works                       // {x: 10, y: 20}          Console.WriteLine(d["a"].x.ToString());  // this works  // 10          // d["a"].x = 2; // why doesn't this work?     } }   How come I can access the struct variables when it's in a dictionary but can no longer change them? How do I change them?
When should you use struct and not class in C#? My conceptual model is that structs are used in times when the item is merely a collection of value types.  A way to logically hold them all together into a cohesive whole.  I came across these rules :   A struct should represent a single value. A struct should have a memory footprint less than 16 bytes. A struct should not be changed after creation.   Do these rules work? What does a struct mean semantically?
Installing opencv I've downloaded opencv but unfortunately I've got no idea how to install it. All the pages I found online were only telling me how to download and install it directly from the console, not what to do when you already have it downloaded. Could anybody tell me what to do? Given a set of vectors $v_1 \cdots v_n$, the $n\times n$ Gram matrix $G$ is defined as $G_{i,j}=v_i \cdot v_j$  Due to symmetry in the dot product, $G$ is Hermitian.  I'm trying to remember why $|G|=0$ iff the set of vectors are not linearly independent. Labels and nesting gather and align Does the MacBook battery cycle count reset when replacing a battery I've been  on battery cycle counts and checked out my current count on my MacBook (13-inch, Aluminum, Late 2008) - recommended maximum cycle count is 500.  I've had this laptop now for over 4 years and at the 2 year mark I had the battery replaced by AppleCare. The first time I checked out the cycle count was today and it's currently on 1004. Now my question is, is this the cycle count of the battery since I replaced it (as in, it reads the cycle count from the battery), or is it the combined cycle count (as in, it stores the count somewhere and increments occasionally)? My assumption is that it's the count of that battery but I have no idea how to verify this.  Either way, it looks like I need a new battery ;) The meaning of action The action  $$S=\int L \;\mathrm{d}t$$  is an important physical quantity. But can it be understood more intuitively? The Hamiltonian corresponds to the energy, whereas the action has dimension of energy × time, the same as angular momentum.  I've heard the action being described as a measure of change, although I don't know how this description can be justified. Can screen layouts or workspaces be locked? \selectcolormodel{gray} doesn't work for the duck hair, but it works for the other parts of the ducks, why?  \documentclass{ltugboat}  \usepackage{microtype}  \usepackage{graphicx}  \usepackage{ifthen} \newboolean{grayscale}    \setboolean{grayscale}{true}% for the black &amp; white version    %\setboolean{grayscale}{false}% for the colored version     \usepackage{tikzducks} \usetikzlibrary{positioning}  \newenvironment{mytikz}{%     \begin{tikzpicture}     \ifthenelse{\boolean{grayscale}}{\selectcolormodel{gray}}{}      }     {\end{tikzpicture}}  \usepackage{ifpdf}  \ifpdf  \usepackage[breaklinks,hidelinks]{hyperref}  \else \usepackage{url} \fi   \begin{document}      Why \textbackslash\texttt{selectcolormodel\string{gray\string}} does not work for the duck hair?      Black and white version:          \begin{mytikz}         \begin{scope}[xscale=-1]             \duck[longhair=pink]         \end{scope}         \begin{scope}[xshift=10pt]             \duck[crazyhair=orange]         \end{scope}     \end{mytikz}      Colored version:     \setboolean{grayscale}{false}      \begin{mytikz}         \begin{scope}[xscale=-1]             \duck[longhair=pink]         \end{scope}         \begin{scope}[xshift=10pt]             \duck[crazyhair=orange]         \end{scope}     \end{mytikz} \end{document} How to initialize all members of an array to the same value? I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.  I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax? How do I backup ssh keys? I am planning to do a fresh install of ubuntu 11.10 in my system. Before that i have setuped key based ssh authentication in this machine. Is it possible to take backup of those ssh keys, so that i  can use that in my new installation. Or else i must setup keybased ssh authentication again? If i can take backup, what are the files i need to copy? Can someone explain it in detail pls. Thanks in advance. Why is the edit button disabled? I edited some questions before, but now I get an error message when clicking the edit button. I thought there was a problem with the specific question, but I cannot click it on any question.  What's going on? While I applaud the excellent work of , the question has come up:     How long will be the elected moderator’s “mandate”? Is it for life, or are we going to have “moderator elections” regularly?   Of course, any community moderator who wishes to recuse him or herself can certainly do that at any time.   Should we have term limits that require community moderators be cycled out periodically, so others get a chance to moderate? Should we hold regular (say, yearly) moderator elections? Is it better to have a larger pool of community moderators, and let the normal ebb and flow of turnover get us "natural" variability in moderation?   What are your thoughts on this? When should I use # and = in ASP.NET controls? I have been using ASP.NET for years, but I can never remember when using the # and = are appropriate.  For example:  &lt;%= Grid.ClientID %&gt;   or  &lt;%# Eval("FullName")%&gt;   Can someone explain when each should be used so I can keep it straight in my mind? Is # only used in controls that support databinding? I feel that I might have a complete misunderstanding here. If DNA has two strands, how does the machinery of RNA transcription determine which one to transcribe? How can I stop Lollipop ignoring my wifi network? Android 5.0 has a new "feature": If a wifi network has no connection to the internet, it will remain connected to it but route traffic over mobile data instead. A small exclamation mark shows in the status bar over the wifi symbol.  Unfortunately, for some reason Android has decided that my home wifi does not have a good internet connection - which is not true, as I'm using it to access Stackexchange at the moment - and is, instead, trying to send everything over GPRS.  With mobile data disabled, things work over wifi just fine, despite the exclamation mark - so it isn't a problem with the wifi not working, per se.  Is there any way to override this "smart" feature? The only way I have found to make things work at the moment is to disable mobile data while I am in my house - which is not a practical long-term solution.   EDITING to add that I have now solved this problem by buying a new router! I was using something very old... But, I'll leave the question here for the benefit of anybody else with the same difficulty. Why should the minimal class be avoided? The additive group $\mathbb{G}_a$ over an infinite field $k$ is not a topological group An algebraic group is not necessarily a topological group, since for an algebraic group, the product map $G \times G \to G$ is continuous when $G \times G$ is given the Zariski topology, which is finer than the product topology.   So does this tell you that the additive group $\mathbb{G}_a$ over an infinite field $k$ is not a topological group? The underlying variety of $\mathbb{G}_a \times \mathbb{G}_a$ is $\mathbb{A}_k^1 \times_k \mathbb{A}_k^1 = \mathbb{A}_k^2$, whose Zariski topology is the cofinite topology, where every open set is also open in the product topology (since $\mathbb{A}_k^1$ also has the Zariski topology). We are experimenting with running an OpenVPN server for our business. One question I can't seem to find the answer to is this:  When we generate keys for one of our users for them to use at home, can their use the same keys on their home laptop as well as their home desktop? Or do we need to generate separate keys for each user's client machine? Question: Let $a, b \in \mathbb{R}$ with $a &lt; b$ and let $f: [a,b] \rightarrow [a,b]$ continuous. Show: $f$ has a fixed point, that is, there is an $x \in [a,b]$ with $f(x)=x$.  I suppose this has to do with the basic definition of continuity. The definition I am using is that $f$ is continuous at $a$ if $\displaystyle \lim_{x \to a} f(x)$ exists and if $\displaystyle \lim_{x \to a} f(x) = f(a)$. I must not be understanding it, since I am not sure how to begin showing this... Should I be trying to show that $x$ is both greater than or equal to and less than or equal to $\displaystyle \lim_{x \to a} f(x)$ ? facl ignoring the "x" permission but only on files When I use setfacl to manage on what permissions should the children files / directories have, for some reason the files have all the permissions except the execute ("x") one.  someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ getfacl . # file: . # owner: someuser # group: webs # flags: -s- user::rwx group::rwx other::rwx default:user::rwx default:group::rwx default:other::rwx  someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ touch file someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ mkdir dir someuser@someuser-MS-7816:/opt/lampp/htdocs/project$ ls -l total 4 drwxrwsrwx+ 2 someuser webs 4096 paź 31 13:35 dir -rw-rw-rw-  1 someuser webs    0 paź 31 13:35 file   I thought it has something to do with umask but changing it in various ways never gives the expected result unless I'm missing something.  How can this be fixed? How to disable "time travel" entirely? Every time I open a question I get this oh so funny 90s feel with scrollers and whatnots. In every question I need to click it off. The button seems to only work for the specific page I load; loading a different page shows the theme again.  Is this an attempt to keep people from using the site for a few days or how do I tell you "please never ever do anything like this if you want me to keep contributing here"? Yes I have no sense of humor if this is an attempt at that.  How do I turn off "time travel" (also known as "back to the future") mode off permanently, on all questions, and preferably network-wide?