Skip to content

Instantly share code, notes, and snippets.

# Larger LSTM Network to Generate Text for Alice in Wonderland
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/include/
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM, Activation
from keras.callbacks import ModelCheckpoint, LambdaCallback, TensorBoard
from keras.utils import np_utils
@antimatter15
antimatter15 / main.m
Last active December 29, 2024 18:55
Read Pixel Under Cursor Mac
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
// Grab the current mouse location.
CGPoint mouseLoc = CGEventGetLocation(CGEventCreate(NULL));
@antimatter15
antimatter15 / pairing.js
Created November 30, 2016 05:36
Szudzik's Elegant Pairing Function
// Szudzik's Elegant Pairing Function
// http://szudzik.com/ElegantPairing.pdf
function pair(x,y){
return y > x ? (y*y+x) : (x*x+x+y);
}
function unpair(z){
var q = Math.floor(Math.sqrt(z)),
l = z - Math.pow(q, 2);
@antimatter15
antimatter15 / Antimony Mandelbrot.md
Last active September 9, 2016 20:10
Mandelbrot Set for Antimony

Mandelbrot Set in Antimony

This is a little experiment in using CAD software with a functional representation for solids. I used Mathematica to construct a giant polynomial, and wrote a script which converts arbitrary Mathematica expressions into Antimony's prefix notation.

@antimatter15
antimatter15 / antimony-prefix.m
Last active September 9, 2016 19:57
Translate Mathematica expressions into Antimony's Prefix Notation
(* The f-rep syntax accepts four distinct types of atoms.X,Y,and Z \
are replaced by position in the world\[CloseCurlyQuote]s coordinate system at any \
given evaluation point. *)
Antimony[x] := "X"
Antimony[y] := "Y"
Antimony[z] := "Z"
(* Table A.1:Unary F-rep functions (pg. 93) *)
@antimatter15
antimatter15 / react-d3-graph.js
Created August 30, 2016 04:07
React D3 Graph
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import { forceSimulation, forceLink, forceCenter, forceManyBody } from 'd3-force';
class GraphNode extends React.Component {
render(){
var node = this.props.node;

Adding Probes

This Gist was automatically created b

Fizz Buzz

This Gist was aut

Word Count