Pi approximation
return 355.0/113.0#+RESULTS[65a3244f1a752173c45b62a7685331f3f22836dc]: pi
3.14159292035
Earth’s surface [km^2]
Pi approximation
return 355.0/113.0#+RESULTS[65a3244f1a752173c45b62a7685331f3f22836dc]: pi
3.14159292035
Earth’s surface [km^2]
| ;;;;;;;;;;;;;;;;;;; | |
| ;; ;;;;;;;;;;;;; ;; | |
| ;; ;; Haskell ;; ;; | |
| ;; ;;;;;;;;;;;;; ;; | |
| ;;;;;;;;;;;;;;;;;;; | |
| ;;;;;;;;;;;;;;;;;;; | |
| ;; Prerequisites ;; | |
| ;;;;;;;;;;;;;;;;;;; | |
| ;; (package-install 'haskell-mode) |
| # Alternative to 'evdev'. I needed this one to get CST working under Suse Tumbleweed. | |
| Section "InputClass" | |
| Identifier "CST Trackball" | |
| MatchProduct "Clearly Superior Technologies. CST Laser Trackball" | |
| Driver "libinput" | |
| Option "ScrollMethod" "button" | |
| Option "ScrollButton" "2" | |
| Option "HorizontalScrolling" "true" | |
| Option "MiddleEmulation" "true" |
| ;; -*- lisp -*- | |
| ;; Morse code decoder | |
| (defparameter *morse-code-decoder* (make-hash-table :test #'equal)) | |
| (setf (gethash ".-" *morse-code-decoder*) "a") | |
| (setf (gethash "-..." *morse-code-decoder*) "b") | |
| (setf (gethash "-.-." *morse-code-decoder*) "c") | |
| (setf (gethash "-.." *morse-code-decoder*) "d") | |
| (setf (gethash "." *morse-code-decoder*) "e") | |
| (setf (gethash "..-." *morse-code-decoder*) "f") |
| namespace Bell | |
| { | |
| open Microsoft.Quantum.Canon; | |
| open Microsoft.Quantum.Primitive; | |
| // Qubit setter | |
| operation Set (desired: Result, q1: Qubit) : Unit { | |
| let current = M(q1); | |
| if (desired != current) { | |
| X(q1); |
| # Invoke our custom command when switching windows | |
| bind -T prefix n run "tmux-switch-windows n" | |
| bind -T prefix p run "tmux-switch-windows p" |
| # -*- bash -*- | |
| # These functions require 'dmenu', available as part of the Suckless Tools package | |
| # Ubuntu/Debian: sudo apt install suckless-tools | |
| # Select Docker container from Dmenu and return its ID | |
| function select-container { | |
| echo $(docker ps --format 'table {{.Image}}\t{{.ID}}\t{{.Status}}\t{{.Names}}' | tail -n +2 | dmenu -l 10 | awk '{print $2}') | |
| } | |
| # Go to desired Docker container based on Dmenu selection |
| # -*- conf -*- | |
| # Initialize alphanumerical registers to avoid the problem with 'delete-buffer' | |
| run "tmux set-buffer -b a \"$(echo ' ')\"" | |
| run "tmux set-buffer -b b \"$(echo ' ')\"" | |
| run "tmux set-buffer -b c \"$(echo ' ')\"" | |
| run "tmux set-buffer -b d \"$(echo ' ')\"" | |
| run "tmux set-buffer -b e \"$(echo ' ')\"" | |
| run "tmux set-buffer -b f \"$(echo ' ')\"" | |
| run "tmux set-buffer -b g \"$(echo ' ')\"" |
| ;; -*- lisp -*- | |
| (ql:quickload :quri) ; For encoding URLs | |
| (in-package :stumpwm) | |
| ;; My preferred key bindings | |
| (define-key *top-map* (kbd "s-d") "lookup-selection") | |
| (define-key *top-map* (kbd "s-g") "google-selection") |