Some Rx goodness

The observer pattern

In .NET 4 Microsoft introduced the IObserver<T> and IObservable<T> interfaces. These interfaces give you a generic way of providing push-based notification, which is also known as the observer pattern. The provider (IObservable<T>) must implement a Subscribe method, which lets the caller indicate it wants to receive push-based notifications. The caller passes an instance of the observer. The observer (IObserver<T>) must implement three methods (OnNext, OnError and OnCompleted) which the provider calls to send different kinds of notifications.

For slightly more detail and some simple examples, take a look at the interfaces for IObservable<T> andIObserver<T> in the msdn documentation.

A quick and high level overview of Rx

The Reactive Extensions libraries from Microsoft provide implementations of the interfaces outlined above. Rx uses LINQ to allow incredibly powerful but simple and declarative solutions to complex problems, when dealing with sequences of events. It is available as a number of different packages on NuGet. To install them all, look for Rx-Main. There is also an “Extensions for Reactive Extensions” package available on NuGet, called Rxx. This provides many more useful Reactive LINQ extensions that aren’t in the main Rx library from Microsoft.

View original

Entity Framework 7

The first thing to know about EF7 is that, like EF6, it’s open source. But rather than being developed on CodePlex, EF7 is on GitHub, along with the rest of the upcoming version of ASP.NET. The URL for EF7 development is As with EF6, you’ll be able to see the details of EF7 as it evolves. You can explore the source, as well as its progress through branches and commits, follow the discussions, raise issues, fork the source, and submit pull requests for the team to examine and potentially commit to the code base.

Here’s the high-level view of what’s exciting in EF7:

  • Support for non-relational data stores and even in-memory data for testing.
  • Support for machines and devices that don’t use the full .NET Framework. This means you can use EF7 in Windows Phone and Windows Store apps, as well as on Linux and Macintosh machines that are running Mono.
  • Support for many features that developers have requested but couldn’t be achieved with the existing code base.
  • Continued support for applications that use the full .NET Framework such as Windows Presentation Foundation and other client applications.
  • EF7 will be distributed in the same manner as ASP.NET 5 and can be used with ASP.NET 5 apps.

View Original

Understanding TypeScript

In many ways, it’s useful to think of TypeScript on its own merits. The TypeScript language specification refers to TypeScipt as “a syntactic sugar for JavaScript.” That’s true and probably an essential step in reaching to the language’s target audience—client-side developers currently using JavaScript.

And you do need to understand JavaScript before you can understand TypeScript. In fact, the language specification (you can read it at often describes TypeScript constructs in terms of the resulting JavaScript code. But it’s equally useful to think of TypeScript as a language on its own that shares features with JavaScript.

For example, like C#, TypeScript is a data-typed language, which gives you IntelliSense support and compile-time checking, among other features. Like C#, TypeScript includes generic and lambda expressions (or their equivalent).

But TypeScript, of course, is not C#. Understanding what’s unique about TypeScript is as important as understanding what TypeScript shares with the server-side language you’re currently using. The TypeScript type system is different (and simpler) than C#. TypeScript leverages its understanding of other object models in a unique way and executes inheritance differently than C#. And because TypeScript compiles to JavaScript, TypeScript shares many of its fundamentals with JavaScript, unlike C#.

View Original

Working on a new compression algoriphm

Can’t disclose how it will work. But early tests indicate that if you take a reasonable sized RAR archive compressed to the max and place it in my container, you should expect to achieve a further 15-17% compression.

Now the plan is to finish the library and post the service as a website where you can compress and uncompress a single file. I will probably put a limit on the file around 50 Mb mark. This will allow me to gather vital statistics (without killing my server).

If all checks out I will add support for multiple files and release it as open source. Still thinking about the last step though 😛

Blog at

Up ↑