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
# Macro Recording # | |
qx # start recording to register x | |
:%s/OldString/NewString/g | |
:wnext | |
q # stop recording | |
@x # playback to see if it works correctly | |
999@x # repeat 999 times to complete the job | |
# Copy Visual Block to OS Clipboard # | |
"*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
(defmacro aget2l [a i j] | |
`(aget ^"[J" (aget ~a ~i) ~j)) | |
(defmacro aset2l [a i j v] | |
`(aset-long ^"[J" (aget ~a ~i) ~j ~v)) | |
(defn distance [^String w1 ^String w2] | |
(let [c1 (.length w1) c2 (.length w2) | |
matrix ^"[[J" (make-array Long/TYPE (unchecked-inc-int c1) (unchecked-inc-int c2))] | |
(dotimes [n (unchecked-inc-int c1)] (aset2l matrix n 0 n)) |
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
!! # will expand to last command in history | |
!<n> # will expand to history command number 'n' (could be negative meaning most recent n) | |
!<word> # last comand in history starting with 'ssh' | |
!-1 # will expand to last command in history | |
^word^new # replace 'word' by 'new' in the last command in history | |
!!:s/word/new # same as above | |
!!:gs/word/new # global substitution | |
!:<n> # will expand to 'n'th word in the last command | |
!:^ and !:$ # will expand to first and last arguments |
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 demo.sample | |
(:require [clojure.core.async :as async]) | |
(:import (java.net InetAddress DatagramPacket DatagramSocket MulticastSocket NetworkInterface InetSocketAddress))) | |
(defonce udp-server (atom nil)) | |
(defonce udp-client (atom nil)) | |
(def port 5555) | |
(comment defn server-host [] (InetAddress/getLocalHost)) |