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]) |
| ; | |
| ; Copyright © 2023 Peter Monks | |
| ; | |
| ; This Source Code Form is subject to the terms of the Mozilla Public | |
| ; License, v. 2.0. If a copy of the MPL was not distributed with this | |
| ; file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
| ; | |
| ; SPDX-License-Identifier: MPL-2.0 | |
| ; |
| {-# 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!