Archive for the ‘C#’ Category

One of the issues my workplace has been dealing with over the past several months has been intermittent slow performance of long running processes. In several cases it was impacting the entire company until the long running process had completed, it was doing pessimistic locking on reading data, causing deadlocks, and running really really slow. […]

Developing a mobile application these days is an arduous task.  You need to have a mobile app to get your business noticed and to gain market share with your audience, however which platform do you choose?  Apple?  Android?  Windows Phone? Cost of developing a mobile app is one of the biggest hurdles besides the choice […]

MapReduce is one of “those” buzz words that is going around at the moment. Mostly in part due to Google using it so successfully for their distributed indexing algorithms. So what is MapReduce? According to Wikipedia [http://en.wikipedia.org/wiki/MapReduce] So MapReduce is an amalgamation of two higher order functions taken from functional programming. Map and Reduce :. […]

Problems with the .NET 3.5 implementation During implementation of the same algorithm from Haskell to (Functional) C#, I found that I hit quite a large snag with .NET (3.5) number types. A fibonacci sequence very quickly accumulates into integers larger than an Unsigned Long can contain, in which case you would have to move to […]

Lambda calculus can be summed up doing very much with very little, sacrificing only readability. Personally i’ve found the inability to peform recusion with a lambda expression to be a little pain in what should be an elegant solution. Lets take a factorial for instance, how to write that as a lambda expression? The fathers […]

Learning a new programming language is perhaps one of the most rewarding experiences. You can learn about how another language performs a task, if it seems simpler how does this compare to your current language? Problem 4 from Project Euler goes something like the folowing. A palindromic number reads the same both ways. The largest […]

Learning haskell recently has really highlighted the power of the built in classes of haskell. Compare a function in haskell to captialize the first letter in a sentence, vs c#. Haskell 1 2 3 4 5 import Data.Char   sentenceCase :: [Char] -> [Char] sentenceCase [] = [] sentenceCase (x:xs) = [toUpper x] ++ map […]

Including an embedded resource into your Nant script is not difficult at all. Simply add a resources tag and include the Full Namespace. Note that you will also need to include /Path/To/Resource/File.resx in the include if you don’t have the resource file under the root folder of your library. Here’s a working example. 1 2 […]

Here’s a helper that will allow you to compare 2 objects using reflection. Note: that this will also go through the objects base class and compare the base class fields and properties. I found it necessary to do this, however for speed you may want to add BindingFlags.DeclaredOnly to type.GetProperties() and type.GetFields() to limit the […]

Every now and again it’s necessary to resolve a dependency at runtime. When this happens you don’t really have much of a choice but to insert mock objects into your test fixtures IoC container. The following patterns allow me to specify 1 abstract base class and have all dependent unit tests inherit these stubs thus […]


About Justin

justin

Justin is a Senior Software Engineer living in Brisbane. A Polyglot Developer proficient in multiple programming languages including [C#, C/C++, Java, Android, Ruby..]. He's currently taking an active interest in Teaching Kids to Code, Functional Programming, Robotics, 3D Printers, RC Quad-Copters and Augmented Reality.

About This Blog

Software Engineering is an art form, a tricky art form that takes as much raw talent as it does technical know how. I'll be posting articles on professional tips and tricks, dos and donts, and tutorials.

profile for Justin Shield on Stack Exchange, a network of free, community-driven Q&A sites

Photostream

  • What I look for in a senior software engineer Justin Shield: […] I’m not going to list the design patterns that you’ll need, I’ve already [...]
  • Justin: Hi Ross, I do actually like Umbraco, it provides some nice abilities for creating websites that I [...]
  • Justin: Hi GordonBGood, Thanks for taking the time in replying. You're absolutely correct, it is turners s [...]
  • Ross Gallagher: Hi Justin, I'm a fellow Aussi looking to use Umbraco to create a simple website. I have downloaded [...]
  • GordonBGood: This is the "Turner Sieve" which **IS NOT** the Sieve of Eratosthenes (SoE) neither by algorithm nor [...]