This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Arrow | |
import Data.List | |
import Data.Function | |
main = interact (show.(mergeSort (<=)).head.lines) | |
merge :: (a -> a -> Bool) -> [a] -> [a] -> [a] | |
merge _ xs [] = xs | |
merge _ [] ys = ys | |
merge p (x:xs) (y:ys) = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LIMIT=$1 | |
TIP=$2 | |
BS=$(( 64 * 1024 )) | |
COUNT=$(( ( $LIMIT ) / $BS )) | |
packsize() { | |
COMMITS=$1 | |
ENDPOINT=$TOP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[url "https://github.com/"] | |
insteadof = git@github.com: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
test "2" = `grep -e '^--HG--$' -e '^branch : [^ ][^ ]*$' "$1"|wc -l` || { | |
echo >&2 Missing hg branch specification. | |
exit 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara/mechanize' | |
require 'sinatra/base' | |
Capybara.run_server = false | |
Capybara.current_driver = :mechanize | |
class TestApp < Sinatra::Base; get '/' do; end end | |
Capybara.app = TestApp | |
Capybara.app_host = "http://127.0.0.1/" | |
class Spider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* See https://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp | |
for original plain C/C++ implementation */ | |
/* build with -msse4.2 */ | |
#include <smmintrin.h> | |
#include <emmintrin.h> | |
FORCE_INLINE fmix32_m128i ( __m128i h ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import xml.sax | |
from igraph import Graph | |
from collections import defaultdict | |
class XWN( xml.sax.ContentHandler ): | |
def __init__(self): | |
self.graph = Graph(directed = True) | |
self.synSets = [] | |
self.currentTag = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
readlinkf(){ perl -MCwd -e 'print Cwd::abs_path shift' "$1";} | |
DAALA_ROOT="$(readlinkf ${DAALA_ROOT:-.})" | |
INPUT_IMAGE="$(readlinkf $1)" | |
OUTPUT_VIDEO="$(readlinkf ${2:-$(basename "$INPUT_IMAGE").webm})" | |
cq="0 1 2 3 4 5 7 9 11 13 16 19 22 25 28 33 38 44 50 57 64 73 82 92 104 117 132 148 166 187 209 235 263 295 330 369 413 462" | |
P=${P:-4} | |
( | |
cd /tmp | |
FIFOS="`echo -n $cq|sed 's/[0-9][0-9]*/&.y4m/g'`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# REQUIRES imagemagick compiled with HDRI feature enabled | |
SIZE=$(head -n1 "$1" | sed -E 's/.*W([0-9]*) H([0-9]*).*/\1x\2/') | |
FMT="-size $SIZE -depth 8 -sampling-factor 4:2:0 -interlace plane -set colorspace Rec709YCbCr" | |
convert $FMT YUV:<(tail -n+3<"$1") YUV:<(tail -n+3<"$2") \ | |
-colorspace Lab -compose difference \ | |
-composite -evaluate Pow 2 -separate -evaluate-sequence Add \ | |
-filter box -resize 1x1\! -format "%[fx:-10*log(u)]\n" info: |
OlderNewer