I have a generic method   bool DoesEntityExist&lt;T&gt;(Guid guid, ITransaction transaction) where T : IGloballyIdentifiable;   How do I use the method in the following way:  Type t = entity.GetType(); DoesEntityExist&lt;t&gt;(entityGuid, transaction);   I keep receiving the foollowing compile error:     The type or namespace name 't' could   not be found (are you missing a using   directive or an assembly reference?)   DoesEntityExist&lt;MyType&gt;(entityGuid, transaction);   works perfectly but I do not want to use an if directive to call the method with a separate type name every time.
What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod&lt;T&gt;() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod&lt;T&gt;()?         GenericMethod&lt;myType&gt;(); // This doesn't work          // What changes to call StaticMethod&lt;T&gt;()?         Sample.StaticMethod&lt;myType&gt;(); // This also doesn't work     }      public void GenericMethod&lt;T&gt;()     {         // ...     }      public static void StaticMethod&lt;T&gt;()     {         //...     } }
What are point releases in LTS versions? There are so called "point releases" for LTS versions of Ubuntu. 10.04.3 for instance.  What are those "point releases" releases? How do I enable automatic updates? Apply empty style to the entire bibliography Is there a problem with the ClearBits data dump? How do I install an individual package on a Linux system? Are Jedi bound by a code of honor or morals? In The Phantom Menace alone, Qui-Gon (and in part Obi-Wan) are quick to use Jedi mind tricks and not only gamble but also cheat at it. They seem happy with this fact.  Do Jedi have morals and ethics, or a code of honor? Factorial of 0 - a convenience? If I am correct in stating that a factorial of a number ( of entities ) is the number of ways in which those entities can be arranged, then my question is as simple as asking - how do you conceive the idea of arranging nothing ?   Its easy to conceive of a null element in the context of arrays, for example - so you say that there is only one way to present a null element.   But, in layman terms - if there are three humans $h1, h2, h3$ that need to be arranged to sit on three chairs $c1, c2, c3$ - then how do you conceive of a) a null human, and b) to arrange those ( that ? ) null humans ( human ? ) on the three chairs ?   Please note that referral to humans is just for easy explanation - not trying to be pseudo-philosophical. Three balls to be arranged on three corners of a triangle works just fine. So basically, how do you conceive of an object that doesn't exist, and then conceive of arranging that object ?  So, in essence ... is $0! = 1$, a convenience for mathematicians ? Not that its the only convenience, but just asking. Of course, there are many.  If yes, then its a pity that I can't find it stated like so anywhere.  If not, then can anybody suggest resources to read actual, good proofs ? Prove that $x^x+y^y=z^z$ doesn't have integer solutions How do I set a Boolean field with "yes" and "no" values? Proof that there must exist infinitely many solutions to a homogeneous system of equations when more unknowns than equations Why do the Walking Dead Zombies only show intelligence in the very first episode? I enjoy The Walking Dead, however one question keeps nagging me. The 'Walkers' are always shown to not have any intelligence or memory of having been human. This is for all seasons except the very first one.  In the very first scene of Season One, Episode One, we see a little zombie girl stop to deliberately pick up a teddy bear from the ground.   Later in the same episode we see a zombie apparently try to turn the door knob to get into Morgen Jones' house.  Also at Atlanta they can climb fences and used rocks to break glass.  After season 1 I do not recall seeing any such intelligence demonstrated by a zombie again.  My question is: are these initial displays of intelligence a discrepancy in the story, or is there a plausible explanation why the Walkers performed these actions? dynamic does not contain a definition for a property from a project reference How to disable the "Get Windows 10" icon shown in the notification area (tray)? This icon showed up in my taskbar notification area today and I cannot seem to get rid of it:    Clicking on it displays the following screen:    So how do I disable or remove the "Get Windows 10" icon? Why can two (or more) electric field lines never cross? The the title is self explanatory, I guess.  Why can two (or more) electric  never cross? Relation between power and energy If I have an expression for the 'rated generator power' of a wind turbine, call it $P(t)$ how is the energy, that the wind turbine generator generate, related to the power $P(t)$?  So: $$E(t)=\dots$$ Why can I not access a file named `-` when quoting? I have a file called -.  I want to display its contents.  One way is to do  cat ./-   since cat - reads from standard input. However, why are cat "-" and cat '-' also interpreted by the shell as cat -? Question about "surely" and "certainly" Today I saw a sentence:  She surely can do it.  What does that mean? How does it differ from:  She certainly can do it. Surely she can do it.  This slight difference in meaning of those sentences I am not able to notice. Could you please help me? Thanks in advance! Why can rm remove read-only files? Assuming I have an ArrayList  ArrayList&lt;MyClass&gt; myList;   And I want to call toArray, is there a performance reason to use  MyClass[] arr = myList.toArray(new MyClass[myList.size()]);   over  MyClass[] arr = myList.toArray(new MyClass[0]);   ?  I prefer the second style, since it's less verbose, and I assumed that the compiler will make sure the empty array doesn't really get created, but I've been wondering if that's true.  Of course, in 99% of the cases it doesn't make a difference one way or the other, but I'd like to keep a consistent style between my normal code and my optimized inner loops... How do I determine the result of a Saving Throw? I'm a pretty new player, and I'm building a bard in D&amp;D 5e. I understand how saving throws work in general, but I am a little confused about one thing. Say I cast Blindness/Deafness on a humanoid. They must then make a Constitution saving throw. My question is: what value do they have to roll in order to make the save? Does their roll (plus their constitution modifier) have to beat my constitution (plus my modifier)? This is more of a general player question than one specific to the Bard or that spell.