|
by: Greg Bacchus |
last post by:
Hi,
I'm just concerned about storing a large amount of items in a Hashtable. It
seems to me that as the number of keys in the Hashtable increases, so does
the chance of key clashes.
Does anyone know about the performance with regards to this?
Cheers
Greg
|
by: Avin Patel |
last post by:
Hi
I have question for GetHashCode() function, Is it correct in following code or there is more efficient way to implement GetHashCode() function
class IntArray
public int data
public override int GetHashCode()
int hash = 0
for (int i = 0; i < data.Length; i++
|
by: Stoyan |
last post by:
Hi All,
I don't understand very well this part of MSDN:
"Derived classes that override GetHashCode must also override Equals to
guarantee that two objects considered equal have the same hash code;
otherwise, Hashtable might not work correctly."
Does any one know, why we must also override Equals,
Please give my an example:)
Thanks,
Stoyan
|
by: Matthias Kientz |
last post by:
I have a class which should override the GetHashcode() function, which
look like this:
public class A
{
public string str1;
public string str2;
//other methods...
|
by: One Handed Man [ OHM# ] |
last post by:
The help for the .NET Framework Class Library tells us that the Object.GetHashCode() Method does not guarantee uniqueness' or consistency and that overriding this and the Equals method is a good idea.
It also tells us that using the XOR functions on two or more Fields or Properties is an acceptable way to achieve this.
What do you guys think is the best approach to this given that generating a hashcode should be fast as well as consistant....
|
|
by: MariusI |
last post by:
I have some business objects which overrides Equals to provide syntax
equality instead of just reference equality. Overriding equals gives me a
warning that i must override GetHashcode(). Msdn says this about implementing
hashcode:
(1)If two objects of the same type represent the same value, the hash
function must return the same constant value for either object.
(2)For the best performance, a hash function must generate a random...
|
by: Stephan Keil |
last post by:
Hi all,
I am somewhat confused by the Object.GetHashCode() documentation. What I am
looking for, is a hash code, which is bound to the _identity_ of an
object, not to it's _value_ (see other thread "Object identity").
In the documentation, the statement
"The hash function must return exactly the same value regardless of any
changes that are made to the object"
suggestes that the hash code is bound to an object _identity_ (that would
|
by: Metaman |
last post by:
I'm trying to write a generic method to generate Hashcodes but am having some
problems with (generic) collections. Here is the code of my method:
public static int GetHashCode(object input)
{
try
{
Type objectType = input.GetType();
PropertyInfo properties = objectType.GetProperties();
|
by: Tony Johansson |
last post by:
Hello!
I can't figure out what point it is to use GetHashCode. I know that this
GetHashCode is used for obtaining a unique integer
value.
Can somebody give me an example that prove the usefulness of this
GetHashCode or it it of no use at all?
A mean that if I get an integer from current time in some way what should I
use it for?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|