I have this code public static BigInteger Factorial(int n) { BigInteger sum = n; BigInteger result = n; for (int i = n – 2; i > 1; i -= 2) { sum = (sum + i); result *= sum; } if (n % 2 != 0) result *= n / 2 +1; return result;Read more
Foreword I try to learn unit testing in (Excel) VBA using Rubberduck. As an example “project” I want to create tests for Chip Pearson’s modArraySupport and afterwards refactor that module, because I think I already found some bugs. But because I am not a native English speaker, maybe I just get things wrong. So thisRead more
I wrote a hobby program to ease the job of nurses to calculate insulin bolus dose and infusion rate according to measured blood glucose. There are several protocols around. Almost all hospitals create their own protocols or modify existing ones to accomodate their specific concerns about the patient population at hand. This is an exampleRead more
Constrained by a main loop outside of my control (eg: UI event loop, game loop, etc…), I have a slow (relative to the main loop’s expectations) algorithm involving a loop. Thus, I have to restructure the loop to be ___ (what is this term?) so that it can run partially each iteration (not 1:1) ofRead more
I have a process that takes yaml files describing DB tables (actually they’re all views), keeps track of changes and drop/create the table when the file changes. It’s the kind of thing that would normally be done with something like Flyway but wasn’t for a couple of reasons: Flyway doesn’t support the database being usedRead more
If I have a complex unit tested function: def do_everything(): # turn twizzles # push buttons # move mountain And I re-factor it into some smaller units: def do_everything(): turn_twizzles() push_buttons() move_mountain() def turn_twizzles(): # turn twizzles def push_buttons(): # push buttons def move_mountain(): # move mountain Am I wasting my time writing extra unitRead more