This file contains hidden or 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
async function onPlay() { | |
// console.log("Play!") | |
const videoEl = $('#inputVideo').get(0) | |
let isLoaded = !!faceapi.nets.tinyFaceDetector.params | |
if(videoEl.paused || videoEl.ended || !isLoaded) { | |
console.log("Is not loaded yet!") | |
return setTimeout(() => onPlay()) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ru"> | |
<head> | |
<title>PifPaf</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<script src="faceapi.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> |
This file contains hidden or 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
combinations :: Int -> [(Int, Int)] | |
combinations n = do | |
a <- [1..6] | |
b <- [1..6] | |
if a + b == n then return (a,b) else [] | |
solve :: [(Int, Int)] | |
solve = do | |
n <- [2..12] | |
return (n, length $ combinations n) |
This file contains hidden or 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
' , | |
' | |
, , | |
' ' ;:'dXX: | |
0MMMMMMMc | |
dNMWMMMMMNNl , | |
WMWMMMMMMMWWc | |
oWMMMO:ckMMMO, | |
okkO: NMMM |
This file contains hidden or 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<Integer, BinaryClassifier> learnClassicier = (Integer i) -> { | |
List<Boolean> booleanLabels = new ArrayList<>(labels.size()); | |
for (int j = 0; j < labels.size(); j++) { | |
booleanLabels.add(labels.get(j) == i); | |
} | |
BinaryClassifier binaryClassifier = binaryClassifiers.get(i); | |
binaryClassifier.fit(train, booleanLabels); | |
return binaryClassifier; | |
} | |
MyThreadPool.map(learnClassicier, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) |
This file contains hidden or 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
from multiprocessing import Pool | |
def f(x): | |
return x ** 2 | |
data = [1, 2, 3, 4, 5] | |
with Pool(processes=4) as pool: | |
new_data = pool.map(f, data) |
This file contains hidden or 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
docker run -i -t -p 8888:8888 continuumio/anaconda /bin/bash -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir -p /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-browser --allow-root" |
This file contains hidden or 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 re | |
import sys | |
patt1 = re.compile('^(.*)(\.|_|-)1.(fastq|fq|fastq.gz|fq.gz)$') | |
patt2 = re.compile('^(.*)(\.|_|-)2.(fastq|fq|fastq.gz|fq.gz)$') | |
prev_line = next(sys.stdin) | |
try: | |
for line in sys.stdin: |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 8096 |
This file contains hidden or 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/ruby | |
require 'json' | |
require 'optparse' | |
options = {} | |
OptionParser.new do |opt| | |
opt.on('-s', '--size SIZE', "Set size of logs. By default 1500") { |o| options[:size] = o } | |
opt.on('-q', '--query QUERY', 'Set query to db. By default: { "match_all": {} }') { |o| options[:query] = o } | |
opt.on('-d', '--db DB', 'Set database to request. By default: universe-*') { |o| options[:db] = o} |
NewerOlder