I am making a basic word scrambling and guessing game. To make sure the same word doesn't appear again (example words used) I need to delete the selected word. I have looked all over for solutions however none have worked. Any help is appreciated! //word bank   string[] wordBank = {   &quot;iphone&quot;, &quot;airpods&quot;, &quot;laptop&quot;,&quot;computer&quot;,&quot;calculator&quot;,&quot;ram&quot;,&quot;graphics&quot;, &quot;cable&quot;,&quot;internet&quot;,&quot;world wide web&quot;   };    //select random word   Random wordRand = new Random();   int index = wordRand.Next(wordBank.Length);   string wordSelect = wordBank[index];                //delete word so can't be used again
I have an array of Foo objects. How do I remove the second element of the array?  I need something similar to RemoveAt() but for a regular array.
What is the cardinality of the set of the empty set? Given set $ A = \{  \emptyset   \}$ what is $|A|$? I just learned about sets today in class and I'm unsure how to answer this. How to describe arbitrary accelerations in special relativity Does anyone know if there's a way to get an Android phone to reboot into recovery mode, from the Android command line?  Note:  I do NOT have adb access.  I do NOT know the magic power-on sequence to do it from the boot loader. I've tried the common things and nothing works.  I DO have root. (And can enter commands directly on the device using a terminal emulator.)  I know it's possible, somehow, because applications like ROM Manager do it. But how? Find the derived subgroup of $A_4$ Find the derived subgroup of $A_4$.   Since it is $A_4$, for a permutation $\sigma$ to be in $A_4$, $\sigma$ must have a cycle structure of $2$ cycles. Therefore, $\sigma=(ab)(cd)$.  The commutator of such elements, would be obviously another permutation of $2$-cycle (of length $2$).  Does it mean that $A'_4=A_4$? I got the following problem: Right now I am checking my equations, which are usually written in align. This looks great in most of the cases, but sometimes the pagebreaks are weird, ie there is a lot of vertical whitespace left (like 2.5cm) at the end of a page. I made the following MWE to illustrate this.  \documentclass[a4paper, 12pt, headsepline]{scrreprt} \usepackage[onehalfspacing]{setspace} \usepackage{amsmath, amssymb, mathtools} \usepackage{mathptmx} \usepackage[a4paper]{geometry} \geometry{left=2cm,right=5cm,top=2cm,bottom=2cm} % \usepackage{lipsum} %\lipsum \usepackage[pangram]{blindtext}  \begin{document} \Blindtext[1][3]%1 paragraph, 3 pangrams \begin{align} X_{t+1} &amp;=  \frac{X_{t+1}+X_{t+1}}{Y_t}  \label{eq:1}  \intertext{Solving...:} \notag  X_{t}  &amp;=  \frac{X_{t+1}+X_{t+1}}{Y_{t+1}} \notag \\ \intertext{Solving further...:} \notag  % ===PAGEBREAK HERE: 2nd page begins=== &amp;= \frac{X_{t+1}+X_{t+1}}{Y_t} +  \frac{X_{t+1}+X_{t+1}}{Y_t}  \notag \\ &amp;= \frac{X_{t+1}+X_{t+1}}{Y_t}...  \notag \\ \intertext{Solving further...:} &amp; = \frac{X_{t+1}+X_{t+1}}{Y_t}  \notag \end{align}  \end{document}   In the MWE, the first 'Solving further' should be on the first page instead (to save space and it would also look better I guess?). The position where I would like the pagebreak to be is also marked as a comment in the MWE.  My question is first on a general basis: Which is the best environment to achieve multiple line equations, which can be aligned as in align, and to save space at the same time? Or to be more precise: If possible, I'd like to stick with align and adapt the pagebreaks only if necessary.  Thanks! How to handle ordinal categorical variable as independent variable I am using a logit model. My dependent variable is binary. However I have an independent variable which is categorical and contains the responses: 1.very good, 2.good, 3.average, 4.poor and 5.very poor. So, it is ordinal ("quantitative categorical"). I am not sure how to handle this in the model. I am using gretl.  [Note from @ttnphns: Although the question says the model is logit (because the dependent is categorical), the crucial issue - ordinal independent variables - is basically alike, be the dependent categorical or quantitative. Therefore the question is equally relevant to, say, linear regression too - as it is to logistic regression or other logit model.] I accidentally installed some USB drivers to my Windows 7 system, they were the wrong ones and now my keyboard and mouse won't work. A system restore would get rid of them, but obviously I can't control my computer to make that happen.  Keyboard and mouse still work before windows has loaded, in the BIOS and boot system, so can I do anything from there? I've already tried booting into another OS, accessing my windows filesystem and deleting the Program Files entry, but it didnt work so they must go deeper than that. Or could i launch it from a remote machine? I've got some VNC server insalled so if i could get that running that could work. Question:  Is exception handling in Java actually slow?  Conventional wisdom, as well as a lot of Google results, says that exceptional logic shouldn't be used for normal program flow in Java.  Two reasons are usually given,   it is really slow - even an order of magnitude slower than regular code (the reasons given vary),     and    it is messy because people expect only errors to be handled in exceptional code.     This question is about #1.  As an example,  describes Java exception handling as "very slow" and relates the slowness to the creation of the exception message string - "this string is then used in creating the exception object that is thrown. This is not fast."  The article  says that "the reason for this is due to the object creation aspect of exception handling, which thereby makes throwing exceptions inherently slow".  Another reason out there is that the stack trace generation is what slows it down.  My testing (using Java 1.6.0_07, Java HotSpot 10.0, on 32 bit Linux), indicates that exception handling is no slower than regular code.  I tried running a method in a loop that executes some code.  At the end of the method, I use a boolean to indicate whether to return or throw.  This way the actual processing is the same. I tried running the methods in different orders and averaging my test times, thinking it may have been the JVM warming up.  In all my tests, the throw was at least as fast as the return, if not faster (up to 3.1% faster).  I am completely open to the possibility that my tests were wrong, but I haven't seen anything out there in the way of the code sample, test comparisons, or results in the last year or two that show exception handling in Java to actually be slow.  What leads me down this path was an API I needed to use that threw exceptions as part of normal control logic.  I wanted to correct them in their usage, but now I may not be able to.  Will I instead have to praise them on their forward thinking?  In the paper , the authors suggest that the presence of exception handlers alone, even if no exceptions are thrown, is enough to prevent the JIT compiler from optimizing the code properly, thus slowing it down.  I haven't tested this theory yet. Conflict between tkz-fct and thmtools? Are both expressions correct? If yes, do they have different meanings? It seems to me that I came across both of them in books, but I'm not sure. I have a content type with multiple fields. Some of the fields are accessible to everyone and there are other fields for which the access is controlled.   Example: There is a content type called Reports with fields like title, summary, body etc. Title and summary should be visible to everyone but the access to body field is controlled.  For implementing this I need to have 2 view modes. one of them will have the fields title and summary displayed with the rest of the fields hidden. The other view mode will have only the body field visible. I am planning to implement the hook hook_node_access to derive the access permissions for the node. So how can I get the view mode in this hook so that I can have my access check based on the view mode. Print composer custom grid label problem In answer to  Klas Karlsson puts forward a solution to the problem of formatting print composer grid labels for projected maps.  I'm very weak on scripting, but in QGIS 2.14 I've tried to enter the text as shown in Klas's illustration, which generates error messages. In my case I'm working with a coordinate system that has a six-digit Easting and a six-digit Northing and I'm trying to get a result similar to that shown in Klas's picture (but with a six-digit Northing). Can anyone help me with this? How long can I store a food in the pantry, refrigerator, or freezer? How do I know if a given food or ingredient I have is still good, or if I should discard it?  How can I best preserve a food or ingredient?     This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed. leaflet geojson coordinate problem I just started to play with leflet/geojson a little. But my coordinates are not rendered properly and I have no clue what is going on.  My coordinates are: 52.23943, 4.97599. They work correct with the setView function.  var map = L.map('leaflet_map').setView([52.23943, 4.97599], 15);   But using a geojasonFeature they are, hmmm, 'projected', somewhere east of Somalia.  var geojsonFeature = {             "type": "Feature",             "properties": {             "name": "Coors Field",             "amenity": "Baseball Stadium",             "popupContent": "This is where the Rockies play!"             },             "geometry": {                 "type": "Point",                 "coordinates": [52.23943, 4.97599]             }         };         var myLayer = L.geoJson().addTo(map);         myLayer.addData(geojsonFeature).bindPopup("I am a gjson point.");   Anyone who knows what is happening here?  EDIT  Out of pure curiosity I changed the coordinates around [4.976143930893815,52.23925499011473] and the point appears at its correct location. A known bug!? What are the origins of the word orientated?  As far as I know, the correct spelling is oriented and orientated is not an alternative spelling but an error that is in common use.  Is it for example more commonly used in a certain country or by a certain people? Is there a reason for people choosing to say or write orientated instead of oriented? Prove that $x-1$ divides $x^n-1$ In algebra &amp; polynomials, how do we prove that $$x-1 \mid x^n -1?$$ Enable HTTP DELETE requests on Apache server I need to configure my server to permit the http delete method.  currently, I get the following error when I attempt to make this call:    HTTP/1.1 405 Method Not Allowed Date: Mon, 11 Apr 2011 20:56:23 GMT Server: Apache/2.2.17 (Win32) PHP/5.3.5 Allow: GET,HEAD,POST,OPTIONS,TRACE Content-Length: 233 Keep-Alive: timeout=5, max=98 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1     I have searched far and wide and have not been able to come up with an answer as to how I can configure the server to allow this request.  Someone please help as it has put a stop to my project. The relativistic energy-momentum equation is:  $$E^2 = (pc)^2 + (mc^2)^2.$$ Also, we have $pc = Ev/c$, so we get: $$E = mc^2/(1-v^2/c^2)^{1/2}.$$  Now, accelerating a proton to near the speed of light, I get the following results for the energy of proton:  0.990000000000000   c =&gt;    0.0000000011    J =      0.01    TeV  0.999000000000000   c =&gt;    0.0000000034    J =      0.02    TeV  0.999900000000000   c =&gt;    0.0000000106    J =      0.07    TeV  0.999990000000000   c =&gt;    0.0000000336    J =      0.21    TeV  0.999999000000000   c =&gt;    0.0000001063    J =      0.66    TeV  0.999999900000000   c =&gt;    0.0000003361    J =      2.10    TeV  0.999999990000000   c =&gt;    0.0000010630    J =      6.64    TeV 0.999999999000000   c =&gt;    0.0000033614    J =      20.98   TeV  0.999999999900000   c =&gt;    0.0000106298    J =      66.35   TeV  0.999999999990000   c =&gt;    0.0000336143    J =      209.83      TeV  0.999999999999000   c =&gt;    0.0001062989    J =      663.54      TeV  0.999999999999900   c =&gt;    0.0003360908    J =      2,097.94    TeV  0.999999999999990   c =&gt;    0.0010634026    J =      6,637.97    TeV  0.999999999999999   c =&gt;    0.0033627744    J =      20,991.10   TeV    If the LHC is accelerating protons to $7 TeV$ it means they're traveling with a speed of $0.99999999c$.  Is everything above correct? Images instead of radio buttons or dropdown list? How to unit test an object with database queries I've heard that unit testing is "totally awesome", "really cool" and "all manner of good things" but 70% or more of my files involve database access (some read and some write) and I'm not sure how to write a unit test for these files.  I'm using PHP and Python but I think it's a question that applies to most/all languages that use database access.