duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
;; All the OO stuff | |
(define (object selector-names . all-selectors) | |
(define (apply-it selector selector-names selectors parameters) | |
(cond ((null? selectors) '(I cant do that Dave!)) | |
((equal? selector (car selector-names)) (apply (car selectors) parameters)) | |
(#t (apply-it selector (cdr selector-names) (cdr selectors) parameters)))) | |
(lambda (selector . parameters) | |
(apply-it selector selector-names all-selectors parameters))) | |
;; Defining a new object type |
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101 | |
* 2017-12-05 | |
* | |
* -- T. | |
*/ | |
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */ | |
#include <stdlib.h> | |
#include <stdio.h> |
/* | |
Here are some methods that work very efficiently and acts as fallback to many fast ass DOM libraries | |
*/ | |
document.querySelector('selector'); // selector is same as in querySelectorAll() | |
/* | |
Usage: | |
var firstP = document.querySelector('p'); - It gives first 'p' element in Document. | |
var firstPinsideDiv = someDiv.querySelector('p'); - It gives first 'p' element in someDiv. |
;; fizzbuzz without conditionals in Clojure | |
; Simple patten matching using a single map lookup | |
(defn fizzbuzz [x] | |
(let [v [(= (mod x 3) 0) (= (mod x 5) 0)]] | |
({[true false] "fizz" | |
[false true] "buzz" | |
[true true] "fizzbuzz" | |
[false false] x} v))) |
I was reading ["Clojure is for Type B Personalities"][2] and it sparked some thoughts I had about the intersection of western philosophy and programming.
One could say Mathematics is an extension of Epistemology. And all theory about computability are an extension of mathematics. I reckon how one thinks about computability and how one writes computable functions are a reflection of a person's natural epistemological tendencies. This is going to be just as unscientific as ["Clojure is for Type B Personalities"][2], but hopefully another
This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.
The Atom documentation is excellent. It's highly worth reading the flight manual.
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/ | |
# core | |
brew install coreutils | |
# key commands | |
brew install binutils | |
brew install diffutils | |
brew install ed --default-names | |
brew install findutils --with-default-names |
;; The list of (almost) all Clojure public functions and macros ordered by usage. Source: Github code search for Clojure repositories. | |
(["ns" 394490] | |
["defn" 293918] | |
["require" 279210] | |
["let" 237654] | |
["def" 172983] | |
["refer" 163654] | |
["map" 159781] | |
["fn" 154482] |
(defn delegate-printing-for | |
"Registers the necessary methods to delegate printing of instances of [class] to [fn]." | |
[class fn] | |
#?@(:clj [(defmethod print-method class | |
[x writer] | |
(.write ^java.io.Writer writer (fn x))) | |
(defmethod print-dup class | |
[x writer] | |
(print-method x writer)) | |
(#'clojure.pprint/use-method |