-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
105 additions
and
62 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
# whitelist | ||
/* | ||
|
||
!/.gitignore | ||
!/CNAME | ||
!/README.md | ||
!/index.html | ||
!/contest.scm | ||
!/m-scheme-EschQR | ||
|
||
!/url* | ||
!/*png | ||
!/gen-scm-qr.py | ||
!/gen-site-qr.py | ||
!/gen-py-qr.py | ||
!/*py-qr* | ||
!/img*.py | ||
doodle* | ||
|
||
!/*.png | ||
!/*.scm | ||
!/*.sh | ||
!/*.js | ||
|
||
# blacklist | ||
doodle* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# MSE | ||
|
||
MSE Scheme EschQR<br> | ||
M. Scheme EschQR<br> | ||
Scheme<br> | ||
EschQR<br> | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
log() { | ||
now=$(date +"%T.%3N") | ||
echo "$now :: $1" | ||
} | ||
|
||
TMP="img-min-tmp.py" | ||
MIN="img-min.py" | ||
GEN="img-to-scm.py" | ||
|
||
log "Removing contest.scm..." | ||
command rm contest.scm | ||
log "Minifying $GEN..." | ||
command pyminifier -o $TMP --lzma $GEN # todo pipe to log | ||
MIN="img-min.py" | ||
command head -n -1 $TMP >$MIN | ||
log "Evaluating Python code to get scheme..." | ||
command python $GEN >/dev/null | ||
log "Generating QR of min and reg Python..." | ||
command python gen-py-qr.py $MIN >/dev/null | ||
command python gen-py-qr.py $GEN >/dev/null | ||
log "Evaluating scheme code..." | ||
command python3 scheme.py contest.scm --pillow-turtle --turtle-save-path output >/dev/null | ||
log "Removing tmp files..." | ||
command rm $TMP | ||
command rm $MIN |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
let n = true; | ||
function flippy() { | ||
n = !n; | ||
let fn = ""; | ||
if (n) { | ||
fn = "py-qr-reg.png"; | ||
} else { | ||
fn = "py-qr-min.png"; | ||
} | ||
document.getElementById("QR").setAttribute("src", fn); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
#!/usr/bin/python | ||
import sys | ||
import qrcode | ||
|
||
SCHEME_DATA = open("img-min.py").read() | ||
# SCHEME_DATA = open("img-to-scm.py").read() | ||
py = sys.argv[1] | ||
fn = "py-qr-reg.png" if "min" in py else "py-qr-min.png" | ||
SCHEME_DATA = open(py).read() | ||
|
||
qr = qrcode.QRCode() | ||
qr = qrcode.QRCode(border=1, error_correction=qrcode.constants.ERROR_CORRECT_L) | ||
qr.add_data(SCHEME_DATA) | ||
img = qr.make_image() | ||
img.save("py-qr.png") | ||
img.save(fn) |
This file was deleted.
Oops, something went wrong.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.