Stopwatch stopwatch1 = new Stopwatch(); Stopwatch stopwatch2 = new Stopwatch(); string l = "my test"; string u = "MY TEST";  for (int i = 0; i &lt; 25; i++) {     l += l;     u += u; }  stopwatch1.Start(); l=l.ToUpper(); stopwatch1.Stop();  stopwatch2.Start(); u=u.ToLower(); stopwatch2.Stop();  // Write result. Console.WriteLine("Time elapsed: \nUPPER :  {0}\n LOWER : {1}",                   stopwatch1.Elapsed, stopwatch2.Elapsed);   I have run many times:  UPPER : 00:00:01.3386287 LOWER : 00:00:01.4546552  UPPER : 00:00:01.1614189 LOWER : 00:00:01.1970368  UPPER : 00:00:01.2697430 LOWER : 00:00:01.3460950  UPPER : 00:00:01.2256813 LOWER : 00:00:01.3075738
This came to my mind after I learned the following from :  where T : struct   We, C# developers, all know the basics of C#. I mean declarations, conditionals, loops, operators, etc.  Some of us even mastered the stuff like , , , , ...  But what are the most hidden features or tricks of C# that even C# fans, addicts, experts barely know?  Here are the revealed features so far:    Keywords    by  var by  using() statement by  readonly by  as by  as / is by  as / is (improved) by  default by  global:: by  using() blocks by  volatile by  extern alias by    Attributes    by   by   by   and  by   by   by   by    Syntax    (coalesce nulls) operator by  Number flaggings by  where T:new by  Implicit generics by  One-parameter lambdas by  Auto properties by  Namespace aliases by  Verbatim string literals with @ by  enum values by  @variablenames by  event operators by  Format string brackets by  Property accessor accessibility modifiers by  Conditional (ternary) operator (?:) by  checked and unchecked operators by  implicit and explicit operators by    Language Features   Nullable types by  Anonymous types by  __makeref __reftype __refvalue by  Object initializers by  Format strings by  Extension Methods by  partial methods by  Preprocessor directives by  DEBUG pre-processor directive by  Operator overloading by  Type inferrence by  Boolean operators  by  Pass value-type variable as interface without boxing by  Programmatically determine declared variable type by  Static Constructors by  Easier-on-the-eyes / condensed ORM-mapping using LINQ by  __arglist by    Visual Studio Features   Select block of text in editor by  Snippets by      Framework   TransactionScope by  DependantTransaction by  Nullable&lt;T&gt; by  Mutex by  System.IO.Path by  WeakReference by    Methods and Properties   String.IsNullOrEmpty() method by  List.ForEach() method by  BeginInvoke(), EndInvoke() methods by  Nullable&lt;T&gt;.HasValue and Nullable&lt;T&gt;.Value properties by  GetValueOrDefault method by    Tips &amp; Tricks   Nice method for event handlers by  Uppercase comparisons by  Access anonymous types without reflection by  A quick way to lazily instantiate collection properties by  JavaScript-like anonymous inline-functions by    Other   netmodules by     by     by
How do I transition to SSL without affecting PageRank? Here at Stack Exchange we're working on moving all traffic to SSL. The reason we're not doing logged-in-users only is that one side of the login divide would suffer a redirect from Google every time.  This happens because Google's only going to have http:// or https:// in the results, not both.  Aside from building the SSL infrastructure (), the outstanding question we have is: how do we best transition to SSL?  Here are the relevant bits of our plan (testing on small sites, moving up to stackoverflow.com):   Get SSL ready/enabled (but not linked to) on all domains Start rendering only the &lt;link rel="canonical"&gt; as https:// Start sending a 301 for all http:// requests to https:// (from our domains...of course we can't do anything about all the existing links pointing to us) After a transition period, set all user cookies as secure   So the endgame is having all content delivered over SSL and all HTTP requests redirected.  What we're primarily concerned with is how this will affect PageRank to our sites. We depend a great deal on traffic that comes from Google and want to ensure that doesn't take a dive as we start delivering more security to our users.  The only bits I've found on this that seem to be substantive are  on :     @Frank Yes, I'm certain that Google treats HTTP and HTTPS URLs as separate URLs for crawling, indexing and ranking (I work with the web-search team here at Google). Doing canonicalization with a 301 redirect like you mentioned is a great way to solve this :) –  Oct 23 '10   and the only webmasters video I could find:  The video doesn't have a solid answer, not one I'd base the future of a company on anyway.  Is our transition plan the best way to accomplish an SSL move, at least from an SEO perspective?  If there's other more recent or concrete advice around how a move like this affects Google ranking we'd love to hear about it. If a subring of a ring R has identity, does R also have the identity? I know it does not make sense that if a subring of a ring $R$ is commutative, then $R$ is also commutative. (For example, the set consisting of the matrices whose all entries except (1,1)-entry are zero, is a subring of ring of 2x2 real matrices.)  I also considered the case of a ring containing a subring with identity, but I had no ideas. Maybe it seems that it does not make sense, either.  Who give me some examples supporting my guess? For positive real numbers $a,b,c$ with $abc = 8$ prove that   $$ \frac{a^2}{\sqrt{(1+a^3)(1+b^3)}} + \frac{b^2}{\sqrt{(1+b^3)(1+c^3)}} + \frac{c^2}{\sqrt{(1+c^3)(1+a^3)}} \geq \frac{4}{3}. $$   Can we prove this by Cauchy-Schwarz or Jensen's inequality? If not how? How to remove selected commit log entries from a Git repository while keeping their changes? I would like to remove selected commit log entries from a linear commit tree, so that the entries do not show in the commit log.  My commit tree looks something like:  R--A--B--C--D--E--HEAD   I would like to remove the B and C entries so that they do not show in the commit log, but changes from A to D should be preserved. Maybe by introducing a single commit, so that B and C become BC and the tree looks like.  R--A--BC--D--E--HEAD   Or, ideally, after A comes D directly. D' representing changes from A to B, B to C and C to D.  R--A--D'--E--HEAD   Is this possible? if yes, how?  This is a fairly new project so has no branches as of now, hence no merges as well. How can I install a package on MikTeX? I need to install a LaTeX package on my MikTeX system.  Specifically, I am trying to make biblatex work, but I always get the error message:    ! LaTeX Error: File `biblatex.sty' not found.   I have changed the options to have the "Quick Build" command that includes biblatex too.   Code/commands are correct because it's working under Overleaf. ModernCV Remove horizontal line in sections I want to write my cv with moderncv-Classic style. Can you tell me, how I can remove the horizontal line in the left of each section? Why does universal generalization work? (the rule of inference) Tikz: shading region bounded by several curves I know that my effort below can be improved upon considerably.  In particular, there must be a way of shading the region in a single scope, as opposed to subdividing as I have done (thus necessitating a hidden gray boundary).  Neither am I fond of sample points, but this is where my research has led me.  Your constructive criticism is appreciated.    \documentclass{article} \usepackage{tikz} \begin{document}  \begin{tikzpicture} %graph \draw[draw=gray!50!white,fill=gray!50!white]      plot[smooth,samples=100,domain=0:1] (\x,{0}) --      plot[smooth,samples=100,domain=1:0] (\x,{1}); \draw[fill=gray!50!white] plot[smooth,samples=100,domain=1:2.71828] (\x,{ln(\x)}) --      plot[smooth,samples=100,domain=2.71828:1] (\x,{1}); \draw[domain=0:4] plot (\x,{1}); \draw[samples=100,domain=.25:4] plot (\x,{ln(\x)}) node[above left]{$y=\ln x$}; %coordinate grid \draw (-.5,0)--(4.5,0) node[right]{$x$}; \draw (0,-1.5)--(0,2.5) node[above]{$y$}; \foreach \x in {1,2,3,4}     \draw (\x,2pt)--(\x,-2pt) node[below] {$\x$}; \foreach \y/\ytext in {1,2}     \draw (2pt,\y)--(-2pt,\y) node[left] {$\y$};     %labels  \node at (.75,.5) {$\mathcal{D}$}; \end{tikzpicture}  \end{document} We've had a number of instances over on Stack Overflow involving users who get to the reputation level where they can comment, then spam comments across the site. Due to the lack of community review around comments, these spammed comments can remain on the site for months before someone notices and flags one. Moderators then have to go and manually remove each of these comments. In the last few months, I've personally had to deal with two users who spammed their website across 200+ questions each.  This isn't just limited to people spamming comments with a URL in them. We've had a number of users spray the same nonsense comment or insult across tons of posts and have no one seem to notice for months.  What I'd like is some kind of system-generated notification when a user has posted a barrage of copied-and-pasted comments. This could possibly be triggered when a user has posted a set number of identical comments in a row (4 of them, maybe) or maybe even if they've posted the same comment multiple times. We receive similar system-generated flags when users post duplicate answers, edit many of their posts in a row, or delete many of their own posts at a time.  This system-generated flag should ignore comments generated by review (which have the same text in them). I'm thinking that it shouldn't ignore comments generated by custom off-topic reasons, because someone using the exact same close reason over and over again might be something we want to look into.  The flag itself won't do anything to a user, and would only appear to moderators. I imagine there will be a number of false positives, but it should be easy for us to check these and identify the well-intentioned stock comments from the problematic ones.   We currently have no means of detecting comment spam, so even if this didn't have a great hit rate it would still be beneficial on the balance. Running sample queries for this seems to indicate that it wouldn't have that much noise.  This would allow us to catch comment spam early, and prevent it from living on the site or developing into a more serious problem. Is there an English term for "L'esprit de l'escalier"? wpf combobox binding Assume f is a bounded continuous function on $\mathbf{R}$ and $X$ is a random variable with distribution $F$.  Assume for all $x \in \mathbf{R}$ that  $$ f(x) = \int_\mathbf{R}f(x+y)F(dy) $$  Please help conclude that $f(x+s) = f(x)$ where $s$ is any value in the support of $F$.  The hints that I have come across are to use Martingale theory and consider $\{ X_n\}$ to be i.i.d. with distribution $F$ and make a martingale with some function of $S_n = \sum_{j=1}^nX_j$.    Thanks! Let $f:\mathbb{R}\longrightarrow \mathbb{R}$ a differentiable function such that $f'(x)=0$ for all $x\in\mathbb{Q}$ Let $f:\mathbb{R}\longrightarrow \mathbb{R}$ a differentiable function such that $f'(x)=0$ for all $x\in\mathbb{Q}.$ $f$ is a constant function? Suppose that $5\leq q\leq p$ are both prime. Prove that $24|(p^2-q^2)$.   This is what I got so far. I figured that since $p,q$ are bigger than $5$, there are only odd primes for this conjecture. Then I can rename $p=2m+1,q=2n+1,m,n∈Z$.  We want to show $(p^2-q^2 )=24k,k∈Z$. By substituting $2m+1$ for $p$ and $2n+1$ for $q$, we get  $((2m+1)^2-(2n+1)^2)$. If we expand it, we get $4(m^2+n^2+m-n)$ Q. I think I can make $4(m^2+n^2+m-n)$ look like $24k$. How should I approach ?  And my prof. commented that "I would take this proof in small steps.  Rather than trying initially to prove that $24 | p^2-q^2$, look at the progress you already have.  You proved $4 | p^2-q^2$.  Can you prove 8 is a factor?  What about 3?  Then see if you can put together what you have to get 24 as a factor."  I am stuck here. Any helps? When I ping I have this display:  &gt; ping -i 4 www.google.fr  64 bytes from wi-in-f94.1e100.net (173.194.67.94): icmp_seq=503 ttl=46 time=45.5 ms ....... ....... 64 bytes from wi-in-f94.1e100.net (173.194.67.94): icmp_seq=508 ttl=46 time=44.9 ms 64 bytes from wi-in-f94.1e100.net (173.194.67.94): icmp_seq=509 ttl=46 time=45.1 ms   I'd like to have the time of the ping before.   Something like:  &gt; (right functions) + ping -i 7 www.google.fr  mardi 15 mai 2012, 10:29:06 (UTC+0200) - 64 bytes from wi-in-f94.1e100.net (173.194.67.94): icmp_seq=503 ttl=46 time=45.5 ms ....... ....... mardi 15 mai 2012, 10:29:13 (UTC+0200) - 64 bytes from wi-in-f94.1e100.net (173.194.67.94): icmp_seq=508 ttl=46 time=44.9 ms mardi 15 mai 2012, 10:29:20 (UTC+0200) - 64 bytes from wi-in-f94.1e100.net (173.194.67.94): icmp_seq=509 ttl=46 time=45.1 ms   How would you do this in a command line (if it's possible)? Simple: every other race in Middle Earth has rings, why do Hobbits and Orcs not? I am designing a hobby project that will run on a battery so I am trying to reduce power consumption. The SoC I am using has the ability to go into a deep sleep mode where it consumes very little power, and then can be interrupted by a falling edge on a pin.  I want to generate a high-low-high pulse when the state of a reed switch changes in either direction. I have been reading a lot and it seems that a one-shot monostable circuit can be built from a couple of transistors and an RC circuit to generate an output pulse when an edge is detected. I understand how that works. However, I can't figure out the best way to also pulse on the opposite edge.  One thought, was to just combine two one-shots that are configured to trigger on rising and falling edges respectively, and use the transistors at the output to pull the common pull-up low (kind of like a NOR gate).  Since I am a hobbyist, I am mostly using passive components. What is the "real" way of doing this in a low-power configuration using logic devices?  Edit: I figure I should mention something about the timing requirements. Normally the reed switch will be either open or closed for many seconds at minimum before changing states.  Edit: Here is an example of the circuit I was using for detecting only the falling edge:    And here is the ~20ms pulse it was producing for ~200ms button press simulating the reed switch (Channel 1 is Vbe for T1 and Channel 2 is measured at RST): It seems that OTP encryption is unbreakable. I have read some articles (Wikipedia, Blogpost, etc.), but I could not find any information about how they are used.  If I wanted to create a messenger service, how would I distribute the OTP keys? Both the sender and the receiver need this key before the message is sent, right?   And how do I make sure no one else gets these keys? Prove that for each $n$, there exist $n$ consecutive integers, each of which is divisible by a perfect square larger than $1$. Let $f$ be an analytic isomorphism on the unit disc $D$, find the area of $f(D)$ Let $f$ have power series $f(z) = \sum_{n=1}^\infty a_n z^n$ in $D$, then prove that   $\mathrm{area}\, f(D) = \sum_{n=1}^\infty n \,|a_n|^2$.  Note: We define $\mathrm{area}\, S = \iint_S \mathrm{d}x\,\mathrm{d}y$.  I presume the way to do this is to take the integral $$\iint_{f(D)} \mathrm{d}x\,\mathrm{d}y = \iint_D \mathbf{J}_f (x+iy) \,\mathrm{d}x\,\mathrm{d}y = \int_0^1 \int_0^{2\pi} r \mathbf{J}_f (r e^{i \theta}) \mathrm{d}\theta\,\mathrm{d}r,$$ and letting $\gamma_r : [0,2\pi]\to\Bbb{C}, \,\gamma_r (\theta) = r e^{i\theta},\, \gamma_r '(\theta) = i\gamma_r (\theta),$ then we get $$\mathrm{area}\,f(D) = \int_0^1 \int_{\gamma_r}\frac{\lvert f'(z)\rvert^2 \bar{z}}{ir}\mathrm{d}z\,\mathrm{d}r.$$ Unfortunately, this approach seems to be a dead end. I think I'm meant to use Cauchy's Formula somewhere, but I can't see where that might be useful in this kind of question.