(rdb:1) value.getutc.iso8601(3)
ArgumentError Exception: wrong number of arguments (1 for 0)
(rdb:1) value
Sun, 18 Nov 2007 03:56:07 EST -05:00
(rdb:1) value.class.ancestors
[ActiveSupport::TimeWithZone, Comparable, Object, Metaclass::ObjectMethods, Mocha::ObjectMethods, PP::ObjectMixin, MiniTest::Expectations, FactoryGirl::Syntax::Vintage, Rake::DeprecatedObjectDSL, JSON::Ext::Generator::GeneratorMethods::Object, ActiveSupport::Dependencies::Loadable, Base64::Deprecated, Base64, Kernel]
(rdb:1) value.class
ActiveSupport::TimeWithZone
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
module Geokit::ActsAsMappable::ClassMethods | |
# Distance is selected as an aliased expression, and we want to be able to | |
# use the alias in our order clause. SQL Server has no problem with that | |
# normally, but when the adapter rewrites the query in order to support | |
# pagination, it tries to use the alias. Unfortunately, the alias is invalid | |
# in the rewritten query; we need to use the expression. | |
# | |
# https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/198 | |
# | |
# This extension overrides the order method on the relation to inline |
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
(defn debounce [c ms] | |
(let [c' (chan)] | |
(go | |
(loop [t nil] | |
(let [loc (<! c) | |
now (js/Date.)] | |
(if (or | |
(nil? t) | |
(>= (- now t) ms)) | |
(do |
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 dball.util.async | |
(:require [clojure.core.async :refer [go-loop >! <! timeout close! chan dropping-buffer >!! alts!]] | |
[clojure.tools.logging :as log]) | |
(:import [java.util.concurrent Executors ScheduledExecutorService TimeUnit])) | |
(defn ^ScheduledExecutorService scheduler | |
[] | |
(Executors/newSingleThreadScheduledExecutor)) | |
(defn ticker-chan |
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 transduction | |
(:require [clojure.core.async :as async])) | |
(defn panicky | |
[pipeline-fn n to xf from] | |
(let [errors (atom #{}) | |
ex-handler (fn [ex] | |
(async/close! from) | |
(swap! errors conj ex)) | |
rf (remove (fn [_] (seq @errors))) |
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
module Minesweeper | |
-- row, col | |
Point : Type | |
Point = (Nat, Nat) | |
-- rows, cols, mines (should be a set; should be constrained to rows/columns) | |
Board : Type | |
Board = (Nat, Nat, List Point) |
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
module Minesweeper | |
import Data.Fin | |
import Data.Vect | |
data Board : Type where | |
MkBoard : (rows : Nat) -> | |
(cols : Nat) -> | |
(mines : List (Fin rows, Fin cols)) -> | |
Board |
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
type Point a = (a, a) | |
type PointFn a = ((a -> a), (a -> a)) | |
data Board a = Board { boardMin :: Point a, | |
boardMax :: Point a } | |
deriving (Show) | |
makeBoard :: (Enum a, Ord a) => Point Int -> Board a | |
makeBoard (x, y) = Board (z, z) (toEnum x, toEnum y) | |
where z = toEnum 0 |
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
TypeResolver | |
(resolve-types [_])) | |
(extend-protocol TypeResolver | |
clojure.lang.Keyword | |
(resolve-types [type] | |
(when-let [spec (spark.spec-tacular/get-spec type)] | |
(resolve-types spec))) | |
clojure.lang.Var | |
(resolve-types [var] |
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
(deftxnfn increase-book-quality | |
[db eid attr quality] | |
(do | |
(assert (= :book/quality attr)) | |
(if (q '[:find ?eid . | |
:in $ ?ords ?eid ?quality' | |
:where | |
[?eid :book/quality ?quality-eid] | |
[?quality-eid :db/ident ?quality] | |
[(get ?ords ?quality' -1) ?ord'] |