Skip to content

Instantly share code, notes, and snippets.

View willshiao's full-sized avatar
😵‍💫

William Shiao willshiao

😵‍💫
View GitHub Profile
@willshiao
willshiao / corcondia.py
Created April 27, 2021 01:01
CORCONDIA Python Implementation
'''
Based on the Python implementation by Alessandro Bessi at https://github.com/alessandrobessi/corcondia
and the original MATLAB implementation by Evangelos (Vagelis) Papalexakis at https://www.cs.ucr.edu/~epapalex/src/efficient_corcondia.zip
Updated to work with modern versions of Python.
Uses Tensorly, and assumes that we use the numpy backend.
References:
Buis, Paul E., and Wayne R. Dyksen.
"Efficient vector and parallel manipulation of tensor products."
@willshiao
willshiao / machine.yml
Last active January 22, 2020 00:30
Turing Machine for L_bin
name: copy 1s
source code: |
# input: 'aaaaaaaaaaaaaaaaaaaaaaaaab11001'
input: 'aaaaaab10'
blank: ' '
start state: q_0
table:
q_0:
a: {R: s_b, write: x}
--filter=-whitespace/parens,-legal/copyright,-build/namespaces,-build/header_guard,-build/include_subdir,-runtime/references,-build/include
@willshiao
willshiao / aes.go
Last active January 19, 2024 16:18
AES 256-CFB in Node.js, Go, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
@willshiao
willshiao / .vimrc
Created October 29, 2015 06:07
My .vimrc file.
syntax on
set nocompatible " break away from old vi compatibility
set number " Line numbers
set backspace=2 " Normal backspaces!
set ruler " show current position at bottom
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
set smarttab " tab and backspace are smart
set autoindent " set the cursor at same indent as line above