This file contains hidden or 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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
This file contains hidden or 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
(require '[clojure.java.io :as io]) | |
(defn secure-delete-file | |
"fill file content with mask 0x55AA and then delete it. | |
return nil." | |
[^String fname] | |
(let [length (.length (io/file fname)) | |
buf-len 4096 | |
w (quot length buf-len) | |
r (rem length buf-len) |
This file contains hidden or 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 user | |
(:import (org.apache.logging.log4j.core.config.builder.api ConfigurationBuilderFactory) | |
(org.apache.logging.log4j.core.config Configurator) | |
(org.apache.logging.log4j Level))) | |
(def builder (ConfigurationBuilderFactory/newConfigurationBuilder)) | |
(def console (.newAppender builder "stdout" "console")) | |
(.add builder console) | |
(Configurator/setRootLevel Level/DEBUG) | |
(println "log4j2 is configured.") |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# ******************************************************** | |
# on Mac run: | |
# vagrant plugin install vagrant-vbguest | |
# ******************************************************** | |
Vagrant.configure("2") do |config| |
This file contains hidden or 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
export GRAALVM_HOME="/Library/Java/JavaVirtualMachines/graalvm-ce-java11-19.3.1/Contents/Home/" | |
export PATH="$HOME/.jenv/bin:$PATH" | |
eval "$(jenv init -)" | |
eval "$(direnv hook zsh)" |
This file contains hidden or 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 merge-sort | |
([v comp-fn] | |
(if (< (count v) 2) v | |
(let [[left right] (split-at (quot (count v) 2) v)] | |
(loop [result [] | |
sorted-left (merge-sort left comp-fn) | |
sorted-right (merge-sort right comp-fn)] | |
(cond | |
(empty? sorted-left) (into result sorted-right) | |
(empty? sorted-right) (into result sorted-left) |
This file contains hidden or 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 org.rssys.rle.core | |
(:gen-class) | |
(:require [org.rssys.rle.naive :as rle1] | |
[org.rssys.rle.lazy :as rle2])) | |
(defn -main | |
"entry point to program." | |
[& args] | |
(condp = (first args) |
This file contains hidden or 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 coder ;; org.rssys.lzw | |
(:require [clojure.java.io :as io]) | |
(:import (java.io InputStream OutputStream) | |
(com.github.jinahya.bit.io StreamByteInput StreamByteOutput DefaultBitOutput DefaultBitInput))) | |
(def MAX-BITS-LENGTH 18) | |
(def EOF 256) | |
(defn lzw-encode-stream | |
[^InputStream in-stream ^OutputStream out-stream] |
This file contains hidden or 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
(require '[clojure.core.reducers :as r]) | |
(defn pi | |
"calculate accurately first k digits of PI" | |
[k] | |
(with-precision (+ 3 k) | |
(let [f-exp (fn [k] (let [power (fn [x n] (reduce * (repeat n x))) | |
k8 (* 8M k) | |
a (/ 1.0M (power 16M k)) | |
b (/ 4.0M (inc k8)) |
This file contains hidden or 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
{:deps {org.clojure/clojure {:mvn/version "RELEASE"} | |
io.forward/yaml {:mvn/version "RELEASE"} | |
org.flatland/ordered {:mvn/version "1.5.9"}}} |