Skip to content

Instantly share code, notes, and snippets.

Kevin Kwok antimatter15

Block or report user

Report or block antimatter15

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Add
import java.util.Scanner;
public class Add implements Comparable<Add>{
private String name;
private String lastName;
private int number;
public Add(String name, String lastName, int number) {
this.name = name;
View keybase.md

Keybase proof

I hereby claim:

  • I am antimatter15 on github.
  • I am kkwok (https://keybase.io/kkwok) on keybase.
  • I have a public key whose fingerprint is 1E98 6A49 07AC 5035 F965 9291 E1AC 1506 8D60 9685

To claim this, I am signing this object:

View keras-char-lstm.py
# 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 Feb 11, 2020
Read Pixel Under Cursor Mac
View main.m
#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 Nov 30, 2016
Szudzik's Elegant Pairing Function
View pairing.js
// 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 Sep 9, 2016
Mandelbrot Set for Antimony
View Antimony Mandelbrot.md

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 Sep 9, 2016
Translate Mathematica expressions into Antimony's Prefix Notation
View antimony-prefix.m
(* 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) *)
View react-d3-graph.js
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;
You can’t perform that action at this time.