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
;;THE MOST: 42% of words with J in them start with J | |
;;THE LEAST: 1.6% of words with Y in them start with Y | |
;; Word list used: https://github.com/dwyl/english-words | |
;; Calculation in clojure as follows: | |
(def words (st/split (slurp "words.txt") #"\n")) | |
(println (sort-by :percentage-starts | |
(for [c (map char (map (partial + (int \a)) (range 26)))] |
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 foo [coll] | |
(map concat (reductions conj () (cycle (reverse coll))) (repeat (cycle coll)))) | |
;; > (map (partial take 10) (take 10 (foo [:a :b :c :d]))) | |
;; ((:a :b :c :d :a :b :c :d :a :b) | |
;; (:d :a :b :c :d :a :b :c :d :a) | |
;; (:c :d :a :b :c :d :a :b :c :d) | |
;; (:b :c :d :a :b :c :d :a :b :c) | |
;; (:a :b :c :d :a :b :c :d :a :b) | |
;; (:d :a :b :c :d :a :b :c :d :a) |
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
0xd3f66506b9227344Dc30a56E228f342b646eB61F |
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 split-window-multiple-ways (x y) | |
"Split the current frame into a grid of X columns and Y rows." | |
(interactive "nColumns: \nnRows: ") | |
;; one window | |
(delete-other-windows) | |
(dotimes (i (1- x)) | |
(split-window-horizontally) | |
(dotimes (j (1- y)) | |
(split-window-vertically)) | |
(other-window y)) |
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
Two economists are walking down the street and one of them notices what appears to be a $20 bill (or a $100 bill—the monetary amounts vary) on the sidewalk. “It’s not a real $20 bill,” the other economist declares. “If it were a real $20 bill, someone would have picked it up off the sidewalk already.” |
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
'enode://400b11f152fd4a2348c059ada1f67ea8f732cf8e2fde8136a0ec174c443d63a7ccb27a50598bd65979565b1d4913f193af8f7ee2d69aae1a9aeba3fe58dbb26a@[::]:30303' |
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
<html> | |
<head> | |
<script type="text/javascript" src="bignumber.min.js"></script> | |
<script type="text/javascript" src="ethereum.js"></script> | |
<script type="text/javascript"> | |
var web3 = require('web3'); | |
web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080')); |
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
<html> | |
<head> | |
<script type="text/javascript" src="bignumber.min.js"></script> | |
<script type="text/javascript" src="ethereum.js"></script> | |
<script type="text/javascript"> | |
var web3 = require('web3'); | |
web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080')); | |
var coinbase = web3.eth.coinbase; |
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
(ns groupon.core | |
(require [clojure.string :refer [lower-case]])) | |
;;functional code | |
(defn delete-item [items n] | |
(vec (concat (take n items) (drop (inc n) items)))) | |
(def commands [{:name "(A)dd" | |
:key :a |
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
(ns groupon.core | |
(require [clojure.string :refer [lower-case]])) | |
;;functional | |
(defn add-item [items item] | |
(conj items item)) | |
(defn edit-item [items index item] | |
(assoc items index item)) |
NewerOlder