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
(defun compute-font-dpi () | |
(let* ((display (clim-clx:clx-port-display (clim:find-port))) | |
(db (xlib:root-resources (xlib:display-default-screen display))) | |
(res (xlib:get-resource db :|dpi| :|Dpi| '(:xft) '(:|Xft|))) | |
(default-sizes '(:normal 14 :tiny 8 :very-small 10 :small 12 :large 18 :very-large 20 :huge 24))) | |
(when res | |
(alexandria:when-let ((font-size (parse-integer res :junk-allowed t))) | |
(let* ((default-dpi 96) | |
(font-scale (/ font-size default-dpi))) | |
(setq climi::+font-sizes+ |
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
$ ./waf configure | |
reinitialized logger | |
subdirectories dir = ['wscript'] | |
extensions subdirs = [] | |
Running init() - this constructs the matrix of legal waf operation names | |
Setting top to : /home/elias/src/clasp | |
Setting out to : /home/elias/src/clasp/build | |
cfg.options.enable_mpi = None | |
configure() | |
cfg.env.ENABLE_MMTK = [] |
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
data class SelectedArea(val x: Int, val y: Int, val width: Int, val height: Int) { | |
companion object { | |
fun computeSelectedArea(selectedCells: ObservableList<TablePosition<*, *>>): SelectedArea? { | |
if (selectedCells.size == 0) { | |
return null | |
} | |
val minCol = selectedCells.minOf { it.column } | |
val maxCol = selectedCells.maxOf { it.column } | |
val minRow = selectedCells.minOf { it.row } |
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
data class SelectedArea(val x: Int, val y: Int, val width: Int, val height: Int) { | |
companion object { | |
fun computeSelectedArea(selectedCells: ObservableList<TablePosition<*, *>>): SelectedArea? { | |
if (selectedCells.size == 0) { | |
return null | |
} | |
val cols = selectedCells.groupBy { p -> p.column }.entries.sortedBy { e -> e.key }.map { e -> e.value } | |
val rows = selectedCells.groupBy { p -> p.row }.entries.sortedBy { e -> e.key }.map { e -> e.value } |
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
(defun zn-factor-generators (m) ;; m > 1 | |
(let* (($intfaclim) | |
(fs (sort (get-factor-list m) #'< :key #'car)) | |
(pe (car fs)) | |
(p (car pe)) (e (cadr pe)) | |
(a (expt p e)) | |
phi fs-phi ga gs ords fs-ords pegs ) | |
;; lemma 1, page 98 : | |
;; (Z/mZ)* is cyclic when m = | |
(when (= m 2) ;; 2 |
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
(defun rischexpvar (expexpflag flag l) | |
(prog (lcm y m p alphar beta gamma delta r s | |
tt denom k wl wv i ytemp ttemp yalpha f a expg n yn yd) | |
(desetq (f a expg n) l) | |
(cond ((or (pzerop a) (pzerop (car a))) | |
(return (cond ((null flag) (rzero)) | |
(t (rischzero)))))) | |
(setq denom (ratdenominator f)) | |
(setq p (findpr (cdr (partfrac a mainvar)) | |
(cdr (partfrac f mainvar)))) |
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
(defun map-subseq (fn seq &optional start end from-end) | |
"Helper function to map SEQ between START and END." | |
(declare (type (or null array-index) start end) | |
(optimize (debug 0) (safety 1) | |
(compilation-speed 0))) | |
;; (when (and start end) | |
;; (assert (<= start end))) | |
(let ((start (or start 0)) | |
(fn (ensure-function fn))) | |
(fbind (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
(defmethod tess-begin-polygon ((tess tessellator) &optional (polygon-data nil)) | |
(let* ((polygon-data-id | |
(or (loop for value being the hash-values of (polygon-data tess) | |
using (hash-key key) | |
when (eq value polygon-data) | |
return key) | |
(hash-table-count (polygon-data tess)))) | |
(foreign-key (foreign-alloc :uint64 :initial-contents (list (id tess) polygon-data-id)))) | |
(setf (gethash polygon-data-id (polygon-data tess)) polygon-data) |
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
∇ solvePart1 { | |
content ← ⊃ {⍎¨ ↓ "^([0-9]+),([0-9]+) -> ([0-9]+),([0-9]+)$" regexp:finderror ⍵}¨ io:read "part05.txt" | |
⍝ Compute size of array | |
width ← 1+⌈/,content[;0 2] | |
height ← 1+⌈/,content[;1 3] | |
xcoords ← ((⍋⊇⊢)⍤1) content[;0 2] | |
ycoords ← ((⍋⊇⊢)⍤1) content[;1 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
∇ solvePart1 { | |
stringToNumbers ⇐ {⍎¨ ⍵ ⊂⍨ ⍺≠⍵} | |
filecontent ← io:read "part04.txt" | |
num ← @, stringToNumbers ↑filecontent | |
b ← ⊃ {⊃ (↑" ") stringToNumbers¨ ⍵}¨ v ⊂⍨ (⊂⍬) ≢¨ v←2↓filecontent | |
⍝ Compute the time at which each cell is picked, 0 means that the cell was not picked | |
indexed ← (1+⍳≢num) ×⌺ (⍴b)⍴1 | |
res ← +⌿ indexed × num=⌺b |
NewerOlder