CSharpFeeds - All your C# feeds in one place.

Sunday, January 02, 2011

Reimplementing LINQ to Objects: Part 25 - ToDictionary

by skeet via Jon Skeet: Coding Blog on 1/2/2011 9:50:45 PM

This one ended up being genuinely easy to implement, although with lots of tests for different situations. What is it? ToDictionary has four overloads which look remarkably similar to the ones we used for ToLookup: public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(     this IEnumerable<TSource> source,     Func<TSource, TKey> keySelector) public static Dictionary<TKey, TElement> ToDictionar ...

[ read more ]

Reimplementing LINQ to Objects: Part 24 - ToArray

by skeet via Jon Skeet: Coding Blog on 1/2/2011 8:45:12 PM

This really is a simple one. So simple I might even find the energy to implement ToDictionary as well tonight... we'll see. (EDIT: Oops. It became slightly less simple in the end, as I came up with the third implementation. Oh well.) What is it? ToArray is basically the equivalent of ToList, but producing an array instead of a list. It has a single signature: public static TSource[] ToArray<TSource>(this IEnumerable<TSource> source) Just to recap: It's another e ...

[ read more ]

Reimplementing LINQ to Objects: Part 23 - Take/Skip/TakeWhile/SkipWhile

by skeet via Jon Skeet: Coding Blog on 1/2/2011 6:45:27 PM

I genuinely expected these operators to be simple. At the time of this writing, I'm onto my third implementation of SkipWhile, struggling to find code which obviously expresses what's going on. I find it interesting how the simplest sounding operators sometimes end up being trickier to implement than one might think. What are they? Take, TakeWhile, Skip and SkipWhile form a natural group of operators. Together they are known as the partitioning operators. Here are the signatures: publ ...

[ read more ]

Pigeon

by Paul Stovell via Paul Stovell on 1/2/2011 2:00:00 PM

I'm still experimenting with building games, and one of my projects is a little client/server game. Rather than using WCF and dealing with the leaky abstractions, I decided to write something small and custom. Pigeon is an alternative to WCF designed for high throughput. It uses raw TCP sockets It uses Google Protocol Buffers to keep messages small It is asynchronous The code is on BitBucket On my local machine, WCF NetTcpBinding maxes out at about 10,000 messages/second, while Pigeon ach ...

[ read more ]

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

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