\usepackage{tkz-euclide} % checked for version 3.02c
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 math | |
import os | |
import sys | |
import numpy as np | |
from PIL import Image | |
########################################################################################### | |
# script to generate moving mnist video dataset (frame by frame) as described in |
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 numpy as np | |
def find_closest_orthogonal_matrix(A): | |
''' | |
Find closest orthogonal matrix to *A* using iterative method. | |
Bases on the code from REMOVE_SOURCE_LEAKAGE function from OSL Matlab package. | |
Args: | |
A (numpy.array): array shaped k, n, where k is number of channels, n - data points |
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
(ns xml.test | |
(:require [clojure.java.io :as io] | |
[clojure.data.xml :as xml])) | |
;; wget | |
;; download.geofabrik.de/openstreetmap/north-america/us/maryland.osm.bz2 | |
(def xml-seq | |
#(-> (io/file "/home/gary/dev/maryland.osm") | |
io/input-stream |
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
- certain endpoints are always blocked | |
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then | |
ngx.exit(403) | |
end | |
-- import requirements | |
local cjson = require "cjson" | |
-- setup some app-level vars | |
local app_id = "APP_ID" |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
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
(fn [] (let [s "(fn [] (let [s %s] (format s (pr-str s))))"] (format s (pr-str s)))) |
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
# Run me with: | |
# | |
# $ nginx -p /path/to/this/file/ -c nginx.conf | |
# | |
# All requests are then routed to authenticated user's index, so | |
# | |
# GET http://user:password@localhost:8080/_search?q=* | |
# | |
# is rewritten to: | |
# |
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
var fs = require('fs'); | |
/** | |
* Offers functionality similar to mkdir -p | |
* | |
* Asynchronous operation. No arguments other than a possible exception | |
* are given to the completion callback. | |
*/ | |
function mkdir_p(path, mode, callback, position) { | |
mode = mode || 0777; |