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 scipy.stats | |
import json | |
import sys | |
df_vals = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 24, 30, 40, 60, 120, 1000] | |
def calc(alpha): | |
ans = [] | |
for df1 in df_vals: |
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
/* | |
* Copyright (c) 1999-2015 Pavel Rychly, Milos Jakubicek | |
* Copyright (c) 2016 Tomas Machalek | |
* | |
* This is a PEG version of an original CQL grammar distributed with manatee-open | |
* corpus search engine. | |
*/ | |
Query = | |
Sequence _ (BINAND GlobPart)? (NOT? (KW_WITHIN / KW_CONTAINING) _ WithinContainingPart)* SEMI |
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
function Nothing() {} | |
function Just(x) { | |
this.x = x; | |
} | |
function divide(a, b) { | |
if (typeof a !== 'number' || typeof b !== 'number' || b === 0) { | |
return new Nothing(); |
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
#include <string> | |
/* | |
How to install: | |
1) compile the module: | |
g++ -Wall -fPIC -DPIC -shared -o ucnkdynfn.so ucnkdynfn.cc |
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
def partition(data, left, right, pivot_idx): | |
pivot_value = data[pivot_idx] | |
real_pivot_idx = left | |
data[pivot_idx], data[right] = data[right], data[pivot_idx] | |
for i in range(left, right + 1): | |
if data[i] < pivot_value: | |
data[i], data[real_pivot_idx] = data[real_pivot_idx], data[i] | |
real_pivot_idx += 1 | |
data[right], data[real_pivot_idx] = data[real_pivot_idx], data[right] | |
return real_pivot_idx |
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 sys | |
import json | |
import hashlib | |
def process_item(item): | |
rec = item['_source'] | |
rec['isQuery'] = rec.pop('entryQuery') | |
if rec.get('action', None) in ('wsketch', 'thes', 'wsdiff'): | |
rec['isQuery'] = True |
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 os | |
import argparse | |
import random | |
import hashlib | |
from functools import partial | |
import shutil | |
class TreeWalker(object): |
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
""" | |
KonText vs. Manatee - multi-dimensional frequency distribution | |
words = manatee.StrVector() | |
freqs = manatee.NumVector() | |
norms = manatee.NumVector() | |
crit = 'opus.rokvyd 0 opus.genre 0' | |
corpus.freq_dist(range_stream, crit, limit, words, freqs, norms) | |
""" |
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
(function () { | |
'use strict'; | |
var foo, bar1, bar2; | |
function Foo () { | |
this.counter = { i : 0}; | |
this.counter2 = 0; | |
} |
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
dataChunks(4, function (idx) { | |
return orzo.fileChunkReader(env.inputArgs[0], idx, null, 1); | |
}); | |
applyItems(function (dataChunk, map) { | |
while (dataChunk.hasNext()) { | |
map(dataChunk.next()); | |
} | |
}); |
NewerOlder