This file contains hidden or 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
∇out←dir lines;l;path;size;ls | |
path←⊂'' | |
ls←⍬ | |
size←0 | |
:For l :In lines | |
:If 1=⍴('\$ cd'⎕S'$1')l | |
ls,←⊂(⊃{⍺,'/',⍵}/path)size | |
:If '..'≢5↓l | |
path,←⊂5↓l | |
:Else |
This file contains hidden or 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
fmod PATH is | |
protecting STRING . | |
protecting BOOL . | |
sorts Path Node . | |
subsort String < Node . | |
op _-_ : Node Node -> Path [ctor comm] . | |
op small : Node -> Bool . | |
var s : Node . | |
eq small(s) = ascii(substr(s, 0, 1)) > 90 . | |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:array="http://www.w3.org/2005/xpath-functions/array" | |
xmlns:h="http://www.w3.org/1999/xhtml" | |
xmlns:v="http://docbook.org/ns/docbook/variables" | |
xmlns:m="http://docbook.org/ns/docbook/modes" | |
xmlns:f="http://docbook.org/ns/docbook/functions" | |
xmlns:fp="http://docbook.org/ns/docbook/functions/private" | |
xmlns:t="http://docbook.org/ns/docbook/templates" |
This file contains hidden or 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
// clm -IL Platform -IL ArgEnv -IL Directory -IL StdLib -b -nr -nt mkpdf -o pdf | |
// rewrite of https://github.com/agl/jbig2enc/blob/master/pdf.py | |
module mkpdf | |
import StdEnv, ArgEnv, StdMaybe, StdArrayExtensions, Directory, Data.Func | |
Start w | |
| argc == 1 | |
# (p, w) = getCurrentDirectory w | |
((ec, files), w) = getDirectoryContents p w |
This file contains hidden or 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
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(defpackage #:horoscope)) | |
(in-package #:cl-user) | |
(defparameter horoscope::paragraph | |
'(("*sentence." "*sentence2." "*sentence." "*sentence2." | |
"You'll" "*when" "be" "*state." "*luckynum.") | |
("*sentence." "*sentence2." "*sentence2." "You'll" "*when" "be" "*state.") | |
("*sentence2." "*sentence." "*sentence." "*sentence2." | |
"You'll" "*when" "be" "*state."))) |
This file contains hidden or 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
#| | |
BSD 2-Clause License | |
Copyright (c) 2022, LdBeth | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this |
This file contains hidden or 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
&anchor = 1 | |
char = len(1) . ch | |
white = span(' ') | |
word = break(' ') white | |
count = table(100) | |
loop line = input :f(stat) | |
lc = lc + 1 | |
copy = line ' ' |
This file contains hidden or 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
module mukaren | |
import StdEnv,StdMaybe,StdClass | |
:: Tree = Node Tree Tree | Var Int | Val Int | |
:: State :== ([(Int,Tree)], Int) | |
:: Mu :== (State -> [State]) | |
instance == Tree | |
where |
This file contains hidden or 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
(defun factorial(x) | |
(reduce '* (loop for a from x downto 1 collect a))) | |
(defun algorithm-t (n &aux (num (factorial n))) | |
(let ((table (make-array num :element-type `(integer 1 ,n) :initial-element 0)) | |
(m 2) | |
j k d) | |
(setf d (floor num 2) | |
(aref table d) 1) | |
(loop until (= m n) |
This file contains hidden or 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
acc ← {⍺←1 ⋄ ((⊢⍪(⍺⍺∘,¯1↑⊢))⍣⍺)⍵} | |
cell ← {((⍺⍺ ⍵⍵⊢)⌺3)⍵} | |
code ← {⎕IO←0 ⋄ (+/⍵)⌷⌽(7⍴3)⊤⍺} | |
expnd ← {(,⍉↑⍺)/,¯1 0 1(+⍤0 1)⍵} | |
gmob ← {⍵ snap⍨(⊂L),↓⍉↑(⍺⍺ ⍵⍵ ⍵⌷⍨∘⊂¯1 0 1∘+)¨L←⍸1<⍵} | |
gr ← {(A rule P)(B patn P)⊣A B←⍺⊣P←2|⍵} | |
initi ← {⍺←1 ⋄ ,[⎕IO-0.5]A,⍺,A←⍵⍴0} | |
mcomp ← {((⌽⍣(B rule P))0 0 2)+(⊃A B←⍺)patn⊢P←⍵-0 2 0} | |
mobile ← {((⍺⍺ ⍵⍵ ⍵⌷⍨⊂P)@P)⍵⊣P←¯1 0 1+⍸1<⍵} | |
msimp ← {((⌽⍣A)0 0 2)+(B@2)P⊣A B←⍺ rule¨⊂P←⍵-0 2 0} |