Instantly share code, notes, and snippets.

# Craig Phillips craigtp

Created May 1, 2020 19:38
Notes on Udi Dahan's Advanced Distributed System Design Course

# Advanced Distributed System Design Course - Udi Dahan

Notes by Craig Phillips

## Fallacies of Distributed Computing

• There are 11 fallacies of Distributed Computing:
1. The network is reliable
2. Latency isn’t a problem
3. Bandwidth isn’t a problem
4. The network is secure
1. The topology won’t change
Last active May 28, 2019 07:52 — forked from gregoryyoung/ProbabilityKata2
Probability Kata part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 OK so now you have implemented the kata. Your tests should look something like this: We can say that the tests define the object "in a calculus of itself". They are not state based tests, they define how the behaviours of the object interact with each other. To see the real value of this let's introduce some change ... I hear real system's do this occasionally. Because this is a high performance system decimal math is too slow. You now need to use floats instead. Need help on floating point math? Check out: http://www-users.math.umd.edu/~jkolesar/mait613/floating_point_math.pdf
Created May 27, 2019 16:57 — forked from gregoryyoung/ProbabilityKata
Greg Young's Probability Kata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Value objects are an important concept in DDD. This kata is made both to learn value objects and to learn better ways of testing. Write a probability value object. It should contain the following methods: Probability CombinedWith(Probability) Probability InverseOf() Probability Either(Probability) if you forget your probability math: Either:P(A) + P(B) - P(A)P(B) CombinedWith: P(A)P(B)
Created April 19, 2018 15:09

### Keybase proof

I hereby claim:

• I am craigtp on github.
• I am craigtp (https://keybase.io/craigtp) on keybase.
• I have a public key whose fingerprint is 8FBD 50F4 7D2C E90F 95D6 1B27 3965 4610 07EB B49F

To claim this, I am signing this object:

Created September 23, 2017 10:04
Windows Touch - Update Last Write / Modified Date of files recursively.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 gci -recu -inc "*.*" | % { \$_.LastWriteTime = Get-Date }
Last active April 21, 2017 16:48
Provides a function that will allow two imprecise floating point numbers to be compared for "near" equality and also an "IsNumeric" function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 public static class NumericHelpers { // Float point maths is whack. We can't check for absolute equality as floating point numbers are imprecise // and are subject to rounding issues (See: http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html) // Therefore, we can't check for absolute equality, but instead we have to need to check for values being // "nearly" equal, which allows a small margin of error (i.e. something known as the "Epsilon" value for // the given data type for this CPU that this code is running on). public static bool NearlyEqual(double a, double b, double epsilon) { var absA = Math.Abs(a);
Created May 30, 2016 18:10
Retrieve Windows Product Key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Option Explicit Dim objshell,path,DigitalID, Result Set objshell = CreateObject("WScript.Shell") 'Set registry key path Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" 'Registry key value DigitalID = objshell.RegRead(Path & "DigitalProductId") Dim ProductName,ProductID,ProductKey,ProductData 'Get ProductName, ProductID, ProductKey
Created April 29, 2016 12:16
RandomString - A class containing methods to produce some handy random string combinations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 using System; using System.Text; namespace RandomString { public class RandomString : IDisposable { // Can use the BetterRandom class here or just use the built-in System.Random class. private BetterRandom random = new BetterRandom(); private const string alpha_selection = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
Created February 1, 2016 15:06
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 public static class StringExtentionMethods { public static string TruncateAtWord(this string input, int maxlength, bool addEllipsis) { if (input == null || input.Length <= maxlength) return input; var ellipsisLengthDeduction = (addEllipsis ? 3 : 0); var iLastSpace = input.LastIndexOf(" ", (maxlength - ellipsisLengthDeduction), StringComparison.Ordinal); var iLength = 0; if (iLastSpace < 0) {
Last active April 7, 2021 22:44
Clean Up Temporary ASP.NET Files with Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 # Run this as Administrator net stop w3svc Get-ChildItem "C:\Windows\Microsoft.NET\Framework*\v*\Temporary ASP.NET Files" -Recurse | Remove-Item -Recurse -Force net start w3svc