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
// 2023-11-16 | |
Array.from(document.querySelectorAll('.a-price-whole')).map(x => Number(x.innerHTML.replace(',', ''))).reduce((s, e) => s + e, 0); | |
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
; Proof | |
; | |
; => https://github.com/myaosato/claudia | |
; | |
;; **************************************************************** | |
;; meta data type | |
#| | |
const := const-val | func const* | |
term := const | var |
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
fact(1, F) :- F is 1. | |
fact(N, F) :- | |
N > 1, | |
M is N - 1, | |
fact(M, T), | |
F is N * T. |
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
;;;; heap | |
(defstruct (binary-heap (:conc-name bh-)) | |
(predicate #'>=) | |
(nodes (make-array (list 1024) :adjustable t :fill-pointer 0))) | |
(defun bh-empty (binary-heap) | |
(= (length (bh-nodes binary-heap)) 0)) | |
(defun bh-tail (binary-heap) | |
(1- (length (bh-nodes binary-heap)))) |
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
# 1秒後, 2秒後 3秒後に印字されるものと, | |
# 2秒後, 3秒後 に印字される | |
import time | |
import sys | |
from multiprocessing import Process, Value, set_start_method | |
set_start_method('fork') | |
def f(xs, flg): | |
cnt = 0 |
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
fib(N, F) :- fibo(0, 1, N, F). | |
fibo(A, _B, 0, F) :- F is A. | |
fibo(A, B, N, F) :- | |
N > 0, | |
NEWA is B, | |
NEWB is A + B, | |
NEWN is N - 1, | |
fibo(NEWA, NEWB, NEWN, F). |
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
(defpackage :cl-ulid/cl-ulid | |
(:use :cl) | |
(:nicknames :cl-ulid) | |
(:export :ulid)) | |
(in-package :cl-ulid) | |
(defun get-epoch-millisecond () | |
#+sbcl | |
(multiple-value-bind (sec microsec) (get-time-of-day) | |
(+ (* 1000 sec) (round (/ microsec 1000)))) |
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
(defmacro -> (prev &rest rest) | |
(if (null rest) | |
prev | |
`(-> ,(cons (caar rest) (cons prev (cdar rest))) ,@(cdr rest)))) | |
(defmacro ->> (prev &rest rest) | |
(if (null rest) | |
prev | |
`(->> ,(append (car rest) (list prev)) ,@(cdr rest)))) |