Skip to content

Instantly share code, notes, and snippets.

View KingMob's full-sized avatar

Matthew Davidson KingMob

View GitHub Profile
@Avaq
Avaq / combinators.js
Last active July 15, 2024 14:46
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@halgari
halgari / gist:c17f378718cbd2fd82324002133ef678
Created November 23, 2018 20:54
Contributing to Clojure

So you’d like to contribute to Clojure, great! Let’s talk about what that involves.

The first thing you’ll want to make sure is that your idea is valid, and that you won’t spend a ton of time working on something that won’t make into master. To do this, you should create a JIRA ticket. For example, let’s say we want to improve how core.async handles channel closing propagation. It’s not a super complex problem, but there are some design questions about which of the various semantics currently in place should be the default, and if some semantics should be configurable.

So start by making a JIRA ticket and stating what the problem is you’re trying to solve, what the possible options for solving the problem. Now hit save and wait for the ticket to be triaged. Alex Miller will take a look when he can, and that can take a few days to a few weeks, depending on the time of the year (he has other responsibilities). Alex may out-right reject the idea if he knows Rich would never approve the ticket, but otherwise h

@Morendil
Morendil / ibm-systems-science-institute.md
Last active May 8, 2024 08:58
The IBM Systems Science Institute

The IBM Systems Science Institute

Rubric: Software Engineering : Factual Claims : Defect Cost Increase : Pressman Ratios

Context

Background: I have been researching quantity and quality of empirical evidence underlying claims in software engineering. What do we know, and how well-established is that? See in particular https://leanpub.com/leprechauns which concludes that the answer is in (too) many cases "not much, and poor".

This applies in particular to the "Defect Cost Increase" claim, which is poorly supported by evidence. The claim states that the longer a defect stays undiscovered after being introduced in a software system's artefacts, the more expensive it is to correct.

The citations game: Wolverton Ratios

Rubric: Software Engineering : Factual Claims : Defect Cost Increase : Wolverton Ratios

Context

See previous note on the IBM Systems Sciences Institute

In absolute numbers, the Wolverton are as follows: 139:455:977:7136:14102, claimed dollar costs of fixing an "average" defect. (Itself an absurd claim, see Leprechauns, I should perhaps write more on that.)

(defn re-ws-stream [url]
(let [s (ms/stream 10)
renew-connection
(fn this
([] (this 0 (System/currentTimeMillis)))
([conn-ct prev-conn-ts]
(-> (http/websocket-client url {:max-frame-payload 1e7 :max-frame-size 1e7})
(md/chain
(fn [conn]
(log/info "ws connected. connection count" conn-ct)
@josh-7t
josh-7t / byte_streams_memo_benchmark.clj
Created October 13, 2021 19:13
Benchmarking byte-stream.util/fast-memoize against clojure.core/memoize
(ns byte-streams-memo-benchmark
(:require [metrics.core :refer [new-registry]]
[metrics.timers :as mt]
[byte-streams.utils :refer (fast-memoize)]))
(defn bench-memo [f]
(let [n 500
warmup-arg1 (repeatedly n #(rand-int (* 20 n)))
warmup-arg2 (repeatedly n #(rand-int (* 20 n)))
test-arg1 (repeatedly n #(rand-int (* 20 n)))