KeyUp event
-
I just ran across this line of condition in a KeyUp handler.
if ((e.Modifiers.GetHashCode().ToString() + "+" + e.KeyCode.GetHashCode().ToString()) == "131072+39")
-
I just ran across this line of condition in a KeyUp handler.
if ((e.Modifiers.GetHashCode().ToString() + "+" + e.KeyCode.GetHashCode().ToString()) == "131072+39")
It could be worse. They could then split the generated string by the "+", convert each element to a float, and ask if the value is 131072. Then if it is, repeat the process with the second element using a nested if-statement. X|
Between the idea And the reality Between the motion And the act Falls the Shadow
-
It could be worse. They could then split the generated string by the "+", convert each element to a float, and ask if the value is 131072. Then if it is, repeat the process with the second element using a nested if-statement. X|
Between the idea And the reality Between the motion And the act Falls the Shadow
... so that's the way to do it :doh:
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus) -
... so that's the way to do it :doh:
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus) -
It could be worse. They could then split the generated string by the "+", convert each element to a float, and ask if the value is 131072. Then if it is, repeat the process with the second element using a nested if-statement. X|
Between the idea And the reality Between the motion And the act Falls the Shadow
I remember one program which wanted to check if two variables were equal to something like 73 and 89, in either order, so rather than testing whether (var1=73 and var2=89) or (var1=89 and var2=73) it tested whether var*var2=6497. Not sure whether that qualifies as brilliant or horrible. The two variables were bytes, and the constants were primes, so the factorization was unique.
-
I remember one program which wanted to check if two variables were equal to something like 73 and 89, in either order, so rather than testing whether (var1=73 and var2=89) or (var1=89 and var2=73) it tested whether var*var2=6497. Not sure whether that qualifies as brilliant or horrible. The two variables were bytes, and the constants were primes, so the factorization was unique.
supercat9 wrote:
Not sure whether that qualifies as brilliant or horrible. The two variables were bytes, and the constants were primes, so the factorization was unique.
I'd go with horrible. Because they are bytes, the multiplication test relies on an implicit conversion to (at least) int16. Future failure coming up!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
-
supercat9 wrote:
Not sure whether that qualifies as brilliant or horrible. The two variables were bytes, and the constants were primes, so the factorization was unique.
I'd go with horrible. Because they are bytes, the multiplication test relies on an implicit conversion to (at least) int16. Future failure coming up!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones
I'd go with horrible. Because they are bytes, the multiplication test relies on an implicit conversion to (at least) int16. Future failure coming up! I can't see a problem there, since I don't know of any language which wouldn't do at least an 8x8->16 multiply. A more interesting problem would arise if the constants changed so the factorization was no longer unique.
-
I remember one program which wanted to check if two variables were equal to something like 73 and 89, in either order, so rather than testing whether (var1=73 and var2=89) or (var1=89 and var2=73) it tested whether var*var2=6497. Not sure whether that qualifies as brilliant or horrible. The two variables were bytes, and the constants were primes, so the factorization was unique.
Brilliant if documented by a comment that they must be primes. Otherwise Horror.
JustAStupidGurl