CodeSOD: Ancient Grudges
by Remy Porter from The Daily WTF on (#4B1W4)
Ignoring current events, England and the rest of Europe have had a number of historical conflicts which have left a number of grudges littered across the landscape.
Andro V lives in Norway, but is remotely collaborating with an English developer. That English developer wants their peers to know that Sweyn I and Thorkell the Tall's invasions of southern England will never be forgotten.
/// <summary>/// A counter that is to be read in reverse and computed in a Viking way. It usually is followed by a buffer which must be parsed in reverse order./// </summary>public static int Read3F1(this BinaryReader reader, bool reverse = false){ const float VIKINGS_INVADES_ENGLAND = 1009.0f; int counter = (reverse ? reader.ReadInt32Rev() : reader.ReadInt32()); // Debug.Assert(counter % 0x3f1 == 0, "Wrong data for 3f1 counter: 0x" + counter.ToString("X8")); counter = (int)Math.Round((counter / VIKINGS_INVADES_ENGLAND) - 1.0f); // The VIKINGs magic computation return counter;}
The year 1009 involved a lot of Viking invasions of southern England. But, like all old grudges, it arises from an even earlier grudge, as in 1002, English king Aethelred the Unready massacred all the Danes living in England. Of course, that was in response to a few years of raids prior, and, well" it's ancient grudges and blood fueds all the way down.
[Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!