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
Espanol - Alice en pais de Maravillas | |
--- | |
Alice estaba sentada en la orilla de un río con su hermana. | |
Alicia tenía sueño y estaba aburrida. | |
Su hermana estaba leyendo un libro sin dibujos. | |
Alicia pensó que todos los libros deberían tener dibujos. |
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 numpy as np, os, cv2 | |
from keras.utils import to_categorical | |
from keras.models import load_model | |
#reads images from folder (images must be labeled 0.png, 1.png, etc...) | |
def read_from_folder(folder, pattern, image_number, stop): | |
images = [] | |
while image_number < stop: | |
path = folder + pattern + '/casc (' + str(image_number)+ ').png' | |
import os; img_path = path; assert os.path.exists(img_path), img_path |
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 numpy as np, os, cv2 | |
from keras.utils import to_categorical | |
from keras.models import load_model | |
#reads images from folder (images must be labeled 0.png, 1.png, etc...) | |
def read_from_folder(folder, pattern, image_number, stop): | |
images = [] | |
while image_number < stop: | |
path = folder + pattern + '/casc (' + str(image_number-119)+ ').png' | |
img = cv2.imread(path, 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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/env python3 | |
import sys | |
import shelve | |
clusters = [] | |
separated = set() | |
i2cluster = {} # item to cluster mapping | |
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
def bitfunc(x): | |
return x**4 - 5 * x**2 + 4 | |
def bitfunc_rect(x1, x2): | |
# print("bitfunc_rect ", x1, x2) | |
return (x2-x1) * bitfunc(x1) | |
def bitfunc_recur(steps, x1, x2): | |
if steps: | |
step = (x2-x1) / steps |
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
(define (bitfunc-recur steps x1 x2) | |
(define (step) (/ (- x2 x1) steps)) | |
(if (> steps 0) | |
(+ (bitfunc-rect x1 (+ x1 (step))) (bitfunc-recur (- steps 1) (+ (step) x1) x2)) | |
0)) | |
(define (d x) (exact->inexact x)) | |
(define (bitfunc-iter steps x1 x2) |
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
def binp(x): | |
print("{:3} {:08b}".format(x, x)) | |
def bitwise_and(a, b): | |
result = 0 | |
mask = 1 | |
while a and b: | |
if (a % 2) == (b % 2) == 1: | |
result += mask | |
mask <<= 1 |
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
# allowed operators: | |
# - recursion | |
# - shift | |
# - add | |
# - mul | |
# - div | |
# - mod | |
def bitwise_and_1(a, b): | |
result = 0 | |
index = 0 |