This is a fairly common question, and there isn't a One True Answer.
These are the most common techniques:
This gist assumes:
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
<?php | |
/** | |
* Various methods of computing Fibonacci numbers in PHP | |
*/ | |
class Fibonacci | |
{ | |
/** | |
* @var array Memoization cache | |
* @see Fibonacci::memoized |
Either copy the aliases from the .gitconfig
or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4
- creates local branch pr/4
from the github upstream
(if it exists) or origin
remote and checks it outgit pr 4 someremote
- creates local branch pr/4
from someremote
remote and checks it outIt's easy to trip up on the meaning of this
in JavaScript. The behavior is very different from other languages, which means we have to throw most preconceptions and intuition out the window.
The best way to think of this
in JS is as a hidden function argument which is passed in a slightly awkward way. Instead of the normal passing of arguments:
fn(arg1, arg2, arg3)
// ---- | |
// Sass (v3.3.4) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
// This code sucks. | |
.module-container { | |
background-color: red; |
<script type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = './index_files/web-fonts.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, false); |
Based on this page: | |
http://askubuntu.com/questions/72812/how-to-disable-nolisten | |
How to display an X11 application on remote Ubuntu system | |
display-host: ubuntu linux running X11 server | |
app-host: other linux with an X11 application | |
On the display-host: |