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
(defn- rec-fmt | |
"Define a record format for Aleph Sequential FMT field." | |
[record] | |
(let [leader (:leader record) | |
l6 (subs leader 6 7) | |
l7 (subs leader 7 8)] | |
(cond | |
(and (contains? #{"a" "t"} l6) | |
(not (contains? #{"b" "i" "s"} l7))) "BK" | |
(= "m" l6) "CF" |
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
(def vowels '("a" "e" "i" "o" "u" "y")) | |
(def consonants '("b" "c" "d" "f" "g" "h" "j" "l" "m" "n" "p" "q" "r" "s" "t" "v" "w" "x" "z")) | |
(defn- rand-chars [s amount] | |
(let [indices (take amount (repeatedly #(rand-int (dec (count s)))))] | |
(map (partial nth s) indices))) | |
(defn gen-name! [] | |
(-> (interleave (rand-chars consonants 3) (rand-chars vowels 3)) |
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
502I1 | <M02I1 | ' ' | |
502I2 | <M02I2 | ' ' | |
502$a | <M02$a | Upper(To(1)) + From(2) | |
502$b | <M02$c | S + ' : ' | |
502$c | <M02$c | + S | |
502$d | <M02$d | S | |
M02 | 502 | S; | |
MoveLast('9'); | |
Replace ('$c' By ' :$c', Strict); | |
Replace ('$d' By ',$d', Strict); |
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
#if (Not Exists(@773)) | |
260I1 | 260I1 | S | |
260I2 | 260I2 | S | |
260$a | 260$a | S; RegReplace('\\[S.l.\\]', '[Kustannuspaikka tuntematon]'); RegReplace('\\[s.l.\\]', '[kustannuspaikka tuntematon]') | |
260$b | 260$b | S; RegReplace('\\[s.n.\\]', '[kustantaja tuntematon]') | |
260$c | 260$c | RegReplace('\\[s.a.\\]', '[julkaisuaika tuntematon]'); \ | |
If (RegFind(S, 'cop|©|℗|[Cc]|^p') >= 0) And (RegFind(S, '\\d{4}') >= 0) '[' + RegMatch(0) + ']' \ | |
Else S; | |
260$? | 260$? | S | |
#endif |
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
;; gorilla-repl.fileformat = 1 | |
;; ** | |
;;; # Melindan e-aineistokyselyn tuloksia | |
;;; | |
;;; Melindan e-aineistokyselyn purkua, lukuja ja kaavioita. Aloita valitsemalla oikean yläkulman valikosta ** Evaluate all segments ** (tai painamalla Alt-Shift-Enter). | |
;;; | |
;;; Ensimmäinen solu sisältää laskentaan ja kaavioiden piirtämiseen käytettävää koodia, kooste alkaa tämän jälkeen. | |
;; ** |
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
(defn count-to-kaprekar | |
([number] (count-to-kaprekar number 0)) | |
([number i] | |
(let [found (- (desc-digits number) (asc-digits number))] | |
(if (or (= 6174 number) (= 0 number)) | |
i | |
(count-to-kaprekar found (inc i))))) |
NewerOlder