Reference: http://www.rdkit.org/docs/Install.html#building-from-source
$ sudo apt-get install build-essential cmake libboost-all-dev
# NOTE: don't use a temporary dir, since we'll reference `$RDBASE` afterwards.
.PHONY: run | |
export JULIA_PROJECT = $(PWD) | |
JULIA = julia | |
JULIAC_PATH = $(shell $(JULIA) --startup-file=no -E 'normpath(Base.find_package("PackageCompiler"), "..", "..", "juliac.jl")') | |
RUN_JULIAC = $(JULIA) $(JULIAC_PATH) | |
run: builddir/test.so | |
python test.py |
Reference: http://www.rdkit.org/docs/Install.html#building-from-source
$ sudo apt-get install build-essential cmake libboost-all-dev
# NOTE: don't use a temporary dir, since we'll reference `$RDBASE` afterwards.
jq will sort (-S
) the whole file (.
) and compare STDOUT (<()
) with diff
diff <(jq -S . A.json) <(jq -S . B.json)
# Updated to work with TF 1.4 | |
# Working example for my blog post at: | |
# http://danijar.com/variable-sequence-lengths-in-tensorflow/ | |
import functools | |
import sets | |
import tensorflow as tf | |
from tensorflow import nn | |
def lazy_property(function): |
import numpy as np | |
r = np.arange(1.0, 11.0, 0.1) | |
n = len(r)**3 | |
pts = np.empty((n, 3)) | |
i = 0 | |
for x in r: | |
for y in r: | |
for z in r: |
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) |
import tensorflow as tf | |
import numpy as np | |
import os | |
import zconfig | |
import utils | |
class RBM(object): |
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% 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) |
''' | |
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''' |