How to dispatch based on runtime type?
How do I use reflection to call a generic method?
Characterising reals with terminating decimal expansions Show that a number has a terminating decimal expansion if and only if, it is rational and when in lowest terms, its denominator is coprime to all primes other than $2$ and $5$.   This is an unsolved question in my lecture notes. I can only seem to prove the converse direction for this. Would appreciate a solution for the other direction.     For converse direction:   Let the number, in lowest terms, be given by $\frac{l}{m}$ where $m = 2^ \alpha 5^\beta$, for some positive integers, $\alpha$ and $\beta$.    If $\alpha &gt; \beta$, let $k = 5^{(\alpha-\beta)}$. If $\alpha &lt; \beta$, let $k = 2^{(\beta-\alpha)}$.   Then $\frac{l}{m} = \frac{kl}{k2^\alpha5^\beta}=\frac{kl}{10^q}$ where $q = \max(\alpha,\beta)$.   Hence $\frac{l}{m}$ is a terminating decimal. I've just updated to the latest Google Chrome Dev build, and they've changed from the annoying-but-ok new tab page to an ugly and less usable page.  On the old one, nine thumbnails was not enough, and now they've restricted it to eight.  There's an empty "Tips and Suggestions" box which I wouldn't want even if it had stuff in; they've added Recent Downloads - on the rare occasions when I need that, I'll hit Ctrl-J to open the Downloads tab; and the site-specific search box on the right has now gone!  Is there a way to get the old new tab page back, or a plugin to provide a superior one?   Update: I launch Chrome by pressing Win+R and entering "chrome" - I have a shortcut on the Path with a Target of "C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --old-new-tab-page and whilst double-clicking this shortcut brings up the previous new tab page, using the keyboard method results in the old one.  How do I get it working via the Run box? (Without using a batch file, which slows things down too much.)  Update 2: GRRR! Now they've gone and stopped the --old-new-tab-page parameter from working at all! I hate this new version of the page that they're forcing upon us - can anyone provide a method to get rid of it and get the decent page back? Can a matrix have a null space that is equal to its column space? I had a question in a recent assignment that asked if a $3\times 3$ matrix could have a null space equal to its column space... clearly no, by the rank+nullity theorem... but I have a hard time wrapping my head around the concept of such a matrix, no matter what size, even existing. How could this be possible, and does anybody have an example of such a $m\times n$ matrix? On Latin.SE, I am getting a 404 error when clicking any of the three "history" links on the .  That is, this:        Gives this:        All three editable sections have a revision history with two revisions or more, and all three give an error.  The actual links are , , and . Redirecting stdout to a file you don't have write permission on When you attempt to modify a file without having write permissions on it, you get an error:  &gt; touch /tmp/foo &amp;&amp; sudo chown root /tmp/foo &gt; echo test &gt; /tmp/foo zsh: permission denied: /tmp/foo   Sudoing doesn't help, because it runs the command as root, but the shell handles redirecting stdout and opens the file as you anyway:  &gt; sudo echo test &gt; /tmp/foo zsh: permission denied: /tmp/foo   Is there an easy way to redirect stdout to a file you don't have permission to write to, besides opening a shell as root and manipulating the file that way?  &gt; sudo su # echo test &gt; /tmp/foo This is a question thats been bothering me a while. I don't even know if it makes sense or not (like if it is a physics question or becoming a philosophical one). But here it goes. The crux of my question basically is that we all know that we can't see light (like in its photon or electromagnetic wave form) directly when it is traveling past us. However, we also know that the way we see objects is by light reflecting off them. This then means that we are "seeing" the light reflecting from the object which then sends the signal to our brain saying that we are seeing a particular object. We know that both light traveling past us and light reflected from objects are made of photons (so they are the same kind)? So then my question is that what is happening to the photon of a light after it is reflected from the objects, that causes us to see it or the object, but on the other hand we can't see light as it is directly traveling past us. 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 HTML text input allow only numeric input Is there a quick way to set an HTML text input (&lt;input type=text /&gt;) to only allow numeric keystrokes (plus '.')? Can I add some HTML in my SO Profile 'About me' text box to show some button from linkedin? Show that $E(X)=\int_{0}^{\infty}P(X\ge x)\,dx$ for non-negative random variable $X$ Show that for a non-negative random variable $X$,   $$\mathbb E(X)=\int_0^\infty \mathbb P(X\ge x) \, dx.$$   I started with  $$\mathbb E(X)=\int_0^\infty x \, dF(x)=\int_0^\infty \int_0^x dt\,dF(x).$$ This is my try. Find where java class is loaded from What's the simplest way to list conflicted files in Git? When clicking &quot;edit&quot; I see:  Your edit will be placed in a queue until it is peer reviewed. We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.  Like:     Likewise, when I am not logged in, clicking &quot;improve this question&quot; or &quot;improve this answer&quot; shows:  You are not . Your edit will be placed in a queue until it is .  And when I click 'Save', I get:  Thanks for submitting an edit. It is only visible to you until it's been approved by trusted community members  Like:     Who can suggest an edit? Where do suggested edits go? Who can vote on a suggested edit? How do suggested edits get reviewed? Can I earn reputation? What about abuse or bad edits? Sometimes the Community user approves or rejects my edit. Why is that? When can I not suggest an edit? Is there a minimum change requirement for a suggested edit? How do I check my suggested edit history? I disagree with the reasons why my suggested edit was rejected. What can I do? How do I know whether there are edits waiting for review? Someone suggested an edit to my own post, and the reviewers took the wrong action. What can I do? Are tag wikis included in this scheme? What do the &quot;Improve Edit&quot; and &quot;Reject and Edit&quot; buttons do? Why are apparently valid links to rejected edits resulting in 404 errors?   For more information about editing, see &quot;&quot; in the . I have a generic method with this (dummy) code (yes I'm aware IList has predicates, but my code is not using IList but some other collection, anyway this is irrelevant for the question...)  static T FindThing&lt;T&gt;(IList collection, int id) where T : IThing, new() {     foreach T thing in collecion     {         if (thing.Id == id)             return thing;     }     return null;  // ERROR: Cannot convert null to type parameter 'T' because it could be a value type. Consider using 'default(T)' instead. }   This gives me a build error      "Cannot convert null to type parameter   'T' because it could be a value type.   Consider using 'default(T)' instead."   Can I avoid this error? I receive the error 'grub-install /dev/sda failed' while attempting to install Ubuntu as the computer's only OS. I am attempting to install Ubuntu on a box which was previously running Windows 7.  I have also experienced the dreaded "Unable to install GRUB" error.  I am not attempting to dual boot. I have previously run a Windows boot disk and removed all existing partitions.  If I run the Ubuntu 12.04 install CD and click install after the config screens, I get the error   Executing 'grub-install /dev/sda' failed. This is a fatal error. (It is the same error as this question: )  All the questions I've read while looking for a solution are related to dual boot.  I'm not interested in dual boot, I'm after a clean out the box Ubuntu install. How can I achieve this?  (For my sanity, please use very simple instructions when responding. I don't claim to have any talent either for linux or as a sysadmin)    Additional details copied from comments dated: 2012-05-29 ~15:19Z  After booting from the CD, clicking Try Ubuntu, and then sudo fdisk /dev/sda I get fdisk: unable to seek on /dev/sda: Invalid argument  sudo fdisk /dev/sdb gives   Device contains neither a valid DOS partiion table, nor Sun, SGI or OSF disklabel.  Building a new DOS disklabel with disk identifier 0x15228d1d.  Changes will remain in memory only until you decide to write them.  After that of course, the previous content won't be recoverable.  Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite).  Command (m for help):   I should add the Live CD desktop is graphically bad. I've got missing parts of programs and the terminal occasionally reflects to the bottom of the screen. But I can't imagine this is related. Home folders accessible to other users and should not be, how to fix? Why are my home folders accessible by other users on the same system by default?  I understand that I can change the permission of the home folders but want to know why this happened?  I have done nothing to make the folders "shareable" and yet I can easily navigate to any users home folder using Nemo 2.4.5 and see all their contents.  This is quite a privacy and security flaw and I'm not sure why it has defaulted this way on my system.  Under Users and Groups (items checked =) (both are administrator accounts)  User 1 = adm, cdrom, dip, lpadmin, plugdev, sudo  User 2 = User 2, sudo  Also of note is why User 2 has User 2 clicked but User 1 does not have User 1 clicked.  Both accounts appear to behave exactly the same.  Thank you for any tips in this matter. From the pmset man page:     POWER SOURCE ARGUMENTS      -g with a 'batt' or 'ps' argument will show the state of all attached power sources.      […] Certain Apple battery calibration tools may temporarily disable   battery charging, even though your Apple portable is plugged into AC   power.      Such tools will never surprise you with this behavior; you will know   it's happening. This state will be reflected in an additional line of   output to 'batt' or 'ps' readings, including the pid of the app   inducing this behavior.       'ChargeInhibit':    1432    So, does any piece of publicly available software exist to force the battery not to charge? I was trying to install Ubuntu 12.04 in VirtualBox 4.2.12r84980. I see    this kernel requires an x86-64 CPU, but only detects an i686 CPU, unable to boot   But I am using a 64 bit Windows 8, and trying same .iso for trying Ubuntu. Then what is the problem? Interaction between Leyline of Anticipation and Teferi, Time Raveler With the reprint of  in Core Set 2020, the interaction with  came to mind and I couldn't figure out what is right.  If I have the Leyline and my opponent has Teferi, may I cast spells during my opponent's turn? How do I go about porting Ubuntu Touch to different devices?