stateDiagram
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
View sq2.gp
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
\\ sq2(p) determines sum of squares for prime p = 1 (mod 4), implement "assert()" | |
\\ | |
\\ based on | |
\\ - https://skalatan.de/en/archive/pariguide/doc/Programming_under_GP.html | |
\\ - https://pari.math.u-bordeaux.fr/pub/pari/manuals/2.15.1/tutorial.pdf | |
\\ - https://home.gwu.edu/~maxal/gpscripts/binomod.gp | |
\\ | |
{ assert(b, v, s) = if(!(b), error(Str(v) Str(s))); } | |
{ bits(N) = #binary(N); } |
View cython_demo
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
#!/bin/bash | |
pip install setuptools Cython gmpy2 | |
rm -rf /tmp/tst && mkdir /tmp/tst && cd /tmp/tst | |
wget -q https://gist.githubusercontent.com/Hermann-SW/061d33b47325bd15a4033b33d3f7c4c9/raw/9900616d98b6acdd50c436d9ae914a1c5d81f2b2/sq2_cg.py | |
mv sq2_cg.py sq2_cg.pyx | |
cat << EOF > setup.py | |
from setuptools import setup |
View state_diagram.md
View 36401.py
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
""" | |
sq2_sympy.py from here (plus time print() in "sq2()"): | |
https://github.com/sympy/sympy/issues/15358#issuecomment-1551635777 | |
2.5GHz i7-11850H | |
1998.6601960659027s a = sqrt(-1) (mod p) | |
2011.4160270690918s x, y = gcd(p, a + I).as_real_imag() | |
""" | |
from math import log10 |
View sq2_cg.py
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
# pylint: disable=C0103 | |
# invalid-name | |
""" | |
determine sum of squares for 2467-digit prime | |
- minimized for pycg analysis | |
- original: https://github.com/Hermann-SW/RSA_numbers_factored/blob/main/python/sq2.py | |
- manually converted to Graphviz with splines=ortho | |
- shortened GraphvizFiddle Share link: https://stamm-wilbrandt.de/sq2_cg.py.gvf.html | |
""" | |
from time import time |
View calcpi.js
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
const DecimalJs = require('decimal.js'); | |
const Big = require('big.js'); | |
const BigInteger = require('big-integer'); | |
// const { init: initGMP, DivMode } = require('../dist/index.umd.js'); | |
const { init: initGMP, DivMode } = require('gmp-wasm'); | |
const piDecimals = require("pi-decimals"); | |
const mpzjs = require("mpzjs"); | |
function nullish(lhs, rhs) { | |
return (lhs === null || lhs === undefined) ? rhs : lhs |
View Lehman_factor.alg
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
begin | |
comment v0.1, only factors sometimes as of now | |
comment runs with this compiler: https://github.com/JvanKatwijk/algol-60-compiler | |
$ jff-algol Lehman_factor.alg | |
$ ./Lehman_factor | |
32639 3 | |
127 | |
$ | |
; |
View 2x2cropView
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
#!/bin/bash | |
if [[ "$1" == "--help" ]]; then echo Format: "$0" "[options]"; exit; fi | |
read -r w h dummy < <(libcamera-vid --list-cameras | \ | |
grep "([1-9]" | cut -f3 -d: | sed "s#x# #") | |
dummy=$dummy | |
libcamera-vid -t 0 --width "$w" --height "$h" --preview=0,0,"$w","$h" "$@" |
View V3crop
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
#!/bin/bash | |
if [[ $# -lt 4 ]]; then echo Format: "$0" width height framerate ms [us]; exit; fi | |
if [[ $# -gt 4 ]]; then SHTR="--shutter"; else SHTR=""; fi | |
#TODO patch imx708.ko.xz, then activate with rmmod and modprobe | |
libcamera-hello --list-cameras | grep "([1-9]" | |
rm -f /dev/shm/tst.pts /dev/shm/tst.h264 | |
sleep 0.2 |
View GScropView
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
#!/bin/bash | |
if [[ "$1" == "--help" ]]; then echo Format: "$0" "[options]"; exit; fi | |
read -r w h dummy < <(libcamera-vid --list-cameras | \ | |
tail -1 | cut -f2 -d/ | sed "s#x# #") | |
dummy=$dummy | |
libcamera-vid -t 0 --width "$w" --height "$h" --preview=0,0,"$w","$h" "$@" |
NewerOlder