This file contains 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 spec-test.virtual-time | |
(:require [clojure.spec :as s] | |
[clojure.spec.test :as st] | |
[clojure.spec.gen :as sgen])) | |
(deftype VirtualTime [time] | |
Object | |
(hashCode [_] | |
(hash time)) | |
(equals [this that] |
This file contains 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 spec-test.virtual-time | |
(:require [clojure.spec :as s] | |
[clojure.spec.test :as st])) | |
(s/def ::virtual-time | |
(s/or | |
:positive-infinity #{:positive-infinity} | |
:negative-infinity #{:negative-infinity} | |
:number number?)) | |
(s/fdef vt-lt |
This file contains 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 clj-spec-playground | |
(:require [clojure.string :as str] | |
[clojure.spec :as s] | |
[clojure.test.check.generators :as gen])) | |
;;; examples of clojure.spec being used like a gradual/dependently typed system. | |
(defn make-user | |
"Create a map of inputs after splitting name." | |
([name email] |
This file contains 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
#include <algorithm> | |
#include <vector> | |
#include <iterator> | |
#include <iostream> | |
template< class F, class X, class S > | |
constexpr X foldl( F&& f, X x, const S& s ) { | |
return std::accumulate ( | |
std::begin(s), std::end(s), |
This file contains 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
/* | |
Copyright 2016 Brian C. Beckman | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains 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
module Drone.Control.Ukf | |
open System | |
open Drone.Control.Matrix | |
type IDiscreteModel = | |
abstract Process : Matrix -> Matrix | |
abstract Observe : Matrix -> Matrix | |
abstract InitialState : Matrix |
This file contains 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
subroutine f(mu, Sigma, H, INFO, R, Sigmavar_2, data, muvar_2, k, n) | |
implicit none | |
integer, intent(in) :: k | |
integer, intent(in) :: n | |
real*8, intent(in) :: Sigma(n, n) ! Sigma | |
real*8, intent(in) :: H(k, n) ! H | |
real*8, intent(in) :: mu(n) ! mu | |
real*8, intent(in) :: R(k, k) ! R, H*Sigma*H' + R | |
real*8, intent(in) :: data(k) ! (H*Sigma*H' + R)^-1*((-1)*data + H*mu), data, (-1)* data + H*mu |
This file contains 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
ClearAll[myNotebook, myStyles, myDemoIntegral, myDemoSolution, | |
myMathGroup, myItemGroup, myNumberedGroup, myCode, myProgramText, | |
myMeatyContentGroup, mySectionGroup, myDocumentGroup, | |
myFontFunction, myDefaultStyles, myNonDefaultStyles]; | |
myNotebook[myStyles_, myDocumentGroup_] := | |
Module[{result}, | |
CreateDocument[ | |
result = Notebook[ | |
{Cell[myDocumentGroup]}, | |
StyleDefinitions -> Notebook[ |
This file contains 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
Module[{myNotebook, myCells, myStyles, myDemoIntegral, myDemoSolution, | |
myMathGroup, myItemGroup, myNumberedGroup, myCode, myProgramText, | |
myMeatyContentGroup, mySectionGroup, myDocumentGroup, | |
myFontFunction, myDefaultStyles, myNonDefaultStyles}, | |
myDemoIntegral = RowBox[{ | |
RowBox[{"\[Integral]", | |
RowBox[{"x", RowBox[{"\[DifferentialD]", "x"}]}]}], | |
"+", SqrtBox["z"]}]; | |
myDemoSolution = RowBox[{ | |
FractionBox[SuperscriptBox["x", "2"], "2"], |