CSharpFeeds - All your C# feeds in one place.

Friday, June 19, 2009

Sponsor

OS Jam at Google London: C# 4 and the DLR

by skeet via Jon Skeet: Coding Blog on 6/19/2009 4:50:00 PM

Last night I presented for the first time at the Google Open Source Jam at our offices in London. The room was packed, but only a very few attendees were C# developers. I know that C# isn't the most popular language on the Open Source scene, but I was still surprised there weren't more people using C# for their jobs and hacking on Ruby/Python/etc at night. All the talks at OSJam are just 5 minutes long, with 2 minutes for questions. I'm really not used to this format, and felt extrem ...

[ read more ]

How do ASP.NET Application_ Events Work

by Rick Strahl via Rick Strahl's Web Log on 6/19/2009 4:03:29 AM

I got an interesting question via email today that asked the question: “How do ASP.NET Application_ Event Handlers get hooked so that they are automatically fired?” If you’ve worked with ASP.NET for any amount of time you probably know about the global.asax file and its backing global class that holds event handlers for several common HttpApplication Event Handlers: public class Global : System.Web.HttpApplication { protected void Application_Start(object sender, EventArgs e) { ...

[ read more ]

Thursday, June 18, 2009

Multithreading: adding cancelation to the initial event based pattern implementation

by luisabreu via LA.NET [EN] on 6/18/2009 9:45:36 PM

Today we’re going to improve the code we’ve started writing yesterday: we’re adding canceling support. As you might recall, in our last post we’ve built a simple class which supports a single asynchronous operation at a time. Since we only support one asynchronous operation at a time and we can only start one asynchronous operation from our class, then we only need to add a parameterless CancelAsync method. Here’s how you might implement the CancelAsync method: public void CancelAsync() { & ...

[ read more ]

Use your legs, not your back

by Eric Lippert via Fabulous Adventures In Coding on 6/18/2009 1:32:00 PM

In C# you can "lift", "raise" and "hoist", and they all mean different things. To "lift" an operator is to take an operator that operates on non-nullable value types, and create from it a similar operator that operates on nullable value types. (We are a little bit inconsistent in exactly how we use the word "lifted", which I documented here.) For example, if you have  public static Complex operator +(Complex x, Complex y) { ... }  then we automatically generate a lifted operator for ...

[ read more ]

Determine Whether an Assembly was compiled in Debug Mode

by ssmith via Steve Smith's Blog on 6/18/2009 2:48:47 AM

I’m working on a little application right now that provides some insight into the assemblies in use for a given application.  One of the things that I want to be able to show is whether or not each assembly was built in Debug or Release mode.  As you’re no doubt aware, running applications in production that were built in Debug mode can be a major performance problem (at a minimum – depending on what else you have turned on in Debug mode it could also be a security issue). So I did so ...

[ read more ]

Wednesday, June 17, 2009

Multithreading: implementing the event based pattern

by luisabreu via LA.NET [EN] on 6/17/2009 9:38:35 PM

In the last post of the series, we’ve taken a look at the main features offered by the event based pattern. Today, we’re going to look at how we can implement that pattern. We’re going to start small and we’re going to reuse the IAsyncResult sample for showing how you can implement this pattern. As we’ve seen in the previous post, we need to (at least) add a method (named XXXAsync) that will start the asynchronous operation and an event (named XXXCompleted) that will fire . In practice, this me ...

[ read more ]

Dynamic type inference and surprising possibilities

by skeet via Jon Skeet: Coding Blog on 6/17/2009 8:01:13 PM

There have been mutterings about the fact that I haven't been blogging much recently. I've been getting down to serious work on the second edition of C# in Depth, and it's taking a lot of my time. However, I thought I'd share a ghastly little example I've just come up with. I've been having an email discussion with Sam Ng, Chris Burrows and Eric Lippert about how dynamic typing works. Sam mentioned that even for dynamically bound calls, type inference can fail at compile ...

[ read more ]

Tuesday, June 16, 2009

C#4.0: clearing up some doubts

by luisabreu via LA.NET [EN] on 6/16/2009 3:53:29 PM

After my last post on C# 4.0, I’ve had an interesting exchange of tweets with Thomas Johansen about the usefulness of the code I’ve shown. As Thomas points out, knowing the type means that you should always cast it to that type so that you work with strongly typed verification (ie, compile time checking). In practice, what he’s saying is that example is completely useless because if you know the type of the object you’re creating, then you should always cast it to that type before using it. I d ...

[ read more ]

Multithreading: introducing the event based asynchronous pattern

by luisabreu via LA.NET [EN] on 6/16/2009 9:06:24 AM

In the last posts we’ve looked at several details associated with the use of the APM pattern. Today we’re going to start looking at the second pattern for doing asynchronous work: the event based asynchronous pattern. This pattern was introduced with .NET 2.0 and it targets components that are going to be used in GUIs. In other words, if you’re building components that are going to be used by developers that build GUIs, then you should prefer this pattern instead of the APM. To implement this ...

[ read more ]

Property Causing a Stack Dump

by sweisfeld via Shawn Weisfeld [MVP] on 6/16/2009 12:26:50 AM

Got a call today, someone was getting a stack dump every time they tried to assign a value to a property. Here is a screen print of the problem they were having. can you spot the problem? If you said that the property is calling itself you get a gold star.  What was happening is that every time we tried to set the Name property, it calls the Name property to set it, and that called the Name property, and that called the Name property, over and over again, till .NET stack dumped. We are m ...

[ read more ]

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us