Clone an object (EF entity) in C#
Deep cloning objects
How do you do Impersonation in .NET? Is there a simple out of the box way to impersonate a user in .NET?  So far I've been using  for all my impersonation requirements.  Is there a better way to do it by using .NET Framework?  I have a user credential set, (username, password, domain name) which represents the identity I need to impersonate. Improper display of parentheses in fraction of fraction The following code:  $\dfrac{\left( \dfrac{\left( \dfrac{1}{2}\right) }{2}\right) }{2}$   gives a nasty output:   It seems that the $\left( \right)$ command doesn't do the job.  Any idea how to solve this in general? I've got this one file, favicon.ico. It's actually a large group of nested files, but purely for example, just this one.  If I do cp favicon.ico favicon2.ico, Apache can read the second one just fine.  If I do mv favicon.ico favicon3.ico, Apache throws a 403 on favicon3.ico.  If I su apache, I can read the file as apache.  stat says both files are identical, except for the inode number.  Is there some hidden flag somewhere or something that I'm missing? I've never seen anything like this.  error_log says (13)Permission denied: access to /favicon3.ico denied Discrete Probability: Four dice are thrown, what's the probability that... Four dice are thrown, what's the probability that:  a) None of them fall higher than three?  b) None of them fall higher than four?  c) That four is the highest number thrown?  So for a, I wanna think about the denominator first. There are 6 possible outcomes for each dice, and we have four dice. So we're technically picking r out of n objects, aka picking 4 possible values out of 6. So the denominator/sample space should be $6^4$ right?  Now this is where I'm getting tripped up. Order technically shouldn't count, because we only care about the quadruplets that don't have a value higher than 3. I might be wrong, maybe I am, but could someone explain a bit more? My professor stated that typically in the sample space/denominator, we want order to count.   So I'm trying to think of the numerator now, so we want to find the probability that no values appear higher than 3, so some events that can occur are: $(1, 1, 2, 3), (1, 2, 2, 3), (1, 1, 1, 1)$ etc. Again, I can't see why order should count here, because if we only are concerned about what appears rather than how they appear, then we can say $(1, 1, 2, 3)$ is equal to $(1, 2, 1, 3)$? So if order does not count, and we have replacement, then does this lead the case where we use $$\binom{n-1+r}{r}$$to find out the probability?   I'm pretty sure if I can do a), I could prob do b), but if someone could maybe lead me in the right direction for c) I would appreciate that too! What is serial voting and how does it affect me? Why is cold fusion considered bogus? Cold fusion is being mentioned a lot lately because of some new setup that apparently works. This is an unverified claim.  See for example:         ( of that last link in the Wayback Machine, given frequent  from that page.)   While we should give the scientific community time to evaluate the set up and eventually replicate the results, there is undoubtedly some skepticism that cold fusion would work at all, because the claim is quite extraordinary.  In the past, after Fleischmann and Pons announced their cold fusion results, in perfectly good faith, they were proven wrong by subsequent experiments.  What are the experimental realities that make Fleischmann and Pons style cold fusions experiments easy to get wrong?  Would the same risks apply to this new set up? Provisioning Profiles menu item missing from Xcode 5 Expectation of a function of a random variable from CDF Is it possible to calculate the expectation of a function of a random variable with only the the r.v.'s CDF? Say I have a function $g(x)$ that has the property $\int_{-\infty}^{\infty}g(x)dx \leq \infty $ and the only information I have about the random variable is the CDF.  For example, I have a scenario where there are three timers that can be modeled as exponential random variables $X_1,X_2,X_3$ with rate parameters $\lambda_1,\lambda_2,\lambda_3$ respectively. For each moment in time I earn a reward according to some reward function $g(x)$. That is, my reward for waiting until time $t$ can be written as $\int_0^tg(x)dx$. However, $g(x)$ experiences diminishing returns so the the marginal reward received from waiting one second at $t=0$ is greater than one second at say $t=27$. This 'game' ends when one of two things happens. Either both timers $X_1$ or $X_2$ must ring or timers $X_1$ or $X_3$ must ring. I'm trying to find the expected reward of playing this game.  Currently I can calculate the the CDF of the random variable modeling the time until the game ends, but I dont know how to use this information to when what I really need is reward associated with this time.  So far I have the additional random variables: $$ W_{12}=\max(X_1,X_2) \quad W_{13}=\max(X_1,X_3) \quad Z=\min(W_{12},W_{13})$$ Also let $F_i(x), i\in \{1,2,3\}$ denote the CDF of $X_i$ The CDF of $Z$, can be written as: $$F_Z(t) = F_1(t)F_2(t) + F_1(t)F_3(t) - F_1(t)F_2(t)F_3(t)$$  I know when a random variable takes on non-negative values, you can use a shortcut to calculate the expectation using the CDF. That is, $E[X] = \int_0^\infty F(X\geq x)dx$. Is there something similar I could use for a function of a random variable, or is it necessary to compute the pdf of $Z$ first to compute $\int_0^\infty g(t)f_z(t)dx$ What affects field upgrades in BF4? Reading a bit about recent Monica Cellio related posts, I am afraid that I may be using a language that is a lot like English, but might not be the Stack-Exchange-approved version of English. For example, my English has had a certain gender-neutral pronoun in living use for centuries. That pronoun is used throughout the literature written in this version of English. It is used in the English I was taught as a grammar school student and later as a graduate student working on a master's thesis. I believe that this English is good enough to communicate about topics relevant to the various Stack Exchange sites.  The last thing I want from Stack Exchange is to be booted out because I slip up and accidentally use the language that has served me so well for a lifetime.  The topics discussed on Stack Overflow (I almost referred to it as a "sister site;" would that have been allowed? "mother site?" Good thing I didn't?) are often centered on languages which have formal descriptions.  Where is the formal description of the language that is to be used on Stack Exchange?     Strive not with a man without cause, if he have done thee no harm.      He shall die without instruction; and in the greatness of his folly he shall go astray. Any command that starts with $ returns  command not found   How can I fix this?  I am  using 16.10 Ubuntu. Suggested edits in top-bar put flags over the winterbash snowflake Suggested edits in the top bar put the flag count right over the winterbash snowflake. Looks pretty ugly if you ask me... Create a directly-executable cross-platform GUI app using Python I could install with an error message "unknown media /ALL". It could not run WPS Office. What is the name of the depiction of concentration with raised eyebrow called? "Authoring" versus "Writing" In my area of work the word author as a verb has become quite common. However, it seems to have a subtly different meaning than plain vanilla write. For example, one does not write software unit tests; one authors them.  Can anyone offer a clear distinction between the two words? Has author as a verb become a common usage outside of the field of computer software? Should I disconnect my MacBook Pro's power cord when the battery is fully charged? My friend told me that I need to disconnect the power cord when the battery is fully charged. Otherwise, I will shorten the life of the battery.  Other people say you should drain it once a month or point out that for long term storage, you should charge it to 50% and then periodically (3 to 6 months) bring it back to 50% and store it again.  I am going to use my laptop at home 90% of the time. So, I plan to have the power cord connected all the time.  I'd prefer to just plugging in my MacBook Pro and letting it be on charge long term and occasionally taking it away from the charger when I'm not at home or my desk.  Are these specific recommendations worth the inconvenience? How to find out who called a method? Are Living Beings Turned Into Horcruxes Suceptible to Age, Disease, or Injury? From the HP books I know that Horcruxes grant a form of immortality. So, it is not possible for someone who created a Horcrux to die from old age or succumb to diseases. I guess the same is true for living beings turned into a Horcrux. But do living Horcruxes age normally? Is it possible to cripple them or sever their limbs, head or something like that, or do they instantly "repair" themselves like inanimate Horcruxes? Vertex cover in a graph with maximum degree of 3 and average degree of 2.