Skip to content

Instantly share code, notes, and snippets.

View zugnush's full-sized avatar

Neil McCallum zugnush

View GitHub Profile
try:
cur.execute('select * from blah')
except cx_Oracle.DatabaseError as e:
error, = e.args
print(error.code)
print(error.message)
print(error.context)
import pdb ; pdb.set_trace()
@zugnush
zugnush / refs.clj
Created May 4, 2023 19:48
updated ref example
(import [java.util.concurrent Executors])
(defn test-stm [nitems nthreads niters]
(let [refs (map ref (replicate nitems 0))
pool (. Executors (newFixedThreadPool nthreads))
tasks (map (fn [t]
(fn []
(dotimes [n niters]
(sync nil
(doseq [r refs]