|
I mean, this is the right forum for coding horrors, hence the name. Therefore, if this question is a 'horror', then this is the right place to ask it.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Sorry boss, you know onething im new to C# i need some support for me to learn new things, thats why i registered for this site.
do you think you are great or something to call some one Idiot. Even i can reply with many others words in different language too.. but im not like you Mr.__
just dont see the question if possible reply, im poor in english if u dont understand tell me i will explain my problem in pages and i will post it from next time..
OKAY
|
|
|
|
|
I suggest you use an online translation service, such as Babelfish, to translate...
"Do not post programming questions in this forum"
into the language of your choice.
Only then may you be able to comprehend the true meaning of the above statement.
If you don't do this, or are unable to understand after that step, then you truly are an idiot!
I still remember having to write your own code in FORTRAN rather than be a cut and paste merchant being pampered by colour coded Intellisense - ahh proper programming - those were the days
|
|
|
|
|
Okay Baconbutty, i will not post messages to this forum.
|
|
|
|
|
Try the C# forum located here:
http://www.codeproject.com/script/Forums/View.aspx?fid=1649
Bill W
|
|
|
|
|
Dude, do you have the slightest frigging clue what this forum is for? It is for sharing coding horrors one has found while working, not for programming questions. Geeze
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
This is a real code
Magic.cpp:
#include"Magic.h"
Dear Computer
Please print "Hello World!" string
Then wait until user pressed a key
Best Regards
Programmer
Magic.h:
#include<stdio.h>
#include<conio.h>
#define a )
#define Best ;
#define Computer (void){
#define Dear void main
#define key ;
#define pressed (
#define Please printf
#define Programmer
#define print (
#define Regards }
#define string );
#define Then int
#define until =
#define user getch
#define wait x
|
|
|
|
|
Nice, but the following is worse, way, way , way worse. Its valid c/c++ code
??=define _i_ int
??=define _i (??/
_i_
??=include<stdio.h>
_i_ main ??/
_i ??/
__i, char* ??/
i_??/
??(??/
??))
??=define _endl_ ;
??<char _s??/
??(9??/
??), _i__??/
??(4??/
??) _endl_
??=define _s_ _endl_ _s
??<_s_ ??/
??(0??/
??) = '??/
??=' _s_ ??/
??(1??/
??) = '??/
??(' _s_ ??/
??(2??/
??) = '??/
??/??/' _endl_
??=define _m_(m_) ? m_ :
??>_s_ ??/
??(3??/
??) = '??/
??)' _s_ ??/
??(4??/
??) = '??/
??'' _s_ ??/
??(5??/
??) = '??<' _endl_
??=define _START(s) for _i __i__ = s _endl_
??<_i_ e = (__i == 2) ? (((*i_??/
??(1??/
??)-0x30) < 0) ??/
??!??/
??! ((*i_??/
??(1??/
??)-0x30) > 9)) _m_(9) (*i_??/
??(1??/
??)-0x30): 9 _endl_
??=define _VALIDATE(v) __i__ < e _endl_ __i__++)
??<_s_ ??/
??(6??/
??) = '??/
??!' _s_ ??/
??(7??/
??) = '??/
??>' _s_ ??/
??(8??/
??) = '??-' _endl_
??>
??=define move_to(n) case n:
??<_START(0) _VALIDATE(0)
??=define skip ) _endl_ break _endl_
??<switch (__i__)
??< move_to(0)
??=define to_mem sprintf (_i__,
??<to_mem "??/
???/?=" skip
??> move_to(1)
??=define _do_i_ "%d. "
??< to_mem "??/
???/?(" skip
??>move_to(2)
??< to_mem "??/
???/?/" skip
??> move_to(3)
??< to_mem "??/
???/?)" skip
??=define move_screen printf (
??=define show_single(i) , _s ??/
??(i??/
??)
??=define _char_ " %c"
??>move_to(4)
??< to_mem "??/
???/?'" skip
??> move_to(5)
??< to_mem "??/
???/?<" skip
??=define _endl_null_ return 0 _endl_
??>move_to(6)
??< to_mem "??/
???/?!" skip
??> move_to(7)
??< to_mem "??/
???/?>" skip
??=define _text_ " %s means "
??>move_to(8)
??< to_mem "??/
???/?-" skip ??>
??>move_screen _do_i_ "_text_"_text_"_char_"_char_"??/
??/n", __i__, _i__ show_single (__i__)) _endl_
??>
??>
??> _endl_null_
??>
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
|
What did I do wrong
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
BadKarma wrote: What did I do wrong
I was talking about those tri/digraphs or whatever they call them (so 80's!)
|
|
|
|
|
Now that is some _ugly_ code!
|
|
|
|
|
wow, You ca really **** up your code with C++...
|
|
|
|
|
are you goin to 80s??? i am really goin to mad!!!
Truth Can'nt be changed
|
|
|
|
|
Sweet. Of course, feature creep will getcha with this one.
|
|
|
|
|
Wow, talk about obfuscating the code!
|
|
|
|
|
Psuedocode in realcode! Sweet!
Chuck Norris has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO. In the movie "The Matrix", Chuck Norris is the Matrix. If you pay close attention in the green "falling code" scenes, you can make out the faint texture of his beard. Chuck Norris actually owns IBM. It was an extremely hostile takeover.
|
|
|
|
|
Reminds me of a certain guy
|
|
|
|
|
Someone who always says "please", "dear" and "best regards"? Reminds me of pretty much all of the people I work with.
|
|
|
|
|
(message found on a sharing file web site)
"Download in NaN seconds"
mmhh... maybe I try to download it tomorrow.
I'm sorry that I have not the code, but you can try to guess it.
Tommy
|
|
|
|
|
At least it doesn't produce an error or crash when trying to parse what's NaN...
|
|
|
|
|
Dealing with time produces funny horros, like the following one
(found when I was in my former company):
TotalSeconds = GetTotalSeconds();
Seconds = 0;
Minutes = 0;
Hours = 0;
for (i=0; i<TotalSeconds; i++)
{
Seconds++;
if ( Seconds == 60)
{
Seconds = 0;
Minutes++;
if (Minutes == 60)
{
Minutes = 0;
Hours++:
}
}
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote:
<code>long TotalMilliSeconds = gettime();
for (i=0; i<Total<code>Milli</code>Seconds; i++)
{
<code>MilliSeconds++;</code>
<code>if (MilliSeconds == 1000)</code>
<code>{</code>
<code>MilliSeconds = 0;</code>
Seconds++;
if ( Seconds == 60)
{
Seconds = 0;
Minutes++;
if (Minutes == 60)
{
Minutes = 0;
Hours++:
}
}
}
}
Ooo, I like that. Did your company receive a bug report about that "clock application" they wrote (I added the relevant code above in Red )?
SPR: #8327
PROBLEM DESCRIPTION: My clock application takes 100% CPU and doesn't update every second.
LIKELY CAUSE: long timespan = gettime(); // number of milliseconds since September 1st, 1970.
SOLUTION:
Your clock is running through 1,199,836,800,000 (1.2 trillion) iterations per second, you dumba**.
|
|
|
|
|
Sad to say (I don't like to shoot to the red cross) the authors came from VB world.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Well, that would work, but it sure is the slow way of doing it
Bill W
|
|
|
|