View regexOddness.cs
System.Text.RegularExpressions.Regex separatorRegex1 | |
= new System.Text.RegularExpressions.Regex("a"); | |
System.Text.RegularExpressions.Regex separatorRegex2 | |
= new System.Text.RegularExpressions.Regex("(a)"); | |
string str = "a"; | |
string[] split1 = separatorRegex1.Split(str); // { "", "" } | |
string[] split2 = separatorRegex2.Split(str); // { "", "a", "" } |
View amazon_lambda_start_tagged.py
## Amazon Lambda script: start all appropriately tagged instances | |
## | |
## Runs in Amazon Lambda as Python 2.7 or as Python 3.6. | |
## Intended to be invoked on a schedule by Amazon Cloud Watch. | |
## Tag relevant instances with label 'autostart', value 'true'. | |
## TODO It could be good to add logging to this script |
View hello.adb
-- Prints a nondeterministic integer value | |
with Ada.Text_IO; use Ada.Text_IO; | |
procedure Hello is | |
subtype NumFingers is Integer range 0..10; | |
my_num_fingers : NumFingers; -- := 4; | |
begin |
View boost_strong_typedef_demo.cpp
// A small toy program (in fact it does nothing at all) | |
// to explore what we can do with BOOST_STRONG_TYPEDEF. | |
// We will see that it creates a distinct new type, with permissive | |
// implicit conversions regarding the original type. | |
// | |
// BOOST_STRONG_TYPEDEF has its uses, but we will see that we can't use | |
// BOOST_STRONG_TYPEDEF to implement Ada-style strong typing, such as to protect | |
// against confusing a NumApples_type value with a NumPennies_type value. |
View cpp_type_safe_lib_demo.cpp
// A small toy program to explore some of what we can do with the | |
// 'type_safe' library: https://github.com/foonathan/type_safe/ | |
// We will see that we can use it to create distinct new integer types, | |
// capable of ordinary arithmetic, and *without* implicit conversions. | |
// | |
// We will use this to implement Ada-style strong typing, protecting | |
// against confusing a NumApples_type value with a NumPennies_type value. | |
// |