Archives

Stumbled upon this article written by no other than Eric Lippert listing the top 10 design faults of C# language. Here is the summary,  the source to the full article is at the bottom.  #10: The empty statement does nothing for me Reflects on the fact that lone “;” is a legal statement #9: Too much equality There are too many ways check for equality: ==, Equals, ReferenceEquals, CompareTo(…). From personal experience… Read More

I’m not really sure why Microsoft have never bothere with implementing a Fraction primitive in .NET. I’m sure there are plenty of uses as fraction allow to preserve the maximum possible precision. I have therefore decided to create my own implementation (albeit somewhat primitive at this stage) . My implementation automatically simplifies the fraction, so if you we to create new Function(6, 3) that would be simplified to 2. The Fraction struct implements… Read More

Originally posted on C# Disciples:
Today I stumbled upon a bizarre problem, I wanted to parse an HTML for a site to find out if the site contains any RSS feeds. After some research I found out that finding the RSS feed for a site is not that hard, you have to look for an element that looks like this “Easy task”, I said, me Mr.Optimistic; “I will just load it up…

http://AoA.codeplex.com – tunneling software written using the pre-release version of the Rx framework. Currently the implementation only supports http protocol, the exchange of data is done by posting the data in http request and then returning the data accumulated on the server. This is done several times a second and requires an normal one directional http access. The abstraction of the tunnel makes it easy to tunnel any protocols traffic over another protocol,… Read More

Originally posted on Ákos DUDÁS:
Task Parallel Library Tasks work with schedulers. The most frequently used one is the default, the ThreadPool scheduler. But one can create custom schedulers too. In this case, you need to know, how the runtime chooses the scheduler for a particular task. If you specify a scheduler, it will use that. If you do not specify a scheduler, it will use the current one (TaskScheduler.Current). The current one…

Originally posted on Sacha's Blog Of Programmaticalness:
The other day I have a requirement to schedule something in my app to run at certain times, and at fixed intervals there after. Typically I would just solve this using either a simple Timer, or turn to my friend Reactive Extensions by way of Observable.Timer(..). Thing is I decided to have a quick look at something I have always known about but never…

Application Domains An application domain is the run-time unit of isolation in which a .NET program runs. It provides a managed memory boundary, a container for loaded assemblies and application configuration settings, as well as delineating a communication boundary for distributed applications. Each .NET process usually hosts just one application domain: the default domain, created automatically by the CLR when the process starts. It’s also possible — and sometimes useful — to… Read More

The keyword partial has been with us for a while now. Until recently I couldn’t find a use for partial classes/structs unless some of the code is auto generated and you want to make sure you don’t interfere with auto generated code. That is until recently I have been asked to create a struct representing a local date – a data that is not affected by time-zones and lacks a time component,… Read More

I started a project yesterday. The idea is quite simple take some data and embed it into an image. The size of the image directly correlates to the data that you can embed in it. So during my testing I have created a RAR archive with maximum compression level and embedded it into a PNG image. I tried to keep everything simple and the algorithm follows the following steps: Store size of… Read More

Improvements when debugging .NET Reference Source Historically since the inception of this effort, Microsoft have published sources and PDBs for every major .NET framework update namely .NET framework 4.0 and 4.5. However these builds would be rendered effectively useless the moment any update to the framework was released, since the binaries on the updated box no longer matched the PDBs that were indexed on the reference source server. Unfortunately the design of the… Read More