Magic numbers are special value of certain variables which causes the program to behave in an special manner. For example, a communication library might take a Timeout parameter and it can define the magic number "-1" for indicating infinite timeout.
Magic Mushroom Dosage Calculator Roughly estimates a dosage in grams based on the species and potency of the mushroom, whether or not it's dried, and other factors. I wrote this calculator in JavaScript to help figure out how many mushrooms to eat to reach the desired trip strength.
With Mock you can mock magic methods but you have to define them. MagicMock has "default implementations of most of the magic methods.". If you don't need to test any magic methods, Mock is adequate and doesn't bring a lot of extraneous things into your tests. If you need to test a lot of magic methods MagicMock will save you some time.
The word "magic" gets thrown around a lot here in contexts like "language X just has too much magic", or "platform Y generally avoids magic". However, it seems the term is pretty poorly defined,
This can be solved using simple observation. If you know divisibility rule of 9, which tales that a number is divisible by 9 if the sum of digits is multiple of 9. In your case you need to check end digit sum 1, which depicts that if you divide number by 9 and remainder is 1, then its magic number. Hence, it can be written as: