Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
| {-# LANGUAGE OverloadedLists #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| module Wrap where | |
| import Control.Arrow ((>>>)) | |
| import Data.Bool (not, (||)) | |
| import Data.Char (isSpace) | |
| import Data.Function ((&)) | |
| import Data.Functor (fmap, ($>)) |
I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.
There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:
:vs **/*<partial file name><Tab>| @-moz-document domain("github.com"), domain("gist.github.com"), domain("render.githubusercontent.com") { | |
| /* Hasklig https://github.com/i-tu/Hasklig */ | |
| /* Fira Code https://github.com/tonsky/FiraCode */ | |
| /* Ligaturizer https://github.com/ToxicFrog/Ligaturizer */ | |
| .branch-name, | |
| .blob-num, | |
| .blob-code-inner, | |
| .CodeMirror pre, | |
| .commit .sha, | |
| .commit-desc pre, |
| /// This type is only every inhabited when S is nominally equivalent to T | |
| #[derive(Debug)] | |
| pub struct Is<S, T>(::std::marker::PhantomData<(*const S, *const T)>); | |
| // Construct a proof of the fact that a type is nominally equivalent | |
| // to itself. | |
| pub fn is<T>() -> Is<T, T> { Is(::std::marker::PhantomData) } | |
| // std::mem::transmute does not accept unsubstituted type parameters | |
| // manual transmute as suggested by manual |
This blog post series has moved here.
You might also be interested in the 2016 version.
Fiction
More Technical
| (ns foami.core | |
| "FOreign Asynchronous Mechanism Interop" | |
| (:require [clojure.core.async :as async])) | |
| (defn put! | |
| "Takes a `ch`, a `msg`, a single arg function that when passed `true` enables backpressure | |
| and when passed `false` disables it, and a no-arg function which, when invoked, closes the | |
| upstream source." | |
| [ch msg backpressure! close!] | |
| (let [status (atom :sending] |