I'm new with unity and c#. I have a class with subclass as below. Now I want to add new data inside the list of friends.  [Serializable] public class PlayerData {     public string playerName;     public string playerId;     public Friend[] friends; }  [Serializable] public class Friend {     public string playerName;     public string playerId; }   I want to add new friend in the friend class list. Code I have tried till now.  public string AddFriends(string friendId)     {         PlayerData pd = playerDataDict[playerId];         Friend friend = new Friend();         friend.playerId = friendId;         pd.friends.Append(friend);         return "sdwsd";     }   Thank you
Probably a really simple one this - I'm starting out with C# and need to add values to an array, for example:  int[] terms;  for(int runs = 0; runs &lt; 400; runs++) {     terms[] = runs; }   For those who have used PHP, here's what I'm trying to do in C#:  $arr = array(); for ($i = 0; $i &lt; 10; $i++) {     $arr[] = $i; }
wrappers and JavaScript pop-up? Use Case:  What i want is a list of records, and allow this user to choose 2 of those records, then click a button to go to a new VF page, if the user selects more than 2, i want him to get a notification of some kind saying you need to select 2 records, I do not want the page refeshed though.  Strategy:  I'm creating a wrapper class for the records like this:  and i have that part going by creating a custonm controller... I need the notification part working.   Problem:  I don't know how to call methods from the customController in javascript Also, i do not want to refresh the entire page. I just want them to go back to where they were. I was thinking a pop-up notification but I'm flexible.. Ubuntu files worthless on Windows? How can I find such a $z$? (Injectivity of $T(z) = \lambda z + \mu\bar{z}$) We consider $T:\mathbb{C}\to\mathbb{C}$ defined by $T(z)=\lambda z+\mu\overline{z}$, where $\lambda ,\mu\in\mathbb{C}$. I want to prove that if $T$ is injective, then $\lambda\cdot\overline{\lambda}\neq\mu\cdot\overline{\mu}$.  Clearly, if $\mu =0$, then $\lambda\neq 0$ because $T$ is injective.  Now, if $\lambda\cdot\overline{\lambda}=\mu\cdot\overline{\mu}$ and $\mu\neq 0$, then I wanted to find a $z\in\mathbb{C}\setminus\{0\}$ such that $z=-\dfrac{\overline{\lambda}}{\overline{\mu}}\overline{z}$, because we would have that:  $T(z)=-\lambda\dfrac{\overline{\lambda}}{\overline{\mu}}\overline{z}+\mu\overline{z}=\overline{z}(-\lambda\dfrac{\overline{\lambda}}{\overline{\mu}}+\mu)=0$  ('Cause this would prove that $\lambda\cdot\overline{\lambda}=\mu\cdot\overline{\mu}$ implies $T$ is not injective.)  So, the question is, can we always find such a $z\in\mathbb{C}\setminus\{0\}$? Is there an elementary proof that $\sum \limits_{k=1}^n \frac1k$ is never an integer? Cant find the solution when sorting an array in JavaScript The black book knowledge Breadcrumb hyperlink header Why does Stack Overflow allow duplicate display names? What is the reasoning behind the design decision to allow users to create a display name which matches another existing users exactly?    This is opposed to the common practice of enforcing unique user names, and I'd really like to learn something. RSA encryption with private key and decryption with a public key When using the RSA cryptosystem, does it still work if you instead encrypt with the private key and decrypt with the public key? What about in the case of using RSA for sender authentication? How do I deliver a baby? I'm playing Fallout Shelter, and my newest bonus objective is to "Deliver 1 Baby Dweller."  I've already figured out that I can put a male vault dweller and a female vault dweller together in some residential quarters, and and eventually, if they hit it off, the lady will replace her vault suit with a yellow sweater and a decidedly pregnant figure.   Good enough.  But how long does it take her to deliver the child? Do I have to induce it through some sort of tapping ritual or placing her in the correct room? Does the pregnant dweller need to stay in the living quarters, or can I put her to work in my Diner or Water Treatment Facility? Do the SPECIAL stars of the parents matter?  Tell me everything about  and what I can do to control the process. Finding all solutions for a system of equations with constraint on the sum of absolute values I am looking for a fast algorithm to find all integer solutions for the following system of linear equations ($c_1,\ldots,c_n \in \mathbb{Z}$ and $r\in \mathbb{N}$ ):  $x_1+x_2=c_1$  $x_3+x_4=c_2$  ...  $x_{2n-1}+x_{2n}=c_n$  $|x_1|+|x_2|+\ldots+|x_{2n}|=r$  $x_1,\ldots,x_{2n} \in \mathbb{Z}$   Also can we find the number of solutions before solving the system? SharePoint Online REST API List Items Paging Can anyone confirm that they are able to page against a SharePoint Online List Items query? Either I'm not understanding how this query is supposed to work or it just doesn't work.   tenant.sharepoint.com/conversations/_api/web/lists/getbytitle('Posts')/items?$skiptoken=Paged=TRUE&amp;amp;P_ID=2   I'm leveraging the documentation  but when using Postman, all items are returned in the same query response. For example, according to the $skiptoken P_ID=2 above, I'm expecting a response without item ID 1. However, I still get ID 1, 2, and 3 in the response. Proper subspaces of $ R^n $ I'm trying to prove that proper subspaces of $ R^n $ are closed and have empty interiors.  To prove that they are closed I'm trying to use the fact that inverse images of closed sets are closed sets by continuous functions. So I'm trying to find a linear map such that a proper subspace of $ R^n $ is its Kernel but I don't know how to express it so that it would work on all dimensions.  Regarding the fact that they have empty interiors, I really don't know what to do.  Thanks in advance. I wonder if this is a bug, or if I missed something... When a light hits tangentially convex surfaces with "smooth shading", the shadow on this surface seems to "partially ignore" the smoothness of the surface. Here is an example with a simple cylinder :    On the left, a cylinder with "flat shading". Everything's ok. On the right, the same with "smooth". We can see an edge, bad shadowed.  With or without the "Edge split" modifier, no matters, the edge is still there. The shader is a simple white diffuse shader with no texture nor displace.  I have to add a subsurf modifier with at least 2 levels, which will insanely increase the vertex count... And I can't do that for my project.  I hope someone already saw it, and have a little tip to share. Or if someone already know it's a bug, or a limit of the current Cycles renderer ? This discussion informed our process for seven years, but eventually required updates and augmentation. For discussion regarding the successors to this process, please see:    Stack Exchange has some of the best Moderators around — seriously — and that is due in no small part to the communities who scrutinize and vote in our Moderator elections.  We have a rather formal process for electing moderators, but up until now  has been quite informal. On those rare, rare occasion when things just aren't working out, you can see why it becomes such a sticky business to remove someone from a democratically elected position. Our current process is one of &quot;we've got your back.&quot; The Community Team routinely monitors moderator activities, so if a moderator violates the  or fails to uphold the , we can and do intervene. If the disputes and problems persist without resolution, eventually we can ask someone to step down. That's not good enough. We need a much more transparent and prescribed process for when — and more importantly how — to intervene when on-going problems are going unresolved. In urgent situations, we'll step in to protect a site, but ideally the process should be impartial and not subject to accusations of Stack Exchange simply applying undue influence over a community when the whim strikes. The Question: Before we start bouncing around ideas internally, I'd like to hear what you think. What process should be in place to add some checks and balances to deal with higher issues like possible impeachment of a moderator? When and how would such a process come into play? How should such situations be resolved? How do we keep it from being abused? Have at it. This is a round table vetting of ideas. How can I include value of sharepoint's version column in a word document? I'm trying to work out a way to display the contents of the version column from SharePoint (i.e. the value that changes every time a file is checked in) as a field (or something similar) inside of a Word document.  Ideally, I'd like to know how to configure SharePoint so I could click something like "Insert > Quick Parts > Document Property > Version", and it would include the version in the document.  The goal is to make it easier for someone to correlate a printed version of a document with the version history of SharePoint.  I have been able to add editable text columns to the Document content-type and have them show up as document property quick parts.  I've also been able to add a calculated column which gets the version as a text string... however this calculated column isn't showing up in Word as a document property.  (Perhaps I'm missing a setting on the calculated column) How do I connect to a MySQL Database in Python? How do I connect to a MySQL database using a python program? An integrable and periodic function $f(x)$ satisfies $\int_{0}^{T}f(x)dx=\int_{a}^{a+T}f(x)dx$. I want to prove:     For an integrable function $f(x)$ and periodic with period $T$, for every $a \in \mathbb{R}$, $$\int_{0}^{T}f(x)\;dx=\int_{a}^{a+T}f(x)\;dx.$$   I tried to change the values and define $y=a+x$ so that $dy=dx$ and the limits of the integrals are as we want, but I'm not sure how to use the fact that $f(x)$ is periodic.  Thanks a lot! What Scoping Class Will  Use? In reading through the release notes I was excited to discover the introduction of a new  tag. That should help lower the barriers to entry! However, the release notes do not specify what the name of the scoping class should be. And since , we're left guessing.  To be explicit about what I'm trying to understand, take  for example:  &lt;apex:page showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0"&gt;     &lt;html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en"&gt;         &lt;head&gt;             ...             &lt;apex:stylesheet value="{!URLFOR($Resource.REPLACE_WITH_NAME_OF_SLDS_STATIC_RESOURCE, 'assets/styles/salesforce-lightning-design-system-vf.min.css')}" /&gt;         &lt;/head&gt;         &lt;body&gt;              &lt;!-- REQUIRED SLDS WRAPPER --&gt;             &lt;div class="REPLACE_WITH_NAME_OF_CUSTOM_SCOPING_CLASS"&gt;             ...         &lt;/body&gt;     &lt;/html&gt; &lt;/apex:page&gt;   If I replace the &lt;apex:stylesheet&gt; with &lt;apex:slds&gt;, what should I specify for REPLACE_WITH_NAME_OF_CUSTOM_SCOPING_CLASS? Compute $\int \frac{\sin(x)}{\sin(x)+\cos(x)}\mathrm dx$ I'm having trouble computing the integral: $$\int \frac{\sin(x)}{\sin(x)+\cos(x)}\mathrm dx.$$ I hope that it can be expressed in terms of elementary functions. I've tried simple substitutions such as $u=\sin(x)$ and $u=\cos(x)$, but it was not very effective.  Any suggestions are welcome. Thanks.