I have the code below:  static IEnumerable&lt;int&gt; YieldReturn() {     yield return 1;     yield return 2;     yield return 3; } static void Main(string[] args) {     // Lets see how yield return works     foreach (int i in YieldReturn())     {         Console.WriteLine(i);     } }   I have a couple of questions:  1-How many times does YieldReturn() get called? one or three times?  2-If YieldReturn() get called three times, how does IEnumerable store value 1, 2 and 3?
In the  question one of the answers had the following code snippet:  IEnumerable&lt;object&gt; FilteredList() {     foreach(object item in FullList)     {         if(IsItemInPartialList(item))             yield return item;     } }   What does the yield keyword do there?  I've seen it referenced in a couple places, and one other question, but I haven't quite figured out what it actually does.  I'm used to thinking of yield in the sense of one thread yielding to another, but that doesn't seem relevant here.
How is voltage always able to increase, if electrons move at the speed of light? Are you less likely to down-vote someone whose gravatar is a photograph of them? I know this is hard to answer since, to the extent that anyone does this, they likely don't do it consciously. In the spirit of Richard Wiseman and  I just wondered what were people's thoughts on it.  Please bear in mind that that's me in the picture, and if you down-vote this, that'll be a real person hurtin', not some abstract symbol. Using Mosfet with seperate Logic Converter and Arduino Where is the Layers panel in Blender 2.8? Zooming in to inspect texture details in 3D view clips some closer faces like shown in the image. It's not the camera view so changing camera settings doesn't help.   Where can the distance to the clipping plane be adjusted? Pygame - blitting from x and y cordinates of image YA novel about dystopian future with non-human overlords and teenage heroes 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. DEF file syntax error in visual studio 2012 How do I run Command & Conquer Gold on Windows 7 64-bit (in XP mode)? I downloaded the first Command &amp; Conquer game  and burnt some CDs. I couldn't get the Setup.exe program to run in Windows 7 64-bit, as it must need some old DLLs. So I ran up the Windows XP Mode virtual machine, and was able to install it fine.   However, when I try to run the program, I just get an empty message box with an "OK" button. I've set the compatibility to Windows 95, and checked all of the options in the Compatibility tab, but it's not running. I also downloaded the patch suggested by EA, which is an updated version of the THIPX32.DLL file (copied into the C&amp;C installation folder).  Has anyone managed to get this working? How to say that the phone is held between shoulder and ear? What are common phrases an English native speaker would use for the pose of speaking on the phone where you use your shoulder to keep the receiver against your ear (and mouth), so your hands are free?  I have some ideas, but they all sound wooden, and I don't think I've ever heard anyone describe this pose in words. It's also pretty much impossible to google for a pose or look it up on leo.org or other dictionaries.  OK, since people keep asking for what phrasings I found, I'll provide two, though I was hoping I could avoid influencing people who answer here by not providing them: "balance on one's shoulder", "held/nestled/sandwiched between shoulder and ear". I have two servers (both servers are on Windows OS):   Server_A running Oracle 12c Server_B running SQL Server 2014   I want these servers to be able to see each other, so I can SELECT anything I want in Server_A from Server_B and vice versa.  I only want the ability to run SELECT queries (not INSERT, UPDATE, DELETE or any DDL queries), and also if possible to EXECUTE procedures.  What options or technologies we have for achieving this issue and which one is better?    Tell me if any software I have to install or any configuration have to be set on each of servers. I appreciate explaining the instructions step by step. Automatically capitalise the first word in each sentence Assume $\{a_n\}$is a sequence which  satisfies the following recursion formula: $$a_{n+1}=a_n+\frac{2a_{n-1}}{n+1}~(n\geqslant 1).$$ and $a_0=\pi,a_1=\pi^2 $. How to compute $\displaystyle\lim_{n\to \infty}\frac{a_n}{n^2}$? Layers with same coordinates not lining up I have a project where I have a few layers (State of Texas, cities, roads, etc.). They are all resaved and projected to NAD83 / UTM zone 14N EPSG: 26914. The project CRS is also NAD83 / UTM zone 14N EPSG: 26914 and on the fly projection is enabled. I added a text delimited file and cannot get them to line up. I checked the attribute table of the delimited file and the coordinates are correct. I cross-checked this with a point close to where a few of the points from the delimited file are and they are very close so in theory they should be lining up. I tried to save the delimited file and save it with the same projection and add the shp file back in and that did not work. Anyone have any ideas? I can't think of anything else to try. Is a company e.g. Pfizer, singular or plural? Here is from an article from the  magazine:     One drug he talks about is an antidepressant called reboxetine (branded as Edronax by   its makers, Pfizer) that he used to prescribe to his patients.   Pfizer is a drug company. It is a singular noun. Why is it described as its makers, which is plural? Ethernet: how important is the magnetics topology? I have some Ethernet issues with a set of boards (6/10 are bad). They're possibly just assembly house mistakes... but I'm very concerned about my magnetics jack.  I could have sworn I saw a example schematic with my jack's topology used with my PHY before, but I can't find it. The PHY's datasheet and suggested magnetics jacks are all identical in topology, and very different than what I have.  I'm using a SMSC  PHY, with a Bel  magnetics jack.  The transformer ratios on my jack vs. a suggested jack for this PHY like the  are the same (1:1).  The inductance is the same, 350uH. However, the choke on mine is on the circuit side, not network side. Also, while the TLA has four 75 ohm resistors from taps tied to a single 1nF/2kV cap, mine has an extra set of 1nF caps between the taps and the 75 ohm resistors.  The main difference is that my jack is a POE jack, and I thought I found an example that used one exactly like it. So, the topology is obviously different just because of that feature.  At the moment, I have 4 good boards, 1 'sometimes' board, and 5 boards that just blink a LED at 11.68Hz representing some error that no datasheet explains.  How important is this? Of course there's no other jack with that footprint.  EDIT  I added some detail on the magnetics jacks above. I was just recommended the SI-60152-F, so I'll compare to that one. Of course like all the other recommendations... it also has no stock at anyone on FindChips.  LATE EDIT  It turns out my problem was the crystal layout that fed the Ethernet PLL.  On the respin, I went with a more standard non-POE jack. A correct preposition - account closed due/by/at 12th of May $f$ holomorphic on $D\setminus \{0\}$ and takes no values in $(-\infty,0],$ then $0$ removable If $f$ is holomorphic on $D\setminus \{0\}$ and takes no values in $(-\infty,0]$ then $0$ is a removable singularity.   I thought to prove this by elimination, but I can't really tell anything about the behavior of $f$ around $0$. How can one translate the information about the definition of $f$ in semi-open interval $(-\infty,0]$. Proving bessel identity $[J_0(x)]^2 + 2[J_1(x)]^2 + 2[J_2(x)]^2 + \cdots = 1$ and $|J_0(x)|\le 1$ The generating function for a Bessel equation is:      $$g(x,t) = e^{(x/2)(t-1/t))}$$      Using the product $g(x,t)\cdot g(x,-t)$ show that:      a) $$[J_0(x)]^2 + 2[J_1(x)]^2 + 2[J_2(x)]^2 + \cdots = 1$$      and consequently:      b)      $$|J_0(x)|\le 1, \forall x$$      c) $$|J_n(x)| \le \frac{1}{\sqrt{2}}; n=1,2,3,\cdots$$   For a) I tried the product:  $$e^{(x/2)(t-1/t))}\cdot e^{(x/2)(-t+1/t))} = 1$$  I at least arrived at the right side of the equation. Since this generates the bessel functions, I should arrive at something related to $J_n$ in the left side. I know that  $$e^{(x/2)(t-1/t))} = \sum_{n=0\infty}^{\infty} J_n(x)t^n$$  $$e^{(x/2)(-t+1/t))} = \sum_{n=0\infty}^{\infty} J_n(x)(-t)^n$$  but it's not just a matter of multiplying coefficients from the two infinite series, right?  For $b$, I tried to use  but it's not as obvious  I have no idea how to deal with $c$, could somebody help me?