How to extract phone number from string?
Extracting phone number from string
How should I act when I see tiny "Have you tried this..?" type of answers? Preventing applications from stealing focus I just bought a new HP Pavilion dv7t Quad Edition laptop that has HDMI out. I already have a couple of monitors that are VGA and I'd like to hook up one of these to dual monitors.  I've read some sketchy reviews of products that try to convert directly from HDMI (digital) to  VGA (analog), so I was wondering if someone has a good recommendation on how to hook these two together. Are the off-world colonies really a "golden land of opportunity"? In Blade Runner, there seems to be quite a  for emigration to the off-world colonies, e.g.,      "A new life awaits you in the off-world colonies, a chance to begin   again in a golden land of opportunity and adventure."   Is there any evidence that people emigrating are actually better off than staying on Earth?  The job descriptions of the replicants Deckard is tasked with "retiring" don't seem consistent with the colonies being wonderful places. If the colonies offered a good life, would they have to do so much advertising? Create an instance of a class from a string Is there a way to create an instance of a class based on the fact I know the name of the class at runtime. Basically I would have the name of the class in a string. Conditional expection of gamma distribution on sum I have a process which consists of a number of events and what is known is the timings between the events. What I'm trying to determine is a distribution that allows me to determine a likelyhood that a new sample fits the distibution.  The issue is mainly that if you have lots of samples you can approximate the result using a standard gaussian and use the mean and standard deviation. But if you only have a handful of samples, the gaussian does not accurately represent the situation.  From what I've read it is common to model waiting times using the gamma distribution. Looking at how the process evolves it looks like it matches well. The unknown is the scale parameter, since the shape parameter I think should be the number of samples. What I've worked out so far is that given the timings $X_1 ... X_N$ you can say:  $$ \sum_{n=1}^N X_n \sim \Gamma(N,\theta) $$  ($N$ is known and fixed)  However, $\theta$ is unknown, but the maximum likelihood parameter is the average of the $X_i$ (according to wikipedia anyway).   My question is, can I use this to estimate a distribution for $X_i$, that is, since the $X_i$ are independent:  $$ N X_i | \sum_n X_n \sim \Gamma(N, \tfrac{1}{N}\sum_n X_n) $$  Something else I've wondered about. Suppose I do have information about $\theta$, say a distribution. How can I incorporate this into the model?  Edit: Clarified that N is fixed. How to understand what's taking up disk space? I'm looking for a linux alternative to . I would like to know what is taking up space on my hard drives.  A program that works on console and doesn't require a UI is preferred . Scan vs. Map vs. Apply In X-Men Origins: Wolverine,      Wolverine is shot through the head with what appears to be a vibranium bullet by William Stryker. He remarks that the brain will grow back but the memories won't.   So the projectile penetrated the adamantium skull and damaged the brain. Adamantium is an inorganic substance. It will survive anything that would otherwise destroy the rest of Wolverine's body. But if anything (such as vibranium) manages to damage the adamantium, it is not covered by Wolverine's healing abilities.  Does this mean that Wolverine has an Achilles' heel on his forehead? If so, how did he take a bullet to the exact same spot in X-Men: United (at Ice Man's home)? Sql Server Indexes Include Primary Key? I want to test in a script whether a hostname resolves to something other than 127.0.0.1 as a pre-flight test for an install script. The tools I know (dig, nslookup) specifically query DNS. In my situation a correct entry in /etc/hosts is a valid configuration. So the question is:  Is there a dig-like tool, ideally already on the system, that does the full name-resolution process via nsswitch.conf, like (for example) ping does?  dig my-test-server-that-only-exists-in-etc-hosts    returns NXDOMAIN. I've tried to render my scene but there's an object that won't show up. I've checked the camera, I've checked the visibility, it isn't hidden and it's showing in the viewport. I feel like I've opened every setting and have achieved nothing. I’m trying to render a book with a cover, flipping pages and stacks of pages. I have no idea how to fix the fact that the book cover doesn’t render. If I create a plane and select both the book cover and the plane and join them with Ctrl+J, the render contains a book cover but it doesn’t turn as it’s rigged to do so because it’s now linked to the plane and loses all the animated properties. As soon as I unjoin them the book cover stops rendering and everything appears as you see it there, a book with binding, pages, but no cover. For the life of me I cannot figure out what’s going on. There's a link to the file here: So I recently saw add comment (requires 50 reputation) on a deleted answer. After looking around a bit, it seems to be on all deleted posts now (only deleted posts, normal posts still say just add comment).  I'm sure it wasn't there before (I think it just said add comment (unclickable) or possible nothing).  It is also on , presumably the root cause is the same.  And yes, I do have more than 50 reputation (in case anyone was wondering).  Just to clarify, requires 50 reputation obviously shouldn't be there for users with 50 or more reputation. Choices:   Display nothing Unclickable add comment - probably not ideal Unclickable add comment (disabled for deleted posts) or something along those lines   FYI - You may be somewhat confused right about now if you can't  yet. Why might one also use a blank constructor? I was reading some Java recently and came across something (an idiom?) new to me: in the program, classes with multiple constructors would also always include a blank constructor. For example:   public class Genotype {   private boolean bits[];   private int rating;   private int length;   private Random random;    public Genotype() {              //  &lt;= THIS is the bandit, this one right here     random = new Random();   }    /* creates a Random genetoype */   public Genotype(int length, Random r) {     random = r;     this.length = length;     bits = new boolean[length];      for(int i=0;i&lt;length;i++) {         bits[i] =random.nextBoolean();     }   }    /* copy constructor */   public Genotype(Genotype g,Random r) {     random = r;     bits = new boolean[g.length];     rating = g.rating;     length = g.length;      for(int i=0;i&lt;length;i++) {         bits[i] = g.bits[i];     }    } }   The first constructor doesn't seem to be a "real" constructor, it seems as though in every case one of the other constructors will be used. So why is that constructor defined at all? What is the difference between the following commands:  su sudo -s sudo -i sudo bash   I know for su I need to know the root password, and for sudo I have to be in the sudoers file, but once executed what is difference?  I know there is a difference between su and sudo -s because my home directory is /root after I execute su, but my home directory is still /home/myname after sudo -s. But I suspect this is just a symptom of an underlying difference that I'm missing. do_shortcode() within Admin Page I'm using a few plugins that have shortcodes ... however, instead of creating a public page for the content, I've created some new pages within the admin using add_menu_page and I need to know how to utilize do_shortcode() within this context.  As it stands, all the function does it spit out the string. I'm assuming it's because the shortcode API isn't available within an admin page.  How do I get around this? There is no documentation that I can find that explains how to utilize shortcodes within the WP Admin... or if it's even possible.    Specifically I'm trying to utilize WooCommerce shortcodes within the WP Admin. I hate the fact that plugins don't utilize the WP Backend for account/user management. Can't mount ISO file as loop device: Error: “failed to setup loop device” sudo mkdir -p /media/cdrom cd ~ sudo mount -o loop ubuntu-* / mount: ubuntu-*: failed to setup loop device: No such file or directory Should black holes be considered two-dimensional or three-dimensional? How can I use GDAL to batch define a projection? Libraries module. Where to extract?