Skip to content

Instantly share code, notes, and snippets.

View erikkaplun's full-sized avatar

Erik Kaplun erikkaplun

  • UXO
  • Tallinn, Estonia
View GitHub Profile
erik@iota terminusdb % ./terminusdb
ERROR: /usr/local/Cellar/swi-prolog/8.4.2/libexec/lib/swipl/library/process.pl:57: Initialization goal raised exception:
ERROR: dlopen(/tmp/swipl_31561_1, 1): no suitable image found. Did find:
/tmp/swipl_31561_1: malformed mach-o image: missing LC_DYSYMTAB
/tmp/swipl_31561_1: stat() failed with errno=25
ERROR: In:
ERROR: [18] throw(error(shared_object(open,'dlopen(/tmp/swipl_31561_1, 1): no suitable image found. Did find:\n\t/tmp/swipl_31561_1: malformed mach-o image: missing LC_DYSYMTAB\n\t/tmp/swipl_31561_1: stat() failed with errno=25'),context(...,_12812)))
ERROR: [16] <meta call>
ERROR: [15] with_mutex('$foreign',load_foreign_library(foreign(process),process,default(install))) <foreign>
ERROR: [12] '$run_init_goal'(shlib:load_foreign_library(...)) at /usr/local/Cellar/swi-prolog/8.4.2/libexec/lib/swipl/boot/init.pl:811
(defn convert-stream [f-sink f-src s]
(let [sink (s/stream)
src (s/map f-src s)]
(s/connect-via sink #(s/put! s (f-sink %)) s)
(s/splice sink src)))
(defn make-duplex-stream []
(let [sink (s/stream)
src (s/stream)
duplex (s/splice sink src)]
import Char (isAlpha)
import List (intercalate)
type Name = [NameChar]
type NameChar = Char
nameChar2char :: Char -> NameChar
nameChar2char c | isAlpha c = c
name2str :: Name -> String
/*
Source code is in UTF-8 encoding. The following symbols may appear, among others:
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς σ τ υ φ χ ψ ω « • ¦ » ∀ ∃ ∷ … → ← fi fl ƒ
If you can't read this, you're out of luck. This code was generated with the frege compiler version 3.24.100
from /Users/erik/code/frege/frege-clj-mix/src/frege/frege_clj_mix/Fibonacci.fr Do not edit this file!
Instead, edit the source file and recompile.
*/
import frege.run7.Func;
import frege.run7.Lazy;
(ns shadow.build.targets.chrome-extension
(:require
[clojure.java.io :as io]
[clojure.data.json :as json]
[clojure.string :as str]
[clojure.pprint :refer (pprint)]
[shadow.build :as b]
[shadow.build.targets.browser :as browser]
[shadow.build.targets.shared :as shared]
[shadow.cljs.repl :as repl]
user=> (defn foo [n]
(with-local-vars [x 0]
(dotimes [i n]
(var-set x (inc @x)))))
#'user/foo
user=> (time (foo 5000000))
"Elapsed time: 514.042912 msecs"
user=> (time (foo 5000000))
"Elapsed time: 438.661454 msecs"
ERROR: Unhandled REPL handler exception processing message {:op classpath, :session 17b1873d-6e54-4a77-96a2-e9a30ee136e1, :id 6}
Syntax error macroexpanding at (namespace.clj:29:8).
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3707)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3701)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3701)
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:457)
at clojure.lang.Compiler.eval(Compiler.java:7182)
at clojure.lang.Compiler.load(Compiler.java:7636)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
plugins {
id 'dev.clojurephant.clojure' version '0.5.0-alpha.5'
id 'application'
id 'com.github.johnrengelman.shadow' version '5.0.0'
id 'maven-publish'
}
group = 'myname'
version = '0.1.0-SNAPSHOT'
ZoneId zoneId = null;
try { zoneId = ZoneId.of("Europe/Tallinn"); }
catch(Exception e) {
// what the handler should do when the
// provided URL path contains an invalid zone name
}
// take the current time in the current timezone
LocalDateTime localDateTime = LocalDateTime.now();
// "map" it to
ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, zoneId);
{
"coord": {"lon":-73.99, "lat":40.73},
"weather": [
{"id":501, "main":"Rain", "description":"moderate rain", "icon":"10n"}
],
"base":"stations",
"main": {"temp":288.02, "pressure":1022, "humidity":76, "temp_min":285.95, "temp_max":289.85},
"visibility":11265,
"wind": {"speed":3.85, "deg":47.0027},
"rain": {"1h":0.66},