Is it okay to flush water heater onto the drip pan with drain hole?

Question: Our water heater is on the second floor and we need to have it flushed.  It has a drip pan with a hole that has a tube attached to it.  Common sense tells me that I can flush the water heater directly onto the drip pan since it has a pipe attached to it where the water will drain, but I haven't seen anywhere on line that this is okay to do.  I've read only that it is there just in case there's a leak.  Can I drain our water heater onto the pan or should I attach a hose to the it to drain?
Answer: The drip pan's drain tube may not be large enough to handle the flow if you drain the entire water heater through it, leading to an overflow of the drip pan. I would be safe and use a hose to connect the outlet to the drain.
Answer: I'd suggest you use a watering can or pitcher to test where the drain tube goes before you crack the hot water heater drain. Pour a half-gallon to a couple of gallons down the tube and see if it shows up somewhere below. It probably should be more or less directly below in the basement, but it's always a good thing to check that it works before asking it to do too much. If the wall or ceiling on the floor below suddenly starts weeping water, at least it will be a small amount, and you'll know you should get this fixed before you have a leak, and not use it now.
My recollection is that this sort of thing is not likely to go into the sanitary sewer - dumping on the basement floor, or possibly into a sump, is more likely. You may want to move things in the basement before dumping 50 gallons down there, if that's true.  It should be less than 12" from the basement floor.
Answer: The drain on the safety pan is for leaking heaters only, not for draining.
Shut off the heater via the breaker or shutoff. Use a heat resistant hose (make sure hose  washer is in good condition) and place the other end in the bathtub or equivalent. Then, slowly open the drain. When you're confident the hose is sealed tight, there are no leaks, and half the heater has drained, then and only then slowly open the safety drain on the side. That will hasten the draining.
Be careful: water may scald you and cause injury. Also, shut off power to the heater before draining. It is best to let the water in the heater cool off first.
Answer: I have tried flushing our water heater with the drip pan and it overflow. Good thing that we are located in the basement. But that still sucks :( Better use a hose for the draining.
Answer: I say go for it: as a bonus you get to test the operation of the drip pan (where exactly does it go?  Is it indeed large enough to handle a flood event?).  Just start slow, have towels handy, and be ready to shut it off... quick.
Don't forget the water is... um...hot.
Comment: If you don't enjoy getting scalded, it's not too hard to turn of the water heater the night before you are going to flush it - or to turn it off and run hot water into a bathtub (shower, dishwasher, washing machine, etc.) until the water is no longer hot - THEN drain it.
Comment: I left the implications up to the reader ;-)


Self Contained / Cooled Rack Enclosure

Question: I'm looking at having to place a few servers in a location that does not provide a 'friendly' environment (moderate dust, no HVAC, ok physical security).  Can anyone recommend a 'self contained' rack enclosure that provides cooling, air filtration, and a lock?
Answer: The racks at http://www.kellsystems.com offer exhaust fans and have optional air filter modules. Each rack has a speced heat load that it can handle. The nice things about these racks is they look like furniture in an office environment.
Comment: These are neat solutions where the air temp is suited for equipment.
Answer: You will probably want a cabinet with integrated air conditioning.  There are several companies that manufacture cabinets that either have air conditioning built into the cabinet itself, and others that have the A/C unit mounted outside of the cabinet (such as on the back).
Rackmount Solutions carries some of these.  As others have mentioned, other vendors such as APC and Sun also manufacture modular systems that include A/C, but they tend to be more expensive.
Answer: HP sell a water-cooled, sealed rack that's also pretty secure - lets you run up to 35Kw/rack too, very spendy though, VERY.
Plus it needs cold water feed and exit plumbing too. Other than this, rather extreme, solution I can't think of there being anything that contains active-cooling inside the rack, where would the heat/condensed water go?
Answer: I like Sun's black box concept. It might be way over your requiremnents but it still fits them all.
Comment: That is totally cool!
Answer: APC - Now Liebert has some cooling systems designed for rack level coooling.  One thing you didn't mention was how much noise you can tolerate.
They typically will assign someone to help you design the appropriate system from they selection of racks, UPSs and other devices.
Answer: APC's InfraStruXure range have been around for a while and meet your feature list.
Answer: My company does these racks, www.intelcab.co.za
let me know if you are interested in getting one.
Comment: It is fine to memtion your company's products, but I'd prefer if you also pointed at alternatives (perhaps closer to home for OP). Suggest terms to search for, perhaps clarify the specifications.

Self Contained / Cooled Rack Enclosure


Buttons and Preview gone?

Question: I have been using SO for a few hours this evening and all of a sudden, the edit buttons and preview disappeared.  I am using Chrome and OS X 10.7.  I just cleared my cache, but the buttons are still gone.  Did I do something I am not aware of?
Comment: If you can't see the 'edit' link, it's likely there is already a pending edit on the post.
Comment: I have the same problem on all stack exchange sites. It has made it impossible for me to post a new question on SO, and if you look at the Chrome javascript console when trying to post a new page, you will see this: "Uncaught SyntaxError: Unexpected token ,"
Comment: How do you know that the preview disappeared if you can't click on the "edit" link?
Comment: See this question:

http://meta.stackexchange.com/questions/10131/what-happened-to-the-formatting-buttons
Answer: Thanks, a fix for this will begin rolling out in the next few minutes.
Answer: The prepareEditor call that sets up the editor has a dangling , in it, or (even worse) a double ,, if the variable to immediately show you Markdown help is set to true. Most likely explanation is that someone inadvertently introduced an extra comma when the discardSelector option was added.
All users who access the site using IE are impacted since it considers both conditions syntax errors, and anyone using a non-IE browser will be impacted by the second case.
Answer: It seems to be a problem with loading jquery from googleapis.com, and possibly your browser plugins. See this duplicate question here:
What happened to the formatting buttons?
which links to this issue here:
Employer blocks jQuery from Google, DOH!
Answer: I've just encountered another setup that can lead to this problem.
I'm using the HTTPS Everywhere extension for Firefox. This means that Stackoverflow is loaded using https. The Google API site appears to be loaded via http.
As a result, Firefox sees the Stackoverflow page as 'mixed content' (secure and insecure elements on the same page), and blocks the insecure elements by default. Firefox indicates that is has blocked mixed content via an icon in the URL bar, but does not provide details on which content it has blocked.
Allowing the insecure elements to load resolves the issue.

Buttons and Preview gone?


expected area of a triangle determined by randomly placed points

Question: Three points are placed at independently and at random in a unit square. What is the expected value of the area of the triangle formed by the three points?
Comment: See **[here](http://math.stackexchange.com/questions/676/probability-that-a-stick-randomly-broken-in-two-places-can-form-a-triangle)** and **[here](http://mathoverflow.net/questions/2014/if-you-break-a-stick-at-two-points-chosen-uniformly-the-probability-the-three-re)** for related questions and answers.
Answer: This isn't a full solution, but it goes most of the way there.
The area of a triangle $(x_1, y_1),(x_2,y_2),(x_3,y_3)$ is given by the formula
$A(x_1,x_2,x_3,y_1,y_2,y_3)= | \frac{x_1(y_2-y_3) + x_2 (y_3-y_1) + x_3 (y_1-y_2)}{2}|$
If $x_1, x_2, x_3, y_1, y_2, y_3$ are all independently identically uniformly distributed over $[0,1]$, then the average area is just given by:
$\int_0^1 \int_0^1 \int_0^1 \int_0^1 \int_0^1 \int_0^1 A(x_1,x_2,x_3,y_1,y_2,y_3) d x_1 d x_2 d x_3 d y_1 d y_2 d y_3$
At this point, it's a fairly simple, though tedious, calculation. I recommend using Mathematica or some other computational software if you have access to it. There are also ways to simplify the computation based on inherent symmetries in the problem.
I can't post the final answer because I want to avoid giving a wrong answer, which is totally possible (I don't claim to be able to do the above integral by hand without errors). I can check the answer in Mathematica if you don't have access to it, though it will have to wait until at least Monday.
Answer: See here.
Comment: to be honest, I haven't read the answer too closely, but I'm a little surprised the argument doesn't fall victim to something like Jensen's inequality. It looks like a "mean-field" like argument to me where the expectation of a function is replaced by a function of the expectation. But, I undoubtedly haven't looked close enough. Like @Sol, I was able to "verify" the answer by Monte Carlo.
Comment: @cardinal: The answer is correct, there's just a small error in the case distinction. The answer is based on the fact that the *for fixed orientation* area of the triangle is linear in each of the coordinates of the points, since it's the absolute value of a polynomial that's linear in each of the coordinates and changes sign when the orientation changes. Thus the case distinction has to be such that each case only covers triangles with the same orientation. For the case S1, the author seems to have had in mind a mapping from the rectangle formed by $A$ and $C$ to the unit square. (...)
Comment: (...) That may be why in "within the square one of
the diagonals of which joins the 2 other points" it says "square" where it should say "rectangle", and, crucially, further down in item 2) the condition is stated as $b\lt v$ where in fact it should say that $B$ is above the diagonal $AC$. With that condition, it's OK to use linearity of expectation, since this is the condition that separates the two orientations of the triangle.
Comment: The linked solution is transcribed [as a separate answer](https://math.stackexchange.com/a/2465933/356647).
Answer: User 'Shai Covo' (who seems no longer active) gave a solution as the link to an old webpage maintained by Dr. Les Reid of the math department at Missouri State University. The solution seems to be valid after being fixed by the comments @joriki, and the rigorous integration approach @achille hui supports it (and so much more).
I think the solution is nice and worthy of displaying with a good format so here it is.

The argument below is due to Philippe Fondanaiche (Paris, France), directly lifted from here.

Let $A$ with coordinates $(a,u)$, $B(b,v)$ and $C(c,w)$ be the three points chosen uniformly and at random from a unit square.
As the probability to have 2 or 3 coincident points is nil, we will
consider hereafter the strict inequalities between the abscissas/coordinates of the 3 points.
There are 6 positions of the 3 abscissas having the same probability:
$$\begin{align}
a&<b<c & a&<c<b & b&<a<c \\
b&<c<a & c&<a<b & c&<b<a
\end{align}$$
For each of them, there are 6 equally likely positions of the cordinates:
$$\begin{align}
u&<v<w & u&<w<v & v&<u<w \\
v&<w<u & w&<u<v & w&<v<u
\end{align}$$
So there are globally 36 possible configurations having the same
probability 1/36.
These 36 configurations can be split into 2 subsets $S_1$ and $S_2$
representing respectively 12 and 24 possibilities:

$S_1$: one of the 3 points ($B$ for example) is within the square one of the diagonals of which joins the 2 other points ($A$ and $C$ for example). In other words, $\min(a,c)< b < \max(a,c)$ and $\min(u,w)< v < \max(u,w)$.
$S_2$: any other of the 24 remaining configurations.

It is well known that:

If $a,b,c$ on one hand and $u,v,w$ on the other hand are independent to the ones from the others, then
$$\begin{align}
\min(a,b,c) &= \min(u,v,w) = \frac14 \\
\max(a,b,c) &= \max(u,v,w) = \frac34 \\
\text{med}(a,b,c) &= \text{med}(u,v,w) = \frac12
\end{align}$$
If $\min(a,c) < b < \max(a,c)$, $\min(u,w) < v < \max(u,w)$, and $b < v$, then the expected value of $b$ is $\frac12 + \frac13 \frac14 = \frac7{12}$ and the expected value of $v$ is $\frac12- \frac13 \frac14 = \frac5{12}$.

In these conditions, it is easy to check that the "average" position of
the $\triangle ABC$ with the subset $S_1$ is the $\triangle T_1$ whose vertices are $(\frac14,\frac14),\,  (\frac7{12},\frac5{12}),\,  (\frac34,\frac34)$ or one of the three triangles obtained from $\triangle T_1$ by successive rotations of angle $90^\circ$. The 4 triangles are the same area equal to $\frac1{24}.
As far $S_2$ is concerned, the average position of the $\triangle ABC$ is the $\triangle T_2$ whose vertices are $(\frac14, \frac12),\, (\frac12, \frac34),\,  (\frac14, \frac34)$ or one of the three triangles obtained from $\triangle T_2$ by successive rotations of angle $90^\circ$. The 4 triangles are the same area equal to $\frac3{32}$.
Therefore the expected area of the resulting triangle is equal to
$$ \frac{12}{36} \frac1{24} + \frac{24}{36} \frac3{32} = \frac{11}{144}$$

For completeness, below is the transcription of jorki's comment correcting the error of the derivation above.
Small error in the case distinction: The answer is based on the fact that the for fixed orientation area of the triangle is linear in each of the coordinates of the points, since it's the absolute value of a polynomial that's linear in each of the coordinates and changes sign when the orientation changes. Thus the case distinction has to be such that each case only covers triangles with the same orientation. For the case $S_1$, the author seems to have had in mind a mapping from the rectangle formed by $A$ and $C$ to the unit square.
That may be why in "within the square one of the diagonals of which joins the 2 other points" it says "square" where it should say "rectangle", and, crucially, further down in item 2) the condition is stated as $b<v$ where in fact it should say that $B$ is above the diagonal $AC$. With that condition, it's OK to use linearity of expectation, since this is the condition that separates the two orientations of the triangle.
Comment: +1 nice to see someone who lift a link only answer to a self-contained one.
Answer: The answer is $\frac{11}{144}$.
Following is an approach which allow one to work out the expected area of the convex hull of $n \ge 3$ random points sampled uniformly from a unit square.
Let

$\mu_1(\cdot)$, $\mu_2(\cdot)$ be the standard measures for 1D and 2D geometric objects.
$K \subset \mathbb{R}^2$ be a convex body with area $\mu_2(K) = \Delta$.
$p_1, p_2, \ldots, p_n$ be $n$ i.i.d random points sampled uniformly from $K$.
$C_n = \text{co}(p_1, \ldots, p_n)$ be the convex hull of these $n$ points.
$\Delta_n = \verb/E/[\mu_2(C_n)]$ be the expected area of $C_n$.

For any point $p \ne q \in \mathbb{R}^2$, let

$\ell_{pq}$ be the "oriented" line pointing from $p$ to $q$.
$H_{pq}$ be the open half space on left-hand side of line $\ell_{pq}$.
$L_{pq} = \mu_1(\ell_{pq} \cap K)$ be the length of those portion of $\ell_{pq}$ in $K$.
$A_{pq} = \mu_2(H_{pq} \cap K)$ be the area of those portion of $H_{pq}$
in $K$.

For any $p \in K \setminus \{ p_1, \ldots, p_n \}$, there are several mutually exclusive possibilities for its position relative to $C_n$.

Case   I - $p \in C_n$,
Case  II - $p \notin C_n$ but $p \in \ell_{p_ip_j}$ for some $1 \le i < j \le n$
Case III - $p \notin C_n \cup \left( \bigcup\limits_{1\le i, j\le n} \ell_{p_ip_j}\right)$

Let $E_I, E_{II}$ and $E_{III}$ be the corresponding events.
In case III, $p$ will be a vertex of a larger convex hull $\text{co}(p,p_1,\ldots,p_n) = \text{co}(p,C_n)$. If one walk along its boundary in counterclockwise direction, the next vertex will be one of $p_1, p_2,\ldots,p_n$. Let's say it is $p_k$, it is easy to see for all other $p_i$, we have $p_i \in H_{pp_k}$.
For $1 \le k \le n$, let $E_k$ be the event
$$E_k \stackrel{def}{=} \verb/Event/\left[ p_i \in H_{pp_k}, \forall i \ne k, 1 \le i \le n \right] $$
It is easy to check for $1 \le i < j \le n$, we have
$$E_I \cap E_i =  E_I \cap E_j = E_{III} \cap { E_i \cap E_j } = \emptyset$$
Taking expectations over the positions of $p_1, \ldots, p_n$ and notice
notice $\verb/P/[ E_{II} ] = 0$, we obtain
$$\verb/E/[ p \in C_n ]
= 1 - \sum_{k=1}^n \verb/E/[ E_{III} \cap E_k ]
= 1 - n\verb/E/[ E_{III} \cap E_1 ]
= 1 - n \verb/E/\left[ \left(\frac{A_{pp_1}}{\Delta}\right)^{n-1} \right]
$$
Now replace $p$ be a random point sampled uniformly over $K$ and take expectation, one obtain following integral representation of the expected area $\Delta_n$.
$$\frac{\Delta_n}{\Delta} = 1 - \frac{n}{\Delta^2}\int_K\int_K \left(\frac{A_{pq}}{\Delta}\right)^{n-1} dpdq$$
To compute the integral, parametrize the two points $p,q$ by
$$\mathbb{R} \times [0,2\pi) \times \mathbb{R}^2
\ni (u,\theta,t_p,t_q) \quad\mapsto\quad
\begin{cases}
p &= u(\cos\theta,\sin\theta) + t_p ( -\sin\theta,\cos\theta)\\
q &= u(\cos\theta,\sin\theta) + t_q ( -\sin\theta,\cos\theta)
\end{cases}
$$
This is a two to one parametrization, $(u,\theta,t_p,t_q)$ and $(-u,\theta+\pi,-t_p,-t_q)$ points to same $(p,q)$. To compensate this double counting,
we will impose the constraint $t_p \le t_q$.
Under this constraint, the line $\ell_{pq}$ and half-space $H_{pq}$ becomes
$$\ell_{pq} = \{ (x,y) : x\cos\theta + y\sin\theta = u \}
\quad\text{ and }\quad
   H_{pq}   = \{ (x,y) : x\cos\theta + y\sin\theta < u \}
$$
They depends only on $u$ and $\theta$. As a result, we can treat $L_{pq}$ and $A_{pq}$ as functions in $(u,\theta)$ alone. To abuse notation, we will denote
them as $L(u,\theta)$ and $A(u,\theta)$ respectively.
In terms of the new variables, the volume element has the form
$$dp dq = |t_p - t_q|  du d\theta dt_p dt_q$$
Integrate over $t_p, t_q$ gives us a factor
$$\frac{L(u,\theta)^3}{6} = \frac{L(u,\theta)^2}{6}\frac{\partial}{\partial u}A(u,\theta)$$
Change variable to $(\lambda,\theta)$ where $\displaystyle\;\lambda = \frac{A(u,\theta)}{\Delta}$ and let $m(\lambda,\theta)$ be corresponding value of $\frac{L^2(u,\theta)}{\Delta}$, above integral representation becomes
$$\frac{\Delta_n}{\Delta}
= 1 - \frac{n}{6} \int_{0}^{2\pi}
\int_0^1 \lambda^{n-1} m(\lambda,\theta) d\lambda d\theta
$$
Let's back to our original problem where $K$ is the unit square $[0,1]^2$ and $\Delta = 1$.
By symmetry, we only need to figure out what is $m(\lambda,\theta)$ when $\theta \in [0,\frac{\pi}{4}]$.
For $\theta \in [0,\frac{\pi}{4}]$, let $s = \sin\theta, c = \cos\theta, t = \tan\theta$, it is not hard to work out
$$L(u,\theta) = \begin{cases}
\frac{u}{cs}, & u \in [0,s],\\
\frac{1}{c},  & u \in [s,c],\\
\frac{s+c-u}{cs}, & u \in [c,c+s],\\
0, &\text{ otherwise }
\end{cases}
\quad\implies\quad
m(\lambda,\theta) =
\frac{1}{c^2}
\begin{cases}
\frac{2\lambda}{t}, & \lambda \in [0,\frac{t}{2}],\\
1,                  & \lambda \in [\frac{t}{2},1-\frac{t}{2}],\\
\frac{2(1-\lambda)}{t}, &\lambda \in [1-\frac{t}{2},1]
\end{cases}
$$
Integrate over $\theta$ first, we get
$$\begin{align}
\int_0^{2\pi} m(\lambda,\theta) d\theta
&= 8\int_0^{\pi/2} m(\lambda,\theta) d\theta
= 8\int_0^1 \min\left\{ \frac{2\lambda}{t}, 1, \frac{2(1-\lambda)}{t} \right\} dt\\
&= 8 \begin{cases}
2\lambda(1-\log(2\lambda)),& \lambda \in [0,\frac12]\\
2(1-\lambda)(1-\log(2(1-\lambda)), & \lambda \in [\frac12, 1]
\end{cases}
\end{align}
$$
Split the integral to two, one over $[0,\frac12]$ and the other over $[\frac12,1]$. Change variable to $z = 2\lambda$ or $2(1-\lambda)$ depends which
intervals we are one, we obtain:
$$\Delta_n = 1 - \frac{2n}{3}\int_0^1 z(1-\log z)\left[\left(\frac{z}{2}\right)^{n-1} + \left(1-\frac{z}{2}\right)^{n-1}\right] dz
$$
Integrate by part twice, this leads to
$$
\begin{align}
\Delta_n
&= 1 - \frac{4}{3}
\int_0^1 \log z \left(\left(\frac{z}{2}\right)^n
-\left(1-\frac{z}{2}\right)^n\right) dz
\\
&= 1 - \frac{8}{3(n+1)}\int_0^1
\frac{1}{z}\left[1 - \left(1-\frac{z}{2}\right)^{n+1} - \left(\frac{z}{2}\right)^{n+1} \right] dz\\
&= 1 - \frac{8}{3(n+1)}\int_0^1
\left[\frac12\left(\sum_{k=0}^n\left(1-\frac{z}{2}\right)^k\right) - \frac{z^n}{2^{n+1}} \right] dz\\
&= 1 - \frac{8}{3(n+1)} \left[ \sum_{k=1}^{n+1} \frac{1}{k} \left(1 - \frac{1}{2^k}\right) - \frac{1}{(n+1)2^{n+1}} \right]
\end{align}
$$
Throwing last expression to a CAS, we get:
$$( \Delta_3, \Delta_4, \ldots ) = \left(
\frac{11}{144},
\frac{11}{72},
\frac{79}{360},
\frac{199}{720},
\frac{104873}{322560},
\frac{29609}{80640},
\frac{976837}{2419200},
\frac{13183}{30240},\ldots \right)
$$
Comment: As reference for future readers, $|t_p - t_q| = t_q - t_p$ by choice of parametrization, and hence

$$\int_{t_{\min}}^{t_\max}\int_{t_{\min}}^{t_q}t_q - t_p\,dt_pdt_q = \frac16 {\left ( t_\max - t_\min\right)}^3.$$

$t_\min$ and $t_\max$ depend only on $u$ and $\theta$ (and $K$ of course). Because $\lVert (-\sin\theta,\cos\theta)\rVert = 1$, we see that $t_\max - t_\min = L(u,\theta)$, the portion of $l_{pq}$ in $K$. Therefore, "integrating over $t_p,t_q$ gives us a factor" $\frac{L(u,\theta)^3}{6}$.
Answer: Here's a perl script that confirms the answer Shai linked to via a Monte Carlo approach.
<code>#!/usr/bin/perl -w

$numTrials = 1000000 ;

sub distance {
   my $point1 = $_[0] ;
   my $point2 = $_[1] ;
   return sqrt(($x[$point1]-$x[$point2])**2 + ($y[$point1]-$y[$point2])**2) ;
}

sub heron {
   my $a = $legLength[$_[0]] ;
   my $b = $legLength[$_[1]] ;
   my $c = $legLength[$_[2]] ;
   my $s = ( $a + $b + $c ) / 2 ;
   return sqrt( $s * ( $s - $a ) * ( $s - $b ) * ( $s - $c ) ) ;
}

sub doAtriangle() {
   for ( my $j = 0; $j <= 2 ; $j++ ) {
      $x[$j] = rand(1) ;
      $y[$j] = rand(1) ;
   }
   $legLength[0] = distance(0,1) ;
   $legLength[1] = distance(1,2) ;
   $legLength[2] = distance(2,0) ;
   return heron(0,1,2) ;
}

for ( $i = 0 ; $i < $numTrials ; $i++ ) {
   $sum += doAtriangle() ;
}

print $sum/$numTrials . "\n" ;
</code>
Comment: 0.5*(+/%#)(([: | [: -/ .* (3 1 \$ 1) ,.~ 3 2 \$ [: ? 6 # ])"0) 1000000#0  NB. A terse way in J !


Trello Api: Php Curl error empty reply from server

Question: I want to use the Trello Api to create a new card when certain events happen in my webapplication. I want to use Curl to do the request. This is my code:
<code>$url = "https://api.trello.com/1/cards?key=".$key."&token=".$token."&name=".$name."&idList=".$idList;

# init curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE); // make sure we see the sended header afterwards
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_POST, 1);

# dont care about ssl
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

# download and close
$output = curl_exec($ch);
$request =  curl_getinfo($ch, CURLINFO_HEADER_OUT);
$error = curl_error($ch);
curl_close($ch);
</code>
I tried to use the same url with fiddler and it worked. However with this code I get back the error "Empty reply from server".
Anybody any ideas what I am doing wrong?
Answer: Instead of putting the arguments in the URL, try putting them in CURLOPT_POSTFIELDS.
This worked for me:
<code>$url = "https://api.trello.com/1/cards";
$fields = "key=$key&token=$token&name=$name&idList=$idList";

# init curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE); // make sure we see the sended header afterwards
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_POST, 1);

# dont care about ssl
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

# download and close
$output = curl_exec($ch);
$request =  curl_getinfo($ch, CURLINFO_HEADER_OUT);
$error = curl_error($ch);
curl_close($ch);
</code>


What is the difference between IBFT(Istanbul BFT) and PBFT?

Question: I recently got to know about IBFT and Quorum and started studying on their consensus protocols. And what is the difference on IBFT and PBFT? Are they pretty much like the same and, when considering Quorum IBFT is doing something more with respect to PBFT in other solutions like Hyperledger? Or are they completely different no matter it is Quorum or Hyperledger? Any answer would be highly appreciated.
Answer: IBFT Consensus is inspired by Castro-Liskov 99 PBFT paper. Like PBFT, in IBFT a block is confirmed by passing through PREPREPARE, PREPARE and COMMIT phases and like PBFT, the validators moves through series of Rounds. If a block is not commited in a given ROUND, the validators move to the next ROUND and try to commit a block in that ROUND.
Both Hyperledger PBFT and Quorum IBFT are based on Castro-Liskov's PBFT paper. I haven't gone through the implementation of Hyperledger PBFT, but I believe it would be similar to Quorum IBFT.
Answer: I also found some answers based on this paper. According to it,

In IBFT there is no client submitting requests to the network, instead, all of the validators can in turn propose a block to the network of validators.
IBFT allows for two types of nodes: validators that take part in the consensus protocol and standard nodes that validate blocks but do not participate in the consensus protocol.
the set of validators in PBFT is static whereas IBFT features a dynamic validator-set where validators can be added to, or removed from, the set (we can add a validator any time to the Quorum chain, I tested it).
IBFT specifies a simplified version of the so-called View-Change message of PBFT and does not include the so-called New-View message included in the PBFT protocol.
While IBFT does not use checkpoints explicitly, each IBFT block can be considered the IBFT equivalent of a PBFT checkpoint.


Dedicated Debian Package Server

Question: We've got a series of debs for different projects and different environments to install them in:  dev, build/test qa (less formal), qa (formal), and production.
I would really like to create a system by which I can in some way indicate what version of each package belongs in each environment, and then have them automatically deploy.
I've debated using a local debian repository but that's a lot more than seems needed.  And, I've wondered if I could create a private repository just for the debs that I have, much akin to Ubuntu's PPA.  I know that we use CF Engine for deploying and managing configurations on servers, though I'm not sure if its made for deploying debian packages.
Is there a right way to go about this?
Update It seems that CF Engine can be used for managing debian packages.
Answer: Use a local repository for each environment.  mini-dinstall is a simple enough repository manager, but you will have to move packages between repositories manually.

Dedicated Debian Package Server


Why pulse waves results in wave packets?

Question: I was doing experiments of measuring sonic velocity and I generate pulse waves from sensor 1, but when they are received by sensor 2, I saw wave packets on the oscilloscope, can you explain why?
I was told that it might be related to Fourier transform but I don't understand.
Answer: Yes this is related to Fourier transforms. If you have a signal $s(t)$ that you measure over a time window $\Delta t$, then you will have a resulting dispersion in the frequencies i.e. a $\tilde{s}(\omega)$ that differs from a delta function for a purely harmonic signal. The "physical" reason for this is that for your sensor the signal received is zero before and after a time window $\Delta t$ and you need to sum many harmonic waves together to get vanishing amplitudes after a given time.
More mathematically, if you have a harmonic signal $s_h(t)$, then you need to convolute it with some window function $f_w(t)$ to generate the pulse. The total signal in the output of your sensor 1 is therefore $s(t)=s_h \star f_w$, where $\star$ denotes the convolution operation.
Now, the Fourier transform of a convolution is nothing but the simple product of the Fourier transform of the functions convoluted. It gives then:
$\mathrm{FT}[s](\omega)= \mathrm{FT}[s_h](\omega)\cdot \mathrm{FT}[f_w](\omega)$
Hence, even if $\mathrm{FT}s_h](\omega)= A\delta(\omega-\omega_0)+B\delta(\omega+\omega_0)$, $\mathrm{FT}[f_w](\omega)$ has no reason a priori to be a pure delta function, except if the corresponding time window is in fact infinite...which is never the case in the real world and evn less the case for pulses.
That is why you have a wave packet.


Unable to complete 'Trouble In Skyrim' radiant quest set in Falkreath Watchtower

Question: I have been given a quest by the Companions to kill the Warlocks of 'Crossroads Watchtower' AKA 'Falkreath Watchtower' for the quest 'Trouble In Skyrim'. However I already cleared this tower pre-quest and now when I go to the tower, the quest target just hovers over the area where the enemy, a necromancer, should be. How can I fix this bug using console commands, keeping in mind that there is no body for the main NPC of this location? Also if it helps, the NPC he resurrects to fight is a glitchy ash pile where directly aiming at it and pressing E achieves nothing, meaning I have to move the mouse until I discover "another" ash pile for the same NPC.
Comment: Have you tried leaving the area, waiting 30+ days so it resets, and returning?
Answer: The quest ID for Trouble in Skyrim is: CR05
Try this command:

setstage CR05 20


Lego technic 42082 4 wheel steering issue

Question: I have just completed the build and everything appears to work as it should except the 4 wheel steering. When you turn the small wheel on the rear of the crane only the rear wheels steer. The front wheels will steer if you move them manually, but not in tandem with the rear wheels. Has anyone else encountered this? Am hoping it is an easy fix
Answer: I think you missed step 273 on page 133 of book 1.
In this step you align the front and back wheel and move a gear wheel and bush so the front steering mechanism is connected to the rest.
To fix this you need to disassemble part of the front

After taken of the fenders
Follow steps 471 till 484 in reverse.

This removes the panel above the gear so you should be able to access the gear.
Comment: Same thing happened to me when I build the thing last year. I was so focused on aligning the front and back wheels I overlooked that the gear and bush needed to be moved in. Luckily I'm in the habit of trying every moving part after assembly to see if it moves freely and isn't overly tight. So I noticed straight away that the front wheels weren't steering. And when they give you alignment instructions it is clear they should have moved together or else those alignment instructions wouldn't make sense at this point in the build.


2008 Chevy Equinox: no heat in idle

Question: My 2008 Equinox had not been getting heat in idle, but heat would come on when driving. There was also a strong coolant smell when heat was on. Recently, I was getting overheating messages on the dash, but when turning the car off then on again pretty much right away, the message went away. Also, the temperature gauge on the dash appeared to "stick". When the car is off, the gauge would only go back to about 50%.
So, I brought the car in to get it checked out. The mechanic's first solution was  to replace the thermostat and flush the system. They also wanted to replace the dash cluster gauge for a ridiculous amount of $ (I passed on that for the time being).
So, thermostat replaced. Same problem (no heat when idling and smell of coolant). No overheating and the gauge seems to be working properly again.
Brought the car back and they were able to find a leak at the heater core, so now that's been replaced. The smell seems to be gone (possibly a little residual smell that will go away?). But, there's still no heat in idle. On the highway, the heat is blasting.
I guess my question is.. is there a break-in period on a new heater core? Is there some other potential problem?
Thanks for any help.
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: This sure sounds like a worn water pump. Can't produce enough circulation at idle RPMs but can at higher RPMS. That's assuming that the coolant is at the proper level
Answer: Not your water pump. I had the same problem. You have air in the cooling system. Very common with the 3.4 LTE. There are many ways to bleed the air out. Check it out on YouTube.

2008 Chevy Equinox: no heat in idle


Help Installing NXT-G On Mac 10.6.x

Question: I'm failing to install NXT-G on Mac 10.6.x.  Whatever I try seems to end up with an error saying "A required file is broken" when I try to run the IDE.  Could someone talk me through the steps please?
Thanks.
Answer: The drivers are probably not installed correctly.  You have to run the legodriver.pkg (by double-clicking on it) which you can find in the 'Parts' folder.
You should use this detailed list of steps (and references). The legodriver.pkg is mentioned on point 5 of the fix for OS 10.6.

Help Installing NXT-G On Mac 10.6.x


Theory behind Linear Predictive Coding (LPC)

Question:
What is the theory behind LPC?
Why are(were) certain implementations of LPC said to be more tolerant of transmission or encoding errors quantization than other compressed voice encoding schemes?
Can LPC methods also be used for smoothing or short term "prediction" similar to the use of Kalman filter methods?
Under what conditions or constraints is the use of LPC valid?
Comment: The statement `Why are(were) certain implementations of LPC said to be more tolerant of transmission or encoding errors quantization than other compressed voice encoding schemes?` is rather false. Can you cite any reference that specifically tells what is better over other?
Comment: That's actually my question.  I heard this somewhere, but don't know why this might have been stated.
Comment: "Why is(was) LPC said to be more tolerant of transmission or encoding errors than some other compressed voice encoding schemes?"  Who said that?  I don't know LPC very well, but I thought it had to do with reducing redundancy, which would have the opposite effect.
Comment: This question is [misleading](http://meta.dsp.stackexchange.com/questions/179/dealing-with-misleading-questions-and-answers) as it is on false premise. Please close and rectify this.
Comment: There are multiple questions and premises here.  Which one(s) do you think need repairing?
Answer: First, to say linear predictive coding (LPC) is "more tolerant of transmission or encoding errors" isn't entirely true. The form in which the coefficients is transmitted makes a big difference. For example, if the linear prediction coefficients are solved for, they can be very sensitive to quantization, much like high order IIR filter coefficients (this is because the synthesis filter will be IIR, but more on that later). However, if they are transmitted in some other form, this problem can be mitigated easily.
One way is to transfer the reflection coefficients. If you recursively solve for a k-th order linear prediction filter, the highest order coefficient at each stage is called the reflection coefficient. These can be used together to completely characterize the system (which can easily be seen from the Levinson recursion). In fact, you can use all of them together to form a lattice filter. These filters are often used when quantization is a concern, as they're much more robust to low bit counts. In addition, if the magnitude of these reflection coefficients are bounded by unity, you're guaranteed a BIBO stable filter which is critical for LPC where the filter is used to synthesize your signal. There are other methods such as line spectral pairs which are frequently used, but aren't as intuitively defined as the reflection coefficients in relation to AR modeling for LPC.
Now, to address the first question, the theory of LPC revolves around vocal tract modeling. Essentially, we're modeling speech as air vibrating as an input to a tube of some structure. You can look for some resources that go into much more detail to flesh out this model (length of tubes, intensity of air, structure etc). These resources relate these structures directly to IIR filters responding to various stimuli, white noise for example.
So when we solve for the linear prediction coefficients, we're looking for the coefficients such that if we input our signal (voice for example) into an FIR filter created from the coefficients, we get white noise as an output. So think about what that means. We're inputting a highly correlated signal, and outputting a white noise sequence. So in effect, we're removing all linear dependence of that signal. Another way to look at this, is that all of the meaningful information is contained in the coefficients that remove this linear dependence. Therefore, we can transfer these coefficients (or some form of them as above), and the receiving end can recreate the signal. This is done by inverting the linear predictive FIR filter to create an IIR filter, and inputting white noise. So the compression comes in from removing this linear dependence, and transferring the coefficients. This is why the Burg method is also sometimes referred to as the maximum entropy method, as it aims to maximize the "randomness" or whiteness of the output noise in the linear prediction filter. Another way to look at this, outside of physical modeling, is that vocal spectrum (with exception to unvoiced sounds such as hissing) tend to be very impulsive, making them excellent candidates for AR modeling.
To answer your final question, I'm not sure what you're asking entirely. LPC, or linear predictive coding is meant to "compress" the signal assuming that it can be efficiently modeled as previously discussed. You can certainly use linear prediction to do "shortterm prediction" as you've mentioned. This is the implicit basis behind the high resolution AR methods used for power spectral density estimation. The autocorrelation sequence may be recursively extended from it's finite form from the limited data record to infinity as the theoretical autocorrelation sequence of the unwindowed sequence. This is also why AR methods of PSD estimation don't exhibit sidelobe phenomena.
Comment: My apologies, I originally learned it through the analogy of vocal chords as a physical model which is where that came from. As I said, there are places where they delve into this much deeper into this. But you're correct, LPC is suitable for generic audio waveforms. As I mentioned, it works well on any impulsive spectrum. As a corollary, it works poorly on noisy signals where the spectrum is less impulsive (this is because noisy signals are better modeled as ARMA processes).
Comment: "the theory of LPC revolves around vocal tract modeling" Is this always true?  FLAC uses LPC on generic audio waveforms, not just voice.


What is the percentage of users that block cookies in their web browser?

Question: What is the percentage of web users that use either cookie blocking software for their web browsers or software that blocks Google Analytics tracking?
Comment: What constitutes a blocked cookie for you?   Are users that delete cookies daily considered "blocked"?
Comment: Yeah even that is considered a blocked cookie. Basically any cookie that doesn't follow it's normal predetermined web app life cycle and is deleted/unset by external intervention, either by a javascript browser extension or a user that deletes his browsing data.

For example, everytime the universal analytics javascript code sets the _ga cookie, that cookie is then unset by a cookie blocking software.
Comment: I allow cookies by default because it keeps you signed in. If you're worried about security, block cookies. Doing so will skew Google Analytics.
Answer: None of those blocking tools report [expose] themselves to trend trackers so you gotta count the extension market users. Example, the Google analytics opt-out extension in the play store has 295,842 users out of the billions that use the internet. Thats like nothing in the scope of internet users. And thats just Google analytics block, not all cookies block.
As far as the rest of cookies, they are generally useful and far less people want to block them for obvious reasons: they don't want to lose their cart, they want to stay signed in across apps, they just want a hassle-free experience from a site that has memory of them.
That being said, I would guess at most something less than .001% of web users block all cookies. Thats 1 million folks per billion users.
Comment: 1 million is 0.1% of 1 billion, not 0.001%.
Comment: Your estimations make me happy :)
Comment: @george Haha yeah man its totally off the hip est, but its a good question to ponder. I think due to browser securities locking down cookies, less affiliate stuffing, CORS, and AD opt-outs, the number of full cookie-blockers will decrease while the number of analytics/ads blocks increase. Should leave a growing window for legit cookies to work again while more nefarious ones will consistently be auto-blocked by stock browsers. So if its a utility cookie, I think you're good to go.
Comment: I'm probably a minority, but I run a periodic script that deletes all cookies from domains not on my "whitelist."  I add a domain to the whitelist IFF it's needed for things to work there AND I think they aren't using it for purposes I disapprove of.  So many abusers that a whitelist is easier than a blacklist.
Answer: According to https://blog.yell.com/2016/04/just-many-web-users-disable-cookies-javascript/ it looks like around 2-3% of visitors to Yell.com are either blocking cookies or running in "incognito" mode (which accepts cookies but discards them later, which I think would count here):

How about local storage?
97.6% of users have local storage enabled (0.07% of those are non-JS users)
  I was prepared for the number of users without local storage enable to be slightly higher than the two previous measures, but 2.4% is quite a lot, this translates to around 480,000 visitors. That's not an alarming amount, but it's high enough that we can't ignore it. Of those users, 0.07% don't allow JS.
Many of these remaining visitors choose to use their browser's Private Browsing mode, which causes data to [not] be stored on their machines. iOS Safari is particularly notable for this behaviour. We found that these users know what they are doing and consciously want to prevent tracking and in doing so can stop some features from working.


What's the name of the phenomenon in which upon hearing same sound repeatedly, one begins to hear a rhythm?

Question: When making non-music recordings, sometimes I listen to a three-second snippet repeatedly and after a few listens, I cannot help but hear a rhythm or a certain musicality. What's this phenomenon called and who studies it?
Comment: I see some good answers - I agree with you that since it's such a recognizable phenomenon - it should have a name.  Perhaps if not in English - in some other language.
Comment: This phenomenon is very useful when starting to write a song: if I have a phrase (a few words, not a musical phrase) floating around in my head, I try to identify what the natural rhythm is. The same thing happens on the rare occasions when someone gives me a complete lyric and expects me to write the music: I read the lyrics and imagine their rhythm.
Answer: This sounds similar-to (but more general than) the so-called Speech-to-Song effect, a musical illusion discovered and described by musical psychologist Dr. Diana Deutsch, whereby a repeated phrase of speech comes to sound like music. I think the effect you're discussing is a more general effect, since it involves any repeated sound, and does not necessarily take pitch into account (since you're asking specifically about rhythms). Dr. Deutsch describes this illusion (and several others) in an interview on the Composer Quest podcast here (this particular illusion is described starting around 9:45 or so).
In the case of rhythms specifically, I'd say this is actually what is called Beat Induction -- which is a form of entrainment:

Beat induction is the process in which a regular isochronous pulse is activated while one listens to music... Beat induction can be seen as a fundamental cognitive skill that allows for music. We can hear a pulse in a rhythmic pattern while it might not even be explicitly in there: The pulse is being induced (hence the name) while listening—like a perspective can be induced by looking at an arrangement of objects in a picture.

As for who studies these kinds of effects? Musicologists and perceptual/cognitive psychologists. It seems to be an open question in psychology whether beat induction is an innate biological ability, or a learned, cultural feat. According to this article in Psychology Today, recent evidence (comparing brain scans of adults and infants while listening to various types of music) supports the idea that it is innate.
Answer: A rhythm is essentially a recurring relationhip between the time intervals at which noticable 'events' in a sound wave are occurring. These 'events' can be of many types, though - could be a drum beat, or the start of a note being played - or it could be a sudden change in timbre of a sound, or even a sound stopping.
Think of what happens when a CD player can't read a CD. It starts playing the sound in its buffer round and round - typically a half-second snatch or so. Let's imagine this snatch begins just after someone has started saying the word 'so'. First, there will be a noise from the sibiliant 'S' sound, then the vocal cords will start to vibrate, so there will be a pitched sound... then it will go back to the start of the loop again, and you get a sudden burst of noise again - the burst of noise could sound a bit like a cymbal being hit; the slowly increasing pitched sound could sound like the start of a cello or reed organ note.
Continuing this line of thought, if there are any strong pitches in the sound being repeated, you may hear a repeating melody. It may be that this corresponds to the musical scale notes we are used to, but even if not, the very fact that it repeats will give it a musical identity.
So there's almost no phenomenon to explain - it's just that repetition is rhythm. By repeating a sound snippet, you can turn an unmusical sound into a musical one. One composer who was very interested in exploring this was Steve Reich - an example of his music is It's Gonna Rain :
Comment: Well, I'd say there is a neurological basis. As some MD commented in a piece on annoying advert jingles, "your brain likes repetition."   We sort of 'force' things into patterns.
Comment: Our brain is all about recognising patterns-it will even find patterns where none exist (which is why when things happen randomly, we still manage to convince ourselves our lucky socks are the cause). In the case of a repeated sound snippet  though, there really is a genuine recurring pattern for it to recognise.
Answer: We LIKE patterns.  Our minds and brains crave for order, for organization.  If you write abtruse dodecaphonic music with no tonal basis at all, listeners will strive (often successfully) to find a tonic.  Let's not start a fight, but this could help explain why some people are happier with design than with evolution.
The answer to this specific question is much more simple.  If you repeatedly loop anything there IS a repeated pattern, certainly of rhythm, probably also of pitch.  Who are you to decide anything is "non-music"?  :-)


conforming audio

Question: Just getting myself ready to conform audio to some picture changes which
I haven't done before in Protools.
Is there any advantage in starting at the end to make the first change and working back to the start?
Would the editors notes lose their time location if I make the first edit towards the start etc..
Answer: construct the new edit at a different location on the timeline to avoid confusion. If the picture start at 1 hour, do it at 4 hours for example. also means if something goes wrong you have the old layout available. If your changes are listed as 'add x frames here', 'cut x frames there' etc, then you will have to translate that into a series of cut and pastes - shouldnt be too hard if you take care.
Marc Specter
Answer: +1 Marc. Definitely construct the new edit in a different location.
Region groups are your true friend in this process as well.
Answer: I have the original video file and the new video file running in frame mode and I can see when the frames visually go out of sync. I was wondering would it be helpful to cut the old video file with my grouped regions on the OMF or just leave the old video file unedited.
If the editor says cut x frames at a certain point will I have no reference on the old video to know where he is talking about?

conforming audio


Local cloud Gaming (e.g local OnLive)

Question: Is there a software that allows to create OnLive-like server for game for playing in LAN?
Computing power and bandwidth is enough to do such thing, software is the only problem.
Answer: I am not aware of any Cloud Gaming Service you could install at home. If I should guess you want to have a server or normal PC which functions as a "Cloud Game Server", while you are playing with a mobile device?
If this is the case I advise trying to play through a RDP connection. I did not try it myself, but there are several reports in various forums, implying that gaming through RDP is possible (although there could be problems with latency and graphics).

Local cloud Gaming (e.g local OnLive)


How do I translate "eternity"?

Question: For example, in Those that disobeyed were frozen in place for all of eternity. how should I translate eternity? Specifically, how do I translate it in the context of a small eternity?
Answer: That's just eterno.

Tiuj, kiuj malobeis, estis fiksitaj surloke por ĉiam. / por tuta eterno.

"In place" is surloke or enloke. If "frozen" is literal, then use frostigitaj.
I suppose "a small eternity" would be an eterneto, but that sounds a little too much like Eterreto ("Ethernet"). Maybe an eta eterno?
Comment: There actually are bigger infinites than others (at least more densely populated than others). Take the set of all real numbers. Then, the set of all integers. They're both infinite, but technically all integers are just a piece of a bigger infinite, real numbers. More on topic, I like *eta eterno*.
Comment: _Small eternity_ is a contradiction; it would be like saying _a small infinite_. There isn't a bigger eternity, or a bigger infinite.
Comment: Yes but, in my opinion, you have to be a math geek to know that
Answer: I would say "eterneco" - "eterna" (eternal) + "-eco" (state, quality).
I'm not sure what "a small eternity" is even in English, so I'm not sure how to translate that one.

How do I translate "eternity"?


Wouldn't Matt Smith be the 12th Doctor and not the 11th because David Tennant is both 10 and 11?

Question: How is Matt Smith not the 12th Doctor (since David Tennant regenerated first into himself and then into Matt Smith)? Then wouldn't Peter Capaldi be the 13th Doctor?  (Because that regeneration was a gift from the Time Lords thanks to Clara.)
Comment: And it's more complicated than that, due to the existence of [the Valeyard](https://en.wikipedia.org/wiki/Valeyard).
Comment: And the War Doctor. :p
Comment: What about the war doctor played by John hurt? If you count his regeneration he should be 9th doctor, which screws up all numbers.
Answer: Here's the "regeneration" you're referring to:

The key here is that, while the Doctor did use up one of his regenerations, he didn't actually regenerate. He used just enough of the regeneration energy to heal himself, then channelled the rest into his severed hand from "The Christmas Invasion", preventing himself from fully changing.
You can think of it like the scene in "Let's Kill Hitler" where River Song transfers the last of her regeneration energy into the Doctor to revive him: on both occasions, the energy brought him back to life, but he didn't regenerate. So he's still the Tenth Doctor.
Comment: I'm fairly certain 12 discusses this with Pond at some point, mentioning his "vanity issues" at the time, and how this was his last form. I just wish I could remember the scene.
Comment: @EricMcCormick I think that was Eleven, discussing it with Clara during the Siege of Trenzalore.
Comment: That sounds right, although I didn't quickly find a clip on YouTube substantiating it. ¯\\_(ツ)_/¯
Answer: It's complicated, more complicated than anyone knows exactly and this is why:
In the episode "The Brain of Morbeus" The Doctor faced a Timelord, a criminal mastermind who had survived execution called Morbeus. In a desperate attempt to thwart his plans, The Doctor goaded Morbeus into a mental duel.
They were both hooked to a machine which pitted all their mental resources from each of their many lives against the other's, their will and their knowledge and their determination to win, and to live.
The effort killed The Doctor, and reduced his enemy Morbeus to an insane gibbering wreck who threw himself off a cliff, so The Doctor - even in death won.
Whilst he was hooked up to the machine, The Doctor's and Morbeus's  previous personas were displayed one by one as they were drawn into the contest - these images appeared among others:

Attribution: Peter 2018
None of the (lower row of) above images are of Doctors that we can pinpoint and name easily, they all appeared before the image of William Hartnell, Peter Cushing (had you forgotten him too? Here.) Michael Jayston (as per comments), David Bradley (Here) et al..
The Party line is that Peter Capaldi is the twelfth, but there's more to it, much more to it, perhaps more than even The Doctor himself knows - Rasillon knows, I don't.
Comment: Canonically, I'd expect that they're meant to be future versions considering that they're in a different colour with a sort of portally effect.
Comment: @wizzwizz4 Possibly, but their costumes appear to be from Earth's past - admittedly that's no guarantee of anything.
Comment: @Duckisaduckisaduck such linear thinking.
Comment: @JAB True, I need a Tardis, for educational purposes.
Comment: We certainly know by out of universe reasons that none of them can or will be future doctors on the show so this certainly complicates any numbering system based on regenerations.
Comment: In some future episode I suspect they will do a true origin story for the Doctor which involves him/her coming back from the future, in a different universe, and will imply that the Doctor has in fact always existed, perhaps having had an infinite number of incarnations, but that when they do this universe-switch they lose most of their memories of their previous selves, for "reasons".
Answer: Canonically, there only is, was, and will ever be one Doctor. The numbering is simply a referencing device for commentating on the show.
Comment: You've had my +1, the rest of the answers are just waffle, including mine.
Answer: Personally, I also thought that by regenerating into the "same" body, that ought to count as two separate Doctors.  However, regardless of in-universe status, the numbering of the Doctors is really based on the out-of-universe actors who played the character.  On that basis, since the actor did not change, the numbering of the Doctor did not change either.
Comment: Given the fuss Ten made about changing into a new body at the end (you know, about dying and a new man walking away with his memories) and how easily this went over, I conclude he didn't really regenerate here.
Answer: The numbers generally refer to the number of times the Doctor has regenerated, distinct from the number of times the Doctor has consumed one of his available regenrations.
In short, new face, new actor, new number.
Comment: The first Doctor was not the doctor after the first regeneration, and the War Doctor is not in the numbering scheme and was a regeneration, so only 9th Doctor and the first regeneration of 10th Doctor have the same 'Doctor number' as the number of times the Doctor has regenerated. (https://www.bbc.co.uk/iplayer/episode/p01mj6k8/doctor-who-the-time-of-the-doctor 54:26 the 11th Doctor refers to "regeneration number 13")
Answer: There's another question on here that asks what "counts" as a regeneration - I've opined that it's not the amount of energy used, but the number of times the energy (and the process) is tapped into. The events of the show suggest they consider the rule to be the number of times the process is started.
This was all addressed in Matt Smith's last episode The Time of the Doctor. The War Doctor (played by John Hurt) was a regeneration The Doctor didn't acknowledge, but it certainly counted as a regeneration. So too did Ten's "partial" regeneration after getting hit by the Dalek beam. He chose to offload the regeneration energy into his severed hand. He retained the same body/regeneration, but the process was started, the energy was expended, so it too counted towards his twelve regeneration limit.
Moffat cannily hinted that the fans "had forgotten something" when it came to the regeneration limit, namely that Tennant regeneration. Comments online made it clear that damn near nobody forgot, and we were all keen to see what he was going to do, since by the rules, The Doctor had hit his limit.
So to answer the original question, Smith's regeneration indeed the twelfth regeneration, but the "extra" Doctor is The War Doctor. So technically, Eccleston was Ten, and Tennant was Eleven. They never "counted" the War Doctor, so Smith often referred to himself as "eleven", but he still counted as a regeneration.


Is there a Bitcoin bank, which gives interest on my deposit?

Question: Is there any Bitcoin bank I can place my Bitcoins in that will give me a decent interest rate. It should be at least 1% for it to be worth it.
Comment: @eldentyrell Even if there is deflation a bank should be able to give a higher interest rate than Bitcoins standing idle in a wallet.
Comment: Bitcoin is a deflationary economy, so you should not expect there to be **nonzero time value of money**.  Any interest you earn will be the risk premium for the chance you take of the "bank" going bust.
Comment: @eldentyrell - also in fiat economy, you take the chance of the bank (or its backing government) to go bust.
Comment: @this_site_is_a_cesspool, You are mistaken. As long as the currency has "business potential" (can be used in a business to make more money), the time value of that currency will never be zero. Yes, inflation/deflation will affect the %, but **it will never be zero** for the same reason `1` will never be `0` even if you divide it by an extremely large number.
Comment: What about https://www.bitbond.net/ and/or http://www.bitsavings.org
Comment: asked in 2011... so hopefully if had a few hundred or a few thousand dollars in bitcoins at that time and now you can retire 3 times
Answer: Please Take Note: Flexcoin has been hacked and is no longer operating.
Original Post shown below:

Right now, the closest thing you can find to a bank is Flexcoin. If you keep your money there, you will receive a variable interest (they call it discount for legal matters) every month. They also have a user defined cold storage service available for those who want to keep their funds offline.
Here is how it works. Every time you withdraw money from Flexcoin, you pay a fee:

Fees:
Flexcoin to Flexcoin = FREE
  Bitcoin to Flexcoin = FREE
  Flexcoin to Bitcoin = 0.01 BTC or one half of one percent of the transaction amount (whichever is greater)
  Cold Storage Transaction Fee (outbound) = 0.02 BTC or one percent of the transaction amount (whichever is greater)
  Cold Storage Transaction Fee (inbound) = 0.01 BTC or one half of one percent of the transaction amount (whichever is greater)

This fee is used to pay miner fees and keep the service running. The rest of it is distributed among clients:

Discount Payout:
70% of the fees collected are disbursed to the account holders as
  discount payments on any fees already paid or any potential future
  fees, based on the following formula…
(your account balance / total balance of all flexcoin accounts) *
  ((all fees collected – miner fees) * 0.7)

Here are two bitcointalk threads about the discount payments for the first two months.
As a final note, I would like to say that I personally think that this kind of service is not very useful right now because the Bitcoin price is too unstable. For example, yesterday the price dropped 15%. Any interest you might earn becomes irrelevant in this scenario.
Comment: It is wrong to say that this kind of service is not useful due to unstable pricing. The short time price swings are irrlevant if you are aiming for long term storage. 101 BTC will still be worth more than 100 BTC regardless of the price.
Answer: In theory, such a thing could be created. 10 Bitcoins today is worth more than 10 Bitcoins tomorrow. If you don't see why, just ask yourself this: Would I rather have 10 Bitcoins today or 10 Bitcoins tomorrow.
Obviously, you'd rather have the 10 Bitcoins today. Why? Because you can hold them for a day and have the 10 Bitcoins tomorrow. Plus, you have the extra benefit of anything you'd prefer to do with them today rather than holding them until tomorrow.
However, to set up such a bank right now, you'd have to use the following method:

You convert the Bitcoins to whatever national currency had the highest interest rate.
You loan out that money or place it in bonds or other secure investments.
At the end of the term, you buy back Bitcoins to pay back the depositor.

The problem, of course, is that the value of Bitcoins could shoot up while the currency is loaned out. To protect against that, a bank that used this model would have to offer offsetting shorts to cover that loss. Basically, that means it allows other counter-parties to buy a derivative that goes up if Bitcoins go down and down if Bitcoins go up.
This way, if the price of Bitcoins goes down, the bank makes extra money buying back the Bitcoins at a lower price, but it has to pay out on the shorts. If the price of Bitcoins goes up, the bank loses money buying back the Bitcoins, but makes it up on the shorts.
If the bank itself offers the shorts, it actually makes extra profit on the shorts either way. It makes some profit on the loan and some on the shorts. (Whether Bitcoins go up or down cancels out. Any extra profit on the loan, due to Bitcoins going down, is made up with a loss on the shorts. Any extra profit on the shorts, due to Bitcoins going up, is made up with a loss on the loans. If Bitcoins stay the same, the bank makes its small commission profit on both the loan and the shorts.)
There are definitely people who believe that, long-term, Bitcoins will gradually drop to near-zero value, and they would like to buy shorts on that basis. However, the shorts would likely have to be more short-term unless the loans were long term. So making the details work could be quite a challenge.
To my knowledge, nobody offers this yet.
Comment: It doesn't require infinite liquidity. It just requires that you match shorts to loans. It only requires infinite liquidity if you insist on zero risk or expect to be able to issue unlimited amounts of shorts or deposits.
Comment: Your model is unsustainable. It would require a infinite liquidity in the derivatives market. I think we have only three possible options: 1) Bitcoin Bonds return should be computed over $ - 2) The bitcoin becomes more stable - 3) The bitcoin economy starts to create more opportunity, without the need to convert them in $
Comment: @Mascarpone, The model is definitely sustainable. It is an extremely old idea and often used by major banks and companies that have to deal with *nonbit-coins* (aka foreign currency). See http://en.wikipedia.org/wiki/Foreign_exchange_hedge
Answer: I don't think a bank offering that would/should be trusted right now, because the bonds market is too shallow.
The way I see it, we have to see a large increase in the bonds market beforehand. There will be a lot more bonds, some riskier/boarderline scams, and some more "serious" (e.g. Gavin or Mt. Gox issuing for a bond would probably not be treated as a scam by ... almost anyone). The interest rates of these various bonds will vary.
After this market materizlies, some trusted 3rd party can come and slide & dice these loans into something more structured. E.g. if within a year we had a range a bonds, with interest rates running from 2% to 10%, then a big player ("bank"), trusted by the community, can come and offer a safe interest rate of 1%. He would then invest in the bonds with some risk distribution, and make an arbitrage. Some bonds will default, but that's ok, because the overall portfolio of the bank should usually increase over time by more than 1%.
Comment: MtGox issuing a bond *will* be treated as a scam by... almost anyone http://gawker.com/does-mt-goxs-ceo-have-a-secret-history-of-online-payme-1534752110
Comment: @Pacerier - yeah, times have changed.
Answer: I know many people who accept Bitcoin Loans and promise a return, which in finance is known as bond. The problem is: Can you trust them?
At the moment no serious emitter is available,
in the near future MtGox and Tradehill will start offering such services. and it seems like no candidate is available in the near future. Mtgox and Tradehill will launch Options soon, which are slightly different than Bonds, in the fact that there is no guaranteed return.
If you are interested in investing in a start up drop me a mail to email@example.com
Comment: If you have any source for the upcoming MtGox/Tradehill services, could you please add a link? Thanks!
Comment: My memory failed me. I just updated the answer.
Answer: My co-founder and I run the site Bitbond where you can finance Bitcoin loans (Bitbonds) of other people who present their funding project on our marketplace. That way you can earn interest on your Bitcoins. Technically this resembles a bank since we also offer a secure wallet.
It is easily possible to start a Bitcoin based bank. You would simply take Bitcoin deposits and grant loans to other customers who will pay interest on these loans making a margin from the interest rate spread. Then you would have what you ask for, an account where you earn interest on your deposits.
I just don't believe this is a good thing. One of the main reasons why the fiat banking system is in such huge trouble is that they take short term money (their client's deposits) and lend it out long term (for loans, mortgages etc.). When people who lent money to the bank through their deposits want to withdraw their money earlier and in a larger extent than expected, banks get into huge trouble.
There used to be a golden rule of banking that basically said to match maturities. Long term loans should be refinanced long term. But fiat banks don't stick to this rule anymore for a long time. It's just more profitable to take cheap short term deposits and put them in long term assets. But it makes the whole financial system sink.
So to cut it short. Yes a Bitcoin bank is easily possible but we, the users of Bitcoin, are better advised to stick to the golden rule of banking. That's what happens at peer to peer lending.
Comment: You stated "but fiat banks don't stick to this rule anymore for a long time". Are they actually allowed to do that?
Comment: Yes, banks are allowed to do that. The "golden rule" is not a law but rather an inofficial guideline. It's more profitable for banks to borrow short-term and lend long-term. And since there is deposit insurance, the bank's clients don't have a reason to care. When a bank messess it up, most of the client's deposits will be covered by the insurance. So nobody is giving banks an incentive to stick to the "golden rule".
Comment: So why couldn't a bitcoin bank do that as well?
Comment: A potential Bitcoin bank could borrow short-term and lend long-term as well. For the reasons stated in my main answer I just don't think it's a good idea. In the end it's simply the users who decide which services they support and which they don't.
Answer: First of all, you should have a good answer to the non-trivial question:
If I deposit 1 BTC in a "bank" and expect to get more than 1 BTC back, where did that extra (interest) come from? You don't expect an ounce of gold to increase in mass.

If you are like most people, you do not understand that banks do not lend money! When you get a so-called loan in a bank what the bank provides is a "promise to pay" (Google 'checkbook money' and 'fractional reserve banking'), it provides credit - not money.
Credit, which is the same as debt, can be infinite in supply and as long as the more people (or states or corporations) keep adding to the total debt faster year after year than the rate of interest the system can stay solvent.
However, if people take out too few loans to service the interest on old loans the system collapses (in a so-called 'deflationary spiral'). By the way, contrary to popular understanding the 'deflationary spiral' phenomenon has little or nothing to do with "people hoarding money", but everything to do with shrinking money supply (debt).
One GREAT feature of Bitcoin is that people can easily hold their own money in their own wallets (ie. NOT deposit the BTC in banks or online wallets). This prevents the banks from issuing "promise to pay BTC" in the usual fraudulent (but legalized!) way that regular banks do.
Morale - be careful what you wish for.
Interest-giving BTC accounts is the kind of thing that would lead me and many others to give up on Bitcoin because once you accept promise-to-pay BTC as real BTC, the supply cap is no longer 21 million, but infinite - and Bitcoin will go the way of the fiat currency. (Die)
Real, sound, currencies like precious metals or BTC do not give interest - and for exactly the same reason. This is a good thing that we should all fight for.
Comment: This does not answer his question. Also, your answer invites to a discussion that is not suited for a Q&A site.
Comment: D.H., are you one of those **StackExchangeCultureNazis**?  I upvoted this answer for nothing other than "you don't expect an ounce of gold to increase in mass", which is probably the most insightful sentence in any of the answers to this question.
Comment: @eldentyrell: I certainly don't want to come across as a "Nazi". It's just that this question is not supposed to discuss whether or not we _should_ have Bitcoin banks. We certainly _could_ have. If you want to invite to a discussion on whether or not we _should_ it's better to use the comment field and add a link to a forum post or a blog where it could be discussed. Using the chat here on SE is another option. I apologize if I come across as a Nazi.
Comment: I'm with @D.H. on this one. -1.
Answer: There cannot be a bank that pays interest on BTC, because there cannot be a bank that lends BTC. No one would borrow an appreciating currency, and no one would lend against collateral that depreciates relative to the real value of the outstanding debt.
Banks make money by lending in a currency that the parties expect to depreciate modestly over time. The nominal interest rate compensates for the expected inflation, effectively amortizing the real loan over time.  That is an appropriate outcome, because the underwriting data on which the loan was based becomes stale over time, raising the statistical risk associated with the loan; the declining real balance, along with appreciating nominal collateral, offsets this risk.
Absent a depreciating currency, there is no banking.  (And, if there is no banking, there is no economy, which is why bitcoin cannot be a currency but only a means of transmitting currency).
Comment: People will borrow currency regardless of whether it's appreciating or depreciating as long as they can reasonably expect to get back more (e.g. by investing those money in their business etc). Banks make money by lending money to businesses which pays interest. Yes, upon an inflationary currency, banks may benefit more, but upon a deflationary currency, banks will still earn.
Answer: There is a bitcoin "bank" that pays 6 % interest just check it out here
Answer: coinlenders.com
filling 30 chars with blank blank blank...
Comment: You could fill the 30 characters with a description. Your link is relevant
Comment: Hi sahra! Like David says, please add some description to make the answer more helpful. Also, when writing links in an answer, make sure that they are clickable. Thanks!
Comment: @sahre, Link broken...


Why does the water in the recipe for dough making not have a definite temperature or an advise about temperature?

Question: The recipes lists 60 cc of milk and specifies 25 C in Summer and 45 C in Winter but for 150 mL of water it merely says lukewarm water. The recipe is in Japanese but I can understand it. The recipe is for wholemeal bread.  It uses 9g of yeast and 150 g each of wholewheat flour and self-raising flour.
It says to mix the dry ingredients and then add the milk and water slowly.
Comment: It is usually prudent to proof the yeast before adding to the dough mixture. That would mean using very warm water with a bit of sugar to help the yeast grow and make sure the yeast is viable.
Answer: It doesn't have definite temperature because you don't need it. The dough will work with any temperature water you use, anywhere between 0 and 40 C. The difference will be in the time needed for the dough to rise, and the amount needed kneading to get the same gluten strength. But as these parameters are not firm, but you proof until the dough is risen properly, and knead until it is kneaded properly, you don't have to start with a specific temperature.
You don't need it for the milk either. But if the recipe author wants to spend roughly the same time preparing the bread, they must have used this temperature to achieve similar rising times for dough left to rise at room temperature, or maybe yeast left to proof at room temperature as suse mentions in a comment. It is just an additional convenience which can be followed, but is optional. So there is no need to supply it for the water either.


How many miles of riding require the same effort as one mile of running?

Question: A co-worker and myself are having a friendly bike / run contest. What is a good ratio for miles ridden vs. miles run? I know it depends on pace. But I'm curious what a generally accepted range of ratios might be.
Comment: I think this question missed the point to some degree.   I think the real metric is how much trash you can talk afterwards.  Whatever rules you settle on, roll up next to them during the bike portion, pull a beer out of your water bottle cage, take a swig, and say "The problem with running is all that silly bouncing throws off your drink."  Then hammer off.  Cyclists 1.  Runners 0.
Comment: I can "run" maybe a quarter mile.  I can bike 80 miles.
Comment: I'd say the ratio is not linear, since one can run for much less hours than one can ride, non-stop. A way to calculate it would be to take an average-fit person marathon's time, and see how much distance a biker does in the same time at a certain average speed.
Comment: @heltonbiker - True, it's not linear. But there must be some reasonable conversion between someone who runs a say 5K in 21 minutes vs. biker who rides say 20 miles at 18mph.
Comment: @heltonbiker: "In 2005, the average marathon time in the U.S. was 4 hours 32 minutes 8 seconds for men, 5 hours 6 minutes 8 seconds for women." (top world times are 2.25 hours) That calculation would probably put comparable cycling distance at about a metric century (62 miles), but I think most cyclists consider a full century (100 miles) more fairly comparable to a marathon.
Comment: I wonder... The question perhaps suggests to compare MONTHLY mileage of two co-workers (as a way to compare their level of physical activity) or would it be the mileage of EACH RIDING/RUN, as a measure of physical fitness/condition?
Comment: related - http://bicycles.stackexchange.com/questions/5020/how-much-easier-is-cycling-compared-to-walking-or-running
Comment: You could use [Fitocracy](http://www.fitocracy.com/), and see who can get the most points through biking or running.
Comment: You could both ascend a hill so steep that the increase in potential energy dominates energy consumed by the mode of transport... :)
Comment: "A co-worker and myself are having a friendly bike / run contest." So, this is a **race**? You're riding "x" miles and the runner is running "y" miles? And so, whoever gets to the finish line first; wins?
Comment: @RandyMinder - "...a friendly bike / run contest." The contest is not described in **any** way. Can you describe the rules and so forth?
Comment: I don't see how this is really answerable. What is a "good" ratio? Are you concerned with how much effort the ride/run takes? What about the x-factor of the bike itself? Any answer will be an educated guess at best.
Answer: The short answer to your question is "probably between 2.5 and 3.5 miles; the faster the runner the closer to 2.5 while the slower the runner the closer to 3.5." The long answer is quite long.
As you already noted in your question, the full answer depends on pace; but it also depends on the surface being run or ridden on, whether it is up hill, down hill, or flat, whether it is windy or calm, and how "aero" the cyclist is. That said, if we are talking about a road bike on a firm flat surface under calm conditions, it is possible to make some estimates of the "equivalent" distance. The simple answer is given in the chart below, which relates the distance one must cycle in a given amount of time to equal the effort in running a mile at a given pace.

In this chart, the x-axis is the run pace for a mile and the y-axis shows the distance one must cycle in the same amount of time. For example, if you can run a mile in 4 minutes, an equivalent cycling distance if you were riding "in the drops" would be to ride about 2 miles in the same 4 minutes (that is, to average 30 mph). If you ran a mile at a 10 minute/mile pace, it would take you 10 minutes to run a mile and an equivalent cycling distance would be to ride about 3.5 miles in the same 10 minutes (that is, to average about 21 mph).
How was the chart calculated? In running, the power needed to run X meters/second is approximately X watts/kg of body weight (cf. Hall, Figueroa, Fernhall, and Kanaley, 2004 or McArdle, Katch & Katch, 2007), while the power needed to ride at Y meters/second varies with Y^3 (cf. Wilson and Papadopoulos, 2007). Thus, if we know the amount of time it takes to run a mile, the weight of the individual and the bike, and some other simplifying assumptions we can make the conversion. An exact estimate of running power will depend on the individual's gross metabolic efficiency, the runner's energetic economy (that is, how economical in an energy sense is the individual's running style), and the runner's resting metabolic rate, but it is commonly observed that for a normal-sized individual without unusual abilities or disabilities, energy expenditure while running on a firm flat surface will range between about 0.8 to 1.1 kcal/kg/km. Thus, a common rule of thumb is that running requires about 1 kcal/kg/km. There are 4.2 joules per kilocalorie but gross metabolic efficiency usually lies in the range of 19-25%; if we assume a value of 23.8% for GME, we can derive the happy simplification that (running speed in meters per second)*(body weight in kg) is a reasonable estimate of power in watts; or speed in meters/second ~ watts/kg.
For this chart, I first calculated the speed in meters per second for various running paces along the x-axis, from a 4 minute mile (= ~6.7 m/s) to a 10 minute mile (= ~2.7 m/s). By the running rule of thumb, this requires roughly 6.7 watts/kg down to about 2.7 watts/kg. I then presumed "average" values for the coefficient of rolling resistance (Crr) of .005, flat ground, no wind, and a CdA (drag area) of the cyclist of 0.25, 0.33, and 0.42 sq. meters (typical of a road bike rider "on aerobars", "in the drops", and "on the hoods") and calculated the cycling speed for a cyclist able to produce between 6.7 watts/kg and 2.7 watts/kg. The running pace defines a total amount of time needed to run a mile so the question becomes "how far must a cyclist producing this much power ride in the same amount of elapsed time?" Knowing the speed and the elapsed time lets us calculate the distance. That is what is shown on the y-axis. Note that for the fastest runners, the equivalent cycling distance approaches 2 miles while for the slowest runners competing against the most aerodynamic cyclists, the equivalent cycling distance approaches 4 miles. Thus, for a friendly race between you and your co-worker, if neither of you is a world-class athlete, a reasonable range is 2.5x - 3.5x the running distance to handicap a race so that you both finish in approximately the same time.
If the cyclist were a bit more aerodynamic (for example, if the cyclist used aerobar extensions and subsequent CdA was below 0.25 m^2) the curve would move upward and the rider would have to ride farther in the same amount of time (that is, faster) to match the runner's energy expenditure. If the cyclist were a bit less aerodynamic (for example, if the cyclist's position was more upright, or was wearing loose and flappy clothing) the rider would be expending energy at a faster rate so the curve would move down.
A rough validation of this approximation is that, anecdotally, people who both run and cycle say that running 10 km in about 42 minutes is roughly about as hard as riding 40 km in an hour. That's a running pace of about 6:45 per mile, and the chart equates that to cycling about 2.75 miles in 6:45, or about 24.5 mph -- which is 39 km/h. Our rule of thumb for equivalence is "between 2.5 and 3.5 times as far; closer to 2.5 times if the runner is fast and closer to 3.5 for a slower runner." Running a mile at a 6:45 pace is moderately fast, so we would expect the equivalent multiplier for cycling distance to be closer to 2.5 than to 3.5 -- as you can see, the predicted multiplier is 2.75 so the rule of thumb appears to work. Further evidence can be gathered from duathlons or triathlons. Below you can see data from the 2010 Ironman World Championship in Kailua-Kona, Hawaii. The Ironman comprises a 2.3-mile ocean swim, a 112-mile bike ride, and a 26.2-mile marathon. The scatterplot matrix below shows the swim, bike, and run times (in hours) for each of the finishers.

If we ignore the swim leg and concentrate only on the relationship between the run and the bike, we can prorate them to equivalent 10k run times and 40k bike times, as is done here:

What these latter two charts clearly show is that equivalent bike distance will depend heavily on run pace but also on the individual. There is a great deal of "scatter" in the scatterplot, which indicates that while the rule of thumb is reasonable it is not precise.
Comment: This is a great answer. I do have one issue with comparing running to cycling times in an Ironman: fatigue! Running comes after cycling, so it is natural to assume that the contestant will be running at a slower pace relative to cycling than they would were the two events reversed. That said, this is probably mitigated somewhat by the significant endurance requirement (it's probably better strategy to maintain as equal effort as possible across both events). It would also be interesting to consider the ratio for both sprinting and endurance distances.
Comment: @heltonbiker: The data were downloaded from the Ironman site. The plots were done with R, using the basic graphics function "pairs" which creates the scatterplot matrix. A slightly custom function was used to draw the smooth red line in the upper plots.
Comment: Looks like you're using Matplotlib. Very nice plots, where did you take this data from? It's worth noticing that overall time correlates well with cyclinc and running times, but not so well with swimmin (i.e., swimming time would not be a good predictor for overall time). At last (I think you know that), upper-right and lower-left plots are symmetric to each other, so plotting times are unnecessarily doubled.
Comment: @StephenTouset, I've done a similar thing for short duathlons, where you have a bike leg in-between two run legs. Here's an example of the splits: http://anonymous.coward.free.fr/wattage/duath-splits.png
Comment: There is a great chart showing the number of bike miles relating to running pace or running speed. However to use that chart effectively, can it be re-posted with a) the X and Y axes showing markers of each 0.1 and b) grid lines? That way, it would be much easier to read off exact values from the three curves shown.
Comment: @A.Schwartz I'll see what I can do. It may take a couple of days.
Comment: @R.Chung See [also](http://bicycles.stackexchange.com/a/42796/8273)
Answer: If you want to do a competition which gives a (good runner, mediocre cyclist) even chances against a (good cyclist, mediocre runner) then you might use the same ratio as the Ironman triathlon.
It has a 112-mile (180.25 km) bike and a marathon 26.2-mile (42.2 km) run which puts the ratio of distance cycled/distance run at roughly 17/4.

EDIT:
Based on questions in comments, let me clarify.
I think 17/4 is probably well on the low side for a long race.  I've done a double metric century with 3km of climbing and ridden the next day.  I doubt I could run the day after a marathon on anything but a gentle downhill slope.
For shorter distances though, it seems more reasonable.  If I push myself for 10km (6.2 miles), I expect it would take more out of me than if I hammered for 42km (26 miles) miles, but that's because I'm a better cyclist.  I think the hammering would take just as much extra out of some runner friends of mine.
Weak cyclists can benefit from drafting a strong cyclist in a way that weak runners can't, but I think I'm strong enough to drop a strong runner/weak cyclist so that isn't a factor.  I would definitely try to have the ride first though, because otherwise the run might take enough out of me that I would have more trouble dropping a tail.
Comment: http://www.drmirkin.com/fitness/run_or_cycle.html Don't have time for the math...
Comment: @wdypdx22, I never claimed the OP mentioned Ironman.  I introduced that as a rough proxy for bike/run competitions that I presume has been weighted based on some kind of analysis of cross-training athletes who come from swim/bike/run backgrounds.
Comment: @wdypdx22, 17/4 is 4.25 so the equivalent cycling speed according to that link is 10MPH.  That's probably a bit slow for something competitive, so perhaps bias towards more running than an iron man, unless you're on hilly terrain where a cyclist spends much less of their energy fighting wind resistance.
Comment: @wdypdx22, please see my edit.
Comment: @wdypdx22, "Why wouldn't calories be a more fair measure?"  Because that's just not how races are measured.  Weightlifters burn more calories because maintaining extra muscle mass requires a higher metabolism to maintain.  Races are measured in terms of overcoming some natural obstacle so that the efficient skilled riders can out-compete the young, muscle-bound, unskilled ones.  If you want a caloric competition, try Mr. Universe.
Comment: The issue with using an Ironman (or triathlon) as a benchmark is that it's not really comparing like for like. You're meant to come off the bike tired, but still capable of running a marathon. The run is not the same. A reverse ironman - run, bike, swim - would be almost impossible to complete safely, and certainly not in similar times.
Comment: @Mike - Sorry. I read things wrong. Somehow, the idea that it's a race escaped me. You're right. Calories won't work as a measure.
Comment: @wdypdx22, I can see how you'd reach that conclusion from the post title alone, and agree that calories would be a better metric for someone who wants to plan an exercise regimen or other non-competitive reasons.
Answer: While the idea of comparing the distances of the cycling and running portions of the Ironman triathlon might seem appealing at first, you'll quickly see that the times of those distances aren't quite the same. The cycling portion of the Ironman typically takes participants about 1.25 times as long as the running portion, varying somewhat between competitors but always hovering around 1.25 times as long for cycling.
It might be better to compare world records set over an equal amount of time. As it happens, there are world records held for the maximum distance covered in an hour for both cycling and running. Currently, the hour record for running is just a smidge over 21 km. The cycling hour record is a little bit trickier due to the fact that it has been set on a number of different types of bicycles, many of which are illegal in competition today. However, the hour record on a standard drop-bar road bike with a steel frame, rounded tubes, and wire spokes (much like the one most of us might ride on the road today) is held by none other than the great Eddy Merckx and is a bit over 49 km. This suggests an approximately 5:2 ratio between cycling and running.
However, when comparing calories burnt over an hour of cycling verses an hour of running, you don't get the same approximate 5:2 ratio. It's a little closer to 2:1. This ratio actually does appear to be nearly linear, at least until you approach professional level speeds where the calorie calculator I was using topped out. NB: I was calculating the calories burnt by a 190 lb man. The values and ratios come out wildly different as body weight approaches the very thin and the very heavy.
So I guess it really depends on the metric you'd like to use for comparison.
Answer: The problem here is that the effort spent is differently.
A "good" 45 y.o. runner capable of qualifying for Boston Marathon might do a 3:30 marathon (26.2) while a "good" biker on reasonably flat course might cover around 90 miles on a bike in the same time (87.5 miles @ 25 mph). The marathoner would likely be very much done for the day while the biker would likely still have some left in the tank.
Take it to one extreme, run a 100m sprint as hard as you can. Have your buddy do a 400m lap at the velodrome. The biker will recover MUCH faster. At the other extreme (running/biking for 12 hours+) things are even murkier. As HeltonBiker points out, the ration is not linear (I doubt it's even quadratic). There is also a level of fitness at issue here. Because your are, in essence, multiplying effort small differences between levels of fitness will be blown way out of proportion.
For your contest, you could semi-level the playing field and make it about semi-equivalent effort spent. My $0.02 would be to get heart rate monitors (I would even step it up and get GPS devices) that take into account type of activity, heart rate, etc to generate # of calories burned. Person that burns the most over a specified period wins.
If you are looking to do a single race rather than a longer contest, then you should look at average times for equivalent races. The various triathlon distances would be a good start, but I would discount the run times by 5-10% as the runner will not be doing a swim and bike first!
Comment: I'm not saying that 25 mph on a flat course is out of the question. I'm saying that pace for more than three hours isn't the same as running a marathon in that time. A 3:30 marathon (or even 3:15) is admirable, especially for a 45 year old. 90 miles in the same time is absolutely stellar. Riding 80 miles in 3:15 or 90 miles 3:30 is more comparable to running 30-35 miles in those same time frames.
Comment: Really? 90 miles in 3 and a half hours? That's not just good. That's really close to the speed that the 100-mile world record holder set on a track. That's not a fair comparison for a 40 year-old 3:30 marathon finisher. I get your point but the numbers are way off.
Comment: I did say "good" biker. 25 mph average on a flat course is not out of the question. I know several bikers that could do fit in this range. As for the world record, there is well over a 10% difference in distance ( (100 - 87.5) / 100 = 12.5% ) This is a huge gap at the more competitive levels. Okay, I'll give you a bit...say a 3:15 marathon time to get the fitness levels closer...now the 25 mph biker has only gone 81.25).
Answer: You could just try it once to get baseline values. E.g. you both go and do your thing for an hour, then come back with the results. Then you can use that as your ratio.
To prevent one another from gaming the calibration you could keep a running average that you both try to beat.
Of course the bike will always win for the reasons stated above, and because on a bike you can increase efficiency by spending money, whereas a runner cannot.
A more fair contest would be to compete in each others' sports and compare results fairly. E.g. "I beat you by 15% when you biked, and you beat me by 12.3% when I jogged." Or whatever.
Answer: I am aged 50+ and cycled about 10,000 km (from a 36 km total daily commute) in the last 15 months.
Only very recently (after all that) have I found that I have enough strength in my legs and 'feet' and heart, to run any continuous distance at all.
So for my body, actual running (on my toes and not my heels) was unquantifiably harder (and required a year of cycling just as training, to get started on running).
Answer: In Bulgaria we have an annual 100-km race in Vitosha mountain. Speed walkers/runners set off at midnight, while cyclists start at 6 AM. The terrain asphalt and mountain trails, with slopes up and down. This is considered fair.
I, personally, pity the runners, for reasons mentioned in other answers here - walking 100 miles - heroic torture, cycling 100 miles - pleasure.