Skip to content

Instantly share code, notes, and snippets.

View d4hines's full-sized avatar

Daniel Hines d4hines

View GitHub Profile
@d4hines
d4hines / window-description1.lp
Created November 20, 2019 03:12
Attempt a translation of Dr. Gelfond's system description of windows.
% fluent win(W), where W is a window name, e.g "w".
% fluent position(W, P), where W is a window, and P is a possible position, e.g "p1"
% Note: position is really a total function: every window has one and only one position. position is not injective, i.e windows can occupy the same position.
% add(W, P) causes window(W).
window(W, T + 1) :- occurs(add(W, P), T).
% add(W, P) causes position(W, P).
position(W, T + 1) :- occurs(add(W, P), T).
% remove(W) causes -window(W).
-window(W, T + 1) :- occurs(remove(W), T).
@d4hines
d4hines / Hi.jpg
Created October 22, 2019 16:14 — forked from ryanlucas/Hi.jpg
Image Prototype Demo
Hi.jpg
@d4hines
d4hines / SketchSystems.spec
Created August 14, 2019 19:02
Workspace A is loaded
Workspace A is loaded
user requests to load B-> Switch Requested
Switch Requested
any window responds as NOT_READY -> Workspace A is loaded
all windows respond as READY -> Switch In Progress
Switch In Progress
any window fails to close -> Empty Workspace is loaded
all windows close -> Workspace B is loaded
Empty Workspace is loaded
Workspace B is loaded
@d4hines
d4hines / SketchSystems.spec
Last active June 27, 2019 21:03
Spira Test Workflow
Spira Test Workflow
# This is a custom component I'll make that will display Spira in an IFrame.
Open Spira Test Component
# Detecting this may be tricky. We need a way to start the "loop", but it's totally user driven.
navigate to test set -> Begin Next Test
Begin Next Test
# API calls. Much easier thanks to Glenn's prior art. Need to differentiate between workspaces and other attachments
# Glenn wants us to display previous results of the same test. The API calls aren't trivial (several joins involved)
# however, he's worked it all out in some Python code he linked me.
Check Spira for Workspace Attachment
@d4hines
d4hines / schema.clj
Last active March 30, 2019 19:11
Panel Schema
;; Panel attributes
;; Top, Left, Bottom, and Right
;; Each of these is a ref to an Edge.
{:db/ident :panel/top
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/one}
{:db/ident :panel/left
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/one}
{:db/ident :panel/bottom
@d4hines
d4hines / rectangles.cljs
Created March 5, 2019 12:16
Rectangles defined in DataScript
(ns rectangles.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript.core :as d]))
(def schema
{:rectangle/left {:db/valueType :db.type/ref}
:rectangle/right {:db/valueType :db.type/ref}
:rectangle/top {:db/valueType :db.type/ref}
:rectangle/bottom {:db/valueType :db.type/ref}
@d4hines
d4hines / perfect-squares.cljs
Created March 1, 2019 22:39
Perfect Square Gists
(ns constrained.core
(:require [reagent.core :as reagent]
[goog.dom :as dom]))
(set! *warn-on-infer* true)
(defn collision? [x y w h other-rectangles]
(some
(fn a-collision? [{:keys [left top width height]}]
(and
Focus
Unfocused
focus -> Focused
Focused*
unfocus -> Unfocused
Tabs
Tab1 Selected*
click tab 2 -> Tab1 Selected
click tab 1 -> Tab1 Selected
@d4hines
d4hines / anagram-logic.md
Created August 4, 2018 18:23
Anagram Confusion

function anagrams

  • given an anagram key ak, an initial set of partial angrams pas

    e.g ak = "adeor", pas = #{"a", "are", "dare" ...}

    • For each partial anagram pa in pas,
      • Let key-diff be the multiset difference between pa and ak

        e.g pa = "a", key-diff = "deaor"

@d4hines
d4hines / .spacemacs
Created July 6, 2018 12:47
My Spacemacs config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory