Latest C# stories

Object Pipelines(www.blackwasp.co.uk)

submitted by BlackWaspBlackWasp(4212) 3 days, 15 hours ago

A pipeline is a chain of connected steps that process information. In object pipelines, each step receives an object and performs an action using it before passing an object to the next step. This repeats until every step is complete. read more...

add a comment |category: |Views: 142

tags: another

IoC & Convention over Configuration in an Agile world(www.infoq.com)

submitted by wladekwladek(38) 7 days ago

James Kovacs (http://www.jameskovacs.com) is highly regarded figure in the .NET consulting community. The video linked in this kick is a great talk on how to simplify your codebase using Convention over Configuration with your IoC container. It also briefly touches on some other topics like testing, app bootstrap/initialization, and lots of details regarding the Castle container itself. To download the FakeVader application he uses in his talk check it out on github: https://github.com/JamesKovacs/fakevader read more...

add a comment |category: |Views: 199

tags: another

C#/.NET Little Wonders: Select() and Where() with Indexes(www.blackrabbitcoder.net)

submitted by BlackRabbitCoderBlackRabbitCoder(661) 10 days, 14 hours ago

We’ve talked about the Select() and Where() LINQ extension methods before. The Select() method lets you project from the source type to a new type, and the Where() method lets you filter the list of items to the ones you are interested in. Most people know of these methods in their simplest form, where they simply take a projection and predicate respectively that operates on just an element. However, there are overloads for both of these methods that take a delegate that operates on both the element and the index of the element. read more...

1 comment |category: |Views: 290

tags: another

Post-increment Operator and Precedence(www.kodefuguru.com)

submitted by KodefuGuruKodefuGuru(2818) 11 days, 19 hours ago

int i = 0; i = i++ + i--; Console.Write(i); What is written to the console? read more...

2 comments |category: |Views: 144

tags: another

Creating Type Aliases in C#(www.blackwasp.co.uk)

submitted by BlackWaspBlackWasp(4212) 12 days, 16 hours ago

The using directive of the C# programming language is often used to create namespace aliases, allowing types with matching names that appear in separate namespaces to be easily accessed. A lesser known use of the directive is to create aliases for types. read more...

2 comments |category: |Views: 271

tags: another

Work Stealing | Passion of Programming in .NET(badamczewski.blogspot.com)

submitted by badamczewskibadamczewski(9) 15 days, 5 hours ago

When working with multi threaded applications, we tend to spawn worker threads which can lead to ineffective code when not done correctly, for example threads will not get reused and will be recreated for each work items. The solution to all those problems is a ThreadPool which reuses threads and queues work items that are consumed by those threads. This sort of implementation while simple can have side effects as unless the pool Queue is immutable it will have to be locked each time an item Enqueued and... read more...

add a comment |category: |Views: 32

tags: another

Performance Tuning Visual Studio Builds(jameslewiscv.com)

submitted by JamesLewisAwesomeJamesLewisAwesome(75) 16 days, 22 hours ago

My findings after spending a day trying to bring our teams local build time down from over a minute. read more...

1 comment |category: |Views: 302

tags: another

Faking num lock, caps lock and scroll lock leds(www.aboutmycode.com)

submitted by mcnamaragiomcnamaragio(283) 18 days, 2 hours ago

Some time ago I came across a post where the author wanted to turn on and off num lock, cap lock and scroll lock led light without actually toggling their state. This sounded challenging and impossible but after some googling I found a piece of code in C for achieving exactly what I was looking for. In this post I show how it works and how to port it to C# read more...

1 comment |category: |Views: 143

tags: another

What JavaScript taught me about C# – Understanding ‘Access to modified(sblakemore.com)

submitted by onesteronester(90) 19 days, 11 hours ago

This is how I finally came to understand fully 'Access to modified closure', plus details of a BREAKING CHANGE in C# 5 regarding this! read more...

1 comment |category: |Views: 361

tags: another

Using delegates, func and lambdas: a tutorial with soldiers(timdams.wordpress.com)

submitted by timdamstimdams(119) 21 days, 7 hours ago

In this tutorial, written for beginning programmers, I’d like to show a little demonstration on the usage of delegates and how we can go all crazy by refactoring and magically see all our duplicate code disappear. read more...

2 comments |category: |Views: 319

tags: another

Creating Parallel Tasks with TaskFactory(www.blackwasp.co.uk)

submitted by BlackWaspBlackWasp(4212) 24 days, 16 hours ago

The Task Parallel Library provides a number of ways in which parallel tasks can be instantiated. This article describes the use of the TaskFactory class, which uses the factory method design pattern to generate and start tasks with a single method call. read more...

1 comment |category: |Views: 184

tags: another

C#/.NET Little Wonders: The Enumerable.Repeat() Static Method(www.blackrabbitcoder.net)

submitted by BlackRabbitCoderBlackRabbitCoder(661) 24 days, 14 hours ago

The Enumerable.Repeat() method performs the simple task of creating a sequence by repeating an element a specific number of times. While this is, in of itself, a trivial need, it can also be used to drive more useful results such as repeating a generator delegate, or creating sequences out of single items. read more...

1 comment |category: |Views: 295

tags: another

Compilify: Compile and run your .Net code in the browser(www.compilify.net)

submitted by dpetersondpeterson(4397) 1 month, 2 days ago

Compilify is a new website that lets you compile and run your .Net code right from the browser. Built on the Rosyln CTP, Compilify lets you write, compile, and observe the output of your code right from your browser. Now you can write and test code from anywhere, without the need for Visual Studio. It's fast too! read more...

add a comment |category: |Views: 294

tags: another

Building Expression Evaluator with Expression Trees in C# – Improving (www.aboutmycode.com)

submitted by mcnamaragiomcnamaragio(283) 1 month, 5 days ago

Our expression evaluator has support for variables but it has a big disadvantage: values of the variables are bound by position and not by name. This means that you should pass values for the variables in the same order as they appear in the expression. On the other hand binding by name has following advantages: If you change the expression you do not have to worry about keeping order of the variables you pass in sync. In this post we are going to change expression evaluator to bind parameters by name. We will also add a new overload for better performance when we need to evaluate same expression with different parameter values. read more...

add a comment |category: |Views: 122

tags: another

NHibernate's inverse - what does it really mean?(notherdev.blogspot.com)

submitted by notherdevnotherdev(238) 1 month, 12 days ago

NHibernate's concept of 'inverse' in relationships is probably the most often discussed and misunderstood mapping feature. When I was learning NHibernate, it took me some time to move from "I know where should I put 'inverse' and what then happens" to "I know why do I need 'inverse' here and there at all". Also now, whenever I'm trying to explain inverses to somebody, I find it pretty hard. read more...

add a comment |category: |Views: 132

tags: another

Delegates in c#(www.dotnetjalps.com)

submitted by jalpeshjalpesh(1347) 1 month, 16 days ago

I have used delegates in my programming since C# 2.0. But I have seen there are lots of confusion going on with delegates so I have decided to blog about it. In this blog I will explain about delegate basics and use of delegates in C#. What is delegate? We can say a delegate is a type safe function pointer which holds methods reference in object. As per MSDN it's a type that references to a method. So you can assign more than one methods to delegates with same parameter and same return type. read more...

add a comment |category: |Views: 25

tags: another