diff options
author | EuAndreh <eu@euandre.org> | 2024-11-18 08:21:58 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-11-18 08:44:57 -0300 |
commit | 960e4410f76801356ebd42801c914b2910a302a7 (patch) | |
tree | 615d379416f72956d0c1666c63ce062859041fbe /src/content/pastebins/2021/06 | |
parent | Remove jekyll infrastructure setup (diff) | |
download | euandre.org-main.tar.gz euandre.org-main.tar.xz |
Diffstat (limited to 'src/content/pastebins/2021/06')
-rw-r--r-- | src/content/pastebins/2021/06/08/reading-session-pt1.adoc | 77 | ||||
-rw-r--r-- | src/content/pastebins/2021/06/22/curl-wget.adoc | 102 |
2 files changed, 179 insertions, 0 deletions
diff --git a/src/content/pastebins/2021/06/08/reading-session-pt1.adoc b/src/content/pastebins/2021/06/08/reading-session-pt1.adoc new file mode 100644 index 0000000..b97ef08 --- /dev/null +++ b/src/content/pastebins/2021/06/08/reading-session-pt1.adoc @@ -0,0 +1,77 @@ +--- + +title: Debit Reading Session - SICP solutions pt.1 + +date: 2021-06-08 + +layout: post + +lang: en + +ref: debit-reading-session-sicp-solutions-pt-1 + +--- + +```scheme +;; 1.41 +(define (double f) + (lambda (x) + (f (f x)))) + + +:;; 1.42 +(define (compose f g) + (lambda (x) + (f (g x)))) + + +;;; 1.43 +(define (repeated f n) + (if (= 1 n) + identity + (comp (repeated f (dec n))))) + + +;;; 2.27 +(define (map-tree node-fn leaf-fn tree) + (cond + ((null? tree) tree) + ((not (pair? tree)) (leaf-fn tree)) + (else + (node-fn + (cons (map-tree node-fn leaf-fn (car tree)) + (map-tree node-fn leaf-fn (cdr tree))))))) + +(define (map-nodes f tree) + (map-tree f identity tree)) + +(define (deep-reverse x) + (map-nodes reverse x)) + + +;;; 2.28 +(define (flatten tree) + (define (rec acc t) + (cond + ((null? t) acc) + ((not (pair? t)) (cons t acc)) + (else + (rec (rec (cdr t) acc) + (car t))))) + (rec nil tree)) + + +;;; 2.30 +(define (square-tree tree) + (map-leaves square tree)) + + +;;; 2.31 +(define square-tree map-leaves) ; ha! + + +;;; 2.32 +TODO +``` + +FYI: I just typed those in, I didn't yet test them yet. diff --git a/src/content/pastebins/2021/06/22/curl-wget.adoc b/src/content/pastebins/2021/06/22/curl-wget.adoc new file mode 100644 index 0000000..1030c7b --- /dev/null +++ b/src/content/pastebins/2021/06/22/curl-wget.adoc @@ -0,0 +1,102 @@ +--- + +title: "cloc: curl and wget" + +date: 2021-06-22 + +layout: post + +lang: en + +ref: cloc-curl-and-wget + +--- + +`curl`: + +```shell +$ pushd `mktemp -d` +/tmp/tmp.AZkwvk7azD ~/ +$ git clone git://github.com/curl/curl . +Clonage dans '.'... +remote: Enumerating objects: 167029, done. +remote: Counting objects: 100% (925/925), done. +remote: Compressing objects: 100% (372/372), done. +remote: Total 167029 (delta 590), reused 818 (delta 548), pack-reused 166104 +Réception d'objets: 100% (167029/167029), 75.63 Mio | 9.33 Mio/s, fait. +Résolution des deltas: 100% (131415/131415), fait. +$ cloc . + 3386 text files. + 3342 unique files. + 2084 files ignored. + +github.com/AlDanial/cloc v 1.90 T=1.34 s (973.7 files/s, 260104.4 lines/s) +------------------------------------------------------------------------------------ +Language files blank comment code +------------------------------------------------------------------------------------ +C 535 25645 36361 135318 +XML 23 21 20 45997 +m4 29 1526 1976 16972 +Perl 56 2611 4010 15411 +C/C++ Header 223 4178 10109 13794 +Markdown 53 2784 0 7038 +Visual Studio Solution 27 0 21 5049 +D 242 398 0 3549 +CMake 34 754 1288 3056 +DOS Batch 7 293 370 1554 +YAML 18 115 171 1493 +make 21 296 660 1440 +Bourne Shell 22 326 633 1136 +Pascal 2 228 0 634 +Python 4 196 221 628 +Visual Basic Script 1 30 60 341 +C++ 3 58 69 169 +Gencat NLS 1 2 0 130 +TNSDL 1 3 0 113 +Windows Resource File 2 17 47 110 +Bourne Again Shell 1 17 44 97 +Protocol Buffers 1 2 0 28 +diff 1 0 0 11 +Lisp 1 1 23 7 +TOML 1 0 0 3 +------------------------------------------------------------------------------------ +SUM: 1309 39501 56083 254078 +------------------------------------------------------------------------------------ +``` + +`wget`: + +```shell +$ pushd `mktemp -d` +/tmp/tmp.NX0udlJMiz ~/ +$ git clone git://git.savannah.gnu.org/wget.git . +Clonage dans '.'... +remote: Counting objects: 52248, done. +remote: Compressing objects: 100% (18430/18430), done. +remote: Total 52248 (delta 23879), reused 52248 (delta 23879) +Réception d'objets: 100% (52248/52248), 13.11 Mio | 6.18 Mio/s, fait. +Résolution des deltas: 100% (23879/23879), fait. +$ cloc . + 12210 text files. + 11629 unique files. + 11876 files ignored. + +github.com/AlDanial/cloc v 1.90 T=1.26 s (270.4 files/s, 61357.4 lines/s) +-------------------------------------------------------------------------------- +Language files blank comment code +-------------------------------------------------------------------------------- +C 53 6596 8955 34084 +Perl 106 1832 870 7415 +Python 105 1481 2374 5318 +C/C++ Header 43 704 1153 1486 +Bourne Shell 11 308 311 1278 +m4 3 172 183 940 +make 9 136 172 522 +YAML 3 27 13 515 +Bourne Again Shell 6 78 89 274 +Markdown 2 37 0 113 +lex 1 29 65 73 +-------------------------------------------------------------------------------- +SUM: 342 11400 14185 52018 +-------------------------------------------------------------------------------- +``` |