Browse by Tags
All Tags »
.net (
RSS)
The problem of animals and foods this is a short post that is dealing with a classic riddle. I was thinking on this riddle when I was trying to figure out a Scala feature. we are having (at Sela Group) a small Scala study group led by Israel Tabadi and while we were going over Scala's abstract type (which is by the way a cool implementation) I was thinking about the .NET equivalent solution. I will use the problem of " animals and foods " (taken from here ) as an anchor's point...
Weak Event there is no doubted that event handler is the number one reason of memory leak under .NET framework. recently I was part of a team which was tracing a memory leak out of a dump file, as expected the main issue was happens to be the prime suspect (event handler). you can find plenty of resources on how and why careless usage of event handler can cause a memory leak (just Google it). in this post I will present a general solution for this problem (which can be use when applicable). the solution...
Enum.HasFlag: good or bad? .NET 4 give us nice elegant way of checking whether [Flags] enums contain a value. assuming that we have the following enum : Code Snippet public enum MyEnum { None = 0, A = 1, B = 2, C = 4, D = 8 } we can use the bitwise for checking whether instantiation of the enum contain a value, as shown in the next snippet: Code Snippet var options = MyEnum .A | MyEnum .B; if ((options & MyEnum .A) == MyEnum .A) { // Do something } .NET 4 come with elegant syntax which...
Testing and Debugging MEF, Tips - Part 1 this is the first post of a series that will offer some tips about testing and debugging your MEF -able component and application. in this post we will focus about exporting Mock objects. the code sample for this post can be download from here . Prerequisite if you are not familiar with Mocks you better read more about this subject before proceeding with this post (in short Mocks are fake object which is use for separate dependencies during...
T 4 beginners – part 4 this is the 4rd post on this series. in this post we will focus on T4 Class feature control blocks . you can download the code for this post here . the series TOC is available here . What is class feature control block? class feature control block is one of the T4 extension mechanism that enable reuse of T4 sections. using class feature control block you can defines helper properties or methods , that can be used from different T4 templates. The syntax of class...
T 4 beginners – part 3 this is the 3rd post on this series. in this post we will focus on basics T4 Control blocks . you can download the code sample from here . the series TOC is available here . T4 Control blocks is where dynamic text is added into the template output, this is the heart of T4 concept ( C# is the default language but you can change it to VB ). Standard control blocks A standard control block is a section of program code that generates part of the output . You can mix...
Yuval Mazor has contrib CCR provider for the Reactive Queue . read more here http://blogs.microsoft.co.il/blogs/yuvmaz/archive/2010/05/19/ccr-provider-available-for-the-reactive-queue.aspx
T 4 beginners – part 2 this is the second post on this series. in this post we will focus on basics T4 Directives . you can use the code sample of the previous post here . the series TOC is available here . Directive syntax: any of the directives is using the following syntax: <#@ DirectiveName [ParameterName = " ParameterValue "] #> it start with <#@ follow with the directive name , includes zero or more name value parameters and end with #> All parameter values...
T 4 beginners – part 1 this is the first post of a series that will focus on T4 template. this post discuss the T4 in general while the following pose will focus on the T4 practice. the code for this post can be found here . the series TOC is available here . What is T4 template? T4 is sanding for T ext T emplate T ransformation T oolkit. T4 is all about automating code or content generation. the usual extension for T4 files is the *. tt When to use T4? whenever you identify repeatable...
Performance tips recently I was working on the Reactive Queue (which is part of the Rx Contrib ). the requirement for the Reactive Queue was to to achieve the highest throughput possible for each queue provider ( 2,000,000 messages of 500 byte per second using Concurrent Queue provider running on simple quad server ). while working on this project I was encounter the the following performance hits: 1. ManualResetEventSlim there is a big difference between using the old ManualResetEvent Vs...
the Source code for C# IntelliSense extension for VS 2010 is available at codeplex under the following link: http://csharpintellisense.codeplex.com/ the current version is 1.5 you can send improvements to bnayae@sela.co.il so I can make it available to the public. see previous post on this subject here , and here .
Rx - for beginners (part 14): time based buffering this post is the 14th in a series of posts about the new Reactive Framework ( Rx ). the series TOC can found here . in this post we will focus on the BufferWithTime operator. the code for this post available here . What does BufferWithTime operator do? the buffer with time operator is buffering values that occurs within specific time windows , and then publish the buffered values whenever the time period ends . Marble diagram...
C# IntelliSense extension for VS 2010 – UPDATE the extension has update and it is include the description. enjoy :)
C# IntelliSense extension for VS 2010 the C# IntelliSense extension is now available at the Visual Studio Gallery . the extension is adding filtering capability to the VS IntelliSense, so for example when you are looking for methods you can filter out the namespace, fields, events and properties. Credits this work is heavily based on the Xaml IntelliSense extension that was written by Karl Shifflett . Download you can either download the extension from Visual Studio...
MEF for Beginner (Deployment Catalog) - part 12 this is the 12th post of the MEF for Beginner series, the series TOC is available here . this post will focus on Deployment Catalog . the code sample for this post can be found here . What is MEF Deployment Catalogs? the deployment catalog is actually a redesign of the older package catalog . it enable to load parts from xap packages a-synchronically. Code sample the following code sample depend on 2 assembly that...
More Posts
Next page »