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 "dir.h" | |
#include <arrayfire.h> | |
std::vector<std::string> get_tiff_files(std::string dir) { | |
std::regex re ("*\\.tiff?"); | |
return Dir::re_filter(Dir::get_files_in_dir(dir), re); | |
} |
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
#define macros | |
EXE = executable.exe | |
SRC = src | |
BIN = bin | |
INT = obj | |
INCL = include | |
OCV_INC = "$(OPENCV_DIR)\..\..\include" | |
OCV_LIB = "$(OPENCV_DIR)\lib\opencv_world310.lib" |
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
| |
# Change the definition of CCL_DEFAULT_DIRECTORY below to refer to | |
# your Clozure CL installation directory. The lisp will use this | |
# environment variable to set up translations for the CCL: logical | |
# host. | |
# Any definition of CCL_DEFAULT_DIRECTORY already present in the | |
# environment takes precedence over definition made below. | |
if( ! $CCL_Default_Directory ) { |
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
(defun fizzbuzz (n) | |
(fizzbuzz-helper 1 n )) | |
(defun fizzbuzz-helper (n x) | |
(case (mod n 15) | |
(0 (princ "FizzBuzz")) | |
((3 6 9 12) (princ "Fizz")) | |
((5 10) (princ "Buzz")) | |
(otherwise (princ n))) | |
(fresh-line) |
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
(defun normal-random (mean std-dev) | |
"Normal random numbers, with the given mean & standard deviation." | |
(do* ((rand-u (* 2 (- 0.5 (random 1.0))) (* 2 (- 0.5 (random 1.0)))) | |
(rand-v (* 2 (- 0.5 (random 1.0))) (* 2 (- 0.5 (random 1.0)))) | |
(rand-s (+ (* rand-u rand-u) (* rand-v rand-v)) | |
(+ (* rand-u rand-u) (* rand-v rand-v)))) | |
((not (or (= 0 rand-s) (>= rand-s 1))) | |
(+ mean | |
(* std-dev | |
(* rand-u (sqrt (/ (* -2.0 (log rand-s)) rand-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
all 3 plots should be the same, they are not! | |
https://postimg.org/image/vdcnsnafb/ |
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
clang-linux.compile.c++.without-pth /home/justin/opensource/clasp/build/clasp/Contents/Resources/cxx/clasp/src/main/clang-linux-linux/release/gc-boehm/program-clasp/sharpEqualWrapper.o | |
clang version 3.9.0 (http://llvm.org/git/clang.git 15e8341db0a87789998fd828bf09c96a7821e917) (http://llvm.org/git/llvm.git 7a3e4d658c5d54e48cc6a793ee9e497ae7afc6f5) | |
Target: x86_64-unknown-linux-gnu | |
Thread model: posix | |
InstalledDir: /home/justin/opensource/externals-clasp/build/release/bin | |
Found candidate GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1 | |
Found candidate GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/6.1.1 | |
Selected GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/6.1.1 | |
Candidate multilib: .;@m64 | |
Selected multilib: .;@m64 |
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
;; This function is the only one that needs to be defined, | |
;; everything else can be defined in terms of this one function. | |
;; YAY LOGIC! | |
;; | |
;; This assumes only *simple* semvers containing only *numbers* | |
;; so something like "1.3.9-beta" it will barf on... | |
;; maybe something for an extension later? | |
;; | |
;; run it like this: | |
;; `(semver<= "1.2.3" "1.2.3")` |
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
;; here is a funky little function to parse a string representing a | |
;; number with any base (radix) from 2 upto 36 (0-9+a-z) | |
;; | |
;; it can even do floats in alternate bases!! | |
;; so "0.1" in binary = "0.5" in decimal! :-D | |
;; (2e(-1) = 1/2 = 0.5) | |
;; one note: you *need* split-sequence to use this function, | |
;; everything else is vanilla common lisp | |
(defun parse-number (str &optional (radix 10)) |
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
(defun struct-slots (struct) | |
"Quick & dirty hack to get the slot names of a given struct" | |
(let ((data (cdr (read-from-string (string-left-trim "#S" (format nil "~S" struct)))))) | |
(labels ((pull-slot (s k) | |
(if s | |
(pull-slot (cddr s) (cons (car s) k)) | |
k))) | |
(pull-slot data nil)))) | |
;; it's not the prettiest/most efficient code, but it works! |