1. C# / Говнокод #17398

    +136

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    int num10 = Convert.ToInt16(this.label13.Text);
        int num11 = Convert.ToInt16(this.label11.Text);
        int num12 = Convert.ToInt16(this.LH2.Text);
        int num13 = Convert.ToInt16(this.dmserver.Text);
        int num14 = Convert.ToInt16(this.vipserver.Text);
        int num15 = Convert.ToInt16(this.NAMALSK_FREE_server.Text);
        int num16 = Convert.ToInt16(this.Igromafia_serevr.Text);
        int num18 = Convert.ToInt16(this.LH3_total_on_off.Text);
        int num17 = ((((((num10 + num11) + num13) + num14) + num15) + num12) + num16) + num18;
        this.servers.Text = Convert.ToString(num17);

    Часть метода статистики одного из лаунчеров для пиратского клиента игры.

    kingmonstr, 03 Января 2015

    Комментарии (2)
  2. JavaScript / Говнокод #17397

    +158

    1. 1
    Function.prototype.apply.call(window.alert, window, ['alert'])

    А я чё? Я ничё...

    AjiTae, 01 Января 2015

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

    +135

    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
    /*
         * Lack of time prevents me from writing this segment properly.
         * May Krishna have mercy on my soul.
         */
        static const uint32_t pal            = 720 * 576 * 2;
        static const uint32_t ntsc_composite = 720 * 507 * 2;
        static const uint32_t ntsc_sdi       = 720 * 480 * 2;
        uint16_t new_width = width, new_height = height;
    
        if (height == 0) {
            new_width = 1920;
            new_height = 1080;
        }
    
        if (format == PAL) {
            rv = pal;
            memset(out_payload, 0x3F, rv);
        }
        else if (format == NTSC) {
            if (source == SDI_VIDEO) {
                rv = ntsc_sdi;
                memset(out_payload, 0x3F, rv);
            }
            else {
                rv = ntsc_composite;
                memset(out_payload, 0x3F, rv);
            }
        }
        else {
            rv = new_width * new_height * 2;
            memset(out_payload, 0x3F, rv);
        }

    Вот что переизбыток мочи делает.

    codemonkey, 31 Декабря 2014

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

    +137

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    void main()
    {
      printf("HAPPY NEW YEAR!");
      printf("Forever alone! Vodka!");
      Sleep(INFINITE);
    }

    LispGovno, 31 Декабря 2014

    Комментарии (26)
  5. JavaScript / Говнокод #17394

    +154

    1. 1
    <input type="submit" name="sub" value="регистрация" class="buttom2_activ" onmouseover="this.className='buttom2_activ'" onmouseout="this.className='buttom2'">

    CSS :hover, лол

    heyzea1, 31 Декабря 2014

    Комментарии (2)
  6. C# / Говнокод #17393

    +97

    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
    using System;
    using Microsoft.Win32;
     
    namespace Reester
    {
        class Program
        {
            static void Main(string[] args)
            {
                RegCreatySubKey();
            }
     
            private static void RegCreatySubKey()
            {
                RegistryKey regKey = Registry.LocalMachine;
                string[] shell = new[] { "SOFTWARE", "Microsoft", "Windows", "CurrentVersion", "Explorer", "CommandStore", "shell" };
     
                string prog = "Programma";
    1)            using (regKey = Registry.LocalMachine.OpenSubKey(shell[0],true))// тут regKey равно{HKEY_LOCAL_MACHINE}
    2)                {                                                    //сдеть уже regKey   равно {HKEY_LOCAL_MACHINE\SOFTWARE}
     
     
    3)                    if (regKey != null)//и тут уже regkey равно Null.А дальше программа не идет.
                        {
                            using (regKey = Registry.LocalMachine.OpenSubKey(shell[1], true))
                            {
                                if (regKey != null)
                                {
                                    using (regKey = Registry.LocalMachine.OpenSubKey(shell[2], true))
                                    {
                                        if (regKey != null)
                                        {
                                            using (regKey = Registry.LocalMachine.OpenSubKey(shell[3], true))
                                            {
                                                if (regKey != null)
                                                {
                                                    using (regKey = Registry.LocalMachine.OpenSubKey(shell[4], true))
                                                    {
                                                        if (regKey != null)
                                                        {
                                                            using (regKey = Registry.LocalMachine.OpenSubKey(shell[5], true))
                                                                
                                                            {
                                                                if (regKey != null)
                                                                {
                                                                    using (regKey = Registry.LocalMachine.OpenSubKey(shell[6], true))
                                                                    {
                                                                        if (regKey != null)
                                                                        {
                                                                            regKey.CreateSubKey(prog);
                                                                        }
                                                                    }
                                                                 }
     
                                                              }
                                                          }
                                                      }
                                                    }
                                                 }
                                               }
                                            }
                                          }
                                        }
                                     }
                                  }
                              }
                        
                       }
                  }

    Работаем с реестром

    Psilon, 31 Декабря 2014

    Комментарии (15)
  7. Куча / Говнокод #17392

    +127

    1. 1
    alias Foo(V : V[]) = V;

    dlang, угадайте, что этот код делает.

    DlangGovno, 31 Декабря 2014

    Комментарии (6)
  8. C++ / Говнокод #17391

    +57

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    /* Fix NAN constant for VisualC++. */
       #ifdef _MSC_VER
          #ifndef NAN
              static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
              #define NAN (*(const float *) __nan)
          #endif
       #endif

    ????

    Pythoner, 30 Декабря 2014

    Комментарии (22)
  9. PHP / Говнокод #17390

    +162

    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
    if ($n > '25') {
        $list = floor($n / 25) + 1;
        $str .= '<div id="srt_page" align="center">';
        for ($q = 1; (($q) <= $list); $q++) {
            if ((((isset($_GET['page'])) && ($_GET['page'] == $q)) || ((!isset($_GET['page'])) && ($q == 1))))
                $str .= ' <b>' . $q . '</b> ';
            else {
                if ((($q == ($pg - 1)) && (($pg - 1) != 1) && (($pg - 1) != $list)) || (($q == ($pg - 2)) && (($pg - 2) != 1) && (($pg - 2) != $list)) || (($q == ($pg - 3)) && (($pg - 3) != 1) && (($pg - 3) != $list)) || (($q == ($pg - 4)) && (($pg - 4) != 1) && (($pg - 4) != $list)) || (($q == ($pg + 1)) && (($pg + 1) != 1) && (($pg + 1) != $list)) || (($q == ($pg + 2)) && (($pg + 2) != 1) && (($pg + 2) != $list)) || (($q == ($pg + 3)) && (($pg + 3) != 1) && (($pg + 3) != $list)) || (($q == ($pg + 4)) && (($pg + 4) != 1) && (($pg + 4) != $list)) || ($q == $list) || ($q == 1)) {
                    if (($q == $list) && (($pg + 4) < ($list - 1)))
                        $str .= '...';
                    $str .= ' <a class="link_page" href="?page=' . $q . '"> ' . $q . ' </a> ' . "\n";
                    if (($q == 1) && (($pg - 4) > 2))
                        $str .= '...';
                }
            }
        }
        $str .= '</div>';
    }
    return $str;

    Кто не понял, это такой pagination %))

    AgentSIB, 30 Декабря 2014

    Комментарии (1)
  10. Java / Говнокод #17389

    +74

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    private void showProgress() {
        if(mIndProgressVisible && mIndProgress != null && mIndProgress.isShowing()) return;
        if(!mIndProgressVisible && (mIndProgress == null || !mIndProgress.isShowing())) return;
    
        ...
    }

    Не ходите, дети, в Африку гулять

    StanDalone, 30 Декабря 2014

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