I hereby claim:
- I am rex-sheridan on github.
- I am rexsheridan (https://keybase.io/rexsheridan) on keybase.
- I have a public key ASC25B1r94YIE9PLzTA9ptSDqKuEad1mDpBgNZUsfi3ArAo
To claim this, I am signing this object:
(ns ycombinator) | |
;; Based on https://blog.klipse.tech/lambda/2016/08/07/pure-y-combinator-clojure.html | |
(defn factorial [n] | |
(if (zero? n) | |
1 | |
(* n (factorial (dec n))))) | |
(defn factorial-gen [func] |
-- Find foreign keys referencing a table: postgres | |
-- From https://bowerstudios.com/node/1052 | |
SELECT tc.table_schema, tc.constraint_name, tc.table_name, kcu.column_name, ccu.table_name | |
AS foreign_table_name, ccu.column_name AS foreign_column_name | |
FROM information_schema.table_constraints tc | |
JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name | |
JOIN information_schema.constraint_column_usage ccu ON ccu.constraint_name = tc.constraint_name | |
WHERE constraint_type = 'FOREIGN KEY' | |
AND ccu.table_name='myTableName'; |
I hereby claim:
To claim this, I am signing this object:
SELECT *, pg_size_pretty(total_bytes) AS total | |
, pg_size_pretty(index_bytes) AS INDEX | |
, pg_size_pretty(toast_bytes) AS toast | |
, pg_size_pretty(table_bytes) AS TABLE | |
FROM ( | |
SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM ( | |
SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME | |
, c.reltuples AS row_estimate | |
, pg_total_relation_size(c.oid) AS total_bytes | |
, pg_indexes_size(c.oid) AS index_bytes |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.Executor; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
public abstract class DeferredCompletableFuture<T> | |
implements Function<Executor, CompletableFuture<T>>, Supplier<CompletableFuture<T>> { | |
private static class SupplierDeferredCompletableFuture<T> extends DeferredCompletableFuture<T> { | |
Supplier<T> supplier; |