I want an elegant way to create a new List&lt;int&gt; just by to integers.  Example:  var from = 2; var to = 5;   What I want is this:  List&lt;int&gt; { 2, 3, 4, 5 };   Of course I could do it in a simple loop like this:  var results = new List&lt;int&gt;(); for (var i = from; i &lt;= to; i++) {      results.Add(i); }   But I want some kind of more efficient or elegant way.
I need a list of integers from 1 to x where x is set by the user.  I could build it with a for loop eg assuming x is an integer set previously:  List&lt;int&gt; iList = new List&lt;int&gt;(); for (int i = 1; i &lt;= x; i++) {     iList.Add(i); }   This seems dumb, surely there's a more elegant way to do this, something like the
I've seen them maneuver. They definitely can go backwards. How fast can they go in reverse? Is warp speed possible, or is reverse limited to impulse power? If it is limited to impulse power, can they travel backwards under impulse power as fast as they travel forwards under impulse power? What does different focal length offer me? Doing a search via regular Gmail frontend in the browser, shows strange results.  I want to search all mails from   *@ebay.*   My search:  from:@ebay   shows also emails sent from an ebay subdomain:   eBay@reply.ebay.com   It seems like Gmail ignores the "@", otherwise I can't see why those messages appear in the search results.  I also tried following searches with no success:  from:"@ebay" from:'@ebay' from:(@ebay) from:("@ebay") from:('@ebay') How to add http:// if it doesn't exist in the URL How does the double strike mechanic interact with other mechanics like lifelink or trample? How to access Render Result pixels from python script? Render Result exists in bpy.data.images["Render Result"] but it contains no data.  Also bpy.data.images["Render Result"].size[0] is 0, even if the render shows as an image in the UV/Image Editor with a width of 1366.  Maybe the render result cannot be accessed as an image or I missing some update or refresh call somewhere but I can't find such a thing in the 2.68 API documentation.  Any tip in the correct direction appreciated. I've had a promising Skype interview with a great professor from a top-level university in US. Our research interests are closely related and he encouraged me to apply BUT he says that all decisions are finally made by admission committee there.  The question is "Is a professor in such a high-level university able to affect admission committee if he really wants a student?" or "Does admission committee decision-making process become easier if a professor really wants an applicant?"  The main point is the difference between my transcript (which is a real catastrophe!) and my research background which is pretty good so the professor's decision might be different from admission committee. For any triangle with sides $a$, $b$, $c$, show that $a^2b(a-b)+b^2c(b-c)+c^2a(c-a)\ge 0$ Imagine I have tons of RAM. Let's say 64GB. That's a lot for even gaming PCs. Now the default location of a pagefile in Windows is on the main OS drive, be it HDD or SSD, which are faster in general, but still not as fast as RAM.  Something tells me that disabling the pagefile on the hard drive or creating a virtual RAM drive and letting the pagefile be there could make Windows move all its virtual memory to RAM, and so increase the system's performance, but I'm not very knowledgeable in that area, so that might not be true at all.  I tried both, but I couldn't analyze the results to reach a definite conclusion with my knowledge level in memory things.  Would this work? If not, why? I was going through the fundamental theorem in Number Theory where any non zero integer n can be represented as a product of distinct primes. A related problem with this theorem is to prove that for every such number, there exists a prime $p$ such that $p&lt; \sqrt n$. I was wondering if there is any mathematical proof that no prime $p$ exists for the number $n$ such that $p&gt; \sqrt n$. Given any $10$ consecutive positive  integers , does there exist one integer which is relatively prime to the product of the rest ? Finding specific records of US WW2 veterans? How to upload LaTeX-generated pdf paper to arXiv without LaTeX sources arXiv is smart enough to detect whether your PDF is generated by LaTeX. If it is, arXiv asks for the sources of the PDF instead of the PDF file itself. This is really annoying and inconvenient.  I ask a way to fool the arXiv and avoid PDFs being detected as generated by LaTeX (even if they were indeed).  I have tried this: : "create a pdf from word and then simply insert pages from your article, and delete the word's page".  And it did not work. Can I get the "Diamonds to you!" achievement in singleplayer? How can one get the "Diamonds to you!" achievement in singleplayer? The achievement list cannot be completed without it. Perhaps it can be possible by passing a diamond to a zombie? putting a tikzpicture inside a \caption{} I'm attempting to put a small tikzpicture inside a \caption{} belonging to a figure environment. The reason for doing this is fairly simple - to create an in-caption legend for a PGFplot, with consistency between the TikZ styles in the figure and in the caption. Previously I would have done this using dashes and the xcolor package, however, this is an awful hack. In this MWE:  \documentclass{article} \usepackage{tikz} \begin{document} \begin{figure} \caption{\raisebox{0.5ex}{ \begin{tikzpicture}\draw[dashed,color=red,thick] (0,0) -- (0.5,0);\end{tikzpicture}} Gas--Phase}  \end{figure} \end{document}   The expected output:    is generated, but I get ! Argument of \@caption has an extra }. and ! Paragraph ended before \@caption was complete. Within the larger context of the document that I'm writing, which includes chapters in external .tex files, compilation fails catastrophically (dozens of errors) with no output, so I can't just ignore the warnings in this instance. Any ideas? Package natbib Error: Bibliography not compatible with author-year citations I have a basic tex file and a bibliography which is exported from Mendeley  However, when I want to cite in the author-year style, I get the error:   Package natbib Error: Bibliography not compatible with author-year citations. (natbib) Press &lt;return&gt; to continue in numerical citation style.  Any clue what's wrong?  Minimum working example:  \documentclass[letterpaper, 10pt]{article}  \usepackage[authoryear]{natbib} \usepackage{lipsum}  \begin{document}  \lipsum[1-4] \nocite{*}  \bibliographystyle{apalike} \bibliography{articles}  \end{document}    A snippet of my .bib library:  @article{shortcode, author = {Lastname, Firstname}, file = {:/path/to/file.pdf:pdf}, journal = {Journal name}, number = {xx}, pages = {x--xx}, title = {Title}, volume = {xx}, year = {xxxx}     } Is a constant condition more costly than switching shaders? In general, branching in shaders is not a good idea. But now I have a shader with a condition that is constant with respect to the entire draw call. So the branch that is executed is always the same for one draw call.  Is such kind of branching still more costly than having multiple shaders without these branches and switch between them? Why the middle mouse button in Blender 2.80 changes the orthographic view to perspective? If I choose an orthographic view by using the numpad and then try to orbit the geometry by clicking the middle mouse button Blender goes from orthographic to perspective. Why is that the default now? Wouldn't it be more logical if instead of that Blender kept the orthographic mode? In other words: Why Auto Perspective is turned on by default? text processing rows to columns for a block I have a file containing lists on Solaris:  List A hi hello hw r u  List B Hi Yes  List C Hello   I need to transpose the lists as shown below:  List A    List B    List C hi        Hi        Hello hello     Yes hw r u   How can I do this on Solaris? Predicting the number of decimal digits needed to express a rational number