Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Desktop Developer

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

Search

XML Feeds

Google Ads

Tags: linq

comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

Last week I was asked to create a normalisation routine for the Msp spectra that my application uses. No worry if you don't know what Msp is. The thing is that it needed to find the maximum value in a collection of values and then do a calculation with that number over the other values in that collection.

First the value object.

vbnet Sample Code (See Article for Rest)
Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

In an ICollection(of T) you have a contains method to see if your collection has the requested element in it. But if you want to look for Multiple elements, you have to resort to making predicates (and we all know how ugly those get).

So why didn’t MS implement ContainsAny (OR) and/or ContainsAll (AND). I couldn’t think of a good reason, so I made them myself. They are perhaps a bit over easy and not very performance friendly but they work.

Here are the extension methods.

vbnet Sample Code (See Article for Rest)
Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

Problem

I keep forgetting that it needs the System.linq namespace to work. And I keep forgetting that it is not set by default on my projects. I try not to overuse linq but sometimes it is easy.

So what happened?

I was trying this:

vbnet Sample Code (See Article for Rest)
Read More...