• Programming Jokes February - Obligatory Witty Remark
    1,291 replies, posted
[img]http://i.imgur.com/lQUUllF.png[/img]
[QUOTE=Sidneys1;45689684]From an old programming book, "The Tao of Programming": --- The Tao gave birth to the Machine Language. Machine Language gave birth to the Assembler. The Assembler gave birth to the Compiler. Now there are ten thousand languages. Each language has its purpose, however humble. Each language expresses the yin and yang of software. Each language has its place within the Tao. But do not program in Cobol if you can avoid it. --- Grand Master Turing once dreamed he was a machine. When he awoke he exclaimed: "I do not know whether I am Turing dreaming that I am a machine, or a machine dreaming that I am Turing!" --- A Master was explaining the nature of Tao to one of his novices. "The Tao is embodied in all software - regardless of how insignificant," said the Master. "Is the Tao in a hand-held calculator?" asked the Novice. "It is," came the reply. "Is the Tao in a video game?" continued the Novice. "It is even in a video game," said the Master. "And is the Tao in the DOS for a personal computer?" The Master coughed and shifted his position slightly. "The lesson is over for today," he said. --- Just a few excerpts, hope you enjoyed! It and its sequel, "The Zen of Programming" are two of my favorite books, given to my by the father of a friend of mine, who was a programmer back in the 80s.[/QUOTE] Looked it up and found a site with a load of excerpts: [url]http://canonical.org/~kragen/tao-of-programming.html[/url] [quote]There was once a programmer who was attached to the court of the warlord of Wu. The warlord asked the programmer: ``Which is easier to design: an accounting package or an operating system?'' ``An operating system,'' replied the programmer. The warlord uttered an exclamation of disbelief. ``Surely an accounting package is trivial next to the complexity of an operating system,'' he said. ``Not so,'' said the programmer, ``when designing an accounting package, the programmer operates as a mediator between people having different ideas: how it must operate, how its reports must appear, and how it must conform to the tax laws. By contrast, an operating system is not limited by outside appearances. When designing an operating system, the programmer seeks the simplest harmony between machine and ideas. This is why an operating system is easier to design.'' The warlord of Wu nodded and smiled. ``That is all good and well, but which is easier to debug?'' The programmer made no reply.[/quote]
OC joke do not steal: What do you do when your compiler throws a lot of unecessary warnings? You tell it to grow a std::pair.
[video=youtube;5U1_KW6ww7Y]http://www.youtube.com/watch?v=5U1_KW6ww7Y&list=UU1s3pFsMZv37NAxIIW90MGw[/video]
[URL="http://youtu.be/kLO1djacsfg"]found this[/URL]
[QUOTE=EmilioGB;46002580][URL="http://youtu.be/kLO1djacsfg"]found this[/URL][/QUOTE] Holy shit there are so many and are so funny Fucking brilliant [video=youtube;HXvm76e2X1Q]http://www.youtube.com/watch?v=HXvm76e2X1Q[/video]
to multiply in c you must use a while loop according to this guy [url]http://www.ehow.com/video_12245475_multiply-c-programming.html[/url]
[QUOTE=elevate;46030290]to multiply in c you must use a while loop according to this guy [url]http://www.ehow.com/video_12245475_multiply-c-programming.html[/url][/QUOTE] At this point I'm not sure whether his name is actually Omar Butt or if it is the cloud to butt addon again.
[QUOTE=elevate;46030290]to multiply in c you must use a while loop according to this guy [url]http://www.ehow.com/video_12245475_multiply-c-programming.html[/url][/QUOTE] It's one way to do it on systems without a hardware multiplier, although the compiler should take care of that on it's own.
[QUOTE=elevate;46030290]to multiply in c you must use a while loop according to this guy [url]http://www.ehow.com/video_12245475_multiply-c-programming.html[/url][/QUOTE] Naw mate this is how you do it: [code]int mul(int a, int b) { int c = 0, i = 0; do c += (b << i++) & -(a & 1); while ((a >>= 1) != 0); return c; }[/code] What a pleb teaching people to multiply numbers in O(2^n) :rolleyes:
[QUOTE=elevate;46030290]to multiply in c you must use a while loop according to this guy [url]http://www.ehow.com/video_12245475_multiply-c-programming.html[/url][/QUOTE] Web Developer
[QUOTE=DrDevil;46030484]It's one way to do it on systems without a hardware multiplier, although the compiler should take care of that on it's own.[/QUOTE] In that case you'd use the shift and add method so it runs in constant time, this is method is just bad and would never be used by any compiler. This elementary school-level algorithm looks like a poor troll attempt.
[code] int mult(int a, int b){ int c=0; for(int i = 1;i <= b;i++){ c+=a; } return c; } [/code] ezpz
Clearly, using inline assembly is the fastest way to do anything. [code] int mult(int a, int b) { int result; __asm__ ( "imull %%ebx, %%eax;" : "=a" (result) : "a" (a), "b" (b) ); return result; } [/code]
[img]http://i.imgur.com/Zojv02Y.png[/img]
[url=http://d116.com/ace/]Web development with Fairchild ACE assembly.[/url]
[img]http://i.imgur.com/U09jY8l.png[/img]
[QUOTE=MatheusMCardoso;46059375][img]http://i.imgur.com/U09jY8l.png[/img][/QUOTE] :suicide: Thats why you should forbid some people using the internet :v:
it'sjustatroll it'sjustatroll it'sjustatroll it'sjustatroll it'sjustatroll (I hope)
if i got a dollar for every time i got a dollar, i'd be a stack overflow
[QUOTE=Mobon1;46115420]if i got a dollar for every time i got a dollar, i'd be a stack overflow[/QUOTE] Only if you haven't implemented proper tail recursion. :v:
[img]https://i.imgur.com/p7eQQK3.jpg[/img] [url]https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29[/url]
[QUOTE=Goz3rr;46129766][img]https://i.imgur.com/p7eQQK3.jpg[/img] [url]https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29[/url][/QUOTE] Because they couldn't fix that by, for example, setting the OS string to "Microsoft Windows 9".
[code]if(version.Contains("Windows 9"))[/code]
[QUOTE=DrTaxi;46130996][code]if(version.Contains("Windows 9"))[/code][/QUOTE] Windows™ 9
[img]http://i.imgur.com/tjIQ5CT.png[/img] I'm confused.
[QUOTE=Khub;46132284][img]http://i.imgur.com/tjIQ5CT.png[/img] I'm confused.[/QUOTE] ^ is XOR operator, A XOR 0 is A.
[QUOTE=cartman300;46132332]^ is XOR operator, A XOR 0 is A.[/QUOTE] Oh. Well, guess that explains why is the hint labeled as 'useless bitwise operation'. Now I feel bad for posting it in here :(
- snip -
[QUOTE=Khub;46132383]Oh. Well, guess that explains why is the hint labeled as 'useless bitwise operation'. Now I feel bad for posting it in here :([/QUOTE] This reminds me of someone posting on Stack Overflow about implementing an algorithm who used [I]^[/I] instead of the modpow operation that denotes in its original context. [editline]2nd October 2014[/editline] You can use shift operators there btw: [code]1 << 0 == 1 1 << 1 == 2 1 << 2 == 4 ...[/code]
Sorry, you need to Log In to post a reply to this thread.