I wonder how long before we get Rx in AppFabric land so that cache notifications leverage observable collections via the new .NET 4.0 interfaces IObservable and IObserver? I already have Rx in my StreamInsight adapters, so obviously now I want it in Velocity
AppFabric Cache Notification Methods: Rx?
•February 10, 2010 • Leave a CommentSQL Server Modeling, LINQ to M and AndAnd
•February 9, 2010 • Leave a CommentA few articles caught my eye recently while train surfing:
- This SQL Server Modeling three part series is worth watching. There are also a few more relevant video’s here. The MCsla uses modelling data from the repository to generate a user experience – a WPF interface. The DSL discribes what the runtime can do based on entitlements. This concept may for example be of interest from an exotic trade entry viewpoint. The 3rd video in the series has the code and demo if you want to jump to the interesting stuff
- IL perversions: throwing and catching strings
- Andand.NET
- Telerik LINQ to M Refresh
- Notes from the Agile UX Retreat at Cooper
- Implement your own Parallel.For in C#
OData and Push
•February 9, 2010 • Leave a CommentRx: Memorization Acceleration and SOW
•February 9, 2010 • Leave a CommentMemoization can be implemented as a function which takes a function as a parameter and returns a new function which when invoked the first time on some set of parameters will compute the result and when invoked with the same values will not recompute the result but will instead return the previously computed result.
Memorizations are not new, and have been blogged out for quite some time. Below is some simple code
that I and a colleague created for retrieving the State Of the World (SOW) of trades for populating a blotter.
ConcurrentDictionary is a particularly cool class, especially GetOrUpdate – this posting over on the Parallel Computing forum is worth a read.
class Trade
{
public int Id { get; set;}
}class Program
{
enum TradeType {Bond, Equity, Fx}static void OutputTrades(List trades)
{
Console.WriteLine(trades[0].Id.ToString());
}static void Main(string[] args)
{
Func<TradeType, List> sow = GetSOW;
var sowAsync = sow.AsyncMemoize();sowAsync(TradeType.Bond).Subscribe(OutputTrades);
sowAsync(TradeType.Bond).Subscribe(OutputTrades);Console.ReadLine();
}static List GetSOW(TradeType t)
{
Console.WriteLine("Calling server to get SOW");
return new List() {new Trade() {Id = 2}};
}
}public static class SowMemoizeExtentions
{
public static Func Memoize(this Func function)
{
var results = new ConcurrentDictionary();
return arg => results.GetOrAdd(arg, _ => function(arg));
}public static Func<TArg, IObservable> AsyncMemoize(this Func function)
{
var resultObservables = new ConcurrentDictionary<TArg, IObservable>();
return arg => resultObservables.GetOrAdd(arg, _ => Observable.Start(() => function(arg)));
}
}
Maybe this code should be submitted to Extension Method
Arrange-Act-Assert: MSpec and SpecFlow
•February 5, 2010 • Leave a CommentInterested in BDD? Then check out MSpec, SpecFlow and SpecUnit.net
Microsoft’s Creative Destruction
•February 5, 2010 • Leave a CommentMaybe this article explains Microsoft’s lack of product in the real-time/streaming space? Microsoft has been somewhat late (again) to the game with their StreamInsight offering – especially now with the Sybase RAP + Aleri deal.
DryadLinq for Finance?
•February 4, 2010 • Leave a CommentThis announcement means that I can finally use DryadLinq for financial applications
I was getting a little bored of StreamInsight anyway
More Interesting Stuff From MSR: Moles
•February 3, 2010 • Leave a CommentRandom Reading On The Train
•February 2, 2010 • 1 Comment- .NET Framework 4.0: Comparing LINQ and PLINQ performance
- F# for Parallel and Asynchronous Programming – PDC 2009
- Steve Jobs and Control
- Tracing and Caching for Entity Framework available on MSDN Code Gallery – hopefully we’ll see Velocity (AppFabric) integration with other Microsoft products soon
- NDepend v3 is now 100% integrated in Visual Studio – Must Have VS Plugin?
- Are you using the CCR? – One runtime I just haven’t managed spend enough time with
- CLR V4: Stuff That May Break Your Profiler + Profiler Attach Part 2: Ok, now what?
- Much Ado About Monads – Creating Extended Builders
- An Insurgency of Quality
- WPF Unit Testing
- Line Charts with Data Templates – missed this one when I last looked at the MSDN Magazine site
StreamInsight: CepStream.Create and the ConfigInfo Parameter
•February 2, 2010 • Leave a CommentFor some reason I still seem to be in StreamInsight world. Not sure if that is a good thing or a bad thing. My Strategy Pricer POC is complete as far as I’m concerned, but another POC is bugging me. The problem I’ve walked into in the last few days is around ConfigInfo. In the StreamInsight samples that are supplied by Microsoft, the ConfigInfo parameter passed to CepStream.Create is a constructed object that passes configuration information to the input/output adapter. Now I was expecting this object to simply be passed to the adapter. However it appears I either have a very silly bug or for some reason I am seeing new instanced of my ConfigInfo class constructed by StreamInsight and passed to the adapters when the ConfigInfo class is more than the basic string property struct as per the StreamInsight samples.
Confused? Very
The problem is all centred around the queries being complied, and the ConfigInfo object being serialised. Here the stack trace that invokes the constructor of my ConfigInfo class:
System.Runtime.Serialization.dll!System.Runtime.Serialization.ClassDataContract.ReadXmlValue(System.Runtime.Serialization.XmlReaderDelegator xmlReader = {System.Runtime.Serialization.XmlReaderDelegator}, System.Runtime.Serialization.XmlObjectSerializerReadContext context) + 0x30 bytes
System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(System.Runtime.Serialization.DataContract dataContract, System.Runtime.Serialization.XmlReaderDelegator reader) + 0x10 bytes
System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator reader, string name, string ns, ref System.Runtime.Serialization.DataContract dataContract) + 0x81 bytes
System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(System.Runtime.Serialization.XmlReaderDelegator xmlReader, System.Type declaredType, System.Runtime.Serialization.DataContract dataContract, string name, string ns) + 0x28 bytes
System.Runtime.Serialization.dll!System.Runtime.Serialization.DataContractSerializer.InternalReadObject(System.Runtime.Serialization.XmlReaderDelegator xmlReader, bool verifyObjectName) + 0xa8 bytes
System.Runtime.Serialization.dll!System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(System.Runtime.Serialization.XmlReaderDelegator reader, bool verifyObjectName) + 0x63 bytes
System.Runtime.Serialization.dll!System.Runtime.Serialization.DataContractSerializer.ReadObject(System.Xml.XmlReader reader) + 0x2a bytes
Sidebar: Maybe I should hook StreamInsight to NewsScope
