Skip to content

Instantly share code, notes, and snippets.

@agness
agness / union_bitmaps.py
Created July 7, 2023 06:34
Combines an array of image files into a single bitmap with union (logical OR).
#!/usr/bin/env python3
# Combines an array of image files into one bitmap with union (logical OR).
# Requirements
# pip3 install opencv-python
import cv2
import numpy as np
@agness
agness / split_by_color.py
Last active July 7, 2023 06:44
Given an image file, splits into N bitmaps of identical dimensions, one each for each unique color in the input file.
#!/usr/bin/env python3
# Given an image file, splits into N bitmaps of identical dimensions, one each
# for each unique color in the input file.
# via https://stackoverflow.com/a/65392173
# Requirements
# pip3 install opencv-python
import cv2

Keybase proof

I hereby claim:

  • I am agness on github.
  • I am agness (https://keybase.io/agness) on keybase.
  • I have a public key ASCewPLnhYvMovdLQJbXJsy7sUTpfleHvSb5PBzv1eaeMAo

To claim this, I am signing this object:

Why Visualize?

  • The goals of visualization
    • Exploratory: to uncover a relationship in the data, to analyze data
    • Explanatory: to communicate a relationship in the data, to present data
  • Anscombe’s Quartet
    • Datasets that have identical summary statistics can appear very different when graphed.

Designing

  • Divergent vs. convergent idea generation
  • How to critique example: Tufte Challenger Criticisms
@agness
agness / dummy-web-server.py
Last active January 8, 2019 15:43 — forked from bradmontgomery/dummy-web-server.py
Py3 minimal http server. Responds to GET, HEAD, POST requests.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@agness
agness / install_ruby_with_rbenv.md
Last active September 23, 2020 00:54 — forked from stonehippo/install_ruby_with_rbenv.md
Installing a new Ruby with rbenv on Mac OS

Install a new Ruby with rbenv on Mac OS (and make yourself a superhero)

Modified from the original at stonehippo/install_ruby_with_rbenv.md

If you're doing stuff with Ruby on a Mac, e.g. installling Jekyll or something, by default you'll end up having to use the sudo command to do stuff, since the permission to modify the default config is not available to your user account.

This sucks and should be avoided. Here's how to fix that.

Installing a new Ruby

Why Visualize?

  • The goals of visualization
    • Exploratory: to uncover a relationship in the data, to analyze data
    • Explanatory: to communicate a relationship in the data, to present data
  • Anscombe’s Quartet
    • Datasets that have identical summary statistics can appear very different when graphed.

Designing

  • Divergent vs. convergent idea generation
  • Tufte Challenger Criticisms

W4995.004 Assignment 3: EDA Writeup Template

This is a suggested format; you may omit or add sections but are encouraged to follow this template.

1: Initial Hypotheses

1.1 Motivation

Describe how you came up with your hypotheses and your reasons for choosing them.

1.2 Hypotheses

State your hypotheses in sentence or question form (be clear and concise):

@agness
agness / stumbleupon_ml.py
Created January 20, 2014 23:31
StumbleUpon evergreen webpages ML challenge submission from http://www.laurenatphysics.com/2013/11/followup-to-stumbleupon-challenge.html
import csv
import numpy as np
import scipy as scipy
import re
from sklearn.feature_extraction.text import TfidfVectorizer
from nltk.stem import LancasterStemmer,SnowballStemmer
from nltk.stem.snowball import EnglishStemmer
from nltk import word_tokenize
from sklearn import preprocessing,metrics,cross_validation
from sklearn.cross_validation import StratifiedKFold
@agness
agness / css-scale3d-transition
Created December 5, 2013 01:54
css lightbox transition (3 yrs old now?)
.overlay {
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
-webkit-transform: scale3d(0.1,0.1,1);
-moz-transform: scale3d(0.1,0.1,1);
-o-transform: scale3d(0.1,0.1,1);
transform: scale3d(0.1,0.1,1);