This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# https://gist.github.com/292018 - augmented to plot row/column labels | |
""" | |
Draws Hinton diagrams using matplotlib ( http://matplotlib.sf.net/ ). | |
Hinton diagrams are a handy way of visualizing weight matrices, using | |
colour to denote sign and area to denote magnitude. | |
By David Warde-Farley -- user AT cs dot toronto dot edu (user = dwf) | |
with thanks to Geoffrey Hinton for providing the MATLAB code off of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- encoding: utf-8 -*- | |
# Usage: double_utf8_fix.py < input > output | |
import sys, re | |
# functions to detect/fix double-encoded UTF-8 strings | |
# Based on http://blogs.perl.org/users/chansen/2010/10/coping-with-double-encoded-utf-8.html | |
DOUBLE_ENCODED = re.compile(""" | |
\xC3 (?: [\x82-\x9F] \xC2 [\x80-\xBF] # U+0080 - U+07FF | |
| \xA0 \xC2 [\xA0-\xBF] \xC2 [\x80-\xBF] # U+0800 - U+0FFF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ Usage | |
Windows: | |
lua factorio-recipe-parser.lua "C:/Apps/Factorio/data/base/prototypes/recipe/" | |
Steam on macOS: | |
lua factorio-recipe-parser.lua ~/"Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents/" | |
NB: json.lua is from https://gist.github.com/tylerneylon/59f4bcf316be525b30ab | |
]]-- |