How do you convert a stream of digits in one base into a stream of digits in another base?
Written up on my blog at http://checkmyworking.com/2012/06/converting-a-stream-of-binary-digits-to-a-stream-of-base-n-digits/
digraph{ | |
overlap=false; | |
splines=true; | |
"d0" [label="0"]; | |
"d1" [label="1"]; | |
"d2" [label="2"]; | |
"d4" [label="4"]; | |
"d16" [label="16"]; | |
"d37" [label="37"]; | |
"d58" [label="58"]; |
SCORM Engine Log | |
Version not.official.release.15337 keyboard shortcuts: refresh "r", close "esc" | |
Displaying: Control Runtime Sequencing Sequencing P-Code Look-ahead P-Code Refresh All | |
Refresh With Filter Expand All | |
Collapse All Send to Support | |
Save Debug Log | |
Regular expressions are equivalent to finite state automata. (well, lookahead needs a pushdown automaton, but that's OK) | |
Describe password constraints using regular expressions. | |
Randomly traverse the FSA corresponding to a password constraint. A path ending in an accepting state is a valid password. |
import sys | |
import pickle | |
import operator | |
import itertools | |
alphabet = 'abcdefghijklmnopqrstuvwxyz' | |
#test if a word uses letters at most once | |
def monoglyphic(word): | |
word = sorted(word) |
How do you convert a stream of digits in one base into a stream of digits in another base?
Written up on my blog at http://checkmyworking.com/2012/06/converting-a-stream-of-binary-digits-to-a-stream-of-base-n-digits/
https://cloud.scorm.com/ScormEngineInterface/PENS.jsp?command=collect&pens-version=1.0.0&package-type=scorm-pif&package-type-version=1.3&package-format=zip&package-id=http%3A//tallaght.ncl.ac.uk/exam/1/mas1041_20122013_cba1/&package-url=http%3A//tallaght.ncl.ac.uk/exam/1/mas1041_20122013_cba1.zip%3Fscorm&package-url-expiry=2013-05-20T1T16%3A05%3A39Z&client=Christian%20Perfect&receipt=mailto%[email protected]&alerts=mailto%[email protected]&system-user-id=<<<app ID from SCORM Cloud>>>&system-password=<<<secret key from SCORM Cloud>>> |
@echo off | |
IF %1==north cd .. | |
IF not %1==north cd %* |
define({a:1}); |
#!/bin/sh | |
EDITOR_PATH=/srv/www/numbas.mas.ncl.ac.uk80/numbas/ | |
PYTHON=python2.6 | |
echo "Updating Numbas" | |
cd /srv/numbas/dist | |
git pull | |
echo "Updating editor" | |
cd $EDITOR_PATH | |
git pull | |
$PYTHON manage.py syncdb |
A card trick based on a de Bruijn sequence
Encode cards as 6-digit binary strings. Arrange them following a de Bruijn sequence. Get someone to draw 6 cards, and tell you their colours. You can tell them exactly which cards they have.
Written up on The Aperiodical at http://aperiodical.com/2012/08/davids-de-bruijn-sequence-card-trick/