Create an empty git repo or reinitialize an existing one
git init| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |
| #!/bin/sh | |
| # | |
| # a simple way to parse shell script arguments | |
| # | |
| # please edit and use to your hearts content | |
| # | |
| ENVIRONMENT="dev" |
| import re | |
| bvh_file = "Example1.bvh" | |
| def identifier(scanner, token): return "IDENT", token | |
| def operator(scanner, token): return "OPERATOR", token | |
| def digit(scanner, token): return "DIGIT", token | |
| def open_brace(scanner, token): return "OPEN_BRACE", token | |
| def close_brace(scanner, token): return "CLOSE_BRACE", token |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
Create an empty git repo or reinitialize an existing one
git init| ''' | |
| Example of Tornado that autoreloads/watches all files in folder 'static' | |
| ''' | |
| import tornado.ioloop | |
| import tornado.web | |
| import tornado.autoreload | |
| import os | |
| ''' serves index.html''' |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| % University Assignment Title Page | |
| % LaTeX Template | |
| % Version 1.0 (27/12/12) | |
| % | |
| % This template has been downloaded from: | |
| % http://www.LaTeXTemplates.com | |
| % | |
| % Original author: | |
| % WikiBooks (http://en.wikibooks.org/wiki/LaTeX/Title_Creation) |
This is a small demo of how to create a library in Rust and call it from Python (both CPython and PyPy) using the CFFI instead of ctypes.
Based on http://harkablog.com/calling-rust-from-c-and-python.html (dead) which used ctypes
CFFI is nice because:
ctypes| import tensorflow as tf | |
| import numpy as np | |
| import os | |
| import zconfig | |
| import utils | |
| class RBM(object): |
| from keras.layers import Input, Dense, Lambda | |
| from keras.models import Model | |
| def eucl_dist(inputs): | |
| x, y = inputs | |
| return ((x - y)**2).sum(axis=-1) | |
| x = Input((32,)) | |
| y1 = Dense(8)(x) | |
| y2 = Dense(8)(x) |