1. Лучший говнокод

    В номинации:
    За время:
  2. Куча / Говнокод #5144

    +145

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    /*tabcontent.js*/
    
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>404 Not Found</title>
    </head><body>
    <h1>Not Found</h1>
    <p>The requested URL /about/photos/tabcontent.js was not found on this server.</p>
    <hr>
    <address>Apache Server at www.zadornov.net Port 80</address>
    </body></html>

    http://www.zadornov.net/about/photos/tabcontent.js
    в стиле!

    This is obvious, 04 Января 2011

    Комментарии (79)
  3. PHP / Говнокод #3581

    +162

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    $vl_c=fetch_array($rs_c);
    $ch1=$vl_c[0]%4;$ch2=((int)$vl_c[0]/4)%4;$ch3=((int)$vl_c[0]/16)%4;
    if($vl_c[16]==''||$vl_c[16]==0){$ch2=0;}if($vl_c[18]==''||$vl_c[18]==0){$ch3=0;}
    $s1=$vl_c[19]%2; $s2=($vl_c[19]/2)%2; $s3=$vl_c[19]/4;
    
    if(($vl_c[20]==0||$vl_c[20]==2&&$s1==1)&&($ch1>1||$ch1==0)){$chk_status1=check_sert(str_replace("\\'","'",$vl_c[1]),str_replace("\\'","'",$vl_c[2]),str_replace("\\'","'",$vl_c[3]),$vl_c[4],$vl_c[5],$vl_c[6],$vl_c[13],$vl_c[14]);} else{$chk_status1=$ch1;}
    if(($vl_c[20]==0||$vl_c[20]==2&&$s2==1)&&($ch2>1||$ch2==0)&&($vl_c[16]!=''&&$vl_c[16]!=0)){$chk_status2=check_sert(str_replace("\\'","'",$vl_c[1]),str_replace("\\'","'",$vl_c[2]),str_replace("\\'","'",$vl_c[3]),$vl_c[7],$vl_c[8],$vl_c[9],$vl_c[15],$vl_c[16]);} else{$chk_status2=$ch2;}
    if(($vl_c[20]==0||$vl_c[20]==2&&$s3==1)&&($ch3>1||$ch3==0)&&($vl_c[18]!=''&&$vl_c[18]!=0)){$chk_status3=check_sert(str_replace("\\'","'",$vl_c[1]),str_replace("\\'","'",$vl_c[2]),str_replace("\\'","'",$vl_c[3]),$vl_c[10],$vl_c[11],$vl_c[12],$vl_c[17],$vl_c[18]);} else{$chk_status3=$ch3;}
    $chk=$chk_status1+$chk_status2*4+$chk_status3*16;

    AdOLF_04, 27 Июня 2010

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

    +178

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    #ifndef TSTACK_H
    #define TSTACK_H
    
    #include &lt;iostream.h&gt;
    
    using namespace std
    
    template.......

    Это начало программы "самостоятельно" написаной от руки на бумажке студентом с целью получения зачета по объектно ориентированному программированию. Дальше я читать не стал

    klavdiev, 09 Июня 2010

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

    −1

    1. 1
    Здесь будут опубликованы пароли от учётных записей

    Lokich, 29 Сентября 2021

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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    На любимом форуме Сёмы шаблоны никак не защищены от внешнего доступа. Сёме особенно должен понравиться последний файл:
    
    https://2ch.hk/makaba/templates/Search.template
    https://2ch.hk/makaba/templates/Archive.template
    https://2ch.hk/makaba/templates/Posting.template
    
    Судя по всему, используется шаблонизатор CTPP для Perl.

    rotoeb, 28 Мая 2021

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

    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
    class MyString
    {
    public:
    	MyString(const char* str)
    	{
    		symbol = strlen(str);
    		this->str = new char[symbol + 1];
    		for (int i = 0; i < symbol; i++)
    		{
    			this->str[i] = str[i];
    		}
    		this->str[symbol] = '\0';
    	}
    	int Size()
    	{
    		return symbol;
    	}
    	MyString()
    	{
    		str = nullptr;
    		symbol = 0;
    	}
    	~MyString()
    	{
    		delete[] str;
    	}
    	MyString(const MyString& objct)
    	{
    		symbol = strlen(objct.str);
    		this->str = new char[symbol + 1];
    		for (int i = 0; i < symbol; i++)
    		{
    			this->str[i] = objct.str[i];
    		}
    		this->str[symbol] = '\0';
    	}
    	MyString operator ()(const char* objct)
    	{
    		if (this->str != nullptr)
    		{
    			delete[] this->str;
    		}
    		symbol = strlen(objct);
    		this->str = new char[symbol + 1];
    		for (int i = 0; i < symbol; i++)
    		{
    			this->str[i] = objct[i];
    		}
    		this->str[symbol] = '\0';
    		return *this;
    	}
    	MyString& operator =(MyString& objct)
    	{
    		if (this->str != nullptr)
    		{
    			delete[] str;
    		}
    		symbol = strlen(objct.str);
    		this->str = new char[symbol + 1];
    		for (int i = 0; i < symbol; i++)
    		{
    			this->str[i] = objct.str[i];
    		}
    		this->str[symbol] = '\0';
    		return *this;
    	}
    	MyString operator +(MyString& objct)//конкатенация строк
    	{
    		MyString NEWString;
    		symbol = strlen(this->str);
    		Ssymbol = strlen(objct.str);
    		NEWString.str = new char[symbol + Ssymbol + 1];
    		int i = 0;
    		NEWString.symbol = symbol + Ssymbol;
    		for (; i < symbol; i++)
    		{
    			NEWString.str[i] = this->str[i];
    		}
    		for (int j = 0; j < Ssymbol; j++, i++)
    		{
    			NEWString.str[i] = objct.str[j];
    		}
    		NEWString.str[symbol + Ssymbol] = '\0';
    		return NEWString;
    	}
    	//перегруженные операторы........
     int main()
    {
    	MyString asd = "Go";
    	MyString aa = "God";
    	if (asd >= aa)
    	{
    		cout << "Первая переменная больше по символам чем вторая." << endl;
    	}
    	else
    	{
    		cout << "Первая переменная меньше по символам чем вторая." << endl;
    	}
    }

    Свой класс строк. Что можно поправить для лучшей оптимизации?

    1337, 28 Марта 2021

    Комментарии (78)
  8. Python / Говнокод #26461

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    Вы напишите
    x != x
    или
    import math
    math.isnan(x)
    ?

    3_dar, 03 Марта 2020

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

    +5

    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
    function fix_hacker_strings($str){
            $s=$str;
            $s=str_replace('/*', 'xx', $s);
            $s=str_replace('*/', 'xx', $s);
            $s=str_replace('../', 'xxx', $s);
            $s=str_replace('..\\', 'xxx', $s);
            $s=str_ireplace('file:', 'xxxxx', $s);
            $s=str_ireplace(':$', 'xx', $s);
            $s=str_ireplace('http:', 'xxxx', $s);
            $s=str_ireplace('https:', 'xxxxx', $s);
            $s=str_ireplace('script', 'xxxxxx', $s);
            $s=str_ireplace('delete', 'xxxxxx', $s);
            $s=str_ireplace('drop', 'xxxx', $s);
            $s=str_ireplace('select', 'xxxxxx', $s);
            $s=str_ireplace('update', 'xxxxxx', $s);
            $s=str_ireplace('replace', 'xxxxxxx', $s);
            $s=str_ireplace('/etc/', '/xxx/', $s);
            $s=str_ireplace('/var/', '/xxx/', $s);
            $s=str_ireplace('/root/', '/xxxx/', $s);
            $s=str_ireplace('/bin/', '/xxx/', $s);
            $s=str_ireplace('/usr/', '/xxx/', $s);
            $s=str_ireplace('/sys/', '/xxx/', $s);
            $s=str_ireplace('/sbin/', '/xxxx/', $s);        
            $s=str_ireplace('/proc/', '/xxxx/', $s);
            $s=str_ireplace('/boot/', '/xxxx/', $s);
            $s=str_ireplace('mysql', 'xxxxx', $s); 
            return $s;
    }

    обработка user input

    dim1r, 08 Февраля 2020

    Комментарии (78)
  10. Perl / Говнокод #26005

    +1

    1. 1
    2. 2
    3. 3
    use Unicornify::URL;
     
    my $url = unicornify_url( email => '[email protected]' );

    https://metacpan.org/pod/Unicornify::URL

    PACTPOBblu_nemyx, 30 Октября 2019

    Комментарии (78)
  11. Куча / Говнокод #24787

    −3

    1. 1
    2. 2
    Что будет, если владелец ориентированного в том числе и на Евросоюз сайта не установит на нём ублюдочное уведомление об использовании "cookies"?
    Каторга? Электрический стул? Гильотина?

    tuberkulez, 19 Сентября 2018

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