ldd path/bin
objdump -p path/bin | grep NEEDED
readelf -d path/bin | grep NEEDED
https://stackoverflow.com/questions/10052041/how-to-list-library-dependencies-of-a-non-native-binary https://en.wikipedia.org/wiki/Ldd_(Unix)
ldd path/bin
objdump -p path/bin | grep NEEDED
readelf -d path/bin | grep NEEDED
https://stackoverflow.com/questions/10052041/how-to-list-library-dependencies-of-a-non-native-binary https://en.wikipedia.org/wiki/Ldd_(Unix)
+++ date = "2015-01-08T08:36:54-07:00" draft = false title = "How Goroutines Work" +++
###Introduction to Go
| const copyToClipboard = str => { | |
| const el = document.createElement('textarea'); // Create a <textarea> element | |
| el.value = str; // Set its value to the string that you want copied | |
| el.setAttribute('readonly', ''); // Make it readonly to be tamper-proof | |
| el.style.position = 'absolute'; | |
| el.style.left = '-9999px'; // Move outside the screen to make it invisible | |
| document.body.appendChild(el); // Append the <textarea> element to the HTML document | |
| const selected = | |
| document.getSelection().rangeCount > 0 // Check if there is any content selected previously | |
| ? document.getSelection().getRangeAt(0) // Store selection if found |
| (defn- invoke-private-method | |
| [obj fn-name-string & args] | |
| (let [m (first (filter (fn [x] (.. x getName (equals fn-name-string))) | |
| (.. obj getClass getDeclaredMethods)))] | |
| (. m (setAccessible true)) | |
| (. m (invoke obj (into-array Object args))))) | |
| (defn- invoke-static-method | |
| [klass fn-name-string & args] | |
| (let [m (first (filter (fn [x] (.. x getName (equals fn-name-string))) |
| var el = document.querySelector("div[class^=viewport-]"); el.scrollTop = (el.scrollTop + el.clientHeight - 40); |
| (defmacro def-test | |
| [name args & body] | |
| `(defn ~name ~args | |
| (let [[params#] ~args | |
| parsed-args# (parse-args params#) | |
| new-param-data# (merge parsed-args# {:uuid "0efecd84-bba0-4a95-a6dd-a3c3f7071057"}) | |
| new-params# (merge params# {:as new-param-data#}) | |
| ] | |
| (str ~name ", " ~args ", parsed: " parsed-args# ", new-args: " new-params#) | |
| ))) |
Use script /tmp/output to start recording in a new shell, then type your commands and look in the /tmp/output file, e.g. with an editor or cat -vet. Type exit to the shell to exit the recording.
| Lisp interpreter in 90 lines of C++ | |
| I've enjoyed reading Peter Norvig's recent articles on Lisp. He implements a Scheme interpreter in 90 lines of Python in the first, and develops it further in the second. | |
| Just for fun I wondered if I could write one in C++. My goals would be | |
| 1. A Lisp interpreter that would complete Peter's Lis.py test cases correctly... | |
| 2. ...in no more than 90 lines of C++. | |
| Although I've been thinking about this for a few weeks, as I write this I have not written a line of the code. I'm pretty sure I will achieve 1, and 2 will be... a piece of cake! |
| #!/usr/bin/env emacs --script | |
| ;; https://www.lunaryorn.com/posts/emacs-script-pitfalls | |
| (message "Hello world") | |
| (message "%S" (/ 30 4)) |
| // inplace merge sort | |
| // http://thomas.baudel.name/Visualisation/VisuTri/inplacestablesort.html | |
| (function () { | |
| "use strict"; | |
| var floor = Math.floor; | |
| function lower(a, from, to, value, compare) { | |
| while (to > from) { | |
| var middle = from + floor((to - from) / 2); |