git cat-file commit master | awk '/^parent.*/{print $0}; //{print $0}' | git hash-object --stdin -w -t commit | xargs git checkout -B master
Here it is:
$> git show --stat
commit 52eb56f6d5816f9e43015878e60a41cbbfb3e702
#!/usr/bin/perl | |
$_=' | |
$q ="\ 47"; wh | |
ile ($ ;= | |
$z += .5 ){ | |
%c= $r=0;$/ ="";whi le(2 | |
0+ $z>($;+=.05)){$c{int$ _+ 2 | |
6+ 2*($ r+= .0 2) * | |
s in$ ;}{1 -$_ | |
+1 0+ int $r*c o s |
PS > "m" -contains "m" | |
True | |
PS > "a b m" -contains "m" | |
False |
#!/bin/bash | |
# wow so bash such fast very O(n^2*log(n)^2) | |
for author in `git log --format='%ae' | sort -u`; do | |
changes=`git log --author=$author --pretty=tformat: --numstat | awk '{ add += $1 ; subs += $2 } END { printf "%s ++ / %s --\n",add,subs }'` | |
commits=`git log --author=$author --oneline | wc -l` | |
echo "$author: $commits commits / $changes" | |
done | sort -rn -k2 |
open System | |
open System.Net | |
type Stock(symbol : string) = class | |
let url = | |
"http://download.finance.yahoo.com/d/quotes.csv?s=" + symbol + "&f=sl1d1t1c1ohgv&e=.csv" | |
let mutable _symbol = String.Empty | |
let mutable _current = 0.0 | |
let mutable _open = 0.0 |
What is going on here is creating 2 streams with numbers from 1 to 100000 sorting randomly and finding with grep all lines that each of them contains. All of them, actually. -c flag is a shortcut for `| wc -l`, nothng more. | |
$> n=100000; time grep -f <(seq 1 $n | sort -R) <(seq 1 $n | sort -R) -c | |
100000 | |
grep -f <(seq 1 $n | sort -R) <(seq 1 $n | sort -R) -c 148.65s user 0.28s system 98% cpu 2:31.89 total | |
$> n=100000; time grep -xF -f <(seq 1 $n | sort -R) <(seq 1 $n | sort -R) -c | |
100000 | |
grep -xF -f <(seq 1 $n | sort -R) <(seq 1 $n | sort -R) -c 0.34s user 0.01s system 26% cpu 1.315 total |
import Control.Monad (($), forM, undefined) | |
main = forM [] $ undefined |
Lemma mult_0_r : forall n:nat, | |
n * 0 = 0. | |
Proof. | |
intros n. induction n as [| n']. | |
(* Case "n = 0". *) | |
simpl. | |
reflexivity. | |
(* Case "n = S n'". *) | |
simpl. | |
rewrite -> IHn'. |
α(L,P,R) :- β(L,P,R,0). | |
β([H|T],P,R,A) :- pow(H,P,X), β(T,P,R,A + X). | |
β([H],P,R,A) :- pow(H,P,X), R is A + X. | |
γ(X, Y, P) :- α(X, P, A), α(Y, P, B), A == B, !. | |
main(A) :- findall(X, (between(0,100,X), γ([0,3,5,6,9,10,12,15], [1,2,4,7,8,11,13,14], X)), A). |
// es = map exists tasks | |
List<Boolean> es = Lists.transform(tasks, new Function<File, Boolean>() { | |
@Override | |
public Boolean apply(File file) { | |
return file.exists(); | |
} | |
}); | |