Skip to content

Instantly share code, notes, and snippets.

LoopInvariant (Token (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 1 0) (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 2 1)) (Lit (LitBool True /workspaces/gcl-all/gcl-vscode/example/bug.gcl [2-6] 1:3-7)) (Token (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 7 6) (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 8 7)) (Token (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 9 8) (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 12 11)) (Token (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 12 11) (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 13 12)) (Lit (LitInt 0 /workspaces/gcl-all/gcl-vscode/example/bug.gcl [13-14] 1:14-15)) (Token (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 16 15) (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 1 17 16)),Do (Token (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 2 1 17) (Pos "/workspaces/gcl-all/gcl-vscode/example/bug.gcl" 2 3 19)) (Head (GdCmd (Lit (LitBool False /workspaces/gcl-all/gc
@LCamel
LCamel / 0_fail.js
Last active August 7, 2025 21:53
mutual recursion
var MkIsOdd = (other) => ( (x) => x == 0 ? false : other(x - 1) );
var MkIsEven = (other) => ( (x) => x == 0 ? true : other(x - 1) );
// // doesn't work: isEven is undefined
// var isOdd = MkIsOdd(isEven), isEven = MkIsEven(isOdd);
// // the line above will be translated to something like:
var isOdd = undefined;
var isEven = undefined;
isOdd = MkIsOdd(isEven); // doesn't work: isEven is undefined
isEven = MkIsEven(isOdd);
@LCamel
LCamel / with version
Last active July 25, 2025 09:12
editTexts 的 callback 中, 即便晚了 10 秒再去 readSource, 讀到的也是舊的. 但隨後的 didChange 去讀就能讀到新的.
Jul 25 16:53:05 json: decoding request
Jul 25 16:53:05 JSON content: {"filePath":"/workspaces/gcl-all/gcl-vscode/example/gcd.gcl"}
Jul 25 16:53:05 json: decoding succeeded
Jul 25 16:53:05 Reload handler >>>> /workspaces/gcl-all/gcl-vscode/example/gcd.gcl
Jul 25 16:53:05 load: start
Jul 25 16:53:05 ask file state ref
Jul 25 16:53:05 ask file state map
Jul 25 16:53:05 lookup file state map
Jul 25 16:53:05 found
Jul 25 16:53:05 readSource: version: 3
@LCamel
LCamel / digHoles.log
Last active July 23, 2025 03:29
GCL digHoles: old source
json: decoding request
JSON content: {"filePath":"/workspaces/gcl-all/gcl-vscode/example/gcd_2.gcl"}
json: decoding succeeded
Reload handler >>>> /workspaces/gcl-all/gcl-vscode/example/gcd_2.gcl
load: start
ask file state ref
ask file state map
lookup file state map
found
source read
@LCamel
LCamel / node version
Created June 25, 2025 06:28
VS Code crashes sometimes
vscode ➜ /workspaces/gcl-all/gcl-vscode/example (main) $ /vscode/vscode-server/bin/linux-x64/18e3a1ec544e6907be1e944a94c496e302073435/node
Welcome to Node.js v22.15.1.
Type ".help" for more information.
>
@LCamel
LCamel / fullscreen1.sh
Last active February 19, 2025 14:09
Mac OS X fullscreen
#!/bin/sh
osascript -e 'tell application "System Events" to set frontApp to (name of first process whose frontmost is true)' -e 'tell application "System Events" to tell process frontApp to set position of window 1 to {0, 0}' -e 'tell application "System Events" to tell process frontApp to set size of window 1 to {1512, 3000}'
@LCamel
LCamel / a.html
Created February 6, 2025 07:21
a.html
<img src="https://lcamel.github.io/LCamel-Notes/LazyTower/level_digests.png" width="431px">
@LCamel
LCamel / a.svg
Created February 6, 2025 04:04
a.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LCamel
LCamel / false_positive.js
Last active May 29, 2023 14:12
False positives for the LessThan circuit (caused by overflow)
// https://github.com/iden3/circomlib/blob/master/circuits/comparators.circom
const p = 23;
const N = 2;
var fp = []; // false positive
for (var x = 0; x < p; x++) {
fp[x] = [];
for (var y = 0; y < p; y++) {
fp[x][y] = ' ';
@LCamel
LCamel / PickOne.circom
Last active May 27, 2023 12:33
PickOne experiments
pragma circom 2.1.4;
include "circomlib/multiplexer.circom";
include "circomlib/comparators.circom";
// Pick in[sel]
template PickOne(N) {
signal input in[N];
signal input sel;
signal output out;