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
"use strict"; | |
{ | |
// http://mrl.nyu.edu/~perlin/noise/ | |
class Noise { | |
constructor(octaves = 1) { | |
this.p = new Uint8Array(512); | |
this.octaves = octaves; | |
this.init(); | |
} | |
init() { |
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
filename = "map.txt" | |
def create_map(): | |
A = [] | |
m = 0 | |
n = 0 | |
f = open(filename) | |
cur = 0 | |
for i in f.readlines(): | |
if cur == 0: |
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
class BigMap { | |
constructor() { | |
this._store = [new Map()]; | |
this._currentIndex = 0; | |
this._maxInternalMapSize = 13000000; // lesser than 16.4M | |
this.size = 0; | |
} | |
set(key, value) { |
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
curl 'http://127.0.0.1:8000/api/activities/1/photos' -H 'Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36' -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundary3SMDOkFgspafqSPk' -H 'Accept: */*' -H 'Cache-Control: no-cache' -H 'Cookie: csrftoken=rYWGb4twOPnbxhjPZwic6nmANMdr51oF' -H 'Connection: keep-alive' -H 'DNT: 1' --data-binary $'------WebKitFormBoundary3SMDOkFgspafqSPk\r\nContent-Disposition: form-data; name="file1"; filename="spark.png.bz2"\r\nContent-Type: application/x-bzip\r\n\r\n\r\n------WebKitFormBoundary3SMDOkFgspafqSPk--\r\n' --compressed |
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 MySQLdb | |
import json | |
HOST = "localhost" | |
USERNAME = "root" | |
PASSWORD = "" | |
DATABASE = "optimus" | |
def get_cursor(): |
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
string s, p; | |
bool f(int i, int j){ | |
if(i == s.length()){ | |
} | |
else{ | |
if(p[j+1] !='*' && p[j+1] !='+'){ | |
if(p[j] == s[i] || p[j] == '?') | |
return true; | |
else |
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
dataloader: | |
class: SQLLoadFromHDFS | |
dependencies: [] | |
settings: | |
verify_load_count: 1% | |
configuration: | |
db: | |
adapter: '' | |
dsn: '' | |
source_path: /user/optimus_app/dataloader/aahuja/20150330014818test4.csv |
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
context: | |
local_dir: /var/groupon/optimus/sandbox/user/bobba/1/${loadkey} | |
hdfs_dir: hdfs://cerebro-namenode.snc1:8020/user/optimus_app/sandbox/user/bobba/1/${loadkey} | |
__start__: | |
class: ScriptTask | |
dependencies: [] | |
configuration: | |
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
import os | |
from scipy.misc import imread | |
frames = {} | |
for filename in os.listdir('.'): | |
if filename.endswith('.jpg'): | |
img = imread(filename).astype(int) | |
left = img[99][75] | |
right = img[99][225] | |
frames[filename] = [0, 0] |
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 os | |
from scipy.misc import imread | |
frames = {} | |
for filename in os.listdir('.'): | |
if filename.endswith('.jpg'): | |
img = imread(filename).astype(int) | |
left = img[99][75] | |
right = img[99][225] | |
frames[filename] = [0, 0] |
NewerOlder