Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
GeneralGetHashCode() Pin
deanoA3-Sep-03 0:18
deanoA3-Sep-03 0:18 
GeneralRe: GetHashCode() Pin
dog_spawn3-Sep-03 1:31
dog_spawn3-Sep-03 1:31 
GeneralRe: GetHashCode() Pin
freshthinking3-Sep-03 4:42
freshthinking3-Sep-03 4:42 
GeneralRe: GetHashCode() Pin
James T. Johnson3-Sep-03 6:54
James T. Johnson3-Sep-03 6:54 
GeneralRe: GetHashCode() Pin
dog_spawn3-Sep-03 7:06
dog_spawn3-Sep-03 7:06 
GeneralRe: GetHashCode() Pin
James T. Johnson3-Sep-03 7:09
James T. Johnson3-Sep-03 7:09 
GeneralRe: GetHashCode() Pin
--daljv--3-Sep-03 16:17
suss--daljv--3-Sep-03 16:17 
GeneralRe: GetHashCode() Pin
James T. Johnson3-Sep-03 7:07
James T. Johnson3-Sep-03 7:07 
daljv wrote:
Any ideas what Hashcode is?

GetHashCode is used to provide a value called a 'hash' for classes like System.Collections.Hashtable. These classes use that value to create a collection which can grow but still retain a fast look-up to get the proper value. A hash table is also called a Map by some people because you can map one value on to another.

For example, you can use a Hashtable to map a string representing the name of a customer onto an object that contains more information about that customer. Hashtable internally calls GetHashCode on the string so that it can find the customer object quickly.

Rather than calling GetHashCode on the Checked property you could just use the ?: operator.

Checkbox1.Checked ? 1 : 0;

That basically expands out to,

if( Checkbox1.Checked )
  return 1;
else
  return 0;
HTH,

James

At Jethro Tull's August 28, 2003 concert Ian Anderson mentioned that the group would be performing a medley of title tracks. The songs were "Songs from the Wood", "Too Old to Rock and Roll; Too Young to Die"; and from the Heavy Horses album, "Stairway to Heaven".
GeneralRecordSelection in Crystal Reports Pin
Marix2-Sep-03 22:55
Marix2-Sep-03 22:55 
GeneralRe: RecordSelection in Crystal Reports Pin
Braulio Dez3-Sep-03 4:24
Braulio Dez3-Sep-03 4:24 
GeneralRe: Sorry... answers from the newsgroups... Pin
Braulio Dez3-Sep-03 4:26
Braulio Dez3-Sep-03 4:26 
GeneralDisplaying label in ASP.NET Pin
IrishSonic2-Sep-03 22:39
IrishSonic2-Sep-03 22:39 
Generalscroll events detecting Pin
azusakt2-Sep-03 21:39
azusakt2-Sep-03 21:39 
GeneralRe: scroll events detecting Pin
J. Dunlap2-Sep-03 21:46
J. Dunlap2-Sep-03 21:46 
GeneralRe: scroll events detecting Pin
azusakt2-Sep-03 22:04
azusakt2-Sep-03 22:04 
GeneralRe: scroll events detecting Pin
J. Dunlap3-Sep-03 19:43
J. Dunlap3-Sep-03 19:43 
GeneralRe: scroll events detecting Pin
azusakt3-Sep-03 17:12
azusakt3-Sep-03 17:12 
GeneralGAC and Versioning Question Pin
Mazdak2-Sep-03 21:20
Mazdak2-Sep-03 21:20 
GeneralAccessing a .mdb database on a CD Pin
Den2Fly2-Sep-03 21:15
Den2Fly2-Sep-03 21:15 
GeneralRe: Accessing a .mdb database on a CD Pin
Mazdak2-Sep-03 21:23
Mazdak2-Sep-03 21:23 
GeneralRe: Accessing a .mdb database on a CD Pin
J. Dunlap2-Sep-03 21:48
J. Dunlap2-Sep-03 21:48 
GeneralRe: Accessing a .mdb database on a CD Pin
Tatham2-Sep-03 22:34
Tatham2-Sep-03 22:34 
GeneralRe: Accessing a .mdb database on a CD Pin
Braulio Dez3-Sep-03 5:47
Braulio Dez3-Sep-03 5:47 
GeneralOne more tip Pin
Braulio Dez3-Sep-03 5:58
Braulio Dez3-Sep-03 5:58 
GeneralRe: Accessing a .mdb database on a CD Pin
Anonymous3-Sep-03 6:52
Anonymous3-Sep-03 6:52 

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.