Resolving hostname to IP: what command is most likely to be available on any Linux flavor?
How to get remote host DNS address from a super-slim host (docker) without ping or bind-utils?
I'm a college student and I just got my first credit card (through Chase). The only reason I got the card is to try and build my credit score. I also have a checking account with Chase, and they let me pay off my credit card any time I want.  For example, right now I have a balance of $92 on my credit card, but my bill won't come until September 2, and the payment isn't actually due until September 27. But through their website I could go ahead and pay it off with money from my checking account.  My question is, is it better for my credit score if I pay off that $92 balance right now, or should I wait for the bill, or does it not matter either way? Evaluate $\int_0^{\infty}\frac{\log x}{1+e^x}\,dx$ "invalid EFI file path" while booting Windows I just got my new working notebook with Windows 8 pre-installed. After installing Ubuntu 12.10 the grub menu says that there is an "invalid EFI file path" and it won't boot Windows. Ubuntu works fine...  Is there anything I can do about this? Placing math environments inside math environments I have a macro which appears throughout my document in various places:  \newcommand{\placefraction}[2]{     $\frac{#1}{#2}$ }   Sometimes it is placed with regular text. Sometimes it is placed within other math modes. However, the document won't compile if it is placed inside another math mode.  None of my math ever appears in displayed formulas, it is always part of the paragraph.   How can I have a macro which sometimes appears inside math mode, sometimes outside, but itself contains math mode? How to get color of pixel in coordinates 123, 456 in screen? My AppleScript app needs to get color of pixel in coordinates 123, 456 in screen. Uses of the definite article (the) in generic noun phrases How to replace a string with a string containing slash with sed? How to log out user from web site using BASIC authentication? Is it possible to log out user from a web site if he is using basic authentication?  Killing session is not enough, since, once user is authenticated, each request contains login info, so user is automatically logged in next time he/she access the site using the same credentials.  The only solution so far is to close browser, but that's not acceptable from the usability standpoint. Prove that $ n^3 + 5n$ is divisible by 6 for all $n\in \textbf{N}$ Prove that $ n^3 + 5n  $ is divisible by 6 for all $ n \in \textbf{N} $.  I provide my proof below. What fallacy dismisses a conclusion because supporters give invalid arguments for it? MySQL - varchar length and performance Duplicate explanation should encourage improvement of original The new closed-as-duplicate banner says:     This question has been asked before and already has an answer. If those answers do not fully address your question, please .   I think it should instead say     This question has been asked before and already has an answer. If answers there do not fully address your question, please  or  to the pre-existing one.   &mdash; to discourage re-re-asking the same question. (I also changed "those answers", which has no plural , to "answers there", which doesn't need one.)    As of September 19, 2013, the original text quoted above has returned here. I use Cygwin on my laptop (DOS). I have a collection of scripts from my colleagues, and my own. I am not an IT person, not knowledgeable in Unix. I am following my colleagues' syntax and able to manage a few simple things. The scripts worked well on my old laptop. I just changed laptop and installed Cygwin. When I run my scripts, they do not work. Here is one example of the error message I get: line 1: $':\r': command not found line 5: syntax error near unexpected token `$'\r'' line 5: `fi  Here are the top 5 lines of my script : iter=1 if [ -f iter.txt ]    then rm ./iter.txt  fi    Can someone please explain how I can get around this problem? Why does $(g^b \bmod m)^a \bmod m = (g^a \bmod m)^b \bmod m$? I have been trying to understand why the diffie hellman key exchange algorithm works, specifically why the two exponents can be swapped in it without the result changing.   So my specific question is why:  (g^b mod m)^a mod m  = (g^a mod m)^b mod m  I am interested in the reasoning/proof/explanation behind why it is true.    Thank you How can I obtain a Cauchy distribution from two standard normal distributions? I am interested in      Let $X\sim N(0,1), Y \sim N(0,1)$ independently. Show $\frac{X}{X+Y}$   is a Cauchy random variable.   My work:  $f_{X,Y}(x,y)=\frac{1}{2\pi} e^{\frac{-1}{2}(x^2+y^2)}, -\infty&lt;x,y&lt;\infty$ by independence  Let $U=\frac{X}{X+Y},V=X+Y$. (Is there a better $V$ to choose for this bivariate transformation?)  Then, $X=UV, Y=V - UV$. So, $|J|=V$.  $f_{U,V}(u,v)=f_{X,Y}(uv,v-uv)|J|=\frac{v}{2\pi}e^{\frac{-v^2}{2}(2u^2-2u+1)},-\infty&lt;u&lt;\infty$  $f_U(u)=\frac{1}{2\pi}\int_{-\infty}^{\infty}ve^{\frac{-v^2}{2}(2u^2-2u+1)}dv$. Let $y=\frac{v^2}{2}(2u^2-2u+1)$, so $dy=v(1+2u^2-2u)dv$. Then,  $f_U(u)=\frac{1}{2\pi(2u^2-2u+1)}\int_0^{\infty}e^{-y}dy=(\pi[(\frac{u-1/2}{2})^2+1])^{-1}, -\infty&lt;u&lt;\infty$,   which is not exactly a Cauchy distribution. Where did I mess up? More importantly, how would you proceed in solving this problem? In Newtonian mechanics, if we throw an object in against direction of gravity with speed $v$ and it achieve max height of $h$. Now if we allow object to fall from that height $h$, it will eventually attain speed $v$ when it reach position where we launch it.   Now applying same idea to a black hole in general relativity. Speed require to escape black hole gravity is greater than $c$, so if we throw something into black hole with almost the speed of light, the object speed will exceed speed of light $c$ before hitting black hole surface! How relativity explain this? Can space-time curvature reduce speed of this freely falling object from attaining speed of light? My mortgage came up for renewal right at the time in 2009 when UK interest rates hit rock bottom. This was unprecidented, and most financial advice was to take out a fixed-rate mortgage. So I perhaps went overboard and got one for ten years.  Five years on, interest rates haven't moved and I'm losing money on it to the tune of £100 a month. Obviously, this is ongoing: so that decision has cost me about £5000 in real terms so far. It'll come to a lot more by the end of the mortgage, unless interest rates rise.  Being fixed rate, it's been designed so you can't get out early. If I decide to end the mortage, it'll cost me £1,000 per year of the mortgage remaining - which is roughly what I'm losing anyway, so that seems a bad idea.   I can overpay by up to £500 per month. However, doing this doesn't help pay down the mortgage at all: the total is just added up and will cause the mortgage to end early, by a period dependent on the overpayment total.   This seems to me to be a very bad idea because hoping interest rates rise over the next five years is the only hope I have of making good on some of the losses that I've made.   Is this sensible thinking? If so, is there anything at all I can do to try and ameliorate the financial pain this product is causing me? dropping trailing '.0' from floats I'm looking for a  way to convert numbers to string format, dropping any redundant '.0'   The input data is a mix of floats and strings. Desired output:  0   --> '0'  0.0 --> '0'  0.1 --> '0.1'  1.0 --> '1'  I've come up with the following generator expression, but I wonder if there's a faster way:  (str(i).rstrip('.0') if i else '0' for i in lst)   The truth check is there to prevent 0 from becoming an empty string.  EDIT: The more or less acceptable solution I have for now is this:  ('%d'%i if i == int(i) else '%s'%i for i in lst)   It just seems strange that there is no elegant way to handle this (fairly straightforward) case in python. RMSE vs Standard deviation in population Android design convention for saying a user needs to complete an action first? I've read the Android design conventions, but can't see a good solution.  I have a 3 tab mobile application. Tabs 2 and 3 need a selection made on screen 1 before they will work. The user enters at Screen 1, and the tab options are along the top. If they attempt to open screen 2 or 3, I would like to advise them to make a selection first. 'notifications' are the closest answer I can see from the Android design guidelines. Anybody have any other solutions?  Thanks  Andy