Skip to content

Instantly share code, notes, and snippets.

View mango314's full-sized avatar
💭
https://retrocomputing.stackexchange.com/questions/tagged/6502

JM mango314

💭
https://retrocomputing.stackexchange.com/questions/tagged/6502
View GitHub Profile
@mango314
mango314 / A.md
Last active April 18, 2022 00:39
convex hulls + municipalities of Puerto Rico

Convex Municipalities of Puerto Rico

Today we will learn about convex hulls using GeoPandas.

The result is less dramatic when we apply to the map of PR. El resultado.

@mango314
mango314 / cien.py
Created January 26, 2014 03:53
2014 distinct words in Chapter 1 of "Cien Años de Soledad" by Gabriel García Márquez
# -*- coding: utf-8 -*-
import scraperwiki, urllib2, re, urllib
from bs4 import BeautifulSoup
def download():
file("CAdS",'w').write(urllib.urlopen("www.uaca.ac.cr/bv/ebooks/novela/3.pdf").read())
def scrape():
u=file("CAdS.pdf")
x=scraperwiki.pdftoxml(u.read())
@mango314
mango314 / gcd.clj
Last active August 29, 2015 13:55
Review of Clojure Meetup at PR Science Trust
; greatest common divisor
(defn gcd [a b]
(if (= b 0)
a
(gcd b (rem a b))))
; > (gcd 15 25)
; > 5
@mango314
mango314 / game.clj
Last active August 29, 2015 13:55
scratchpad for combinatorial game theory
(def zero {:L nil :R nil } )
(def one {:L zero :R nil })
(def half {:L zero :R one })
(defn neg [x] (if (= x nil) nil { :L (neg (:R x) ) :R (neg (:L x)) }) )
@mango314
mango314 / colors.py
Created May 14, 2014 00:51
grab K=10 colors off image
from skimage import io
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['figure.figsize'] = 6,6
im = io.imread("filename.jpg")
#crop
piece = im[1250:2250, 1250:2250,:]
@mango314
mango314 / readme.md
Last active August 29, 2015 14:02
how to do screencasts on ubuntu

Voronoi Tesselation

Move your mouse around

Voronoi Tesselation

Move your mouse around

@mango314
mango314 / main.elm
Created July 25, 2014 00:23
error message with tab
main : Element
main = flow down
[ leftAligned (toText "A")
, leftAligned (toText "B")
, leftAligned (toText "C")
]
@mango314
mango314 / hilbert.elm
Last active October 30, 2015 07:55
hilbert space filling curve
main : Element
main = collage 400 400
(map (move (50, 0) )(
(motif x red ) ++ (motif (t x) blue ) ++ (motif (t (t x)) green ) ++
(motif (t (t (t x))) orange ) ))
-- build motif from path and color
motif : [(number, number)] -> Color -> [Form]
motif z color = [ traced (solid color) (path z) , move ( last z) (filled color (circle 3.0))]