Skip to content

Instantly share code, notes, and snippets.

View bekozi's full-sized avatar

bekozi bekozi

  • Alteryx
  • Colorado
View GitHub Profile
import numpy
def get_masked_arr(arr, fill_val):
'''
If a masked array is passed, this function does nothing.
If a filled array is passed (fill_value must be passed also), it will be transformed into a masked array.
'''
if isinstance(arr, numpy.ma.MaskedArray): # numpy.ma.MaskedArray
@bekozi
bekozi / logging.bash
Created March 1, 2018 23:30 — forked from goodmami/logging.bash
Basic logging commands for Linux shell scripts
#!/bin/bash
##
## Simple logging mechanism for Bash
##
## Author: Michael Wayne Goodman <goodman.m.w@gmail.com>
## Thanks: Jul for the idea to add a datestring. See:
## http://www.goodmami.org/2011/07/simple-logging-in-bash-scripts/#comment-5854
## Thanks: @gffhcks for noting that inf() and debug() should be swapped,
## and that critical() used $2 instead of $1
@bekozi
bekozi / Foo.cpp
Created October 25, 2018 19:18 — forked from Luthaf/Foo.cpp
Calling C++ from Fortran
#include "Foo.hpp"
#include <iostream>
using namespace std;
Foo::Foo(int _a, int _b): a(_a), b(_b){
cout << "C++ side, constructor" << endl;
}
Foo::~Foo(){