Skip to content

Instantly share code, notes, and snippets.

View mfikes's full-sized avatar

Mike Fikes mfikes

View GitHub Profile
$ bin/dev
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
nREPL server started on port 51399 on host 127.0.0.1 - nrepl://127.0.0.1:51399
* Initializing CLJS compiler & source server on port 8083
Starting watch on Resources/vee-out
Reflection warning, clojure/data/priority_map.clj:215:19 - call to method equiv on java.lang.Object can't be resolved (no such method).
Reflection warning, clojure/core/memoize.clj:72:23 - reference to field cache can't be resolved.
Starting file watcher (CTRL-C to quit)...
@mfikes
mfikes / ios-sim.txt
Created May 2, 2015 19:43
ios-sim with logging
This file has been truncated, but you can view the full file.
Last login: Sat May 2 15:39:25 on ttys005
orion:~ mfikes$ cd Projects/veestarter/
orion:veestarter mfikes$ ls
README.md bin checkouts src
Resources build.boot modules tiapp.xml
orion:veestarter mfikes$ bin/ios-sim
Titanium Command-Line Interface, CLI version 3.4.2, Titanium SDK version 3.5.1.GA
Copyright (c) 2012-2015, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
@mfikes
mfikes / dev.txt
Created May 2, 2015 19:44
dev output with logging
Last login: Sat May 2 15:38:29 on ttys005
orion:~ mfikes$ cd Projects/veestarter/
orion:veestarter mfikes$ bin/clean
Deleting Resources/vee-out
Deleting build
Cleaned generated resources
orion:veestarter mfikes$ bin/dev
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Retrieving vee-0.0.17.jar from https://clojars.org/repo/
nREPL server started on port 55104 on host 127.0.0.1 - nrepl://127.0.0.1:55104
@mfikes
mfikes / fipp.txt
Created May 3, 2015 20:26
fipp in Ambly
$ rlwrap lein run
Retrieving fipp/fipp/0.6.0/fipp-0.6.0.pom from clojars
Retrieving org/clojure/data.finger-tree/0.0.2/data.finger-tree-0.0.2.pom from central
Retrieving org/clojure/core.rrb-vector/0.0.11/core.rrb-vector-0.0.11.pom from central
Retrieving org/clojure/data.finger-tree/0.0.2/data.finger-tree-0.0.2.jar from central
Retrieving org/clojure/core.rrb-vector/0.0.11/core.rrb-vector-0.0.11.jar from central
Retrieving fipp/fipp/0.6.0/fipp-0.6.0.jar from clojars
[1] Ambly Demo on iPhone Simulator (orion-fikesfarm-com)
@mfikes
mfikes / fipbeta2.txt
Created May 3, 2015 20:32
fipp load with beta 2
$ rlwrap lein run
[1] Ambly Demo on iPhone Simulator (orion-fikesfarm-com)
[R] Refresh
Choice: 1
Connecting to Ambly Demo on iPhone Simulator (orion-fikesfarm-com) ...
cljs.user=> (require 'fipp.edn :reload)
WARNING: eduction already refers to: cljs.core/eduction being replaced by: fipp.engine/eduction at line 228 file:/Users/mfikes/.m2/repository/fipp/fipp/0.6.0/fipp-0.6.0.jar!/fipp/engine.cljc
WARNING: eduction already refers to: cljs.core/eduction being replaced by: fipp.engine/eduction at line 228 /Volumes/Ambly-5CDB1D7C/fipp/engine.cljc
nil
cljs.user=>

tl;dr Below, both cases involved fighting with either garbage collector, or wanting greater control over paging:

Project 1:

With the ESPER correlation engine, you can feed a sequence of Map implementations to it, but it can hold on to them for arbitrary long periods of time (depending on what ESPER statements you have configured). Without care, you can easily exhaust heap. And the access pattern usually is: Look at an object once, hold onto it for a long time (days), and then look at it again later and let go of it, with object access usually having "stream" locality of reference from one to the next.

Approach was to write "guts" of Map to mem-mapped file, but hand flyweight Map to ESPER, and let the operating system essentially move stuff from disk to RAM as it is touched. To make things efficient, data encoded essentially in a column-oriented structure. Used weak references to know when a given page file is no longer in use and can be deleted.

Project 2:

@mfikes
mfikes / closure.txt
Created May 8, 2015 12:55
Problem with latest closure
$ lein cljsbuild once dev
Compiling ClojureScript.
Compiling "out/main.js" from ["src"]...
Compiling "out/main.js" failed.
clojure.lang.ExceptionInfo: failed compiling file:src/shrimp/core.cljs {:file #object[java.io.File 0x1352434e "src/shrimp/core.cljs"]}
at clojure.core$ex_info.invoke(core.clj:4591)
at cljs.compiler$compile_file$fn__2498.invoke(compiler.clj:1142)
at cljs.compiler$compile_file.invoke(compiler.clj:1105)
at cljs.compiler$compile_root.invoke(compiler.clj:1177)
at cljs.closure$compile_dir.invoke(closure.clj:378)
@mfikes
mfikes / closure.txt
Created May 8, 2015 13:07
closure with cljsbuild shrimp
orion:tmp mfikes$ git clone https://github.com/mfikes/shrimp
Cloning into 'shrimp'...
remote: Counting objects: 646, done.
remote: Total 646 (delta 0), reused 0 (delta 0), pack-reused 646
Receiving objects: 100% (646/646), 464.00 KiB | 0 bytes/s, done.
Resolving deltas: 100% (301/301), done.
Checking connectivity... done.
orion:tmp mfikes$ cd shrimp/ClojureScript/
orion:ClojureScript mfikes$ lein cljsbuild once dev
Compiling ClojureScript.
@mfikes
mfikes / interfere.md
Created May 9, 2015 20:48
Dynamic var interference
(do

  ;; Repeatedly display all the colors

  (go-loop []
    (clear)
    (doseq [[c n] (map vector
                    [:black :red :dark-blue :purple
                     :dark-green :dark-gray :medium-blue :light-blue