Skip to content

Instantly share code, notes, and snippets.

View wawiesel's full-sized avatar

William A. Wieselquist wawiesel

  • Oak Ridge National Laboratory
  • Oak Ridge, Tennessee
View GitHub Profile
@wawiesel
wawiesel / read_write_access_to_github.sh
Created December 17, 2017 19:35
read/write access to github from anywhere
#make sure your access is https in your git config file
vi .git/config
[remote "origin"]
url = https://wawiesel@github.com/wawiesel/BootsOnTheGround.git
fetch = +refs/heads/*:refs/remotes/origin/*
#store passwords globally in a cache
git config --global credential.helper store
#create a personal access token https://github.com/settings/tokens
@wawiesel
wawiesel / switch_on_strings_with_compile_time_hash.cc
Last active July 21, 2017 06:04
An example of a switch on strings using a compile time hash
// This is a demonstration of using a COMPILE-TIME hash to do a
// switch statement with a string to answer this question.
//
// https://stackoverflow.com/questions/4165131/c-c-switch-for-non-integers
//
// It is based on the StackOverflow question:
// https://stackoverflow.com/questions/2111667/compile-time-string-hashing
//
// And the solution
// https://stackoverflow.com/questions/2111667/compile-time-string-hashing/23683218#23683218
class Table;
class Row {
size_t b_col;
const std::vector<std::string>* b_fmt;
Table* b_table;
std::vector<std::string> b_entries;
public:
Row(const std::vector<std::string>* fmt, Table* table)
: b_col(0)
, b_fmt(fmt)
module variant_m
use iso_c_binding
type variant
!type(C_PTR) :: instance
end type
interface static_cast
module procedure static_cast_c_int
module procedure static_cast_c_float