Skip to content

Instantly share code, notes, and snippets.

@foursking1
foursking1 / OrnsteinUhlenbeck.py
Created August 31, 2020 02:32 — forked from StuartGordonReid/OrnsteinUhlenbeck.py
Ornstein Uhlenbeck Stochastic Process
import math
import numpy
import random
import decimal
import scipy.linalg
import numpy.random as nrand
import matplotlib.pyplot as plt
"""
Note that this Gist uses the Model Parameters class found here - https://gist.github.com/StuartGordonReid/f01f479c783dd40cc21e
package com.netease.mail
import org.apache.spark.sql.SparkSession
import org.apache.spark.ml.feature.CountVectorizer
import org.apache.spark.ml.feature.StringIndexer
import org.apache.spark.mllib.classification.LogisticRegressionWithLBFGS
import org.apache.spark.mllib.classification.LogisticRegressionModel
import org.apache.spark.sql.Row
import org.apache.spark.ml.Pipeline
import org.apache.spark.mllib.regression.LabeledPoint
# -*- coding: utf-8 -*-
import numpy as np
import os
import glob
import cv2
import math
import pickle
import datetime
#-*- coding: utf-8 -*-
import logging
from Queue import Queue
import threading
import urllib2
import time
import random
from bs4 import BeautifulSoup
logging.basicConfig(level=logging.INFO)
@foursking1
foursking1 / bst.py
Last active August 29, 2015 14:16 — forked from ushadow/bst.py
#!/usr/bin/env python
class BSTNode(object):
"""A node in the vanilla BST tree."""
def __init__(self, parent, k):
"""Creates a node.
Args:
parent: The node's parent.
from math import log, floor, pow
class MinMaxHeap(object):
"""an implementation of min-max heap using an array,
which starts at 1 (ignores 0th element)
"""
def __init__(self, array=[]):
super(MinMaxHeap, self).__init__()
false_table = dict()
true_table = dict()
def possible_next_moves(m, n):
for i in range(m):
yield(i, n)
for i in range(n):
if m < i:
yield(m, i)
def fab(max):
n, a, b = 0, 0, 1
while n < max:
print b
a, b = b, a + b
n += 1
def fab2(max):
n, a, b = 0, 0, 1
L = []
@foursking1
foursking1 / HEY-YOU.md
Last active August 29, 2015 14:08 — forked from cowboy/HEY-YOU.md