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
| const exec = require('child_process').execSync | |
| const isWindows = require('is-windows') | |
| let Encoding | |
| if (isWindows()) { | |
| Encoding = require('encoding-japanese') | |
| } | |
| function hiraToKana(str) { | |
| return str.replace(/[\u3041-\u3096]/g, function(match) { | |
| var chr = match.charCodeAt(0) + 0x60; |
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 face_recognition | |
| import cv2 | |
| from multiprocessing import Process, Manager, cpu_count | |
| import time | |
| import numpy | |
| # This is a little bit complicated (but fast) example of running face recognition on live video from your webcam. | |
| # This example is using multiprocess. |
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
| # coding:utf-8 | |
| import argparse | |
| import base64 | |
| import json | |
| from googleapiclient import discovery | |
| import httplib2 | |
| import Tkinter as tk | |
| import tkFileDialog |
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
| setTimeout(function() { | |
| var encoded = 'eycptqkGmkx|ys=s'; | |
| var decoded = Array.prototype.map.call(encoded, function(c, i) { | |
| return String.fromCharCode(c.charCodeAt(0) - i); | |
| }).join(''); | |
| $('#contact').html($('<a></a>') | |
| .attr('href', 'mailto:' + decoded) | |
| .text(decoded)); | |
| }, 3000) |
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
| package poc | |
| import org.scalajs.dom | |
| import scala.scalajs.js | |
| import scala.scalajs.js.annotation.JSExport | |
| @js.native | |
| object WorkerGlobal extends js.GlobalScope { | |
| def addEventListener(`type`: String, f: js.Function): Unit = js.native |
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() { | |
| function ios_ver (){ | |
| var ios_ua = navigator.userAgent; | |
| if( ios_ua.indexOf("iPhone") > 0 ) { | |
| ios_ua.match(/iPhone OS (\w+)/g); | |
| var version = RegExp.$1.split("_")[0]; | |
| return version; | |
| } | |
| } | |
| if (ios_ver() === '10') { |
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
| var reader = new Reader(10); | |
| var input = {}; | |
| reader.read(function(line) { | |
| var vars = line.split(' ') | |
| input.m = parseInt(vars[0]); | |
| input.n = parseInt(vars[1]); | |
| }).then(reader.read(function(line) { | |
| input.o = line; | |
| })).then(function() { | |
| input.xs = []; |
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
| WIN_USER=john | |
| LINUX_ROOT="C:\\Users\\$WIN_USER\\AppData\\Local\\lxss\\" | |
| alias wcmd=to_win_path | |
| to_win_path() { | |
| join_by() { local IFS="$1"; shift; echo "$*"; } | |
| local IFS narg arg dirnames | |
| narg=() |
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 scala.util.parsing.combinator._ | |
| import scala.language.postfixOps | |
| object Main { | |
| def main(args:Array[String]) = { | |
| val sc = new java.util.Scanner(System.in) | |
| val input = collection.mutable.ListBuffer[String]() | |
| while(sc.hasNextLine) { | |
| input += sc.nextLine |
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
| object Main { | |
| def main(args:Array[String]) = { | |
| val sc = new java.util.Scanner(System.in) | |
| val n, a = sc.nextInt | |
| val x = List.fill(n)(sc.nextInt) | |
| val nx = (a :: x).max * n | |
| val dpMemo = collection.mutable.ArrayBuffer.fill(n + 1, n + 1, nx + 1)(-1L) | |
| def dp(j: Int, k: Int, s: Int): Long = { |
NewerOlder