I have come across a little problem while I'm trying to learn arrays. So the idea is that I need to print out the unique elements in an array. When I run the program, its printing out more than the number of values in the array lol. I'm sorry if this is a super simple and dumb question but i'm not seeing the problem with it. Language is c#.  static void Main(string[] args)     {         int[] numbers = new int[10];         Random random = new Random();          for (int i = 0; i &lt; 10; i++)         {             numbers[i] = random.Next(0, 10);         }          Array.Sort(numbers);         foreach (var num in numbers)         {             Console.Write("{0}, ", num);         }          Console.WriteLine("");          for (int i = 0; i &lt; 10; i++)         {             for (int j = 1; j &lt; 10; j++)             {                 if (numbers[i] == numbers[j])                 {                     break;                 }                 else                 {                     Console.Write(numbers[i] + ", ");                 }             }         }
I have been working with a string[] array in C# that gets returned from a function call. I could possibly cast to a Generic collection, but I was wondering if there was a better way to do it, possibly by using a temp array.  What is the best way to remove duplicates from a C# array?
Let $T:V\to V$ be a linear map, where $V$ is an inner product space. Given $T^2=\frac{T+T^*}{2}$, prove that $T$ is normal and that $T=T^2$. Let $T:V\to V$ be a linear map, where $V$ is a finite-dimensional inner product space. Given $T^2=\frac{T+T^{*}}{2}$, I would like to prove that $T$ is normal and that $T=T^2$. The first part, to prove that $T$ is normal, is quite easy: from $T^2=\frac{T+T^{*}}{2}$ we'll have $\,T^{*}=2T^2 - T$, and as $TT^{*} = 2T^3 -T^2 = T^{*}T$. Now, I need to prove that $T=T^*$, then $T = T^2$ is immediate. I have been thinking about this question for some days and I can't figure out in what technique to prove that $T = T^{*}$. I'm trying to write a program in C (on Linux) that loops until the user presses a key, but shouldn't require a keypress to continue each loop.  Is there a simple way to do this? I figure I could possibly do it with select() but that seems like a lot of work.  Alternatively, is there a way to catch a ctrl-c keypress to do cleanup before the program closes instead of non-blocking io? I had the following two problems:     Find a counterexample for $f_*(A \cap B) \supseteq f_*(A) \cap f_*(B)$ and $ f_*(A-B) \subseteq f_*(A) -f_*(B).$ Where $f_*(X)$ is the image of $X$ under $f$ for some function $f:A \rightarrow B $ and some subset $X \subseteq A$.   I came with the following answer:  Let $ f: \mathbb{Z} \rightarrow \mathbb{Z} $, where $f: x\mapsto 0$; let $A=\{1,2\}$, and $B=\{3,4\}$.     For $f_*(A \cap B) \supseteq f_*(A) \cap f_*(B)$, $$ f_*(A \cap B) = f_*\{ \varnothing\} = \varnothing \hspace{1cm} \text{and} \hspace{1cm} f_*(A) \cap f_*(B)=\{0\} \cap \{0\} = \{0\}. $$ It follows that $ \varnothing \nsupseteq \{0\} $. For $ f_*(A-B) \subseteq f_*(A) -f_*(B)$, $$f_*(A-B)=f_*(\{1,2\})=\{0\} \hspace{1cm} \text{and} \hspace{1cm} f_*(A) - f_*(B) = \{0\} - \{0\} = \varnothing$$ It follows that $ \{0\}  \nsubseteq \varnothing $.   Now (assuming my answer is correct), let's say I want to find more counterexamples or maybe a more general answer (e.g. all the conditions under which the inclusion fails). Other than by trial and error or just intuition, how would I do that?   I know this is a broad question, so I'm specifically asking for methods or advice on how to build counterexamples in elementary set theory (for example, tips on where to begin or rules that apply in general that may be unobvious). Was unable to find rationale for separate tags accros SE sites.   Tag function According general definition in information systems, a  (such as an Internet bookmark, digital image, database record, or computer file). This kind of metadata helps describe an item and allows it to be found again by browsing or searching. Tags are generally chosen informally and personally by the item's creator or by its viewer, depending on the system, although they may also be chosen from a controlled vocabulary.  On SE - the same:  is a () word or phrase that describes the topic of the question help you identify  or relevant to you.  tag origin and quality  Where from tags are originated and what are tag quality parametres?  problems and contradictions examples related with SE tags  Humanity is facing information overload.  are created for collecting and sharing personal knowledge on questions or problem solving. But tag's descriptions are not matter of personal knowledge - it's just matter of , i.e. vocabulary/dictionary, or taxonomy/ontology or, speaking in general, human lexic conceptual apparatus / framework. So why time has to be spent on fact's duplicating and sharing?  At the same time We are living at the linked data times. IMHO it's the biggest blunder having same tags with different descriptions in different SE sites unlinked. Tags (and so - descriptions) should be unified.  So I'm calling to unify all tags across SE sites as feature request. Maybe automatic linking to Wikipedia and/or some other decent dictionary would be reasonable.  solution examples  This is not a duplicate of What are tag synonyms and merged tags? How do they work? A doubt regarding change of variables in Double Integrals. So I have recently learnt to calculate &quot;Double Integrals&quot; and I have a doubt on change of variables. Lets say we are evaluating a double integral of the form I = $\int\int _R F(x,y) dx dy $ , where $F(x,y)$ is an integrable smooth function and $R$ is the region of integration in the $xy$ plane. Now I want to convert to polar co-ordinates $x(r,\theta)=r \cos(\theta)$ and $y(r,\theta) = r \sin(\theta)$. Now the region $R$ in the $xy$ palne can be suitably converted to some region $R'$ in the $r \theta$ plane. The function $F(x,y)$ may take the form of some smooth and integrable $G(r,\theta)$. My main doubt is with the change of the area element. According to my textbook, $dx dy = \frac{\partial (x,y)}{\partial(r,\theta)} = rdrd\theta$. So the area element in the $r\theta$ plane is $rdr d\theta$. Now I want to experiment a little bit with my understanding : I write $dx = d(r\cos\theta) = -r\sin\theta d\theta + \cos \theta dr$  and $dy = d(r\sin\theta)=r\cos\theta d\theta + \sin\theta dr $. And now I multiply the two expression for $dx$ and $dy$ : $dxdy= -r^2\sin\theta\cos\theta d\theta d\theta - r \sin^2 \theta drd\theta + r \cos^2 \theta dr d\theta + \sin \theta \cos\theta dr dr$. Why isn't this expression equal to $rdrd\theta$ ? The $d\theta d\theta$ and $dr dr$ terms look very odd to me. Am I commiting some abuse of notation or something ? Also there are no higher order terms like $dr dr d\theta$ which I can ignore. I am totally confused with all this. Can someone explain this to me a bit clearly? Thanks in Advance :). EDIT 1 : I know differentials are not the &quot;usual&quot; kind of algebraic quantities and we can't just add and multiply them casually. I am just multiplying $dx$ with $dy$ with the spirit of multiplying some $\delta x$ and $\delta y$ and letting both $\delta x$ and $\delta y$ tend to zero. EDIT 2 : Is there a branch of Mathematics where addition and multiplication of differentials is very common? Is there something like differential of a differential ? Windows INSERT key anti-functionality accidentally triggers; how to stop it permanently? Orthographic scale of camera in Blender could somebody explain how orthographic scale is calculated in Blender? I am trying to match an orthographic view that I get from another software with that of Blender, but I am not able. Camera gets in the correct position but the zoom level is wrong.  Thanks, byte Why do some lenses focus past infinity? On the kit 18-55 lens that came with my Nikon D5100 I have noticed that when trying to focus on infinity for shots in dark conditions (star-trails, etc) the lens tends to move past infinity out of focus and need to be brought back a little to get a clear infinity focus point.  Is there a good trick for getting a clear infinity focus when in pitch dark conditions? Tall curly brace I would like to put a tall (long) left curly bracket on the left side of the following:  \documentclass[12pt]{article}  \begin{document}  \noindent c: $\{$1, ..., n$\}$ $\rightarrow$ $\{$1, ..., n$\}$, such that  \hspace{20 mm}  \noindent c($a_i$) = $a_{i+1}$ for 1 $\le$ $i$ &lt; $l$  \hspace{20 mm}  \noindent c($a_l$) = $a_1$   \end{document}   Please let me know if you can help. Thanks! A positive integer $n$ is called a balancing number if  $$1 + 2 + \cdots + (n − 1) = (n + 1) + (n + 2) + \cdots + (n + r) \tag{1}$$  for some positive integer $r$.     Problem: Find the general solution (closed-form expression) of equation $(1)$, in other words, find $f_1(m)=n, f_2(m)=r$ where $f_1, f_2$ are solution of $(1)$ for any integer $m \in \mathbb Z$.   I have asked a  with a constrain involving Pell's equation. <lightning:recordViewForm will not display I am trying to show that if for a group $G$ we have $Z(G)=1$, then $Z(\operatorname{Aut}(G))=1$.  I have tried everything I can think of, but to no avail.  The first part of the problem was to show that $\operatorname{Inn}(G) \triangleleft  \operatorname{Aut}(G)$ - does this have any connection?  I couldn't find one.  I know that $\operatorname{Inn}(G) \cong G/Z(G)$, so in this case $\operatorname{Inn}(G) \cong G$ and $Z(\operatorname{Inn}(G))=1$.  Is there any way to get from this to $Z(\operatorname{Aut}(G))=1$?  How do we go about showing this?  Thanks. Who is allowed to invite people to a Minecraft Realm? I am running centos 5.8 with cpanel. Lately I am getting reports that my swap is full , but there is a lot of free memory  to use.  top - 10:33:43 up 133 days, 17:00,  1 user,  load average: 0.05, 0.03, 0.05   Tasks: 170 total,   1 running, 169 sleeping,   0 stopped,   0 zombie   Cpu(s):  2.1%us,  0.5%sy,  0.0%ni, 97.2%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st   Mem:  24726100k total,  8255368k used, 16470732k free,   599560k buffers   Swap:  1046520k total,   984740k used,    61780k free,  3641828k cached     How do I solve this? The unused ram memory should be used instead of the swap. Or should I increase the swap ( and how do I do that ? ).  Thanks What is Peter Quill's status after Guardians of the Galaxy Vol. 2? why can't i select two objects in edit mode?     I am trying to make a face from two different meshes but can't perform the action Taken from :  Show that it cannot be the case that $U=X+Y$ where $U$ is uniformly distributed on [0,1] and $X$ and $Y$ are independent and identically distributed. You should not assume that X and Y are continuous variables.  A simple proof by contradiction suffices for the case where $X$, $Y$ are assumed discrete by arguing that it always possible to find a $u$ and $u'$ such that $P(U\leq u+u') \geq P(U\leq u)$ while $P(X+Y \leq u) = P(X+Y \leq u+u')$.  However this proof does not extend to $X,Y$ being absolutely continuous or singular continuous. Hints/Comments/Critique? How do I calculate the power consumed by a lightbulb? I'm studying a lightbulb and its variable resistance, given by the expression:  $R(T) = Ro[1 + α(T-T_0)]$, where $R_0$ is the resistance of the lamp at $T_0$.  In this case, $R$ is not given by Ohm's law ($V=Ri$). So, which expression can I use to calculate the power consumed by a lightbulb?   $P = R\cdot i^2$ $P = \frac{V^2}{R}$ $P = V\cdot i$ (I don't think I can use this one)   I have measured the current and the e.p.d. at the bulb using instruments. As I have seen in other posts, i.stack.imgur.com is blocked by numerous companies' firewalls including my own. I have started the process to get the restriction lifted but to increase the likelihood of it being granted, have only requested that i.stack.imgur.com be unblocked.  Staying within the context of SO, imgur and the hosting arrangement SO has with them, are there any other sub-domains/domains that I should be requesting be unblocked? i.e. p.stack.imgur.com or *.stack.imgur.com?  I'm not sure if images can still be embedded/hotlinked in posts from other image hosts or not but if they can I'm not interested in unblocking those hosts, just the addresses used by SO for imgur.  Cheers :)