Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Thursday, February 9, 2012

Linq Except with Duplicate Members

List<string> popcapGames = new List<string> { "Zuma",

"Chuzzled",

"Bejeweled",

"Plants vs Zombies",

"Zuma",

"Peggle"

};

// I want all the elements except Chuzzled.

List<string> excludingChuzzled = popcapGames.Except(popcapGames.Where(x => x == "Chuzzled")).ToList();

// I expect excludingChuzzled to be: { "Zuma",

// "Bejeweled",

// "Plants vs Zombies",

// "Zuma",

// "Peggle"

// };

//

//

//

//

//

// but actually its: { "Zuma",

// "Bejeweled",

// "Plants vs Zombies",

// "Peggle"

// };

// What happened to my duplicate "Zuma"?

//

// I don't like Except any more.

var

My colleagues don't like the var keyword. I do.

Monday, April 6, 2009

Project 1: File Contribution, Tracking, Sharing, Collaboration, Synchronisation

On Friday, the 3rd of April at about 6 in the morning, it struck Robert that learning C# might not be a bad idea. We identified that the problem with learning a programming language or any software development methodology from scratch using online tutorials is that the usage examples don't really make any sense.

When people ask me what object orientation is, I use the classic example of the class "Person" and the object instantiation of "Person", "kareema" or "aPerson". I hear myself going on and on about how a Person needs a Name, an Age and a Sex and that kareema, the instantiation of the class Person needs particular values for those criteria.

Robert asks me, "When will I ever need that?" and it's clear to me that the only way to learn stuff like that is to need it. Incidentally, we do.

Enter the problem: My sisters and I have a network set up at home. We all share the same DSL internet connection and we all download data. Sometimes we download the same stuff without realising it. Bandwidth usage is a big thing for us because it happens to be relatively expensive where we live and we'd like to minimise it.

I know there are file synchronisation tools available for downloading and buying but we thought this would be a great opportunity to exercise skills, become more familiar with the development environment and identify needs for patterns and such the like.