C# static method inlining Is it posible that the JIT compiler will make a static method inlined?  For exmaple, we have some code:  class A {      public static int c(int v)      {           return v*2      } } .............. Console.WriteLine(A.c(2));   In wihich circumstances can method public static int c(int v) be inlined by the JIT compiler?
Can I check if the C# compiler inlined a method call? I'm writing an XNA game where I do per-pixel collision checks. The loop which checks this does so by shifting an int and bitwise ORing and is generally difficult to read and understand.  I would like to add private methods such as private bool IsTransparent(int pixelColorValue) to make the loop more readable, but I don't want the overhead of method calls since this is very performance sensitive code.  Is there a way to force the compiler to inline this call or will I do I just hope that the compiler will do this optimization?   If there isn't a way to force this, is there a way to check if the method was inlined, short of reading the disassembly? Will the method show up in reflection if it was inlined and no other callers exist?  Edit: I can't force it, so can I detect it?
Why were the people of Rhun and Harad allied with Sauron?  Did they join him out of fear, or did Sauron say he would give them something if they joined him?  I know the men of Dunland were angry at Rohan; did Rhun and Harad have something against Gondor? Batch Convert Images from One Format to Another while maintaining directory structure, and removing originals I've looked at , and while it works there a few issues:   All converted images are placed in the directory from which the command is called. The original images are kept.   I need to convert around 70,000 .tif and .jpgs to .pngs.  It's really important the the files when converted are placed in their normal directories.    I can do a batch rm of .tff/.jpg's at the end if that's the best way to handle removing the old files. How to control fan speed? How can I control the computer's fan speed?  On Windows there is a wonderful program called . If $a,b,c$ are positive integers,and $\cfrac{a}{b}+\cfrac{b}{c}+\cfrac{c}{a}$ and $\cfrac{b}{a}+\cfrac{c}{b}+\cfrac{a}{c}$ are integers then $a=b=c$ Create a new cmd.exe window from within another cmd.exe prompt How to find and replace using sed on records starting with Specific number If we have a function $f:A \rightarrow B$, then one way to give meaning, I think, to this function, in terms of set theory, is to say, that $f$ is actually a binary relation $f=(A,B,G_f)$, where $G_f \subseteq A \times B$ is the graph of the function. Now my question is: what is $f$ if   $\bullet \ A=\emptyset, \ B\neq\emptyset$,?  $ \bullet \ B=\emptyset, \ A\neq\emptyset$ ?  $ \bullet \ B=\emptyset, \ A=\emptyset$ ?  (Another way to formulate this, I think, would be: How do the sets $\emptyset\times B,\ A\ \times \emptyset, \ \emptyset \times \emptyset $ look like? Are they all $\emptyset$ ?) Interchanging the order of differentiation and summation Who decides which half of the universe should be destroyed? Why does this work: returning C string literal from std::string function and calling c_str() I am doing an analysis with 2 groups of patients (control and disease) whose blood pressures have been measured continuously for 24 hours. My first goal is to test the effect of GROUP on BP. In the beginning, I built the mixed effect model with TIME as random effect variable and group as fixed effect model. The model I used is listed below:  mod &lt;- lme(BP ~ factor(GROUP), random=~1+ TIME| ID, data=gdata)   However, the experimenter wants to know the effects of GROUP on the slope of blood pressure changing per hour. In another words, we need to have blood pressure slope, which is the change of blood pressure by time, as response variable in the model. And I generated another model as bellow:  mod &lt;- lme(BP ~ factor(GROUP)*TIME, random=~1+ TIME| ID , data=gdata)   However, in the new model, the time works both as random effect variable and fixed effect variable. I am not sure if this is allowed in the mixed effect model. How to use Boost in Visual Studio 2010 Can you re-enter USA on an ESTA? I am visiting the US in August 2014 for a week, returning home to the UK &amp; will then be visiting for another 2 weeks in October 2014.  My question is, can I use the same ESTA or would I need to reapply for the second visit? I think the ESTA lasts 90 days but I am unsure if you can leave &amp; re-enter? Let $p,q$ be primes, $p≠q$, then I have to show that $\mathbb{Q}(\sqrt{p},\sqrt[3]{q})= \mathbb{Q}(\sqrt{p}\cdot \sqrt[3]{q})$  So far I've tried a lot of things with minimal polynomials and bases, but I'm far from any argument that I find sufficient.  This is an example from my algebra course, first chapter about field extension. So far we know about basic definitions, minimal polynomials and their properties, algebraic elements and algebraic fields.  Could someone maybe give me a hint about how to proceed? Thanks a lot!!! I can think of three general ways of explaining why the universe contains more matter than antimatter:  (1) Near the Planck time, the universe had zero baryon asymmetry, but at some later time, determined by some GUT energy scale, the  were satisfied, and the baryon asymmetry became nonzero.  (2) Nonconservation of baryon number occurs only at Planckian energies. Near the Planck time, the baryon asymmetry evolved from zero to some nonzero value.  (3) The Sakharov conditions have never been satisfied. The baryon asymmetry has always been nonzero, and has simply scaled as expected. (Apparently one  $\Delta n=n_B-n_\bar{B}\propto s$, where $n$ is number density and $s$ is entropy density).  It seems like most theorists are interested in #1, but is there any reason why 2 and 3 aren't possible?  2 seems pretty reasonable, since for the reasons given in , we have good reasons to think that baryon number is not conserved under Planckian conditions.  3 also seems reasonable to me, since even if baryon number is nonconserved at Planckian energies, that's only one of the three Sakharov conditions. I don't see any obvious fine-tuning objections to #3, since the scaling of baryon asymmetry with cosmological expansion isn't particularly drastic (not an exponential decay or anything). Is there something unphysical about maintaining $\Delta n\propto s$ all the way back to the Planckian era?   Some people might object to #3 on aesthetic grounds, since we "expect" the initial conditions of the universe to be symmetric, but that seems weak to me. After all, we don't object aesthetically to the fact that homogeneity was an imperfect symmetry of the early universe, and we even accept that the early universe was in a thermodynamically unlikely state. Find all primes $p>2$ for which $x^2+x+1$ is irreducible in $\mathbb{F}_p[x]$ Find all primes $p&gt;2$ for which $x^2+x+1$ is irreducible in $\mathbb{F}_p[x]$   Attempt. Since $x^2+x+1$ is of degree 2, it is reducible iff it has a root in $\mathbb{F}_p$. It has a root in $\mathbb{F}_p$ iff $x^3-1=(x-1)(x^2+x+1)$ has a root other than 1. The latter has a root other than $1$ iff $\mathbb{F}_p$ has elements of order $3$, which happens iff $3\mid |\mathbb{F}_p^{\times}|=p-1$, which happens iff $p\equiv 1\bmod 3$. So $x^2+x+1$ is irreducible iff $p\not \equiv 1\bmod3 $.   I am getting a different answer than my professor, who has $p\equiv 1\bmod 3$. If I am incorrect, were am I going wrong?  Update. Now I am unsure about my own reasoning. What if $1$ is a root of $x^2+x+1$? I don't know why I am considering roots of $x^2+x+1$ other than $1$ when $1$ can be a root. Sudo is also user login password - why? how to change? When installing Ubuntu I can create a user with an encrypted folder, what I always do. Now after the installation the login password for this user is also the sudo password. Is that how it should be? I actually would like to have a different user login and sudo password, does is make sense? Should I do that, how? How to place a float at the top of a floats-only page? Is it possible to recover an account deleted at the SE team level? Finding roots/zeros for collision detection? For the most simple of 2D games, I have implemented a posteriori collision detection (overlapping rectangles) on the x/y Cartesian plane, but am now interested in understanding the basics of a priori collision detection...  In the link , I noticed the reference to Newton’s Method.  So, I want to better understand the link b/w finding zeros of an equation and detecting a posteriori collision.    Let's start with the most obvious case of finding roots of an equation:  If you have a projectile's trajectory modeled as a quadratic function, you can find the roots to predict at what time the height will equal zero (or any other constant height, actually, by just solving f(x)=C to be f(x)-C=0 and then finding roots of that expression).    So, as I understand, finding the root can tell me the time at which the object will be at any chosen height.  More broadly, we basically know the (x,y) location of the object for any given time.  But how does root finding, in particular, translate to detecting collisions with another object?  (The other object may be stationary, or be moving.  If the latter, do you also determine roots/location of this moving object as well? Calculate the (x,y) trajectory of both objects and determine where they will intersect?)  Again, the basic question is where does root finding come into play?  Any links to a basic primer on this topic, with a simple example would also be greatly appreciated.