Malisa Ncube - .NET Delights

.NET Development ideas and things
posts - 41 , comments - 86 , trackbacks - 0

Tuesday, July 8, 2014

Moving to

It has been really nice blogging here. Very exciting times and articles from brilliant people.

I have now decided to consolidate my blogging efforts or one area -

Thanks a lot to the patrons of this blogging platform for your work and keeping it alive. I will continue to subscribe to the feeds and will continue to learn from this knowledgebase.




Technorati Tags: ,

Posted On Tuesday, July 8, 2014 4:34 AM | Comments (0) |

Thursday, October 3, 2013

Dinosaurs and Spaceships: Using self hosted WebAPI 2 with legacy applications


I have blogged about how you can use WebAPI 2 hosted on OWIN with legacy applications. Visit the link below for more information.


Posted On Thursday, October 3, 2013 9:50 AM | Comments (0) |

Monday, May 27, 2013

Windows Azure–multi-platform command line interface into the cloud

I have blogged about Cross platform Windows Azure command line tooling. This is  free open source tooling available for developers wishing to use commands to either automate or simplify their build processes. You can see my post here

This is an introductory post aimed at getting started. Hopefully a more meaty post will follow. Smile

Posted On Monday, May 27, 2013 7:35 AM | Comments (0) |

Tuesday, May 14, 2013

Using Windows Azure Mobile services to develop Android Applications–Nigeria DevCamp

I have blogged about the Dev camp event we had in Nigeria, where I did a session on using Windows Azure Mobile Services on Android Applications. I run through a recipe, in which I created a shopping list application which was shared between Windows 8, Windows Phone 8 and Android. My task was that of developing an Android application from scratch which would make use of some of the coolest features in WAMS. i.e. Facebook authentication and storage.

The result is a cross platform solution which takes advantage of the unified authentication features of WAMS and share the same data.

Check it out here


Posted On Tuesday, May 14, 2013 10:25 AM | Comments (5) |

Tuesday, August 21, 2012

DataObjects.Net releases a community version and some goodies

I have been following the events at and excited by the release of DataObjects.Net community license and new features in version 4.5.4. I have always had a sweet spot on DataObjects.Net, mainly because of the clean architecture and features that the product has. Now my mind is getting blown away by features that I never thought may be possible in an ORM.

Over the past few months the DataObjects.Net community started working on plugins that would extend the functionality of DataObjects.Net. These plugins are really optional and come in handy when you need to provide some functionality which normally would not exist in an ORM or would make an ORM heavy. DataObjects.Net is highly extensible. i.e. You can create your own plugins which can do all sorts of things, from Domain to Session related tasks. There is already some plugins that you can take for a spin on the Codeplex site ( if you want to see the code and dive into the internals. The available plugins include

These are also available as nuget packages. You have to agree with me that, that’s a killer. Smile 

After the new customer portal was launched last week, the X-tensive team has also been updating the samples which are also accessible on the Codeplex site( and harmonising the login mechanism to make it simple to login by using yahoo, google or OpenId accounts.

DataObjects.Net is available on Nuget as a package and also downloadable from the

Let’s get involved. Write Samples, Documentation and blog.


Technorati Tags: ,,,

Posted On Tuesday, August 21, 2012 2:54 AM | Comments (0) |

Monday, December 19, 2011

Alex Groß’s visit to Uganda

In November Alex Groß ( was in Uganda for holidays and we hijacked him to speak to us on some .NET geek stuff. Smile 


In the image above you see Allan Rwakatungu, Jude Opima, Myself and Alex Groß. More pictures

These are some of the topics that were discussed.

  1. Test Driven Development. Alex shared a great amount detail and a step by step tour of how you can work with unit tests and went on to show MSpec as a BDD tool.
  2. The concepts behind Continuous Integration (CI), Continuous deployment and using tools such as TeamCity. He demonstrated one of his project DuplicateFileFinder which is in .NET but uses some ruby build and deployment scripts. I really liked his application and the way it was organised. You can fork it from here
  3. There was some other .NET development topics we talked about ranging from Object Relational Mapping (ORMs), CQRS and BDD among others.

[Download] the PowerPoint presentation about his talk on BDD and MSpec.

Alex is very passionate about .NET user groups, follow him on @agross

Technorati Tags: ,

Posted On Monday, December 19, 2011 9:38 PM | Comments (0) |

Wednesday, December 7, 2011

Microsoft OpenDoor Event–Nairobi

This was a very interesting event, I had never spoken in an event with so many developers in one place. It was cool! I had two talks, one on HTML5 and IE9 where I demonstrated the HTML5 and CSS3 coverage in IE9 and performance improvements, the second on ASP.NET MVC Best Practices where I talked about a fraction of things that you need to be aware of and possibly use when you are developing an MVC application.

The HTML5 and IE9 talk was more of a showcase and focused on new features that will continue to change the way we view the web and the way we design web applications. This included the new mark-up that comes with HTML5, hardware accelerated graphics, SVG, Canvas and many more.

On ASP.NET MVC, I also talked about the new features that have been showcased for ASP.NET vNext, preventing Cross Script Attacks and deployment preparation (minification).

Some of the pictures can be found on 




ASP.NET MVC Best Practices [Download]





Posted On Wednesday, December 7, 2011 7:00 AM | Comments (0) |

Monday, December 5, 2011

Simple Linq PIVOT to one row

My friend in Zimbabwe sent me an email a day ago with the following contents

suppose i have a table called week_days
with only 3 fields i.e.
SEQUENCE  DAY   SALES as follows:

1         Sun    23 
2         Mon    18
3         Tue    30
4         Wed    15  
5         Thu    20
6         Fri    08
7         Sat    0 

i need a query that converts DAY column
to a header row and sort by SEQUENCE as follows:

DAY    Sun Mon Tue Wed Thu Fri Sat
SALES  23  18  30  15  20  08  0 

Pliz Help!!!!!!!!
I was like’ this looks like a candidate for pivot, but it requires that the result be put in exactly on row. I cheated and sent him back this code. He was happy.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication5
    class Program
        static void Main(string[] args)
                var week_days = new List<Sales>();
                week_days.Add(new Sales {Sequence = 1, Day = "Sun", Amount = 23});
                week_days.Add(    new Sales {Sequence = 2, Day = "Mon", Amount = 18});
                week_days.Add(    new Sales {Sequence = 3, Day = "Tue", Amount = 30});
                week_days.Add(    new Sales {Sequence = 4, Day = "Wed", Amount = 15}); 
                week_days.Add(    new Sales {Sequence = 5, Day = "Thu", Amount = 20});
                week_days.Add(    new Sales {Sequence = 6, Day = "Fri", Amount = 08});
                week_days.Add(    new Sales {Sequence = 7, Day = "Sat", Amount = 0});
                //Before transpose
                foreach(var day in week_days)
                  Console.WriteLine("{0}  {1}  {2}", day.Sequence, day.Day, day.Amount);
                var tr = from row in  week_days
                            group row by "SALES" into g
                            where g.FirstOrDefault() != null
                            select new
                            DAY = g.Key,
                            Sun = g.Where(sales => sales.Day == "Sun").Sum(sales => sales.Amount),
                            Mon = g.Where(sales => sales.Day == "Mon").Sum(sales => sales.Amount),
                            Tue = g.Where(sales => sales.Day == "Tue").Sum(sales => sales.Amount),
                            Wed = g.Where(sales => sales.Day == "Wed").Sum(sales => sales.Amount),
                            Thu = g.Where(sales => sales.Day == "Thu").Sum(sales => sales.Amount),
                            Fri = g.Where(sales => sales.Day == "Fri").Sum(sales => sales.Amount),
                            Sat = g.Where(sales => sales.Day == "Sat").Sum(sales => sales.Amount)
            foreach(var day in tr)
                  Console.Write("{0} {1} {2} {3} {4} {5} {6}", day.Sun, day.Mon, day.Tue, day.Wed, day.Thu, day.Fri, day.Sat);
    public class Sales
        public int Sequence {get; set;}
        public string Day { get; set;}
        public double Amount {get; set;}
I should mention that I tried this code on my favourite ORM DataObjects.NET and I was not disappointed. Winking smile
Technorati Tags: ,,

Posted On Monday, December 5, 2011 4:35 AM | Comments (0) |

50% off on DataObjects.NET

I have been closely following the updates on and been impressed with the new features that keep getting added into DataObjects.NET. A few days ago, I saw the 50% sale blog post here and thought it would be very interesting for anyone that wishes to start using DataObjects.NET but feared could not afford the price.

DataObjects.NET ORM is very feature rich, well designed and will certainly save you countless development hours by making you think about the domain and code rather than SQL. For your information the new fact aggregation and comparing site uses DataObjects.NET behind the scenes. Smile For me, that is a testament that shows versatility of a product. The X-tensive guys decided on dogfooding their own product and it has worked very nicely.



Technorati Tags: ,

Posted On Monday, December 5, 2011 12:41 AM | Comments (0) |

Friday, September 9, 2011

EMR - TB Module Deployment

Today, We deployed the “David Blaine” version of the TB Module for our EMR solution here at IDI ( This was mainly for bug fixes and usability improvements based on the feedback that we received from users in the past few weeks. Some of the improvements were related to performance. We had to fine-tune some of our Linq statements in some places to enable better queries to be generated by our ORM. We also added some lookup dialogs that present certain information that would be required to make instant decisions. e.g. showing weight trends to determine loss of weight.

We got some of the feedback in less than 30 minutes of usage. A reason to smile. Smile

This TB module is represented by additional assemblies that are dynamically loaded by ICEA (EMR). If these assemblies exist in a certain folder dedicated for plugins and a manifest file indicates that it must be loaded, then the user will see a seamless integration of features related to it. User rights and security propagates into the loaded module, hence the user that is not explicitly given authorisation to the module will be denied access. We were worried early in the project about reflection and performance but later we found ways to cache some most frequently used views and lazy load images and other data. The system uses a model + view + presenter approach, and we had to made some modifications to the Krypton Toolkit to enable the views to come with their own Ribbon parts. i.e. each view comes with its own RibbonTabs, RibbonGroupButton, AppMenu items and anything you want fused with the main shell. This keeps the controls in context with the data at hand. We also added a mechanism within the framework which keeps the current patient context despite the view you are currently viewing. This enables us to change between views in different modules and still keep on the selected patient in context.




The TB Module is made up of a number of forms within the application.

  1. TBsuspect. This is used to enter details of the patient who would have presented symptoms which suggest that they may have TB. This would enable the TB doctor to perform a physical examination and order for investigations (in the lab – online) that need to be carried out. These may be sputum smear, culture and sensitivity, chest x-ray, abdominal ultrasound, lymph node aspirate, pleural fluid, lymph node biopsy or anything else.
  2. TBInvestigation. This will keep the results from the lab or radiology. It will enable the TB doctor to confirm the existence of TB, and if it exists then the Diagnosis form is filed in.
  3. TBDiagnosis. This is a very interesting form in that as the user fills it in, notifications and hints are displayed based on the rule based engine.
  4. TBFollowup. This is used for a person that is undergoing treatment and filled in on each follow-up visit and it will depend very much on the visit phase (2 weeks, End of Intensive, End of extended Intensive Phase, 5 months continuation phase, End of treatment, End of Extended Treatment). The rule based engine gives hints based on the examination and entries. e.g. When a patient has Skin Rash (side Effect), the doctor should verify whether its major using WHO (World Health Organisation) and NTLP (National TB and Leprosy Programme) standards and consult with TB Coordinator. If its mild then treat with anti-histamines e.t.c.
  5. TBOutcome. This was a challenge to develop because its linkages with all the other forms. The outcome is the termination of the episode which may have started from the patient being a TB suspect or transferred in at diagnosis phase. This is filled in when a patient completes, defaults, is transferred out, or is diseased.



We had a major challenge in that there had been an Access database which was used to enter information written on forms. The design was not what you’d want (not by us) and to make things worse, there were many fields which were not validated (esp dates) and it was hell to transfer the data into ICEA. The access system allowed duplicates and there was no relationship made between the forms I talked about. Forging relationships where there existed duplicates was a major challenge. I’m happy to say that we found a way to create relationships that did not exist through the TB module.


Technorati Tags: ,

Posted On Friday, September 9, 2011 6:15 AM | Comments (1) |

Tuesday, June 14, 2011

DataObjects.Net Beta2 SalesPoint Sample in MySql

After Dmitri posted DataObjects.Net beta2 last night, I couldn’t wait but test the security framework included. If you have been watching you may know that I worked on the provider for MySQL for DataObjects.NET. I was curious to see how the security framework will feel on MySQL. Well to my ‘extreme’ happiness, after I translated the SalesPoint database into MySQL and testing the sample it worked very beautifully. I only had to change the URL in the App.Config file.

I have attached the SQL script that will enable you to test the SalesPoint sample in MySQL.


There is a couple of things I want to add into the sample, including MEFing it up as a MEF addict. I will keep you posted on it in due course.

Posted On Tuesday, June 14, 2011 7:21 AM | Comments (0) |

Wednesday, June 8, 2011

Uganda .Net Usergroup–May 2011

In the month of May we met again for the .NET Usergroup, and I presented some introductory material into software design and architecture. The talk was aimed at looking into new ways of software design and managing of complex software components by using domain driven approach. I talked about best practices, coding patterns and DDD, TDD and DataObjects.NET ( I advocated for best practices presented by the best practices team




Even after a technical problem with the projector we still continued. We clustered together and the heat continued.

I have continued with my interest in DataObjects.Net and I took some time to explain the placement of ORMs (In particular DataObjects.Net). I also talked about some of the lessons I have learned which are vital in collaborated software development.


You can download the PowerPoint presentation from here.

Posted On Wednesday, June 8, 2011 12:30 AM | Comments (0) |

Thursday, May 19, 2011

Highlight Report

Its been a while since I blogged. Its been hard balancing blogging time, work and many other activities. Most my days and even evenings have been cluttered with a number of tasks ranging from mundial to critical. There is some which have been most interesting include very nice lessons I took from from some of the people I respect in the industry. I will try and highlight some of the things I did in below.

1) The DataObjects.NET contribution programme.

From February this year I quickly responded to the contribution programme to DataObjects.NET which was announced by Dmitri I took up the task of developing the provider for MySql for DataObjects.NET and a new section of programming was opened for me. The first was some of the interesting coding patterns,including the translator pattern among others. I had some mental gymnastics trying to distil the content which enables SqlDom to simply spit valid SQL for a particular RDBMS, but it was not without a benefit. I completed the provider and of course Dmtri was true on his word, he sent me a license. There has been a number of development tasks that Dmitri has undertaken with his team to ensure that the provider fits very well to the DataObjects.Net infrastructure.

After working on the MySql provider I was excited, I have decided to take up some other parts of the ORM and see if I can extend them, not just for me but for other developers who use DataObjects.Net. Well... if you have been reading up to this point you may wonder why I'm so excited about DataObjects.Net. Yes, I was impressed by the LINQ coverage and the usage simplicity. There are many features that make me like it more than any other ORM and I would write a number of posts describing the parts I like. I would suggest you visit for more details on their features.


Not so much here except the fact that I was doing a short course on Project Management using the PRINCE2 approach. It was quite interesting from the beginning but I quickly realised it was hard from the perspective in which the examiners ask questions. some of the questions are purely to test your English, which I found awkward. In most cases you had to have crammed the course book because you’d be asked to complete a sentence according to the way it appears on the course material. This I found quite weird because it does not promote understanding and deductively, but only exercises the temporary memory which is supposed to keep things in that level of detail, but after the exam you can re-allocate it for other stuff.

3) ICEA (Integrated Clinic Enterprise Application)

This EMR solution has been evolving. We implemented it in phases and the phase that I have been working on lately has been the TB module. You may wonder why TB (tuberculosis) is such a vital thing in an EMR solution that it warrants a module developed specifically for it. Well.. yes, it does. TB is a very complex disease and is has the highest cause of mortality among HIV/AIDS patients. It needs to be monitored closely and controlled. The use of information systems here should provide help in showing notifications, capture details of patients suspected to have TB, capture investigations and subsequent follow-ups. All this has to be coupled with normal clinic visits and diagnosis, counselling, lab ordering and prescriptions. So.. what you are looking at is a number of modules that are accessible to different individuals in a clinical setting and each one performs tasks relevant to their work, and the workflow and state of data is managed through the visit lifetime. The result is a unified system made up of different modules/plugins, but working in a coupled mechanism and allowing users and patients to have a well-defined workflow that's efficient. I presented this solution once again to the Health Research Forum and was excited that this solution has reduced the error rate which was 80% to 1% and the errors that were found were not significant to the healthcare of patient. I celebrated.

4) Uganda .NET Usergroup

I have been busy with the meetings every month. Its been so much fun, I have had developers from different technologies within the Microsoft stack and this has led to a broader view and better design choices among developers. Some of our talks have included Visual Studio 2010 + .NET 4.0, Windows Azure, NHibernate Internals, SOA using .NET, Aspect Oriented development, .NET Development frameworks among others. Last month we could not meet because of the riots and the violence which engulfed our normally calm city.

5) Microsoft ImagineCup

I chose the students from Makerere who had to go and compete in Kenya. I was very impressed with the vibrant ideas they had and the vision they had. The group had developed a system to help in drug adherence by making use of mobile phones, and that is not all. They also included a reminder system which synchronised the visit messaging to the medical provider and the patient. I was impressed. I noted that there had not been support for students by different stakeholders and that has made it difficult in th past for them to not only know about ImagineCup, but get facilitated to perform the activities that would enable them to win in the competition. I have aired this to the individuals at Microsoft and some Universities and monitoring the progress from a bird's eye view.

6) Research and Development

I will sort of unify the rest of the items I wave been working on under this title. Some of the things I have been researching and doing prototypes of, range from mobile network applications, Windows cloud applications, Windows AppFabric. I have also been following the AsyncCTP which has been released by Microsoft and think it is going to change our lives and the way users interact with software. I will be blogging about some of these things I have been working on and playing with. I can already see many applications becoming more responsive because of these new innovations.

7) Sports.

You may not know this. I started playing soccer. Ohh yes its true. I joined Farai Mwakutuya and his team and have been playing soccer every Saturday afternoon. The feeling has been good but very hard. I will not say much about about this but tell you that during my first game I was the first to send the ball to the nets.

Posted On Thursday, May 19, 2011 10:11 AM | Comments (1) |

Sunday, January 30, 2011

The Uganda .NET Usergroup meeting for January 2011 - a look back.

We had a very interesting meeting on Friday 28th last week. We had 10 attendees and two speakers. The first topic presented was Cloud Computing, presented by Allan Rwakatungu @arwakatungu who works with MTN Uganda. He gave a very brilliant outline of how Cloud computing and service oriented applications had begun changing the platform for operating business and the costs it saves because of scalability and elasticity. He went on to demonstrate the steps you would take if you are beginning a new Windows Azure project. He explained the history and evolution of the Windows Azure, SQL Azure and cloud services offered by Amazon and The attendees had many questions to ask (obviously), but they were all answered very well. We once again thank Allan, for taking time to prepare the presentation and demonstrating for us. We recorded a video on the entire presentation and after doing some editing we will publish it.

One wish which was echoed by most members was that Microsoft should open the cloud services and development for Africa. Microsoft currently does not even have servers here in Africa and so far, that does not put African developers in the same platform as other developers in other continents. Now is the time considering the improvements in network speeds and joining of the Seacom network and broadband.



I presented on Parallelism and Multithreading using .NET 4.0, I also gave some details on the language changes in C# 5.0 and the async keyword and the TaskEx class. I explained the Task, Scheduling of parallel tasks and demonstrated problems that may arise from using parallelism inappropriately. I also demonstrated the performance improvements that may be achieved by taking advantage of multi-core processors.

You may download the presentation on Parallelism and Multi-threading from here.

The resolution of the meeting was that we should meet more than once a month and begin other activities which should be more fun. e.g. Geek Dinner, Geek Beer or CodeCamp. Based on that we all agreed we shall have a mid-month meeting starting from February.

Cheers folks!

Posted On Sunday, January 30, 2011 9:13 PM | Comments (0) |

Friday, September 24, 2010

My thoughts on Kindle 3

I recently purchased the Kindle 3 and very excited to have this device that lets me read documents without tiring my eyes from the backlight. I can even let it read for me in a fairly natural way “when you get used to it”. I have also played some music using this device and perfectly understand that it was not designed to be some form of music player like iPod or Zune, but does give a good sound either off it speakers or through earphones.

Things i like

  1. I was tired a few days ago and set the speakers “on” and the Kindle device started reading for me. I normally don't read the types of books that Kindle was reading for me. I quickly start yawning and dosing when i read those types of books, but with kindle reading for me, i lay relaxed on my bed and switched off the lights and Mr Kindle read 9 chapters for me in one evening. I was excited.
  2. The service is excellent. I called Amazon and spoke to support after my Kindle suddenly started showing only part of the screen and froze the half rest.
  3. The dictionary that can help me as i read when i focus on a word i need explained. the Kindle has an in-built Oxford American English Dictionary that, i think is excellent and well positioned for immediate help.
  4. The experimental music playing functionality is cool. I think it plays mp3s only, i don’t know if it plays other formats.
  5. The new Collections feature is also excellent. I was having problems finding books because i wanted a folder structure that would let me classify content by subject /author or date.
  6. The Amazon store is awesome, i like the easy way i can search for stuff and tryout – well i know many online stores bound to mobile devices have these features but i truly loved the Amazon store.
  7. PDF support. This is just necessary.
  8. Is so easy to upload files into this device. Connect it to your PC and bam! You have it act like a flash disk, copy paste, cut paste, delete.

Things that i wish could be improved


  1. The screens seem very fragile.
  2. I wish i could have a more custom dashboard type of interface. Showing books that i’m still reading, New, those on trial, new music/audio files,
  3. I wish Kindle could support PowerPoint presentation files.
  4. As a developer, i want to see ways of creating small custom apps, that could make my experience better. I know Amazon has availed the SDK for Kindle, but i think we need more documentation / api details. What happens to us .NET developers? I suppose we use mono or other linux tools like that. But where are the guidelines and best practices?
  5. The experimental feature for playing mp3, should rather give me some sort of playlist so i can choose what i want to play.
  6. Touch, gestures and these new things that most geeks are talking about. I found it quite tough to surf the internet, position my mouse click. With touch even context menus will be easier. Touch a word and get a dictionary explanation for it.
  7. I don’t really care much about color screen for now, but when it comes, i want to play video files too.
  8. Improve on that browser. I want to save the html locally and open it later where i have no connection and read it.

Posted On Friday, September 24, 2010 6:01 AM | Comments (1) |

Powered by: