I work on the command line quite a bit and often have to take a screenshot a region of the screen and save it to directory I am currently working in.  (let's assume I've already taken the screenshot and clipboard has it).  This is how I have to do it right now (after have the screenshot in clipboard):   launch Preview. in Preview, ⌘ + N (File, New from Clipboard) creates a new file with the clipboard contents. go back to command line and copy the directory name (copy the results of pwd) go to Preview, ⌘ + S for Save.  Type / gets me a directory navigation prompt where I can paste my directory name from step 3.   Finally, give the actual file name, this_is_where_I_get_the_error.png in my example.   I'd like to do this instead:  $savemyscreenshot ./this_is_where_I_get_the_error.png  How would I go about writing that savemyscreenshot command?  In bash?  As an Automator script (which has to be callable from the Terminal, else that defeats the purpose somewhat)?  All things being equal, would slightly prefer a javascript flavor of the Automator script over AppleScript.  env:  MacOS Sierra
I have a graphic on the clipboard on OS X.  What's the quickest way to get it onto disk as a png or jpg?
When do "per day" spell-like abilities recover in 3rd edition? Number theory lemma - $x^2 \equiv 1 \pmod p$ implies $x\equiv\pm 1\pmod p$ Every season near the trade deadline, we see teams that are out of it trading expensive players and/or free agents-to-be, typically for younger players or prospects.  For example, Matt Garza, set to become a free agent after the season, was traded to the Rangers for a few prospects.  It made sense for the Cubs to trade Garza, because he wasn't under contract any further than this season, and thus doesn't have much value to them.  Compare Garza to someone like Mike Trout, who is likely the most valuable property in baseball, given his skill and inexpensive cost over the next several years.  There's no way the Angels would trade him, because he'll be the cost-controlled centerpiece of the team for years to come.  However, with the Angels out of it this year, what if they wanted to trade Trout to a contender (say the Pirates), but only for the remainder of this season?  That is, they'd get several top prospects now, and would have an agreement with the Pirates that they'd trade him back in the offseason (for something pretty worthless, say for a journeyman minor leaguer).  The Pirates get Trout for the stretch run and are happy to give up a few prospects.  Trout doesn't have much value to the Angels this year, but he has a ton of value for next year.  So they get a few prospects for him, in exchange for the part of his career which has very little value to them.  So in effect, the Pirates are renting or borrowing him for the remainder of 2013.  Why don't trades like this happen?  Are there any rules prohibiting trades like this? RegEx for Javascript to allow only alphanumeric I need to find a reg ex that only allows alphanumeric. So far, everyone I try only works if the string is alphanumeric, meaning contains both a letter and a number. I just want one what would allow either and not require both. All of a sudden, without any change in the index.html, our site is showing up in Google search results (on multiple browsers and devices) with Google Preview text that, instead of giving a summary of our site, now says:     Your browser does not currently recognize any of the video formats available. Click here to visit our frequently asked questions about HTML5 video.     We have a YouTube embed on our homepage that does include an html5 parameter in the media URL link in the embed, but there are no issues playing the video with any browser and device we can find.  What would suddenly cause this text to appear in Google search results?   We are using the  tags as the metatags in the &lt;head&gt; of our webpage and do indeed have title and description tags.    To mimic the behavior of Googlebot, I installed Windows on a VM and got Chromium 41 running. I get the same Google Preview text with the html5 video message when the site comes up in Google search results using this browser.    When I view the site in Chromium 41, I see the YouTube embed and it renders on the page and plays with no issue, just as with all other browser and devices we've tested on. The only time we see this message is in the Google search results, not on our actual site. Finding the dual basis for the space of polynomials of degree $\leq$ 2 Let $V$ be the space of polynomials of degree at most $2$, with basis $\{1,x,x^2 \}$.Find the dual basis to $\{1,x,x^2\}$.   I know that the dual basis of $\{f_1,f_2,f_3\}$ is the basis $\{f_1^*,f_2^*,f_3^*\}$ where $f_i^*(a_1f_1,\ldots,a_3f_3)$ but I'm not sure how to actually compute the dual basis. How do I check the integrity of a storage medium (hard disk or flash drive)? Leave bash script running on remote terminal while not logged in? I have a bash script that takes several hours to run.  While it's running, I would like to do other things, which may involve logging out or disconnecting from the internet (my script runs network tests on various computers).  I understand that there is a command that would allow me to run my tests from a remote terminal and logout of the terminal while it runs.  Does anyone know what this command is? Value of $\frac{\sqrt{10+\sqrt{1}}+\sqrt{10+\sqrt{2}}+\cdots+\sqrt{10+\sqrt{99}} }{\sqrt{10-\sqrt{1}}+\sqrt{10-\sqrt{2}}+\cdots+\sqrt{10-\sqrt{99}}}$ Here is the question:     $$\frac{\sqrt{10+\sqrt{1}}+\sqrt{10+\sqrt{2}}+\cdots+\sqrt{10+\sqrt{99}} }{\sqrt{10-\sqrt{1}}+\sqrt{10-\sqrt{2}}+\cdots+\sqrt{10-\sqrt{99}}} = \;?$$   ()  I think we need to simplify it writing it in summation sign as you can see here:  $$\frac{\sum\limits_{n=1}^{99} \sqrt{10 + \sqrt{n}}}{\sum\limits_{n=1}^{99} \sqrt{10 - \sqrt{n}}}$$  or in Wolfram Alpha input in comments.  I can compute it too! It's easy to write a script for this kind of question. I need a way to solve it. How would you solve it on a piece of paper? How do you list the primary key of a SQL Server table? What Is the Real Name of the #? Installing PHP 5.3 in Ubuntu 14.04 Can sum of a rational number and its reciprocal be an integer? Can sum of a rational number and its reciprocal be an integer?   My brother asked me this question and I was unable to answer it.   The only trivial solutions which I could think of are $1$ and $-1$.  As to what I tried, I am afraid not much. I have never tried to solve such a question, and if someone could point me in the right direction, maybe I could complete it on my own.  Please don't misunderstand my question.   I am looking for a rational number $r$ where $r + \frac{1}{r}$ is an integer. I'm fairly certain this has happened to all of us at some point: You go into a room to get something, but once you're there, you can't remember what you intended to get. It seems like a specific, common phenomenon like this must have a name, but I can't think of it. Does anyone know a name (either formal or slang) for this?  I don't want a general term like forgetfulness or absent-mindedness, which could apply to all sorts of forgetting, or a term for not being able to remember a certain word. I'm looking for a word or phrase that describes this one specific situation of forgetting what you need to get as soon as you go to get it. This has always been a big want for me. I love using multi-monitor setups but only want a single laptop. Does the 2011 MBP Thunderbolt support chaining multiple monitors together? I know that you can add a monitor and say, a few hard drives, but can you connect it to 2 27" monitors and your flat screen TV (for example)? Thanks! How can I remove the new weather information from the taskbar? Prove that between any two different real numbers there is a rational number and an irrational number.  My attempt at a proof: (Throughout this proof it is assumed without any loss of generality that $x &lt; y$)  1.) $x$ is irrational and $y$ is irrational.  In this case the arithmetic mean $\frac{x+y}{2}$ is always an irrational number between $x$ and $y$. Also, if $y$ is irrational then it has a non-terminating decimal expansion and so we can always find a positive integer $n$ such that $x &lt; y - 10^{-n}y &lt; y$. The middle of the three numbers here will have a terminating decimal expansion, and hence it is rational. It also clearly lies between $x$ and $y$. These examples of rational and irrational numbers should also work in the cases:  2.) $x$ is irrational and $y$ is rational.  3.) $x$ is rational and $y$ is irrational.  There is one last case to consider.  4.) $x$ is rational and $y$ is rational.  In this case the arithmetic mean of $x$ and $y$ is rational. An irrational number for example could be the ratio $\frac{ex + \pi y}{e + \pi}$  I'm not sure if this proof is a good method or if it is even valid, so some feedback would be appreciated. Java map with values limited by key's type parameter Is there a way in Java to have a map where the type parameter of a value is tied to the type parameter of a key? What I want to write is something like the following:  public class Foo {     // This declaration won't compile - what should it be?     private static Map&lt;Class&lt;T&gt;, T&gt; defaultValues;      // These two methods are just fine     public static &lt;T&gt; void setDefaultValue(Class&lt;T&gt; clazz, T value) {         defaultValues.put(clazz, value);     }      public static &lt;T&gt; T getDefaultValue(Class&lt;T&gt; clazz) {         return defaultValues.get(clazz);     } }   That is, I can store any default value against a Class object, provided the value's type matches that of the Class object. I don't see why this shouldn't be allowed since I can ensure when setting/getting values that the types are correct.  EDIT: Thanks to cletus for his answer. I don't actually need the type parameters on the map itself since I can ensure consistency in the methods which get/set values, even if it means using some slightly ugly casts. Showing that $f:(0,2\pi]\to S^1$ is not a homeomorphism I want to show that $f:(0,2\pi]\to S^1$ defined by $t\to (\sin t, \cos t)$ is not a homeomorphism. I will do this by showing that its inverse is not continuous.    The inverse is defined by $(\sin t, \cos t)\to t$. So at $(0,1)$ we want to have $\lvert 2(1-\cos t)\rvert &lt;\delta \Rightarrow \lvert t-2\pi\rvert&lt;\epsilon$ for any $\epsilon$. If we take $\epsilon=\pi/2$, no matter how close $\cos t$ and $1$ are there will always be $t$'s close to $0$. So $f^{-1}$ is not continuous.  What do you think? Are there any mistakes? Compression API on the iPhone