Creating an immutable value object in C# – Part IV – A class with a special value

Other posts: Part I – Using a class Part II – Making the class better Part III – Using a struct In the last post we looked at structs as ways to implement immutable value objects and we discovered that they have several issues. A good thing about the struct implementation was the introduction of…

6

Creating an immutable value object in C# – Part III – Using a struct

Other posts: Part I – Using a class Part II – Making the class better Part IV – A class with a special value In Part II I talked about the asymmetry created by using ‘null’ as the special value for our little DateSpan domain. We also noticed the boredom of having to implement Equals,…

11

Bisection-based XIRR implementation in C#

Here is a quick implementation of XIRR (using Excel nomenclature) written in C#. Disclaimer: this is a super simple Bisection-based implementation. People tend to prefer the Newton method, but this is simpler and works for the app I’m writing. I decided to post it because I couldn’t find one on the net when I looked…

1

Creating an immutable value object in C# – Part II – Making the class better

Other posts: Part I – Using a class Part III – Using a struct Part IV – A class with a special value In the previous post I showed how to trivially implement a value object. The code works but it has several issues. Some are very simple, others are more interesting. Let’s take a…

16

Creating an immutable value object in C# – Part I – Using a class

Other posts: Part II – Making the class better Part III – Using a struct Part IV – A class with a special value Value objects are objects for which the identity is based on their state instead of their pointer in memory. For example, a numeric Complex class is, most of the time, a…

18

Brief review of "Total Workday Control"

We get plenty of emails in Microsoft. Without a system to manage them you are dead. Or better, your mind plays strange tricks on you making you think that you still have work to do. You need to convince your mind that you are done for the day and to stop bugging you, please. Almost…

2

Instead of a simple switch statement …

This is Luke‘s kind of code. I might be catching the virus … abstract class QIFParserBase { public enum LoadOptions { All, Prices, Securities, Transactions } static readonly Dictionary<LoadOptions, Action<QIFParserBase, string[]>> parseFuncs = new Dictionary<LoadOptions, Action<QIFParserBase, string[]>> { {LoadOptions.All, (q,c) => q.ParseAll(c)}, {LoadOptions.Prices, (q,c) => q.ParsePricesBlocks(c)}, {LoadOptions.Securities, (q,c) => q.ParseSecurityBlocks(c)}, {LoadOptions.Transactions, (q,c) => q.ParseTransactionBlocks(c)} }; public…

5

Parsing QIF Quicken files in C#

I’m slightly prouder of the structure of this code than the one in the previous blog post. You can simply inherit from QIFParserBase and override a couple of abstract methods to customize the behavior. Still, I just tested it on a couple of test QIF files. It is not production quality at all. Notice that I don’t…

1

Retrieve prices, dividends and splits for a stock in C#

I wrote this code very quickly and I’m kind of ashamed of it, but it gets the job done (I think). You need the HTML Agility Pack for the stock splits retrieving code. You can download it from here or you can simply comment out the code. I wrote it against Visual Studio 2008 beta 2,…

0

Lucabol and Kiraly …

My wife took this in Manhattan Beach this week end. Karch is the one on the right. BeachVolley 123.JPG

1