Skip to content

Instantly share code, notes, and snippets.

View floer32's full-sized avatar

Michael Floering floer32

  • 00:33 (UTC -07:00)
View GitHub Profile
@floer32
floer32 / matrix_multiplication_refresher.md
Last active April 13, 2022 11:59
Matrix multiplication refresher: develop your intuition for matrix multiplication! (Or, "matrix multiplication for dummies")

A refresher on matrix multiplication. Because your math classes were years ago. Here's the order I recommend:

  1. TED-Ed video — How to organize, add and multiply matrices - Bill Shillito (only 5 minutes)
  2. betterexplained.com"An Intuitive Guide to Linear Algebra" by Kalid Azad
  3. mathinsight.org: "Matrices and linear transformations"
  4. Read some of the answers on math.stackexchange.com. You've been studying the general definition of matrix multiplication. You may wonder: "Are there other ways to define the product of two matrices?" These resources will answer, yes, there are other ways, but also explain why this general definition is the standard way.
  5. [What is the intuitive way of thinking about multiplication of m
@floer32
floer32 / livecoding-audio-and-visuals.md
Last active May 5, 2016 04:02
Some notes on Livecoding audio and visuals; centerpiece to a workshop at Dadaconf 0.1
title date description categories tags
Building Borderlands Granular on Ubuntu 12.04 LTS
2012-10-23
music
linux
music
linux
synth
granular

##What Borderlands is

@floer32
floer32 / steeef_hangtwenty.zsh_theme
Created October 28, 2016 16:15
steeef zsh theme customized to add return code
# prompt style and colors based on Steve Losh's Prose theme:
# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
#
# vcs_info modifications from Bart Trojanowski's zsh prompt:
# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
#
# git untracked files modification from Brian Carper:
# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
export VIRTUAL_ENV_DISABLE_PROMPT=1
@floer32
floer32 / ipython_embed_example.py
Last active September 7, 2018 21:40
memo - how to drop into an ipython shell at any time
# -*- coding: utf-8 -*-
if __name__ == "__main__":
# Code code code...
# Code code code...
# Code code code...
from IPython import embed; embed()
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>colorPalette</key>
<dict>
<key>ArchiveExpectationsBarBottomColor</key>
<dict>
<key>a</key>
<real>0.20000000000000001</real>
@floer32
floer32 / sonarqube and gradle and analysis mode.md
Last active March 22, 2018 16:52
little note regarding sonarqube and gradle

SonarQube not "uploading"? Be careful about sonar.analysis.mode=issues (or, if using Gradle, systemProp.sonar.analysis.mode=issues). This analysis mode seems required for some purposes (some plugins maybe?), but it was making Gradle not generate the report or upload it to SonarQube server. I haven't figured out the details yet but I wanted to leave this memo...

@floer32
floer32 / _fix_pip_import_error.md
Last active June 24, 2022 10:44
fix that pesky "ImportError: No module named packaging.version" problem. Or more generally, if you need to fix pip using pip, just make sure you do "python -m pip" instead of straight-up "pip".

It can come up while installing anything really. I'm not sure exactly which versions of pip are affected, I know I had 1.5.6 and it was affected.

These examples are grabbed from my system level Python, but of course you should use a virtualenv.

  Running setup.py install for simplegeneric
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Library/Python/2.7/site-packages/setuptools/__init__.py", line 12, in <module>
        import setuptools.version
@floer32
floer32 / SanitizedString.py
Last active September 6, 2017 17:53
(OLD; newer version is here: https://github.com/hangtwenty/presswork/blob/master/presswork/text/clean.py ) I wanted to "ensure" strings had been sanitized (avoid running redundantly). This is ONLY ONE type of sanitization, removing control chars (BESIDES NEWLINES), because that is what my current project needed. But I thought the design could be…
""" throw your strings to SanitizedString and "ensure" they have been sanitized, such as removing control characters.
SanitizedString will avoid running redundantly, by checking type of the input (good for Very Big Strings)
>>> hello = SanitizedString(chr(0) + "hello")
>>> assert hello == "hello"
>>> assert chr(0) not in hello
>>> assert SanitizedString(hello) == hello
at time of writing there is only one sanitization filter in use:
@floer32
floer32 / remove_punc.py
Last active September 21, 2019 21:12 — forked from kissgyorgy/remove_punc.py
Python: Remove punctuation from string (quickly)
#http://stackoverflow.com/questions/265960/best-way-to-strip-punctuation-from-a-string-in-python
import re, string
table = string.maketrans("","")
regex = re.compile('[%s]' % re.escape(string.punctuation))
def test_re(s): # From Vinko's solution, with fix.
return regex.sub('', s)
def test_trans(s):