1. Куча / Говнокод #29066

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    Новогодний оффтоп #5
    ░░░░░░░░░░░░░░░░░▐▌░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░▀████▀░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░▄█▀▀█▄░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░░▄▄░░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░▄████▄░░░░░░░░░░░░░░░
    ░░░░░░░░░░░▄▄██╬██╬████▄▄░░░░░░░░░░░
    ░░░░░░░░▀███████╬███╬██████▀░░░░░░░░
    ░░░░░░░░░░▄▄█╬████╬█████▄▄░░░░░░░░░░
    ░░░░▄▄▄▄██╬████╬█████╬███╬██▄▄▄▄░░░░
    ░░░░░░▀▀████╬█████╬█████████▀▀░░░░░░
    ░░░░░░░░░▄█████╬██████╬███▄░░░░░░░░░
    ░░▄▄▄▄██████╬█████╬███████╬███▄▄▄▄░░
    ░░▀▀▀████╬█████╬████╬███╬██████▀▀▀░░
    ░░░░░░░░████╬████████╬██████░░░░░░░░
    ░░▄▄▄█████╬██████╬█████╬███╬███▄▄▄░░
    ▀▀▀████╬█████╬█████╬████╬███╬████▀▀▀
    ░░░░░░▀▀▀██████████████████▀▀▀░░░░░░
    ░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░
    ░░░░░░░░░░░░░░░░████░░░░░░░░░░░░░░░░

    #1: https://govnokod.ru/27188 https://govnokod.xyz/_27188
    #2: https://govnokod.ru/27893 https://govnokod.xyz/_27893
    #3: https://govnokod.ru/28484 https://govnokod.xyz/_28484
    #4: https://govnokod.ru/28896 https://govnokod.xyz/_28896

    rOBHOBO3Hblu_nemyx, 23 Декабря 2024

    Комментарии (177)
  2. Си / Говнокод #29064

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    /* Windows doesn't support the fork() call; so we fake it by invoking
       another copy of Wget with the same arguments with which we were
       invoked.  The child copy of Wget should perform the same initialization
       sequence as the parent; so we should have two processes that are
       essentially identical.  We create a specially named section object that
       allows the child to distinguish itself from the parent and is used to
       exchange information between the two processes.  We use an event object
       for synchronization.  */
    static void
    fake_fork (void)
    {
      char exe[MAX_PATH + 1];
      DWORD exe_len, le;
      SECURITY_ATTRIBUTES sa;
      HANDLE section, event, h[2];
      STARTUPINFO si;
      PROCESS_INFORMATION pi;
      struct fake_fork_info *info;
      char *name;
      BOOL rv;
    
      section = pi.hProcess = pi.hThread = NULL;
    
      /* Get the fully qualified name of our executable.  This is more reliable
         than using argv[0].  */
      exe_len = GetModuleFileName (GetModuleHandle (NULL), exe, sizeof (exe));
      if (!exe_len || (exe_len >= sizeof (exe)))
        return;
    
      sa.nLength = sizeof (sa);
      sa.lpSecurityDescriptor = NULL;
      sa.bInheritHandle = TRUE;
    
      /* Create an anonymous inheritable event object that starts out
         non-signaled.  */
      event = CreateEvent (&sa, FALSE, FALSE, NULL);
      if (!event)
        return;
    
      /* Create the child process detached form the current console and in a
         suspended state.  */
      xzero (si);
      si.cb = sizeof (si);
      rv = CreateProcess (exe, GetCommandLine (), NULL, NULL, TRUE,
                          CREATE_SUSPENDED | DETACHED_PROCESS,
                          NULL, NULL, &si, &pi);
      if (!rv)
        goto cleanup;
    
      /* Create a named section object with a name based on the process id of
         the child.  */
      name = make_section_name (pi.dwProcessId);
      section =
          CreateFileMapping (INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,
                             sizeof (struct fake_fork_info), name);
      le = GetLastError();
      xfree (name);
      /* Fail if the section object already exists (should not happen).  */
      if (!section || (le == ERROR_ALREADY_EXISTS))
        {
          rv = FALSE;
          goto cleanup;
        }
    
      /* Copy the event handle into the section object.  */
      info = MapViewOfFile (section, FILE_MAP_WRITE, 0, 0, 0);
      if (!info)
        {
          rv = FALSE;
          goto cleanup;
        }
    
      info->event = event;
    
      UnmapViewOfFile (info);
    
      /* Start the child process.  */
      rv = ResumeThread (pi.hThread);
      if (!rv)
        {
          TerminateProcess (pi.hProcess, (DWORD) -1);
          goto cleanup;
        }
    
      /* Wait for the child to signal to us that it has done its part.  If it
         terminates before signaling us it's an error.  */
    
      h[0] = event;
      h[1] = pi.hProcess;
      rv = WAIT_OBJECT_0 == WaitForMultipleObjects (2, h, FALSE, 5 * 60 * 1000);
      if (!rv)
        goto cleanup;
    
      info = MapViewOfFile (section, FILE_MAP_READ, 0, 0, 0);
      if (!info)
        {
          rv = FALSE;
          goto cleanup;
        }

    Из исходников wget.

    https://git.savannah.gnu.org/cgit/wget.git/tree/src/mswindows.c

    rOBHOBO3Hblu_nemyx, 06 Декабря 2024

    Комментарии (12)
  3. Java / Говнокод #29063

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public static String getJoinedHeaderTypes(List<String> types, String delimiter) {
            if (!types.isEmpty() && types.size() > 1) {
                return String.join(delimiter, types);
            } else if (types.size() == 1) {
                return types.stream().findFirst().get();
            }
            return "";
        }

    Когда тебе рассказали, что есть стримы...

    nekkiy, 03 Декабря 2024

    Комментарии (8)
  4. Куча / Говнокод #29062

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    Говновозный оффтоп #1
    
           _.--,_......----..__
           \  .'          '    ```--...__      \
            \;           '            .  '.   ||
            :           '            '     \ .''.
          .';          :            '       .|  |.--..___
         /   \         |           :        :|  /.------.\
        /    .'._      :           |        ||  ||      |\\
       /.-. /|-| `-.               :        ;|  ||______|_\`.______
      //  // |-|    \   '           '      / |  ||='      | |      `.
     //  //\\|-|     `-._'           '   .'  |  ||        | |        \
    /.-.//  \\-|_________```------------` ___'. ||        | '_.--.   <)
    '._.'  /  .-----.   .-----.   .''''''''.    |'--..____| /  _  \   |
           |_/.'   '.\_/.'   '.\_[ [ [  ] ] ]___|_________.'.'   '.\  ]
             :  .-.  : :  .-.  :  '........'    (_________):  .-.  :`-'
             :  '-'  : :  '-'  :                           :  '-'  :
              '._ _.'   '._ _.'                             '._ _.'

    Предыдущих оффтопов нету.

    rOBHOBO3Hblu_nemyx, 27 Ноября 2024

    Комментарии (259)
  5. Куча / Говнокод #29061

    0

    1. 1
    Просто оффтоп #41

    #11: https://govnokod.ru/27122 https://govnokod.xyz/_27122
    #12: https://govnokod.ru/27153 https://govnokod.xyz/_27153
    #13: https://govnokod.ru/27159 https://govnokod.xyz/_27159
    #14: https://govnokod.ru/27200 https://govnokod.xyz/_27200
    #15: https://govnokod.ru/27237 https://govnokod.xyz/_27237
    #16: (vanished) https://govnokod.xyz/_27282
    #17: https://govnokod.ru/27319 https://govnokod.xyz/_27319
    #18: https://govnokod.ru/27380 https://govnokod.xyz/_27380
    #19: (vanished) https://govnokod.xyz/_27500
    #20: https://govnokod.ru/27607 https://govnokod.xyz/_27607
    #21: https://govnokod.ru/27951 https://govnokod.xyz/_27951
    #22: https://govnokod.ru/28076 https://govnokod.xyz/_28076
    #23: https://govnokod.ru/28266 https://govnokod.xyz/_28266
    #24: https://govnokod.ru/28373 https://govnokod.xyz/_28373
    #25: https://govnokod.ru/28474 https://govnokod.xyz/_28474
    #26: https://govnokod.ru/28563 https://govnokod.xyz/_28563
    #27: https://govnokod.ru/28645 https://govnokod.xyz/_28645
    #28: (vanished) https://govnokod.xyz/_28664
    #29: https://govnokod.ru/28674 https://govnokod.xyz/_28674
    #30: https://govnokod.ru/28680 https://govnokod.xyz/_28680
    #31: https://govnokod.ru/28688 https://govnokod.xyz/_28688
    #32: https://govnokod.ru/28695 https://govnokod.xyz/_28695
    #33: https://govnokod.ru/28702 https://govnokod.xyz/_28702
    #34: (vanished) https://govnokod.xyz/_28708
    #35: https://govnokod.ru/28715 https://govnokod.xyz/_28715
    #36: https://govnokod.ru/28725 https://govnokod.xyz/_28725
    #37: https://govnokod.ru/28733 https://govnokod.xyz/_28733
    #38: (vanished) https://govnokod.xyz/_28748
    #39: https://govnokod.ru/28758 https://govnokod.xyz/_28758
    #40: https://govnokod.ru/28885 https://govnokod.xyz/_28885

    nepeKamHblu_nemyx, 26 Ноября 2024

    Комментарии (379)
  6. Куча / Говнокод #29060

    0

    1. 1
    IT Оффтоп #208

    #178: https://govnokod.ru/28716 https://govnokod.xyz/_28716
    #179: https://govnokod.ru/28726 https://govnokod.xyz/_28726
    #180: https://govnokod.ru/28734 https://govnokod.xyz/_28734
    #181: https://govnokod.ru/28739 https://govnokod.xyz/_28739
    #182: https://govnokod.ru/28749 https://govnokod.xyz/_28749
    #183: https://govnokod.ru/28777 https://govnokod.xyz/_28777
    #184: https://govnokod.ru/28790 https://govnokod.xyz/_28790
    #185: https://govnokod.ru/28794 https://govnokod.xyz/_28794
    #186: https://govnokod.ru/28815 https://govnokod.xyz/_28815
    #187: https://govnokod.ru/28833 https://govnokod.xyz/_28833
    #188: https://govnokod.ru/28837 https://govnokod.xyz/_28837
    #189: https://govnokod.ru/28840 https://govnokod.xyz/_28840
    #190: https://govnokod.ru/28875 https://govnokod.xyz/_28875
    #191: https://govnokod.ru/28878 https://govnokod.xyz/_28878
    #192: https://govnokod.ru/28886 https://govnokod.xyz/_28886
    #193: https://govnokod.ru/28911 https://govnokod.xyz/_28911
    #194: https://govnokod.ru/28914 https://govnokod.xyz/_28914
    #195: https://govnokod.ru/28917 https://govnokod.xyz/_28917
    #196: https://govnokod.ru/28925 https://govnokod.xyz/_28925
    #197: https://govnokod.ru/28935 https://govnokod.xyz/_28935
    #198: https://govnokod.ru/28938 https://govnokod.xyz/_28938
    #199: https://govnokod.ru/28942 https://govnokod.xyz/_28942
    #200: https://govnokod.ru/28945 https://govnokod.xyz/_28945
    #201: https://govnokod.ru/28948 https://govnokod.xyz/_28948
    #202: https://govnokod.ru/28951 https://govnokod.xyz/_28951
    #203: https://govnokod.ru/28954 https://govnokod.xyz/_28954
    #204: https://govnokod.ru/28971 https://govnokod.xyz/_28971
    #205: https://govnokod.ru/28986 https://govnokod.xyz/_28986
    #206: https://govnokod.ru/28991 https://govnokod.xyz/_28991
    #207: https://govnokod.ru/29002 https://govnokod.xyz/_29002

    nepeKamHblu_nemyx, 24 Ноября 2024

    Комментарии (495)
  7. C# / Говнокод #29059

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    using System;
    using System.Threading;
    using System.Diagnostics;
    
    public class ANYRUN_server
    {
        private static string application = null;
    
        public static void Main(string[] args)
        {
            Authorization();
        }
        
        private static void Authorization()
        {
    	DateTime today = DateTime.Now;
    	
            Console.WriteLine("\"Not business mail users\" registration");
            Console.WriteLine("Please fill out our straightforward application form:");
    	application = Console.ReadLine();
    	SendApplication(application);
    	Thread.Sleep(3600000);
            if (today.Month == 4 && today.Day == 1)
            {
                AcceptApplication();
            }
    	else
    	{
    	    RejectApplication();
    	}
        }
    	
        private static void SendApplication(string application)
        {
            // Like, who cares about the application?
    	application = null;
        }
        
        private static void RejectApplication()
        {
            Console.Write("Hello, after reviewing your application we are unable to provide you with a free personal account. ");
            Console.Write("If you want to check files for malware I recommend using services such as https://opentip.kaspersky.com/ and https://www.virustotal.com/gui/home/upload.");
        }
    	
        private static void AcceptApplication()
        {
            Console.WriteLine("Hello, after reviewing your application we decided to provide you with a free personal account.");
    	Console.WriteLine("Please, wait for a password...");
    	Thread.Sleep(1800000);
    	Console.WriteLine("Here's your password: ");
    	Thread.Sleep(5000);
    	Process.Start("videoplayer.exe", "C:\\Rickrolled.mp4");
        }
    }

    Исходный код для регистрации пользователей без бизнеспочты в дискорде сайта any.run #meme

    BelCodeMonkey, 24 Ноября 2024

    Комментарии (1)
  8. Go / Говнокод #29057

    0

    1. 1
    2. 2
    3. 3
    var i int
    for i = range n {}
    fmt.Println(i+1)

    кусочек кода для считание len(n)

    minojo, 17 Ноября 2024

    Комментарии (4)
  9. C++ / Говнокод #29056

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    #include <iostream>
    
    union is_odd {
      long long int number;
      bool yes : sizeof(long long int);
    };
    
    int main() {
      std::boolalpha(std::cout);
      for (long long int i = -10; i < 10; ++i) {
        std::cout << i << " is odd? "
                  << is_odd{ .number = i }.yes
                  << "\n";
      }
    }

    DEMO:
    https://godbolt.org/z/5exc84eYK

    shittycode43, 15 Ноября 2024

    Комментарии (2)
  10. Си / Говнокод #29055

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    int IsEven(long long int number){
    	if (number == 0) return 0; 
    	long long int loc_num = 0;
    	update: 
    	
    	if (number == loc_num+1) {return 1;
    	} else if (number == (loc_num+1)*(-1)) { return 1;
    	} else {
    		if (number == loc_num+2) {return 0;
    		} else if (number == (loc_num+2)*(-1)) { return 0;
    		} else {
    			if (number == loc_num+3) {return 1;
    			} else if (number == (loc_num+3)*(-1)) { return 1;
    			} else {
    				if (number == loc_num+4) {return 0;
    				} else if (number == (loc_num+4)*(-1)) { return 0;
    				} else {
    					if (number == loc_num+5) {return 1;
    					} else if (number == (loc_num+5)*(-1)) { return 1;
    					} else {
    						if (number == loc_num+6) {return 0;
    						} else if (number == (loc_num+6)*(-1)) { return 0;
    						} else {
    							if (number == loc_num+7) {return 1;
    							} else if (number == (loc_num+7)*(-1)) { return 1;
    							} else {
    								if (number == loc_num+8) {return 0;
    								} else if (number == (loc_num+8)*(-1)) { return 0;
    								} else {
    									if (number == loc_num+9) {return 1;
    									} else if (number == (loc_num+9)*(-1)) { return 1;
    									} else {
    										if (number == loc_num+10) {return 0;
    										} else if (number == (loc_num+10)*(-1)) { return 0;
    										} else {
    												loc_num+=10; 
    												goto update;
    											}
    										}
    									}
    								}
    							}
    						}
    					}
    				}
    			}
    		}
    	}

    TurboLyudoed, 14 Ноября 2024

    Комментарии (3)