.Net

Project Euler – Problem 99 Solution

Problem Comparing two numbers written in index form like 211 and 37 is not difficult, as any calculator would confirm that 211 = 2048 < 37 = 2187. However, confirming that 632382518061 > 519432525806 would be much more difficult, as both numbers contain over three million digits. Using base_exp.txt (right click and ‘Save Link/Target As…’), …

Project Euler – Problem 99 Solution Read More »

Nancy self hosting

One of the great thing about Nancy is that you can host it in pretty much everywhere, and that includes inside a console app! The documentations seems to be missing the self-hosting option however, but it’s easy and only takes a minute. First, create a console app and get the Nancy.Hosting.Self package from NuGet: Then …

Nancy self hosting Read More »

Extension Methods – Serialize/Deserialize as Json/XML

Cranked these out last night, hope you find it useful too 1: public static class SerializationExtensions 2: { 3: private static readonly ConcurrentDictionary<Type, XmlSerializer> XmlSerializers = 4: new ConcurrentDictionary<Type, XmlSerializer>(); 5: 6: private static readonly ConcurrentDictionary<Type, DataContractJsonSerializer> JsonSerializers = 7: new ConcurrentDictionary<Type, DataContractJsonSerializer>(); 8: 9: private static readonly JavaScriptSerializer JavaScriptSerializer = new JavaScriptSerializer(); 10: 11: …

Extension Methods – Serialize/Deserialize as Json/XML Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close