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
#![feature(test)] | |
/// Binary search in log N time. Slightly outperforms native rust binary search | |
fn binary_search<T: Ord + std::fmt::Debug>(v: &[T], i: T) -> Result<usize, usize> { | |
let mut first = 0; | |
let mut last = v.len(); | |
while first < last { | |
let pivot = (first+last)/2; | |
if i == v[pivot] { |
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
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
(define (make-order symbol side price amount) | |
(cons 'pending (list symbol side price amount))) | |
(define new-conditional-order (lambda (func order) | |
(if func | |
`(placed ,order)))) | |
(define get-price 2700) | |
(define get-balances |
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 json | |
import requests | |
import time | |
algorithm_id_to_str = [ | |
"Scrypt", | |
"SHA256", | |
"ScryptNf", | |
"X11", | |
"X13", |
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
Top Movies (in no particular order) | |
1. Lawrence of Arabia (1962) | |
2. Children of Men (2006) | |
3. Seven Samurai (1954) | |
4. Lord of The Rings Trilogy (2001-2003) | |
5. One Flew Over the Cuckoo's Nest (1975) | |
6. True Grit (2010) | |
7. The Good, the Bad, and the Ugly (1966) | |
8. Eternal Sunshine of the Spotless Mind (2004) | |
9. Groundhog Day (1993) |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
/** | |
* Stack layout as proposed in http://www.cs.indiana.edu/~dyb/pubs/stack.pdf | |
* [rbp + ...] = pointer to base of stack segment? | |
* [rbp + ...] = pointer to next stack record? |
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
(define (deep-map func list) | |
"Recursively map function onto sublists" | |
(map | |
(lambda (x) | |
(if (pair? x) | |
(deep-map func x) | |
(func x))) list)) | |
(define (free-variable-list func) | |
(let ((body (caddr func)) (args (cadr func))) |
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
;;; Learning how to use Streaming SIMD Extensions 4.2 | |
[bits 64] | |
section .text | |
;=============================== | |
; IMM8 Control Byte Operation | |
; |
NewerOlder