|
I was just doing some housekeeping on Facebook, removed the year from a "life event", and saw: Posted on December 31, 1969 .
|
|
|
|
|
Its almost worth joining just to have fun with that
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
static void Main(string[] args)
{
String str1 = "http://toto.com/";
String str2 = "http://toto.com/";
bool eq = str1 == str2;
Console.WriteLine(eq);
str1 = "http://toto.com/";
str2 = "http://toto.com/";
eq = str1 == str2;
Console.WriteLine(eq);
}
See for yourself, but copy the code, do not retype it.
I lost hair on this one, bug on an actual project for one customer.
But it is a nice trick to do to one of your most hated co worker if his computer is unlocked... Also works in configuration files.
This is pure evil though.
[UPDATE] With some advice I found even more evil than that.
"а" == "a"
modified 11-Aug-14 11:13am.
|
|
|
|
|
Wow. That is evil! :evil_grin:
What do you get when you cross a joke with a rhetorical question?
|
|
|
|
|
Use better tools.
C:\>copy con x.cs
static void Main(string[] args)
{
String str1 = "http://toto.com/";
String str2 = "http://toto.com?/";
bool eq = str1 == str2;
Console.WriteLine(eq); //print false
str1 = "http://toto.com/";
str2 = "http://toto.com/";
eq = str1 == str2;
Console.WriteLine(eq); //print true
}^Z
1 file(s) copied.
P.S. This also reminds me of the time I helped a fellow student track down an error that turned out to be caused by a TAB where a sequence of SPACEs was expected.
modified 11-Aug-14 10:31am.
|
|
|
|
|
Ironnically, the best tool that can show it to you is command line.
Even notepad would not show.
EDIT : TextPad seems to work
|
|
|
|
|
Notepad will, with the correct typeface -- try Terminal.
|
|
|
|
|
I tried to change font, and encoding, nothing do.
I even tried to copy the string in the command line, and don't get the ?.
How did you do ?
|
|
|
|
|
On the command line I use "Raster fonts" 7x12.
(Win 7)
|
|
|
|
|
I also have,
I think the problem is that I am using "clink" as my command line program.
However, on powershell, I get the missing char !
But Notepad, would not show me anything.
|
|
|
|
|
I expect it has to be a non-truetype typeface. I also see it with "Nifty Terminal".
|
|
|
|
|
Yes you are right on Terminal.
It definitively shows me, I was trying other fonts.
Need to train myself about what font, truetype, and typeface means
|
|
|
|
|
Have been reading this from right to left and left to right but could not see anything wrong with the code
Ca marche bien avec tutu et tata aussi!!!
|
|
|
|
|
Ohhhh that's evil! I love it!
|
|
|
|
|
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)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
So, for us mortals, care to explain what is going on here ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
Magic.
str2 is a string with an hidden character.
If you copy my code, you copy the hidden character, so this bug follow you in whatever programming language.
You can execute the code in debug mode, and see that str2 is length +1 str1.
However, I have no idea how I ended up with this hidden character in my code. (the int value of this strange character is 0x200f)
|
|
|
|
|
Another thing that bit me before was an UTF-8 preamble or BOM with the bytes 0xEF, 0xBB, 0xBF that got copied from somewhere...
|
|
|
|
|
Already got it, if you create a text file with visual studio, it bites you.
|
|
|
|
|
Compileonline.com[^] will shows you the buggy char on String str2 . Interesting though.
Wonde Tadesse
|
|
|
|
|
did not know this tool ! good to know.
|
|
|
|
|
bt it wont catch "a" == "a"
We should be building great things that don't exist-Lary Page
|
|
|
|
|
It catches it and will tell you false . They are not the same Unicode. See the code below.
private static void MystriesUniCode()
{
Console.WriteLine("{0} U+{1:x4} {2}", 'а', (int)'а', (int)'а');
Console.WriteLine("{0} U+{1:x4} {2}", 'a', (int)'a', (int)'a');
}
And output is
? U+0430 1072
a U+0061 97
Seeing is believing. Not this time. Compiling is believing.
Wonde Tadesse
|
|
|
|
|
Quote: Compileonline.com[^] will shows you the buggy char on String str2 . Interesting though. Smile |
I was talking about the Above BTW.
Well strange compilation.
Same Line twice and Different Results..
We should be building great things that don't exist-Lary Page
|
|
|
|
|
I once read a kind of ironic posting about what you could do to obscrure your code (and this way make yourself irreplacable).
One of the topics was using similar letters from different alphabets in variable names. They used the example of the Cyrillic 'a' which looks just like the Latin 'a' but is seen as different by the compiler. I assume you could have reached a similar effect by using a Cyrillic 'r' instead of the Latin 'p' in the URL.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|