RM
Friday, July 03, 2020

calc grid min given directions

›
Calculate min for a grid starting from top row and going down in 3 directions (down-left, down, down-right). 00 01 02 -> j 10 11 12 20 ...
Wednesday, January 15, 2020

batching items with batch.tryAdd(item)

›
Process items in batches with bool batch.tryAdd(item). This is a bit clunky as it mixes the batch population and sending. process(sender,...
Saturday, December 14, 2019

find x in non-overlapping ranges

›
range: min max // pre-condition: ranges are sorted and are not overlapping // O(logn) range find(x, ranges): if ranges == null:...
Monday, October 07, 2019

polly simple circuit breaker

›
- Break (or open) circuit on consecutive 'n' handled exception or handled result for breakDuration interval. Throw brokenCircuitEx w...
Saturday, September 28, 2019

REST idempotency for long running jobs

›
scenarios: - POST 202 GET 404, 200 - POST 409 - POST 202 GET 500 retry POST - POST 500 retry POST Due to two operations (cach...
Thursday, September 19, 2019

dial

›
rng = new // dialValue: 0 - 100% bool toDial(dialValue): if !(0
Tuesday, August 06, 2019

polly retry

›
// polly retry pollyRetry_ExecuteAndCapture( work, retryCount, delayer, handlesException, handlesResult): pollyResult = ...
Monday, April 16, 2018

find min in rotated array

›
se m 12 21 sme 123 231 312 int findMinRotated(a, start = 0, end = a.length() -1): if start > end: throw if start == e...
Monday, March 26, 2018

find path out of a maze

›
For left, right, up, down directions. path maze(m, r = 0, c = 0): if m == null || m.length() == 0 || m[0].length() == 0: throw ...
Saturday, March 24, 2018

binary tree iterators

›
binarytreeIterator: stack, prevn ctor(tree): if tree == null: throw stack = new prevn = null ...
›
Home
View web version

Contributors

  • RM
  • RM
Powered by Blogger.