In the following method, how can I prevent the contents of my array from being modified accidentally or otherwise?  Can it be done without changing the array to another type, such as a list?      public static int LinearSearch(int[] myArray, int target)     {         int idx = -1;         for (int i = 0; i &lt; myArray.Length; i++)         {             if (myArray[i] == target) { idx = i; break; }         }         return idx;     }
Is it possible to somehow mark a System.Array as immutable.  When put behind a public-get/private-set they can't be added to, since it requires re-allocation and re-assignment, but a consumer can still set any subscript they wish:  public class Immy {     public string[] { get; private set; } }   I thought the readonly keyword might do the trick, but no such luck.
How to assign dynamic Ids for ui:inputDate element inside aura:iteration? As title says, How do I assign dynamic Ids for ui:inputDate elements inside aura:iteration?  Here is the reproducible version of the problem I am facing:  HelloWorldApp.app  &lt;aura:application &gt;     &lt;c:inputDateExample /&gt; &lt;/aura:application&gt;   inputDateExample.cmp  &lt;aura:component &gt;     &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}"/&gt;     &lt;aura:attribute name="datesList" type="List" /&gt;     &lt;table&gt;         &lt;aura:iteration items="{!v.datesList}" var="dateItem"&gt;             &lt;tr&gt;                 &lt;ui:inputDate aura:id="date-id"                                value="{!dateItem}"                                displayDatePicker="true"                               blur="{!c.fldChanged}"/&gt;             &lt;/tr&gt;         &lt;/aura:iteration&gt;     &lt;/table&gt; &lt;/aura:component&gt;   inputDateExampleController.js  ({     fldChanged : function(component, event, helper) {         console.log('Value changed');         //How do I find from which date element, event is fired??         //The below method finds both date elements because the Id is not unique         var dateComponent = component.find('date-id');         console.log(dateComponent);         console.log(dateComponent[0].get("v.value"));     },     doInit : function(component,event,helper){         var datesArray = [];         datesArray.push("2017-01-01");         datesArray.push("2017-01-31");         component.set("v.datesList",datesArray);     } })   This produces the below output and I need to find which element user is clicking on??    Notes:   I can assign unique Id for tr element but not sure how to use that inside component.find() method. I can assign dynamic id for plain input tags but there is too much markup involved for making these similar to lightning date element. I tried giving html5 data attributes for ui:inputDate but it doesn' accept.   Any workarounds or anything I am missing here? Is there an AES identity key? The following questions are of pure theoretical nature. I don't have an application in mind.   Is there a key that makes AES the identity function? Is there a key that makes AES the identity function for certain inputs? Is it known whether such keys might exist? Are such keys known for other ciphers?   For example, I want to encrypt "Hello StackExchg" with AES with said key and the ciphertext should be again "Hello StackExchg".  When I encrypt "Hello StackExchg" with the perfect cipher one-time-pad, there is a possibility that the resulting ciphertext is again "Hello StackExchg". This possibility must exist (though it is unrealistically small), otherwise, the ciphertext would not be perfectly random but depending on the plaintext. The corresponding key for one-time-pad would be all zeros. How to fix java.net.SocketException: Broken pipe? I am making an Android game that is only in portrait screen orientation.  It works great when I run it on my phone, but when I run it on a tablet, even though the screen size is bigger, all of the bitmaps are the same size. Is there any way to make the bitmaps stay the same proportion even on different size screens? So I have an old unlocked phone and I'd like to load up my own OS.  I've seen some mods out there.  CyanogenMod seems to be the most popular.  However, I was curious if I could just install a pure untouched version of the OS -- as distributed by Google. I seem to remember being able to download a clean compiled version of the Android OS.    Does Google distribute any binaries like this, and if not, is there someone out there that does?    Additionally, is this even worth trying?  These days is it necessary for Android to be packaged with special drivers and such for all of the different hardware out there? Need a MP3 ID3 tagger, and cover fetcher I need to tag my MP3 library, and have tried kid3 (which was manual tagging), when I used Kubuntu 9.10 (I now use Ubuntu Meerkat) Here are the features I am hoping for:   A good and clean UI. Tagging should be automatic, like Winamp's autotag feature, which rocks, btw! It should also embed the cover-art in the mp3, not copy a jpeg file in the folder, because now-a-days all players support displaying cover art. But acceptable if not possible. Rename the files as per some regular expression like %TrackNo - %Artist - %Title.  Should be accurate, and more importantly smart. I want to start tagging at night, and hopefully my collection should be done by the morning, w/o it being stuck at a user prompt at 1%.   If one app cant do all, I am willing to use 3, wouldn't mind exposure to a few more apps ;)  I have used picard or someting, and I didnt like it quite a lot. But wouldn't mind using it, if there is no other alternative.   Thanks for your time! What is the difference between SAN, NAS and DAS? What is the difference between SAN, NAS and DAS? There are now errors when updating and I cannot install most software due to a corrupted  /etc/apt/sources.list   file. Is there a copy I can download to replace it?  The file would be for Ubuntu 12.04 (Final Beta) in the United States. How can I form a word like "quadruple" for any number I want? I'm not sure what these are called, but how can I form a word like "quadruple" for any number I want? Like 5× as much is quintuple, what is 31× as much or 147× as much? I want to know how they are formed so I can make my own.  Similarly, how do I construct the prefixes, such as unicycle, bicycle, tricycle, quadricycle? I figured out 12 is duodeci-, but how can I form any prefix like this? How to contact professors for PhD vacancies? I know many master's students who get an opportunity to talk to their potential PhD advisors well before applying. In most cases this opportunity is available by the professors with whom they worked for their master's. Moreover, there are many others who establish a contact with professors by mailing them and enquiring about PhD vacancies.   My questions are:   How important is knowing an advisor prior to applying for PhD?  Does an email interaction play a vital role when the department makes its admit decisions? If email contact is important, can a student send out mails to 2-3 professors (working in the same area) in case one of them does not bother to reply? To sum up, is applying of any use (especially in top universities) when you have no contacts and only your credentials to bank on? D'Alemberts Principle to solve a Classical Mechanics problem I found this question on this very site and was curious on how to solve it using D'Alembert's Principle  .I already know how to do it by balancing the torque about toppling point so please don't post the latter as an answer . My attempt was to displace the upper sphere by $d\theta$ which gives its virtual displacement as  $rd{\theta}cos(\theta)$j(notice we are only interested in the y component becuz the only component of the applied force which is gravity in this case is the y component in the dot product the other components vanish) similarly the cylinder is also displaced $r'd{\phi}cos(\phi)$ where r' is the distance from the point of toppling of the center of mass. $r'cos(\phi)=H/2=r(1+sin(\theta))$ ,$r'sin(\phi)=R=r(1+cos(\theta))$ and $tan(\phi)=H/2R$ the equation coming from D'Alemberts principle is $mgrcos(\theta)d\theta=Mgr'cos(\phi)\phi$ I tried solving this but couldn't arrive at the right answer. Any help would be appreciated! How would I go about finding $\prod_{n=1}^\infty (1+\frac{1}{n^2})$ ? Setting $a_k = \prod_{n=1}^k (1+\frac{1}{n^2})$, the first few partial products are $a_1 = 2$, $a_1 = 2.5$, $a_3 \approx 2.78$, $a_4 \approx 2.591$, $a_{20} \approx 3.50$, and they eventually appear to converge at around $3.639$. (These values were found with a quick python program. So much for my initial conjecture that the product converged to $e$.)   I tried writing $1+\frac{1}{n^2}$ as $\frac{n^2 + 1}{n^2}$, but it wasn't immediately obvious how to prove convergence / find the limit because the product doesn't really factor or telescope. Is there a way to calculate the limit? Is any divergence-free curl-free vector field necessarily constant? I was just testing Eevee and found that you cannot view a glass object through another glass. Is there any workaround? It works fine only If I rotate the glass window or put my camera to the back side of the scene Windows 10 Asks me to Enter a Password I am using Windows 10 Pro x64 on my personal laptop on which I have a single user account with no password. For some reason however, Windows 10 has started asking me to enter a password whenever I boot up my machine. All I have to do is press the button without entering anything, and I log in, but I would much rather skip this step in favor of an automatic sign-in. Why has this started happening only now? What can I do to stop this behavior? Is there any adjustment required when computing the correlation coefficient between:   continuous and discrete variable  two discrete variables ?    Thanks ! Code Formating in Comments How many generator has a cyclic group of order n? Reference request: Standard textbook for first-order predicate logic in english I am writing my bachelor thesis in english, but I have studied logic in my different native language. Since a rely on elementary results from first-order predicate logic (especially satisfaction in structures), I should reference the reader to a textbook for details.   Is there a standard textbook that starts with elementary propositional logic and goes to Incompleteness theorems? How to automatically add &raquo; (») to  elements using CSS?