|
Of course not ! Thats an exercise for the next poor soul that works on the code :p
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
Pete O`Hanlon wrote: ://it checks it contains 11 char (dd/MMM/yyyy)
if (Convert.ToInt16(chkdate.Length.ToString()).ToString() != "11")
{
//if it does not have 11 char then it will return false
return false;
}
Fixed
|
|
|
|
|
Is this what they call optimized code?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
For checking whether the string contains a valid date the code is crap. (SCNR)
This shows what the results of "high level" programming languages are.
Greetings from Germany
|
|
|
|
|
KarstenK wrote: This shows what the results of "high level" programming languages are
Idiot developers who shouldn't be let anywhere near a keyboard without being wired up to the mains and given a shock everytime they produce crap like this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Then even the lead developer would be shocking.
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Why can't not ONE of you folkes be grown up enough to simply say that the rubbish:
://it checks if it contains 11 char (dd/MMM/yyyy)
if (Convert.ToInt16(chkdate.Length.ToString()) != 11)
{
// Do something if not.
}
SHOULD be:
:// it checks if it contains 11 char (dd/MMM/yyyy)
if (chkdate.Length != 11)
{
// Do something if not.
}
How hard can it be?
It's OK to pinpoint bad code like that but it's not OK not to come up with a useable alternative.
Michael M., mm it-consult dk.
|
|
|
|
|
Michael Mogensen wrote: Why can't not ONE of you folkes be grown up enough to simply say...
Michael,
Is your sense of humor having a bad day?
But if we are geting serious, I'd like to point out that your question contains a double negative and means the opposite of your apparent intended meaning.
|
|
|
|
|
Pete O`Hanlon wrote: :
<br />
if (Convert.ToInt16(chkdate.Length.ToString()) != 11)<br />
{<br />
return false;<br />
}<br />
Shouldn't the comparison do this?
<br />
if (chkdate.Length.ToString() != "11")<br />
|
|
|
|
|
...Double negative... I give up... SS... forget it...
Not beeing 100% into C# (I'm c/cpp) I suppose that this issue is something in the area of 'to get the types right' right? (ough double 'right' ... sorry)
If this is string: chkdate, then this is int: chkdate.length and then I compare 11 to int which is ok, or?
Michael M., mm it-consult dk.
|
|
|
|
|
Michael,
I'm far from 100% into C#, like you, I'm a c/c++ guy. (We still have lots of stuff that's says it's c++ but it's mostly old style C).
Anyway, this is an issue of getting the types right. And I was just being a smart alec.
-- Tony
|
|
|
|
|
i am doing a proj to implement quantum encryption in a vb appln. i just need a best algorithm for doin that.. pls help me soon as my proj dates are coming closer....
Thank u,
Freak8802
|
|
|
|
|
FREAK8802 wrote: implement quantum encryption in a vb appln
I think you are going to need a very small chisel and hammer.
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
No need. All VB apps are quantum encrypted anyway.
Or did I mean 'a quantity of cr*p'?
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
FREAK8802 wrote: proj dates are coming closer
don't worry, quantum encryption runs at the speed of light.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi. Tell you what, you tell me the secret password, the number I'm thinking of and 1 valid reason why I should give this information to you from THIS forum, and I'll oblige.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Tell you what, you tell me the secret password
cheesynipple
Pete O`Hanlon wrote: the number I'm thinking of
42
Pete O`Hanlon wrote: and 1 valid reason why I should give this information to you from THIS forum
I'll give you a free pie
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
The Undefeated wrote: I'll give you a free pie
that won't cut it, IMO Pete wants a waffle, but I know you ran out.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
The Undefeated wrote: cheesynipple
That's so gross - BTW that's the counter reply to cheesynipple.
The Undefeated wrote: 42
Correct.
The Undefeated wrote: I'll give you a free pie
Now, had you said you'd give me two free pies or one waffle and you would have got the code for free.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The Undefeated wrote: Pete O`Hanlon wrote:
the number I'm thinking of
42
Like there is another number
codito ergo sum
|
|
|
|
|
Quantum cryptography makes use of light waves and optical fibers. Firing up Visual Basic 1.0 isn't going to get you there.
Suggestion: Get a flashlight and manually flip the light on and off (1 for on, 0 for off).
ROFLOLMFAO
|
|
|
|
|
|
Once you get some code written, modify your your post and add some code so your post will be in the proper forum.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Although I also have a hard time taking this seriously, here goes a shot at a serious answer. Quantum Cryptography usually signifies two things, as far as current tech allows: (1) generating truly random numbers, via Quant. Phys.; (2) sending keys securely, by using quantum physics to recognize a tap on the line. MagiQ sells VPN hardware that does both of these things. Their RNG alone creates up to 100 unpredictable keys a second.
So, what do you need to do? Get some of that hardware. Write VB wrappers around all pertinent API functions. Generate keys with the Quantum RNG, and use them with a good encryption algorithm, like AES. If you are transmitting data, send it using Public Key cryptography, with at least the private keys generated from the quantum hardware. You can do the key-exchange part over quantum hardware, to detect taps. Operator should be notified if line is breached regularly. Just be sure to ask MagiQ (or the other unknown one) for technical documentation, to be sure this would work. Oh yeah, if you build a VB Quantum CryptoAPI, I will be expecting a free copy.
-Nick P.
|
|
|
|
|
I hate posting this, since probably 85% of general population actually love using #if and #ifdef and even see that's the only easy way to do "cross-platform". I don't, BTW.
Here is my gripe.
One #if is fine. Nested #if is nasty (I've seen #if else nested 8 level deep, with structures whose definition has more #if in it).
Problem is #if begets another #if. I work in a company that has at least 90 conditional compile flags set into either makefile or command line. BTW, my Unix terminal has to scroll 4 pages for the complete build commands (and yes, mostly are the -D define flag). The worst part is the flags are peppered all over the code, maybe 2 millions LOC. And nobody bothers to consolidate them.
I've seen a Linux distro that has parts of files that is different between platform stored in different directory. I couldn't remember what the Linux flavor was. They choose between target sources in makefile, instead of in the code. And the differences are stored in different dirs for ex. /x86 /alpha /risc, and these files have exactly same files with different content.
I think this is a much more cleaner and maintainable approach. The key is to identify what would be different and consolidate it in one area.
Any other ideas?
|
|
|
|