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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Apr 30 13:17:31 2019 | |
@author: Bormann, Lewin; Jürgens, Kira; Leung, Emily | |
""" | |
import random |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Sat May 4 11:36:15 2019 | |
Results for: | |
He - 1.015 MPa (+/- 0.99%) | |
CO2 - 191.754 kPa (+/- 1%) | |
N2 - 1.002 MPa (+/- 0.99%) |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Spinner movement equations solved numerically | |
@author: lbo | |
""" | |
import matplotlib.pyplot as plt |
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
#[macro_use] | |
extern crate time_test; | |
use std::cmp::PartialOrd; | |
fn left(i: usize) -> usize { | |
2 * i + 1 | |
} | |
fn right(i: usize) -> usize { | |
2 * i + 2 |
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 <assert.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
struct coach; | |
struct coach { | |
struct coach* prev; | |
struct coach* next; |
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
;; Calculate intensity of polarized light | |
(defun norm (v) (sqrt (reduce (lambda (a e) (+ a (expt e 2))) v :initial-value 0))) | |
(defun make-ray (x y) (vector x y)) | |
(defun deg-to-rad (deg) (* PI (/ deg 180))) | |
(defun random-normed-ray (&optional (max 100)) | |
(flet ((random-component () (/ (1+ (random (1- max))) max))) |
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
;; Calculate 3-body problem (later: generalize to n-body) | |
;; General helpers | |
(defun unique-pairs (up-to) | |
"Generate all unique combinations of numbers from 0 to up-to - 1 without (n,n) pairs. I.e., (1,2), (1, 3), ..., (2, 3), (2, 4), ..." | |
(let ((result '())) | |
(loop for i from 0 to (1- up-to) do | |
(loop for j from (1+ i) to (1- up-to) do | |
(push (list i j) result))) |
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
[Unit] | |
Wants=network.service nginx.service | |
[Install] | |
Alias=hgweb | |
WantedBy=multi-user.target | |
[Service] | |
User=lbo | |
Type=exec | |
ExecStart=/home/lbo/hg/.config/hgweb.fcgi |
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
TokenStream [Ident { ident: "test_function_onearg", span: #0 bytes(437..457) }, Group { delimiter: Parenthesis, stream: TokenStream [Literal { kind: Integer, symbol: "32", suffix: None, span: #0 bytes(458..460) }], span: #0 bytes(457..461) }] | |
thread 'rustc' panicked at 'expected one of: `for`, parentheses, `fn`, `unsafe`, `extern`, identifier, `::`, `<`, square brackets, `*`, `&`, `!`, `impl`, `_`, lifetime', /home/lbo/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.48/src/parse_quote.rs:95:21 | |
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace | |
error: internal compiler error: unexpected panic | |
note: the compiler unexpectedly panicked. this is a bug. | |
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Sat Nov 21 20:04:54 2020 | |
@author: lbo | |
""" | |
from recordtype import recordtype | |
from queue import PriorityQueue |