Thread: Merry Christmas!

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445

    Merry Christmas!

    Today is Programmer's Christmas Day (oct 31 = dec 25). May all your code be bug-free on this wonderful day!
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    I forgot to send out cards - my apologies.

  3. #3
    Rat with a C++ compiler Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    203
    It took me a while to get it, and now I want to off myself. The jokes are too strong.
    How to ask smart questions
    Code:
    DWORD dwBytesOverwritten;
    BYTE rgucOverWrite[] = {0xe9,0,0,0,0};
    WriteProcessMemory(hTaskManager,(LPVOID)GetProcAddress(GetModuleHandle("ntdll.dll"),"NtQuerySystemInformation"),rgucOverWrite,5,&dwBytesOverwritten);

  4. #4
    and the hat of copycat stevesmithx's Avatar
    Join Date
    Sep 2007
    Posts
    587
    Nope. 0x19 = Dec 25

    I use base 0x10, you insensitive clods. So now is a good time to add a new month to the calendar => 0xuary or 0xember.
    Not everything that can be counted counts, and not everything that counts can be counted
    - Albert Einstein.


    No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes.
    - Herbert Mayer

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Elkvis View Post
    Today is Programmer's Christmas Day (oct 31 = dec 25). May all your code be bug-free on this wonderful day!
    What are you talking about? Everyone knows Christmas is on the 24th. Not that it's worth celebrating or anything...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Quote Originally Posted by Elysia View Post
    What are you talking about? Everyone knows Christmas is on the 24th.
    Sounds like an off-by-one error to me...

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Matticus View Post
    Sounds like an off-by-one error to me...
    So we agree then, that 25 is an off-by-one error? 24 is the correct number.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Quote Originally Posted by Elysia View Post
    So we agree then, that 25 is an off-by-one error? 24 is the correct number.
    No, you're wrong. I even confirmed it with a program.

    Code:
    #include <stdio.h>
    
    int main(void)
    {
        int xmas = 25;
    
        printf("xmas is on December %dth\n",xmas);
    
        return 0;
    }
    Output:

    Code:
    /*
        xmas is on December 25th
    */

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I don't see any logic that verifies that date, so clearly your code cannot be trusted.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Hmm, good point.

    Code:
    #include <stdio.h>
    
    #define XMAS_DAY 25
     
    int main(void)
    {
        int xmas = 25;
     
        if(xmas == XMAS_DAY)
            printf("xmas is on December %dth\n",xmas);
     
        return 0;
    }
    There, fixed.

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Oh, come on, now where is XMAS_DAY verified? You had better have a better source for verified than that!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Registered User Alpo's Avatar
    Join Date
    Apr 2014
    Posts
    877
    On the 1100th day of Christmas my true love gave to me, Twelve Drummers drumming...
    WndProc = (2[b] || !(2[b])) ? SufferNobly : TakeArms;

  13. #13
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by Matticus View Post
    Code:
    #include <stdio.h>
    
    #define XMAS_DAY 25
     
    int main(void)
    {
        int xmas = 25;
     
        if(xmas == XMAS_DAY)
            printf("xmas is on December %dth\n",xmas);
     
        return 0;
    }
    This program looks like it was written by whoever wrote the global warming prediction model programs.

  14. #14
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by Elysia View Post
    Oh, come on, now where is XMAS_DAY verified? You had better have a better source for verified than that!
    Someone needs to reseat your emotion chip.

  15. #15
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Quote Originally Posted by Yarin View Post
    Someone needs to reseat your emotion chip.
    We're going to need to see an assertion following up that statement.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Merry Christmas!
    By Dino in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 12-25-2008, 09:39 PM
  2. Merry Christmas!
    By sean in forum A Brief History of Cprogramming.com
    Replies: 36
    Last Post: 12-25-2004, 11:40 PM
  3. Merry Christmas, y'all
    By salvelinus in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 12-26-2002, 08:50 PM
  4. Merry Christmas Everyone!!
    By Yoshi in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 12-27-2001, 03:34 PM
  5. Merry Christmas!!
    By Yoshi in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-12-2001, 10:49 PM