|
hi,
ok, i got what you want to tell.
thanks.
Chirag Patel
Programmer Analyst
India
|
|
|
|
|
Is there any method in BCL which eliminates the Duplicate items from a listbox?
Or do I have to specifically write a method for it??
|
|
|
|
|
hmmm...
LB.Items.CopyTo()
hope this will help
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Xmen wrote: LB.Items.CopyTo()
Well I think u didnt get my question..
ListBox.Items.CopyTo() copies the entire collection into an array..
What I meant that I want to check whether an item is duplicated in my Listbox..
So is there any method for that in BCL or do I have to manually code one?
|
|
|
|
|
Not that I know of. Surely it would be better to validate the input and disallow duplicates using the Contains() method, rather than adding it then having to remove it later?
Dave
|
|
|
|
|
hi,
how can i change the regional settings, input locale programatically using c#. input locale has to be applied for the Operating system level. plz help me out..
Thanks in advance.
hemanth
|
|
|
|
|
hi all,how to convert string to ascii code..pls give me some example coding..thank you..
kam
modified on Wednesday, March 12, 2008 3:10 AM
|
|
|
|
|
|
Heya,
All you need to do is get the character array from the string, and loop through each character and convert it to an integer, normally int16 will do the job.
The character converted to an integer leaves you its ASCII value
Kyle Rozendo
Developer :: Seriun
UK :: RSA
|
|
|
|
|
i'm having a problem when i try to convert string to float, that is,
the precision messed up
code:
float ff = Convert.ToSingle(textBox1.Text);
Ex1
Input : 98.9824131
Output : 98.9824142
Ex2
Input : 98.9824139
Output : 98.9824142
Ex3
Input : 98.9824188
Output : 98.98242
i read an article, where the author said that if last digit is odd then it will be round to even but here it all mess up
in Ex1 and Ex2, what the hell happened, i increased by 0.0000011 and 0.0000003
in Ex3 last 2 digits has been removed then last digit rounded
any solution??
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Try to use double. Single does not have enough precision to represent your numbers (you need 9 while single precision is up to 7).
|
|
|
|
|
i cannot use double because of restriction, who said i need 9 precision ???
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
98.9824131 <- 9 significant digits, you need 9 precision to represent it exactly in floating point.
|
|
|
|
|
98.9824131, oh that mean 98 will also count ?? are you sure ??
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Yep. It is stored as 0.9898241 in 23 bits or something like that: Wiki: Single_precision[^]
So you can either have more significant digits behind the decimal, or more significant digits before the decimal, or share between the two.
|
|
|
|
|
If you are dealing with money and don't want to get screwed, use decimal .
Cheers,
Vikram.
Zeppelin's law: In any Soapbox discussion involving Stan Shannon, the probability of the term "leftist" or "Marxist" appearing approaches 1 monotonically.
Harris' addendum: I think you meant "monotonously".
Martin's second addendum: Jeffersonian... I think that should at least get a mention.
|
|
|
|
|
something like that, i have a fixed format where i need to use float, so i cant use any other
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
Someone can help me on this subject? I read some tutorials and it is a bit confusing.
Can anyone point me a good tutorial? Just the simple explination of the aim of it, no need of many code.
I read the code but i can not find the purpose of it, when i need to use it.
Thanks 
|
|
|
|
|
Link 1
Link 2
Link 3
hope these will help
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi All,
Just writing a some recursion and want a little advice. I'm encountering directories like "System Volume Information" and its trying to access these and throwing an exception. I don't want to scan these anyway.
Was just thinking about the best way to deal with this. Would you just wrap it in a little try{} catch{} or is there a better way?
Cheers,
Jammer
Going where everyone here has gone before!
|
|
|
|
|
When your going through the folders, check the attributes. You probably want to look for System or ReadOnly, if you find a folder with one of these then just return, or continue or whatever it is you need to do.
So, assuming your using DirectoryInfo somewhere then you could do something like this:
void function(string Path) {
DirectoryInfo di = new DirectoryInfo(Path);
if(di.Attributes&FileAttributes.System)
return;
}
I think that might help. Unless the errors are thrown as soon as you try to access the folder in any way, in which case i suggest you set up a try-catch block. With the correct exception mind.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
Indeed ... I've covered all the errors I've seen so far and logging them to the event log for my app so I can troubleshoot later.
Just out of interest what would be the more performance efficient. Testing the directory as you say or wrapping in a try{}catch{} (which is what I'm doing now ...)
Thanks,
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Well, it'd probably be quicker to check the directory than to catch an error. And even if it were slower, id still go with the if statement myself.
Oh yeah, and the if statement would be more like this:
if((di.Attributes&FileAttributes.System)>0) with the added >0 part.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
Gotcha.
Not sure what to do ...
I'm just testing this on my machine and I'm scanning 26,000+ directories (I have a large machine!) and its having to catch one exception per drive (System Volume Information). I'm already ignoring CD Drives, Floppies and Network Drives. Do you think testing every directory with an if will be quicker than trying and then catching on 3 throw exception?
Thanks,
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Probably not no, and im sure it takes long enough to scan 26K directories. Go with the try-catch then.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|