Skip to content

Instantly share code, notes, and snippets.

View Qyoom's full-sized avatar

Richard Walker Qyoom

  • San Francisco Bay Area
View GitHub Profile
@Qyoom
Qyoom / .block
Created May 5, 2020 17:44 — forked from akngs/.block
D3 implementation of an agent-based predator-prey model.
license: gpl-3.0
@Qyoom
Qyoom / min-char-rnn.py
Created July 2, 2018 23:39 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@Qyoom
Qyoom / index.html
Created April 2, 2017 01:16
SVG ANIMATION 4
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="600px"
height="300px" viewBox="0 0 600 300" enable-background="new 0 0 600 300" xml:space="preserve">
<defs>
<mask id="texture">
<image height="400" width="600" xlink:href="http://img03.deviantart.net/7874/i/2008/122/4/5/crack_texture_by_struckdumb.jpg">
</mask>
</defs>
<g id="S">
@Qyoom
Qyoom / index.html
Created March 26, 2017 04:19
SVG drawing 4
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="600px"
height="200px" viewBox="0 0 600 200" enable-background="new 0 0 600 200" xml:space="preserve">
<defs>
<mask id="texture">
<image height="400" width="600" xlink:href="http://img03.deviantart.net/7874/i/2008/122/4/5/crack_texture_by_struckdumb.jpg">
</mask>
</defs>
<g id="S">
@Qyoom
Qyoom / index.html
Created March 26, 2017 01:01
SVG drawing 2
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="600px"
height="200px" viewBox="0 0 600 200" enable-background="new 0 0 600 200" xml:space="preserve">
<g id="S">
<g class="shapes">
<rect id="square_1_" x="15.085" y="9.272" width="180.861" height="180.861"/>
<line x1="15.085" y1="9.272" x2="195.947" y2="190.133"/>
<line x1="15.085" y1="190.133" x2="195.947" y2="9.272"/>
<circle cx="101.917" cy="157.479" r="30.084"/>
<circle cx="111.167" cy="40.229" r="27"/>
@Qyoom
Qyoom / vector.py
Created May 5, 2016 23:33 — forked from mcleonard/vector.py
A vector class in pure python.
"""
The MIT License (MIT)
Copyright (c) 2015 Mat Leonard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
public class MinimumEditDistance {
public interface CostFunction {
public int cost(int[][] distanceMatrix, CharSequence x, CharSequence y, int i, int j);
}
@Qyoom
Qyoom / Spark Vector lab
Last active August 29, 2015 14:01
Scala worksheet for experimenting with Spark Vector class
import org.apache.spark.util.Vector
import org.apache.spark._
object Vector_lab_1 {
println("Vector_lab_1")
val vec1 = Vector(Array(1.5, 2.5, 3.5))
val vec2 = Vector(Array(1.0, 2.0, 3.0))
val vec3 = Vector(Array(5.1, 6.1, 7.1, 8.1))
val vec4 = Vector(Array(1.0, 1.0, 1.0))
@Qyoom
Qyoom / DerivativesLab
Last active August 29, 2015 14:01
Calculates slope based on delta of x and slope function as x2 goes toward x1 and delta goes toward 0
object DerivativesLab {
import math._
def main(args: Array[String]): Unit = {
// Two different functions to derive derviatives for
def f1 = (x: Double) => pow(x,2)
def f2 = (x: Double) => pow(x,2) * 1.5
// series of test inputs, x1 and x2