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
#DISCLAIMER: Gram-Schmidt is numerically unstable. Use np.linalg.qr if you actually need to calculate an orthonormal basis. | |
def proj(vec,u): | |
return np.dot(u,vec)/np.dot(u,u)*u | |
def gram_schmidt(*vectors): | |
retlist=list() | |
for vec in vectors: | |
vec_calc=np.copy(vec) | |
for exist_vec in retlist: | |
vec_calc=vec_calc-proj(vec,exist_vec) |
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
" Setting some decent VIM settings for programming | |
ru! defaults.vim | |
set ai " set auto-indenting on for programming | |
set showmatch " automatically show matching brackets. works like it does in bbedit. | |
set vb " turn on the "visual bell" - which is much quieter than the "audio blink" | |
set ruler " show the cursor position all the time | |
set laststatus=2 " make the last line where the status is two lines deep so you can see status always | |
set backspace=indent,eol,start " make that backspace key work the way it should |
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
--- config.toml.example 2022-01-04 02:07:27.613408300 +0000 | |
+++ config.toml 2022-01-04 02:15:02.840182900 +0000 | |
@@ -248,14 +248,14 @@ | |
#locked-deps = false | |
# Indicate whether the vendored sources are used for Rust dependencies or not | |
-#vendor = false | |
+vendor = true | |
# Typically the build system will build the Rust compiler twice. The second |
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 core::sync::atomic::{Ordering, AtomicU32}; | |
use core::mem::MaybeUninit; | |
use core::cell::UnsafeCell; | |
use core::hint::spin_loop; | |
use core::convert::Infallible; | |
/// A thread-safe cell which can only be written to once. | |
pub struct OnceStorage<T> { | |
/// The actual storage of the stored object | |
data_holder: UnsafeCell<MaybeUninit<T>>, |
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
#!/bin/sh | |
# This commit-msg git hook enforces the author of a commit signing off on it when not on a branch that contains the word "throwaway". | |
SIGNOFF_LINE=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') | |
echo "Checking for line $SIGNOFF_LINE" | |
# Check if signoff line is present | |
if ! grep -qs "^$SIGNOFF_LINE" "$1"; then | |
# If line is not present, check if we're on a branch with "throwaway" in it |
OlderNewer