While executing the following code i gets this error "Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true."   class Program {     static void Main(string[] args)     {         MethodInfo MI = typeof(MyClass).GetMethod("TestProc");         MI.MakeGenericMethod(new [] {typeof(string)});         MI.Invoke(null, new [] {"Hello"});     } }  class MyClass {     public static void TestProc&lt;T&gt;(T prefix)      {         Console.WriteLine("Hello");     } }   The above code is just a scaled version of the actual problem i am facing. Please help.
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;()     {         //...     } }
Is there a max length for an array in C++?  Is it a C++ limit or does it depend on my machine? Is it tweakable? Does it depend on the type the array is made of?  Can I break that limit somehow or do I have to search for a better way of storing information? And what should be the simplest way?  What I have to do is storing long long int on an array, I'm working in a Linux environment. My question is: what do I have to do if I need to store an array of N long long integers with N > 10 digits?  I need this because I'm writing some cryptographic algorithm (as for example the p-Pollard) for school, and hit this wall of integers and length of arrays representation. Neatest proof that set of finite subsets is countable? I am looking for a beautiful way of showing the following basic result in elementary set theory:     If $A$ is a countable set then the set of finite subsets of $A$ is   countable.   I proved it as follows but my proof is somewhat fugly so I was wondering if there is a neat way of showing it:  Let $|A| \le \aleph_0$. If $A$ is finite then $P(A)$ is finite and hence countable. If $|A| = \aleph_0$ then there is a bijection $A \to \omega$ so that we may assume that we are talking about finite subsets of $\omega$ from now on. Define a map $\varphi: [A]^{&lt;\aleph_0} \to (0,1) \cap \mathbb Q$ as $B \mapsto \sum_{n \in \omega} \frac{\chi_B (n)}{2^n}$. Then $\varphi$ is injective hence the claim follows. (The proof of which is what is the core-fugly part of the proof and I omit it.). Dynamic LINQ OrderBy on IEnumerable / IQueryable I found an example in the  for Dynamic LINQ that allows you to use a sql-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQueryable&lt;T&gt;. Is there any way to get this functionality on IEnumerable&lt;T&gt;? How do I enable or disable Apport? So I have a Palm Pre (original P100EWW) model that I enabled developer mode on, and installed a Debian Squeeze chroot.  Works great.  I have plans to use this for ANYTHING (bittorrent peer, web server) but a phone.  I noticed if I do a cat /dev/urandom &gt; /dev/fb0 it actually writes random pixels to the screen until a No space left on device error is generated.  Awesome, now I can use the display.  So what kind of utilites are there that will either A) let me use /dev/fb0 as a console I can output text to or B) render text on /dev/fb0 from the command line.  I don't know about recompiling the kernel for this yet (I'd love to eventually strip WebOS off entirely and turn this into a minimal ARM server) so userspace tools if they exist is what I'm asking about.  Also would prefer to render directly to /dev/fb0 and not use X. Ubuntu/Kubuntu 16.04.1 installation in VirtualBox I'm trying to install Kubuntu 16.04.1 on a virtual machine (I'm using VirtualBox). When I boot from the disk image Ubuntu begins to load and then I get this screen:   It looks like it's loading but the display is not working properly (the pink blob is my mouse pointer, only very large and pink).  I also tried installing Ubuntu 16.04.1 and I get a very similar result:   Am I missing something in VirtualBox? Thanks! Proving $\lim \frac{x^n-a^n}{x-a}=n\cdot a^{n-1}$ What's the difference between using a 50mm f/1.8G and a 50mm f/1.8D with a Nikon D80? Recently, Nikon announced their , as revamp of the old 50mm f/1.8D. :     The main difference between this new   "nifty fifty" and the almost   decade-old ƒ1.8D is that it has an   autofocus motor inside. This means you   can use it with any current or recent   Nikon SLR. The older lens lacks this   motor and is instead driven by one in   the camera, which cheaper bodies don't   have.   I currently use a Nikon D80 (and I don't plan on changing that any time soon), and I've been considering getting such a lens. Is there any difference between the D and the G lenses when used on a D80? I believe that the D one works just as well, since D80's have internal autofocus motors - is that right?  Besides the autofocus motor aspect, is there any other big difference between them? Since the D is priced at around $120 and the G at $220, should I just get the D? How can I compute the integral $\int_{0}^{\infty} \frac{dt}{1+t^4}$? Cannot edit post meta fields with rest API I am using python to send POST requests to /wp-json/wp/v2/&lt; post type &gt;/&lt; post id &gt;. This successfully updates standard fields such as title, content etc. However I am unable to make any changes to the custom theme meta fields structured like &quot;post_meta&quot;:{     &quot;meta_1&quot;:[],      .      .      &quot;meta_n&quot;:[] }.  When I make a GET request to the same endpoint, the post meta fields are returned so I don't think this is an issue with the fields not being registered? Thanks What happens to Zhang ziyi (Jen) in  when she jumps off the cliff .. she dies? becomes immortal? Just before jumping what does she want Lo to become - a master?  Why does she jump off, guilt? So far I've proved the following:   $2n \geq \ln(2n) &gt; \ln(n+2)$   for $n \geq 3 $  The proof must be without the use of calculus but I have no idea on how to proceed. How can I prevent false score reports to global highscore tables? Browser and mobile games commonly have global highscore tables. It's also common for those tables to contain scores of 2,147,483,647 &mdash; where people have figured out the webservice call that reports scores and used it to record a fictitious score.  For simple puzzle games, we can defend against this by including a record of every move the player made (and any random seeds used to generate the level) with the score-reporting call. The entire game can then be reproduced and verified on the server.  However, this quickly becomes infeasible for anything larger than Pac-man.  How else can cheating of this kind be prevented? How to have two versions of PHP installed and switch easily between them? I want to have both PHP 5.2.17 and PHP 5.3.5 installed on my Ubuntu machine and switch as per my necessity. How can I achieve this? how to calculate earliest leap year in formula field salesforce I am writing a formula where I need a logic for calculating the earliest leap year.     Formula   (Sum(Mort1, Mort2, Mort3)*1.08^(current year-earliest LP year))+water+ECB+Taxes   What logic we can apply for earliest LP year? Is there a regular expression to detect a valid regular expression? Is it possible to detect a valid regular expression with another regular expression?  If so please give example code below. Give $a, b. c$ be the lengths of a triangle and $a+ b+ c= 3$. Prove that: $$\frac{a}{b}+ \frac{b}{c}+ \frac{c}{a}\geq  \frac{1}{a}+ \frac{1}{b}+ \frac{1}{c}$$ My try  We have England MO inequality: $$\left ( \frac{a}{b}+ \frac{b}{c}+ \frac{c}{a} \right )^{2}\geq  \left ( a+ b+ c \right )\left ( \frac{1}{a}+ \frac{1}{b}+ \frac{1}{c} \right )$$  and $$\frac{a}{b}+ \frac{b}{c}+ \frac{c}{a} \geq  3=  a+ b+ c$$  But it cannot be used to prove the above inequality and how to use triangle inequality in this inequality. I need the help. Thanks! Can't download any app from AppStore! I'm using iPhone 6s 16 GB. My storage isn't full but still I can't download anything. Every time I wanted to start a download it keeps telling:  app name* could not be download at this time Distance metric for (infinite) lines in 3D I would like a metric $d(\;)$ between pairs of (infinite) lines in $\mathbb{R}^3$, with these properties:   If two lines $L_1$ and $L_2$ are parallel and separated by distance $x$, then $d(L_1,L_2) = x$. $d(L_1,L_2)$ increases with the degree of skewness between the lines, i.e., the angle $\theta$ between their projections onto a plane orthogonal to the shortest segment connecting them (dashed below), where $\theta=0$ for parallel lines and $\theta=\pi/2$ for orthogonal lines. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   Intuitively, I would like the metric to be related to the repulsive force between two electrically charged lines (but it need not be exactly the actual physical force).  Have such metrics been considered in the literature? If so, I'd appreciate descriptions and/or pointers&mdash;Thanks!  Update1. It turns out that the natural ad hoc definition (from the comments) fails to be a metric. For example, below, a sufficiently large value of $a$ ensures the triangle inequality will be violated: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; So this question may be more difficult than it initially appeared...  Update2.  The  have revealed that in fact there is no metric that satisfies my two conditions (and is continuous w.r.t. $\theta$)! How can I install themes in Lubuntu?