This post uses the excellent Ammonite REPL for Scala REPL.
Thank you, Li Haoyi, for building it!
;; SPDX-License-Identifier: EPL-2.0 OR MIT | |
(ns mobserve | |
(:require | |
[missionary.core :as m]) | |
(:import | |
missionary.Cancelled)) | |
;; Encapsulate differences between Clojure and ClojureScript | |
;; on how IFn and IDeref are implemented. |
; The goal here is to provide a coupling between Electric | |
; and JavaScript event listeners that's more idiomatic on the | |
; JavaScript side: namely, that the event listener can be | |
; attached only once on mount and only needs to be removed on | |
; unmount. | |
; | |
; The strategy is to use e/fn to convert the reactive event | |
; listener fn into a continuous flow of event listener functions, | |
; which we can then sample to get the latest listener function | |
; when an event occurs. |
package zero | |
import izumi.reflect.Tag | |
import Kyo.* | |
import scala.collection.View.FlatMap | |
type Id[T] = T | |
type Const[T] = [U] =>> T | |
type MX[T] = Any |
;; ## General helpers | |
(ns app.helpers.rama | |
(:require | |
[missionary.core :as m] | |
[taoensso.timbre :as timbre]) | |
(:import | |
[com.rpl.rama Depot PState Path ProxyState$Callback RamaModule] | |
[com.rpl.rama.test InProcessCluster LaunchConfig] | |
[hyperfiddle.electric Failure Pending])) |
{:deps {clj-http/clj-http {:mvn/version "3.12.3"} | |
org.jsoup/jsoup {:mvn/version "1.11.3"}}} |
(venv) # Exit:0 2023-03-12 16:59:27 [r2q2@Reformer#[:~/opt/llama.cpp] | |
$(: !605 ) ./main -m ./models/65B/ggml-model-q4_0.bin -t 8 -n 128 | |
main: seed = 1678658429 | |
llama_model_load: loading model from './models/65B/ggml-model-q4_0.bin' - please wait ... | |
llama_model_load: n_vocab = 32000 | |
llama_model_load: n_ctx = 512 | |
llama_model_load: n_embd = 8192 | |
llama_model_load: n_mult = 256 | |
llama_model_load: n_head = 64 | |
llama_model_load: n_layer = 80 |
(ns app.mappy | |
#?(:cljs (:require-macros app.mappy)) | |
(:require #?(:clj [datascript.core :as d]) ; database on server | |
#?(:clj [clojure.data.csv :as csv]) | |
[hyperfiddle.electric :as e] | |
[hyperfiddle.electric-dom2 :as dom] | |
[hyperfiddle.electric-ui4 :as ui] | |
#?(:cljs ["@openlayers-elements/core/ol-map" :as ol-map]) | |
#?(:cljs ["@openlayers-elements/maps/ol-layer-openstreetmap" :as ol-layer-openstreetmap]) | |
#?(:cljs ["@openlayers-elements/core/ol-layer-vector" :as ol-layer-vector]) |
{-# LANGUAGE TypeSynonymInstances #-} | |
data Dual d = D Float d deriving Show | |
type Float' = Float | |
diff :: (Dual Float' -> Dual Float') -> Float -> Float' | |
diff f x = y' | |
where D y y' = f (D x 1) | |
class VectorSpace v where | |
zero :: v |
This post uses the excellent Ammonite REPL for Scala REPL.
Thank you, Li Haoyi, for building it!
;; missionary solution to petrol pump example by Stephen Blackheath and Anthony Jones, ISBN 978-1633430105 | |
;; huanhulan's demo : [live](https://huanhulan.github.io/petrol_pump), [code](https://github.com/huanhulan/petrol_pump) | |
(ns pump | |
(:refer-clojure :exclude [first]) | |
(:require [missionary.core :as m]) | |
(:import missionary.Cancelled)) | |
(defn rising | |
"A transducer that outputs `nil` when the input switches from logical false to logical true." |