I am creating a Stack&lt;T&gt; where I have the type of the Stack in a variable. After I have created the Stack&lt;T&gt;, I am wanting to push items to the Stack. How can I access the Push method? Here is my code: var itemType = GetIEnumerableItemType(type); var stackType = typeof(Stack&lt;&gt;); var constructedStackType = stackType.MakeGenericType(itemType); var instance = Activator.CreateInstance(constructedStackType);  EDIT Here is some code that I have tried that works with a List&lt;T&gt;: var itemType = GetIEnumerableItemType(type); var listType = typeof(List&lt;&gt;); var constructedListType = listType.MakeGenericType(itemType); var instance = (IList)Activator.CreateInstance(constructedListType); //instance.Add(&quot;example item&quot;);  Thank you
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;()     {         //...     } }
Why is there no plural 's' after "hundred" or "thousand" in cardinal numbers? Let's say we have the numeral "12,345". Why is it pronounced as "twelve thousand three hundred and forty five" as opposed to "twelve thousands three hundreds and forty five". Are 's's omitted while pronouncing numerals to make the whole thing more succinct and easier to pronounce? How to tell the difference between linear and non-linear regression models? I was reading the following link on non linear regression . My understanding from reading the first section "Nonlinear Regression vs. Linear Regression" was that the equation below is actually a linear regression, is that correct? If so why?  $$y = b_1x^3 + b_2x^2 + b_3x + c$$  Am I also to understand that in non linear regression multicollinearity isn't an issue? I know that multicollinearity can be an issue in linear regression so surely if the model above is in fact a linear regression there would be multicollinearity? How does vendor restocking work in Fallout 4? Inverse function of $x^x$ How can I find the inverse function of $f(x) = x^x$? I cannot seem to find the inverse of this function, or any function in which there is both an $x$ in the exponent as well as the base. I have tried using logs, differentiating, etc, etc, but to no avail. How to search for all questions with bounties across the network? I wanted to search for questions on all SE sites that had a bounty. I am not sure if it is possible, and if it is how can I?   I have seen other questions that show how to find questions on each individual site, but how can I find all of them in one search from the homepage stackexchange.com? If this has been asked already, please let me know.  It has been suggested that the question was already asked (click  for the question), but that question only showed how to find those questions on each separate site or some complex way to search. I am hoping to find a way to search for bountied questions easily or for someone to create a way to do this. Check which IPs or web-sites an app is communicating with? Usually they do it behind the scenes. So I'd love to know where apps are actually sending data and from whom they are actually getting responses. Does app review rejection list all issues? Our app was rejected recently with reason Google+ signin, which we understood is not according to Apple policy and need to fix.  While discussing about this issue we came across an interesting question with Apple review process, does Apple review team list all issues (if more than one exists) while rejecting app (or) would they stop reviewing other areas as soon as they found an issue (in our case Google+ signin)? Where are Time Machine local backups/snapshots stored? Out of curiosity, I'm wondering where in the file system Time Machine stores its local backups/snapshots. I currently have an Ubuntu-Windows Dual boot. However, I would like to try out a new OS so I burned Linux Mint to a USB stick.   I would like to install Linux Mint and remove Ubuntu while still keeping my windows dual boot. I've already backed up my Ubuntu setup so I can wipe it out.   In the Linux Mint installer, should I choosing the "install alongside windows" option do this? (1) Does he not know? (2) Doesn't he know?  I don't usually see and hear questions formed in the first style. I was even surprised to know that it is grammatically correct. And actually it is the most &quot;proper&quot; way to form an interrogative sentence.  shows that the first style was much more popular before than now. What are your suggestions on choosing between these styles? And I will probably add the third one.  (3) He does not know?  EDIT: The answers have explained how to form a question, but have not actually provided an account on the usage of the first two forms. Especially I'm interested in the first form: does it sound formal, is it used in speech or only in writing, et cetera. What is the definition and purpose of a pre-amplifier? I find in many places mentions of pre-amplifiers being used to boost audio signals prior to feeding to a power amplifier.  Wikipedia's article on  gives some hints at their usage, but it doesn't really explain why it would be necessary to have two amplifiers in series rather than a single one with greater gain.  If a pre-amp is just a power amp with a smaller gain, what's the point, and why the distinction between the two kinds? Is the distinction in function, or simply purpose? I have an external sound card which mostly works fine, except that when its first plugged in, or when I turn on my laptop, the volume gets set to 100%. That is, the overall system volume, as shown in the sound indicator.  What I'm looking for is a terminal command that will set that volume to 50%, so that I can run it on login and not have to worry that the first audio I play is going to blare out at me if I forget to turn the volume down. What commands allow you to change that volume, i.e. the one in the sound indicator?  I've poked around in gsettings and dbus, but have been unable to find anything that would let me set the system volume like that. I do know about alsamixer, but that's not the solution I'm looking for, since that doesn't allow me to change the volume using the sound indicator or my laptop's multimedia keys. This questions has been asked before too and I did go through most of the suggestions. Things I have tried so far: setting up correct  path variable environment, installing anaconda 32 bits, python 2.7, or even switching to python 2.7 in cmd while initially using Anaconda 3 , adding Desktop 10.4.pth file with  following path.  C:\Program Files (x86)\ArcGIS\Desktop10.4\bin C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcToolBox\Scripts   I also added those paths in environment variable   These suggestions help me to reduce the error. But Now I am getting a different error. Looks like python can find arcpy but missing another package.  Getting this error while trying to import arcpy in python 3.6.   File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\__init__.py", line 22, in &lt;module&gt;     from arcpy.geoprocessing import gp    File "C:\Program Files (x86)\ArcGIS\Desktop10.4\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in &lt;module&gt;     from _base import *  ModuleNotFoundError: No module named '_base'   Any suggestions? Proving set of interiors is open Dihedral group - elements of order $2$ If $D_{n}$ is the Dihedral group of degree $n$ (order $2n$) where n is an odd number, can I then conclude that the numbers of elements of order 2 in $D_{n}$ is equal $n?$  I suppose there are the following types of elements in $D_{n}$: b, $a^{i}$, $a^{i}b$ for some $0\leq i &lt; n$ . Openlayers v4.0.1 support Google Maps Javascript API? I want to know if the latest version of Openlayers (v4.0.1) supports Google Maps as a Tile Layer. I can't find any document ion about this. If Openlayers doesn't support Google Maps, could someone  tell me if there is any way to do this? If $\int_0^1 f(x)x^n \ dx=0$ for every $n$, then $f=0$. Computing determinant without expansion $$\begin{align}\mathrm D &amp;= \left|\begin{matrix} (b+c)^2 &amp; a^2 &amp; a^2 \\ b^2 &amp; (a+c)^2 &amp; b^2 \\ c^2 &amp; c^2 &amp; (a+b)^2 \end{matrix}\right|\\ &amp;= (a+b+c)\left|\begin{matrix} b+c - a &amp; a^2 &amp; a^2 \\ b - a -c &amp; (a+c)^2 &amp; b^2 \\ 0 &amp; c^2 &amp; (a+b)^2 \end{matrix}\right| \\ &amp;= (a+b+c)^2\left|\begin{matrix} b+c - a &amp; 0 &amp; a^2 \\ b - a -c &amp; a+c - b &amp; b^2 \\ 0 &amp; c - a-b &amp; (a+b)^2 \end{matrix}\right|\\ &amp;= (a+b+c)^2\left|\begin{matrix} b+c - a &amp; 0 &amp; a^2 \\ 0 &amp; a+c - b &amp; b^2 \\ c - a-b &amp; c - a-b &amp; (a+b)^2 \end{matrix}\right|\end{align}$$  Can $\rm D$ be further simplified without expanding ?  I feel it should be because this was competition question. Why do neural networks need so many training examples to perform? A human child at age 2 needs around 5 instances of a car to be able to identify it with reasonable accuracy regardless of color, make, etc. When my son was 2, he was able to identify trams and trains, even though he had seen just a few. Since he was usually confusing one with each other, apparently his neural network was not trained enough, but still.  What is it that artificial neural networks are missing that prevent them from being able to learn way quicker? Is transfer learning an answer? I have a question about something I'm wondering about. I've read somewhere that L'Hopitals rule can also be applied to complex functions, when they are analytic. So if have for instance:  $$ \lim_{z \rightarrow 0} \frac{\log(1+z)}{z} \stackrel{?}{=} \lim_{z \rightarrow 0} \frac{1}{(1+z)} = 1 $$  Now i'm wondering if this is correct? Also if we take $|z|&lt;1$, is it then correct?  Thanks,