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
void setup(){ | |
size(500, 500); | |
translate(250, 250); | |
String lines[] = loadStrings("mandelbrot.csv"); | |
for(String line : lines){ | |
String tmp[] = line.split(","); | |
float x = (float(tmp[0])); | |
float y = (float(tmp[1])); | |
int count = 0; | |
if(!tmp[2].equals("NIL")){ |
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
(defparameter chars (list "ムー" "チャ" "ッソ")) | |
(defun next (w) | |
(cdr (apply #'append (list w (list (nth (random (length chars)) chars)))))) | |
(defun find-mu (w) | |
(if (string/= (apply #'concatenate 'string w) "ムーチャッソ") | |
(progn (princ (nth (1- (length w)) w)) | |
(find-mu (next w))) | |
(princ (nth (1- (length w)) w)))) |
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
public class Quaternion implements Comparable<Quaternion>{ | |
private final double re, i, j, k; | |
public static final Quaternion ZERO = new Quaternion(0, 0, 0, 0); | |
public static final Quaternion ONE = new Quaternion(1, 0, 0, 0); | |
public static final Quaternion I = new Quaternion(0, 1, 0, 0); | |
private Quaternion(double re, double i, double j, double k){ | |
this.re = re; | |
this.i = i; | |
this.j = j; |
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
public class ConcurrencyTest { | |
public static void main(String[] args) { | |
System.out.println("available processors "+ Runtime.getRuntime().availableProcessors()); | |
int[] a = new int[8000000]; | |
for(int i = 0 ; i < 800000 ; i++){ | |
a[i] = (int) (10000 * Math.random()); | |
} | |
PrefixScan s = new PrefixScan(a); |
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
(ql:quickload "cl-glut") | |
(defparameter *width* 500) | |
(defparameter *height* 500) | |
(defparameter *magnification* 100.0) | |
(defun get-latice-points (width height reduction) | |
(apply #'append (loop for x from (* -1 (/ width 2)) below (1+ (/ width 2)) | |
collect (loop for y from (* -1 (/ height 2)) below (1+ (/ height 2)) | |
collect (complex (/ x reduction) (/ y reduction)))))) |
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
(defparameter *inf* (* most-positive-fixnum #c(1 1))) | |
(defclass matrix () | |
((a :accessor mat-a :initform 1 :initarg :a) | |
(b :accessor mat-b :initform 0 :initarg :b) | |
(c :accessor mat-c :initform 0 :initarg :c) | |
(d :accessor mat-d :initform 1 :initarg :d))) | |
(defgeneric mat* (a b)) | |
(defgeneric inverse (m)) |
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
(ql:quickload '(:usocket :osc :cl-glut :cl-glu :bordeaux-threads)) | |
(defparameter *port* 9000) | |
(defun create-server (port) | |
(usocket:socket-connect nil nil | |
:protocol :datagram | |
:element-type '(unsigned-byte 8) | |
:local-host "127.0.0.1" | |
:local-port port)) |
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
(module | |
(func $double-loop (param $width i32) (param $height i32) (result i32) | |
(local $x i32) | |
(local $y i32) | |
(local $sum i32) | |
(loop $x-loop | |
(set_local $y (i32.const 0)) | |
(loop $y-loop | |
(set_local $sum (i32.add (get_local $sum) (i32.const 1))) | |
(set_local $y (i32.add (get_local $y) (i32.const 1))) |
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
173 192 189 184 183 180 165 164 169 175 174 172 168 165 164 162 | |
188 205 203 200 198 180 95 125 155 146 189 185 183 181 178 173 | |
201 210 206 202 201 136 130 70 130 143 189 190 187 185 183 177 | |
219 216 210 207 205 169 135 107 132 174 196 195 192 188 185 178 | |
223 218 213 207 108 167 195 135 191 179 147 197 195 191 189 183 | |
212 220 216 208 140 131 207 141 206 162 89 190 199 195 192 186 | |
205 221 220 185 166 118 148 97 148 140 163 160 200 198 195 190 | |
202 221 216 146 201 167 185 154 155 172 172 148 202 198 194 187 | |
202 218 187 178 197 152 205 172 188 197 191 115 205 202 199 194 | |
202 221 160 215 142 92 134 193 27 51 206 121 195 202 201 190 |
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
(use srfi-1) | |
(define (bit-or list1 list2) | |
(map (lambda (x y) | |
(if (or (= 1 x) (= 1 y)) | |
1 0)) | |
list1 list2)) | |
(define (bit-and list1 list2) | |
(map (lambda (x y) |
OlderNewer