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 |
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
--- 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
" 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
#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
import matplotlib.dates | |
import pylab as plt | |
import numpy as np | |
from datetime import datetime | |
def get_entropy(): | |
with open("/proc/sys/kernel/random/entropy_avail","r") as fil: | |
res=fil.read() | |
return int(res) |
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
#!/usr/bin/env python | |
# Gimp-Python - allows the writing of Gimp plugins in Python. | |
# Copyright (C) 2007 Kalman, Ferenc <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# |
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 | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 <name of tag>" | |
exit | |
fi | |
git add --all | |
git diff --staged --quiet | |
hasdiff=$? | |
if [ $hasdiff -eq 0 ]; then | |
echo "No changes exist on the index" |

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
/* The Computer Language Benchmarks Game | |
* http://benchmarksgame.alioth.debian.org/ | |
* | |
* contributed by Christoph Bauer | |
* slightly sped up by Petr Prokhorenkov | |
* | |
* Taken from https://github.com/cythonbook/examples (04-nbody 03-pure-c) | |
*/ | |
#include <math.h> |
NewerOlder