Click here to Skip to main content
15,902,939 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Regular Expression Help Pin
Dimitri Witkowski30-Dec-09 22:00
Dimitri Witkowski30-Dec-09 22:00 
GeneralRe: Regular Expression Help Pin
Paul Selormey30-Dec-09 22:22
Paul Selormey30-Dec-09 22:22 
QuestionTwo hashsets same values, different HashCodes? Pin
ThomasPep29-Dec-09 20:32
ThomasPep29-Dec-09 20:32 
AnswerRe: Two hashsets same values, different HashCodes? Pin
Luc Pattyn30-Dec-09 1:00
sitebuilderLuc Pattyn30-Dec-09 1:00 
GeneralRe: Two hashsets same values, different HashCodes? Pin
ThomasPep30-Dec-09 2:20
ThomasPep30-Dec-09 2:20 
GeneralRe: Two hashsets same values, different HashCodes? Pin
Luc Pattyn30-Dec-09 3:03
sitebuilderLuc Pattyn30-Dec-09 3:03 
GeneralRe: Two hashsets same values, different HashCodes? Pin
Gideon Engelberth30-Dec-09 13:22
Gideon Engelberth30-Dec-09 13:22 
GeneralRe: Two hashsets same values, different HashCodes? [modified] Pin
ThomasPep30-Dec-09 20:29
ThomasPep30-Dec-09 20:29 
I had a HashSet of HashSets - and wanted no duplicates when the elements (the sets) contained the same values. I did succeed (finally) by creating the sets with a non default comparer and SetEquals as you write (and overwriting all "GetHashCode" I could think of potentially being called D'Oh! | :doh: ).

It seems to me that the HashSet implementation in .net needs some twisting to work with references/nested references when testing on values is needed (I didn't succeed with CreateSetComparer as only "1-level", though should be possible to nest this).

The following also confused me good during debugging:
using System;
using System.Collections.Generic;

HashSet<HashSet<int>> setA = new .....; 
HashSet<int> subSetB = new HashSet<int>(new int[]{....});
setA.Contains(subSetB)

This code ran well except I could never find subSetB... - and I was confused (happens a lot to me) as the documentation referred to two methods including one setA.Contains(subSetB,myComparer) which I couldn't find with IntelliSense.

Finally I realized that the namespace for the two methods were System.Linq, so I included System.Linq and I could use myComparer and find subSetB. I guess the code above used an earlier version of HashSet than .NET 3.5 to run - but that took some time to find out.

modified on Thursday, December 31, 2009 12:53 PM

QuestionHow to propagate an exception raised in a worker thread to the UI thread Pin
DanielDaMeda29-Dec-09 10:21
DanielDaMeda29-Dec-09 10:21 
AnswerRe: How to propagate an exception raised in a worker thread to the UI thread Pin
ProtoBytes29-Dec-09 11:13
ProtoBytes29-Dec-09 11:13 
AnswerRe: How to propagate an exception raised in a worker thread to the UI thread Pin
john_masen6-Jan-10 2:11
john_masen6-Jan-10 2:11 
AnswerRe: How to propagate an exception raised in a worker thread to the UI thread Pin
David Skelly6-Jan-10 5:41
David Skelly6-Jan-10 5:41 
QuestionUsing SMTP client of .net in proxy connections to send email Pin
JayKhatri28-Dec-09 19:52
JayKhatri28-Dec-09 19:52 
AnswerRe: Using SMTP client of .net in proxy connections to send email Pin
Dave Kreskowiak30-Dec-09 7:01
mveDave Kreskowiak30-Dec-09 7:01 
QuestionCommunicating with servers by code Pin
khKamel28-Dec-09 8:06
khKamel28-Dec-09 8:06 
AnswerRe: Communicating with servers by code Pin
Abhinav S28-Dec-09 19:55
Abhinav S28-Dec-09 19:55 
GeneralRe: Communicating with servers by code Pin
khKamel29-Dec-09 0:46
khKamel29-Dec-09 0:46 
GeneralRe: Communicating with servers by code Pin
Abhinav S30-Dec-09 2:03
Abhinav S30-Dec-09 2:03 
QuestionDebgugging application with AsyncOperations Pin
Jeroen De Dauw27-Dec-09 9:33
Jeroen De Dauw27-Dec-09 9:33 
AnswerRe: Debgugging application with AsyncOperations Pin
Eddy Vluggen29-Dec-09 7:10
professionalEddy Vluggen29-Dec-09 7:10 
AnswerRe: Debgugging application with AsyncOperations Pin
Luc Pattyn29-Dec-09 7:18
sitebuilderLuc Pattyn29-Dec-09 7:18 
QuestionRegion question [modified] Pin
Steve5177127-Dec-09 0:09
Steve5177127-Dec-09 0:09 
AnswerRe: Region question Pin
Luc Pattyn27-Dec-09 0:42
sitebuilderLuc Pattyn27-Dec-09 0:42 
Generaltest Pin
amitsol26-Dec-09 19:41
amitsol26-Dec-09 19:41 
GeneralRe: test [failed] Pin
Mark Salsbery27-Dec-09 8:41
Mark Salsbery27-Dec-09 8:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.