Reverse Double Linked List in C#

This is a question that often comes up in an interview. The solution is simple. To begin with, initialise three node references: current points to the head node previous points to null next points to null Remember to point the tail to the head before we begin: tail = head; Now, iterate over the nodes […]

XMPP Progress

The XMPP Component framework is coming on nicely. It can connect and send/receive messages: Using C# again is a joy. I absolutely love the dynamic capabilities. For example, in this factory method, Ping is dynamically added – it is not a property: Which produces the following XML: Eventually Ping will be its own subpacket, but […]

C# Null! Tip

C# 8.0 introduced non-nullable reference types. I use them because it is considered best practice. I first encountered them in Kotlin. But I’m not a huge fan because they: have a cascading effect on interfaces and code are often not very helpful Monkey Business On the first problem, there are cases where things might be […]

Enums and Literals

One of the things I love about C# is reflection. Because of assemblies and metadata, and an excellent supporting framework, it is very easy to take advantage of this paradigm. This week I threw myself into building an XMPP component framework from scratch. The first objective is to get the plumbing and architecture in place. […]

Concise C# Property Name

When constructing XML elements, it’s nice to have a concise API. One of the features I’m implementing is the ability to easily move up to a parent element. There’s no cascade operator in C#, like you see in Dart. Whilst exploring options, I found this works: Example usage: I thought that was interesting – albeit […]

Result or no Result

Recently I spent a couple of hours building a few classes to support some functional programming constructs in C#. At the end of the experiment, doubts have me backing out mostly. In certain use cases, the new constructs are a nice fit, but they can easily be overused. And their usage has a cascading effect […]

Activator.CreateInstance

One thing I love about using C# is reflection, it adds another paradigm to the toolkit. Recently, I revisited my old friend Activator.CreateInstance which is perfect for scenarios where you want to use generic code to create and initialize specific types of objects. Basic Example Some time ago, I wrote a simple application which plugs […]

Troubleshooting WCF Performance

This is a re-post from 2011 for reference purposes. A small configuration setting can make a big difference. I’m currently working on a C# test application which dispatches real units of work through an Oracle Service Bus (OSB) to C++ services on an AIX box. The application uses the Supervisor Pattern where a single dispatcher, […]

Doxygen for C# and C++

Doxygen is a cross platform open source code documentation tool which I’ve used for both Visual C++ and C# .NET projects. It produces awesome documentation and is very easy to use. Configuration is straight forward using DoxyWizard. Doxygen can be configured to use Graphviz to produce call and dependency graphs. After installing Graphiz you’ll need […]

Xamarin.Android on Ubuntu 19.04

Update: Xamarin on Linux was too much of a moving target. These instructions are obsolete. INTRODUCTION Some time ago I wrote a post on how to install Xamarin.Android in Linux. At the time I was using Kde Neon which was based upon Ubuntu 18.04. Recently I tried to follow the same instructions to set up […]