Skip to content

Instantly share code, notes, and snippets.

1 Computer System Overview

1.1 Basic Elements

  • processor: controls operation of computer, data processing functions
  • main memory: stores data and programs, typically volatile
  • I/O modules: move data between computer and external environment, e.g. disks, internet, terminals
  • system bus: communciation between three systems above

1.2 Evolution of the Microprocessor

@czinn
czinn / combine.py
Created April 3, 2017 20:15
Combiner for /r/place frames.
# Requires PyPNG (https://pypi.python.org/pypi/pypng)
import png
from collections import defaultdict
import sys
import glob
# Colour palettes are in different orders on images. Convert to standard palette.
STANDARD_PALETTE = [(0, 0, 234), (0, 131, 199), (0, 211, 221), (2, 190, 1), (34, 34, 34), (130, 0, 128), (136, 136, 136), (148, 224, 68), (160, 106, 66), (207, 110, 228), (228, 228, 228), (229, 0, 0), (229, 149, 0), (229, 217, 0), (255, 167, 209), (255, 255, 255)]
PALETTE_MAP = {x: i for i, x in enumerate(STANDARD_PALETTE)}
@czinn
czinn / fix_defs.js
Last active October 9, 2016 05:29
Script for fixing irregular lujvo place labels in definitions
var definitions = require('./definitions.js');
function fixDefinition(def) {
if (/;/.test(def)) {
// split at ; and recombine
return def.split(';').map(fixDefinition).join(';');
}
// remove all $ signs
def = def.replace(/\$/g, '');
# You can find a pretrained binary vector files or train your own using tools found at
# https://code.google.com/p/word2vec/
# Sometimes it takes a while to find a path, but #fuckitshipit
# You can speed it up by decreasing the number of words loaded
# If you don't like your scale, try reversing the two words
MAX_WORDS_TO_LOAD = 50000
import sys, struct, heapq
from queue import PriorityQueue
@czinn
czinn / FizzBuzzBF
Created February 8, 2015 03:47
Plays Fizz Buzz ad infinum (restricted by tape size but not bin size). Works with http://www.iamcal.com/misc/bf_debug/ in the debugger. Does not terminate.
++++++++++[->+++++>+>>+>>>>>>+++++++>++++++++++>++++++++++++>++++++++++++>+++++++<<<<<<<<<<<<<<]>-->>+>>>+++>>>+++++>>+++++>++>--->----<<<<<<<<<<<[<<<+[->+>-[-<<+<+>>>]<<<[->>>+<<<]+>[<->[-]]<[->>---------->++++++++++<<<<[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[-<++++++[-<<++++++++>++>]<-->>]<<<<+<]>]>[>>>>]+>-[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[-<<<[-]>>>>>.>.>..<<<<<<+++>>]>-[-<+<+>>]<[->+<]+<[>-<[-]]>[-<<<[-]>>>>>>>>>.<.<..<<<+++++<]<<<[-<<<<[<<<<]>>>>[.>>>>]]<.<]456
@czinn
czinn / keybase.md
Last active March 15, 2019 22:13
Proof of identity for keybase.io

Keybase proof

I hereby claim:

  • I am czinn on github.
  • I am charlesz (https://keybase.io/charlesz) on keybase.
  • I have a public key ASACyIXAGkx7uTOvhdlNUR_ghRHnp-SgEE8XsVrDzbhP_Qo

To claim this, I am signing this object: