This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[me.raynes.fs :as fs]) | |
(require '[me.raynes.fs.compression :refer [unzip]] | |
(defn download-datomic [version username password] | |
(let [credential (str username ":" password)] | |
(when-not (fs/file? "datomic.zip") | |
(fs/exec "cmd" "/C" (str "curl -L -u " credential " " download-url " > datomic.zip")))) | |
(unzip "datomic.zip" ".") | |
(fs/delete (fs/file "datomic.zip")) | |
(fs/exec "cmd" "/C" (str "move datomic-pro-* datomic"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns formulas.constants "Collection of physical constants and their formulas composed of physical quantities." | |
(:require [clojure.math.numeric-tower :as math])) | |
(def pi | |
{:value 3.14159265359 | |
:formulas | |
{[:frequency :angular-frequency] (fn [& {:keys [frequency angular-frequency]}] | |
(/ angular-frequency | |
(* 2 frequency)))}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def tf | |
(comp | |
(partial mapv | |
#(if (coll? %) | |
(seq %) | |
%)) | |
(fn [[fs & rs]] | |
(cons (inc fs) rs)))) | |
;; 1654 ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pixel_class' | |
class Display | |
attr_accessor :position, :pixels, :dimensions, :shape | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pixel | |
attr_accessor :position, :color, :brightness, :shape, :states | |
def self.update_pixels | |
timestamp = Time.now | |
end | |
def initialize initial_position=Position.new (0,0,0), initial_color=Color.new 'black',+ | |
initial_brightness=Brightness.new 0.upto 1000 |