Skip to content

Instantly share code, notes, and snippets.

View jonathanng's full-sized avatar

JPN jonathanng

View GitHub Profile
@jonathanng
jonathanng / clustering_illusion.py
Last active April 10, 2021 01:24
Clustering Illusion Test
# 'We see patterns where they don't exist and we invent causes to explain them.' - Amos Tversky
import numpy as np
def flip(prob_same, last=None):
if last is None:
p = [.5, .5]
elif last == 'H':
p = [prob_same, 1 - prob_same]
@jonathanng
jonathanng / gist:8265610
Created January 5, 2014 07:54
Ruby stopwords
def self.stopwords
# http://dev.mysql.com/doc/refman/5.5/en/fulltext-stopwords.html
unless defined? @stopwords
@stopwords = []
# http://dev.mysql.com/doc/refman/5.5/en/fulltext-stopwords.html
@stopwords += ["a's","able","about","above","according","accordingly","across","actually","after","afterwards","again","against","ain't","all","allow","allows","almost","alone","along","already","also","although","always","am","among","amongst","an","and","another","any","anybody","anyhow","anyone","anything","anyway","anyways","anywhere","apart","appear","appreciate","appropriate","are","aren't","around","as","aside","ask","asking","associated","at","available","away","awfully","be","became","because","become","becomes","becoming","been","before","beforehand","behind","being","believe","below","beside","besides","best","better","between","beyond","both","brief","but","by","c'mon","c's","came","can","can't","cannot","cant","cause","causes","certain","certainly","changes","clearly","co","com","come","comes","conc
@import compass
$icons: sprite-map("icons/*.png")
$icons-hd: sprite-map("icons-hd/*.png")
i
background: $icons
display: inline-block
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)
background: $icons-hd