Click here to Skip to main content
15,895,283 members
Home / Discussions / C#
   

C#

 
GeneralRe: Storing 2 bytes in one Pin
harold aptroot22-Dec-09 6:52
harold aptroot22-Dec-09 6:52 
GeneralRe: Storing 2 bytes in one Pin
Chris Copeland22-Dec-09 6:57
mveChris Copeland22-Dec-09 6:57 
GeneralRe: Storing 2 bytes in one Pin
harold aptroot22-Dec-09 7:09
harold aptroot22-Dec-09 7:09 
GeneralRe: Storing 2 bytes in one Pin
Chris Copeland22-Dec-09 7:18
mveChris Copeland22-Dec-09 7:18 
GeneralRe: Storing 2 bytes in one Pin
harold aptroot22-Dec-09 7:21
harold aptroot22-Dec-09 7:21 
GeneralRe: Storing 2 bytes in one Pin
Chris Copeland22-Dec-09 7:29
mveChris Copeland22-Dec-09 7:29 
GeneralRe: Storing 2 bytes in one Pin
harold aptroot22-Dec-09 7:48
harold aptroot22-Dec-09 7:48 
GeneralRe: Storing 2 bytes in one Pin
Ben Fair22-Dec-09 11:06
Ben Fair22-Dec-09 11:06 
It seems you are essentially looking for a Hashing algorithm to take 2 values and create a single unique value where the hash would be unique across your entire set; for example the hash of the values 14, 16 would need to be different than 16, 14. I would recommend using one of the built-in collection classes that implement such algorithms rather than trying to create your own. The Hashtable and Dictionary classes should work nicely or you can use the System.Drawing.Point class to create coordinates. Personally, I'd use Dictionary<point, [some_other_type]=""> where the Points are X, Y coordinates of the cells in the set. Since Point is a struct its operated on as a value type and can easily lend itself to what you're trying to do. I believe the default Point struct's X and Y members are int and if you are worried about wasted memory you could create your own Point struct that has X and Y of byte, or short, etc. If you decide to use the Dictionary class try to pass in the number of cells to the constructor (you will hopefully know that upon creation) and it will help performance slightly by preventing it from automatically growing its internal collection as items are added.

Hope in one hand and poop in the other; see which fills up first. Hope and change were good slogans, now show us more than words.

GeneralRe: Storing 2 bytes in one Pin
harold aptroot22-Dec-09 11:14
harold aptroot22-Dec-09 11:14 
GeneralRe: Storing 2 bytes in one Pin
J4amieC22-Dec-09 21:30
J4amieC22-Dec-09 21:30 
GeneralRe: Storing 2 bytes in one Pin
harold aptroot22-Dec-09 21:44
harold aptroot22-Dec-09 21:44 
AnswerRe: Storing 2 bytes in one Pin
PIEBALDconsult22-Dec-09 10:28
mvePIEBALDconsult22-Dec-09 10:28 
GeneralRe: Storing 2 bytes in one Pin
Luc Pattyn22-Dec-09 12:00
sitebuilderLuc Pattyn22-Dec-09 12:00 
AnswerRe: Storing 2 bytes in one Pin
J4amieC22-Dec-09 21:33
J4amieC22-Dec-09 21:33 
AnswerRe: Storing 2 bytes in one Pin
vtchris-peterson23-Dec-09 7:26
vtchris-peterson23-Dec-09 7:26 
Questionproblem with list view selection. Pin
santhosh-padamatinti22-Dec-09 5:20
santhosh-padamatinti22-Dec-09 5:20 
AnswerRe: problem with list view selection. Pin
EddieRich22-Dec-09 5:37
EddieRich22-Dec-09 5:37 
QuestionWebparts Pin
NETLearning22-Dec-09 5:06
NETLearning22-Dec-09 5:06 
QuestionC# / LINQ Directory.GetFiles Pin
Wheels01222-Dec-09 3:37
Wheels01222-Dec-09 3:37 
AnswerRe: C# / LINQ Directory.GetFiles Pin
Rob Philpott22-Dec-09 3:51
Rob Philpott22-Dec-09 3:51 
AnswerRe: C# / LINQ Directory.GetFiles Pin
#realJSOP22-Dec-09 3:53
mve#realJSOP22-Dec-09 3:53 
AnswerRe: C# / LINQ Directory.GetFiles Pin
Luc Pattyn22-Dec-09 6:26
sitebuilderLuc Pattyn22-Dec-09 6:26 
GeneralRe: C# / LINQ Directory.GetFiles Pin
Wheels01222-Dec-09 6:32
Wheels01222-Dec-09 6:32 
QuestionFile copy progress Pin
Samarchpa22-Dec-09 3:21
Samarchpa22-Dec-09 3:21 
AnswerRe: File copy progress Pin
Rob Philpott22-Dec-09 3:53
Rob Philpott22-Dec-09 3:53 

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.