|
J4amieC wrote: Now, I had thought of concatenating the 4 values into a string and calling GetHashCode() on that string, but i thought this was a bit of a kludge... I guess i was getting too snmart for my boots
Are string hash codes guaranteed to be unique? I don't know the answer to that, but I'm guessing no.
Just wanted to point out that the solution Vlad described was not to concatenate strings but to bit-shift and OR together your ids. This guarentees uniqueness, but whether or not it's doable depends on the range of your ids.
J4amieC wrote: I now think its a better solution, but if any math-heads out there know the real solution id be interested to hear.
Creating good hash codes seems to be an art in and of itself, kind of like creating good psuedo random number generators. I don't know much about this field, but I believe a good hash code algorithm will generally give values that are evenly distributed. They don't necessarily have to be unique.
This is why if you override GetHashCode , it's recommended (required?) that you override Equals as well. That's so if a duplicate hash code is encountered, Equals can be used to find the actual item. Though, I can understand wanting to avoid duplicates for performance reasons.
At any rate, you may know all of this, just chiming in with my two cents.
[EDIT]
Actually, after rereading Vlad's post, it looks like what he describes in the first paragraph does use string concatenation to create unique keys. An interesting approach.
In the second paragraph, I'm assuming he's talking about bitwise operations instead of string concatenation. At any rate, both approaches look ok to me.
[/EDIT]
-- modified at 16:03 Tuesday 22nd November, 2005
|
|
|
|
|
hi to all,
how can i change the application major, minor and revision with the designer in c# win form.
best regrads and thanks in advance
fady
|
|
|
|
|
Open AssemblyInfo.cs and look for a string similar to this '[assembly: AssemblyVersion("1.0.0.02")]' by default I think the last number is an * and auto incremented.
|
|
|
|
|
Its in the AssemblyInfo.cs file with your project - winform, class library, web app et al.
|
|
|
|
|
Hello,
I've got a very big problem with the .NET remoting. I've developed a synchronization library using .NET 2.0 that uses classes derived from MarshalByRefObject . These classes have public events which remote objects can subscribe to. Under the 2.0 framework, everything works like a charm.
Now I have to port the library to .NET 1.x since my teachers want to be able to test and compile the code by themselves. I though that this would be a task of a few minutes. I guessed wrong. The runtime refuses to serialize the delegates. I've read something about RemotingSurrogateSelector , but I can't find a thorough explanation about how the class should be used to handle this type of serialization.
Does anybody know how I can subscribe to a remote event?
Source example:
public delegate void MyDelegate();
class RemoteObject : System.MarshalByRefObject
{
public event MyDelegate EvMyEvent;
}
class MyClient
{
private void MyDelegateFunction()
{
}
public MyClient()
{
RemoteObject oRO = null;
oRO.EvMyEvent += new MyDelegate(MyDelegateFunction);
}
}
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I don't know why this happens either, but making the delegate function (MyDelegateFunction ) public solves the problem. Ugly, I know, but it works. I guess this is a bug and has been corrected in .NET 2.0
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
Thanks for the reply. It's ugly indeed. It's that I'm not a strict OO purist... I hope that everybody moves to the .NET 2.0 framework soon..
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hello,
What would be the equivelent command in C# to Eval in VB?
Thank you.
|
|
|
|
|
|
is there anyone help about how can read rfid tags under .NET using c#. if it is possible can you send me an example. Because i try using serialport component and after i open port, i set baudrate but in every run this function, it is halted. what is the problem
Thanks So Much
|
|
|
|
|
Can anybody point me in the right direction for information on how to convert dwg files to emf format graphic files. Can this be done through C# code? Or do I need to get my hands dirty and delve into converting dwg's in C++? Any help or guidance would be highly appreciated. Thanks!
|
|
|
|
|
I'm well known about verison handling with SVN, but I like to start using the option source control that comes with Visual Studio.
I've searched here at CP but I can't find any tutorial on how to set up a server (which program to install).
Any tips where to start?
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi!
AFAIK VS only supports Visual SourceSafe and compatible SCC systems, so you're out of luck trying to use SVN in that way.
But there's an add-on for SVN (Ankh SVN) that can integrate into VS, perhaps you should check this out.
Regards,
mav
|
|
|
|
|
I gladly skip SVN!
Do you have any tip on a good SCC system?
_____________________________
...and justice for all
APe
|
|
|
|
|
Huh?
What's wrong with SVN? I'm using it, too...
mav
|
|
|
|
|
Do you use Subversion on your server?
At this moment I just want it to work and can I make it throug VS2005 and Subversion I am just happy!
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi
I have created an addin. Then i installed it. It gets instaleld successfully,
but when i reopened the VS2003 IDe next time it doesnt open and shows the error System.StackOverflowExcpetion in Drawing.dll file. and asks for debugger.
On debugging the project it points on the textbox that i have added.
please let me know the exact problem and how to rectify it.
Any pointers and help is highly appreciated.
Thanks
Naveen
|
|
|
|
|
Stack overflow exceptions usually happen because of unbounded recursion. Look for recursive calls to paint from within paint event handlers.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi Dears!
I am facing a problem. I want to get the names(Not the Datatype) of the controls used in a form on Tabpage @ run time how to achieve this.
Thnx in advace!
|
|
|
|
|
wut r u talking abt? win32 form or web?
mãdhãwã™4ever»(üþ îñ §mökz)®
|
|
|
|
|
I love the irony of you asking what he was talking about in (almost) totally incomprehensible language
|
|
|
|
|
Every Control that you add to a container such as a TabPage has a Name property.
|
|
|
|
|
Hi
I know how to run a program in c# (system.diagnostics.process.start)
but I cannot make it embeded in my form (Like the action that Internet explorer do with PDF files)
for example i want to have Acrobat toolbar in my toolbars or even have the program in a specific fram in my form
Thank you in advance
|
|
|
|
|
|
string[] names = new string[this.Controls.Count];
int i = 0;
foreach (Control c in this.Controls)
{
names[i] = c.Name;
i++;
}
------------------------------ "The Soapbox has been so ..."
|
|
|
|