Skip to content

Instantly share code, notes, and snippets.

View Nectarineimp's full-sized avatar

Peter Mancini Nectarineimp

  • BTCSunrise
  • Tennessee, USA
  • 21:49 (UTC -05:00)
View GitHub Profile
@Nectarineimp
Nectarineimp / baghdad.dot
Created March 25, 2026 20:26
Baghdad Battery from Basic Principles
digraph BaghdadBatteryDependencies {
rankdir=TB;
node [shape=box, style=rounded];
subgraph cluster_L0 {
label="Level 0 – Physical Laws (Not Known, but True)";
style=dashed;
L0_1 [label="L0.1: Different metals have different\nintrinsic electrode potentials"];
L0_2 [label="L0.2: Acids enable redox reactions\nbetween metals and ions"];
L0_3 [label="L0.3: Charge separation creates an\nelectric potential difference"];
@Nectarineimp
Nectarineimp / 2048ml.clj
Created April 21, 2014 20:16
2048 Machine Learning Mucking About
;; 2048 machine learning analysis
;; Order, Free Space, Weight Distribution
;; Scoring Analysis, Nabla ∇ Divergence
;; initial board state - choose wisest direction for move (up down left right)
;; 2 0 2 4 0 pairs (actually a scoring pair is in there once the space is crossed.)
;; 2 2 4 0 1 pair
;; 4 4 0 0 1 scoring pair, 1 blank pair
;; 4 0 8 0 1 blank pair
@Nectarineimp
Nectarineimp / trig.clj
Created April 16, 2013 22:02
experiments in trigonometry in Clojure
(defn get-slope [[x1 y1] [x2 y2]]
(/ (- x2 x1) (- y2 y1)))
(get-slope [500 400][290 600])
(defn angle-offset [slope]
(java.lang.Math/atan slope))
(angle-offset (get-slope [500 400][300 490]))
@Nectarineimp
Nectarineimp / main.java
Created November 15, 2012 18:38
exploring coreferences from Stanford CoreNLP
Map<Integer, CorefChain> graph = document.get(CorefChainAnnotation.class);
for (Map.Entry<Integer, CorefChain> entry : graph.entrySet()) {
CorefChain c = entry.getValue();
System.out.println("\nClusterID: " + entry.getKey());
CorefMention cm = c.getRepresentativeMention();
if (cm != null) {
System.out.println("Representative Mention: " + cm.mentionSpan + " @" + cm.position.elems()[0] + " H:" + cm.position.elems()[1] + " [ " + cm.startIndex + ", " + cm.endIndex + "]");
List<CorefMention> cms = c.getCorefMentions();
System.out.print("Mentions:\n");
for (CorefMention mention : cms) {