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

    В номинации:
    За время:
  2. C# / Говнокод #3894

    +124

    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
    public void GeneratXMLForChatServerControl()
            {
                List<ClassUsersList> List = GetUsersList();
                System.IO.StreamWriter TextW = new System.IO.StreamWriter("Update_Settings.xml", false,System.Text.Encoding.GetEncoding("UTF-8"));
                
                TextW.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
                TextW.WriteLine("<General>");
                foreach (ClassUsersList User in List)
                {
                    User.Information = User.Information.Replace("<", "");
                    User.Information = User.Information.Replace(">", "");
                    User.Information = User.Information.Replace("&", "");
                    TextW.WriteLine("<Name>" + User.Information + "</Name>");
                    TextW.WriteLine("<Login>" + User.UIN + "</Login>");
                    TextW.WriteLine("<Password>" + User.Pwd + "</Password>");
                    TextW.WriteLine("<LocalPath>D:\\chat2\\" + User.UID + "\\</LocalPath>");
                    TextW.WriteLine("<UID>" + User.UID + "</UID>");
                    TextW.WriteLine("<UIN>" + User.UIN + "</UIN>");
                    TextW.WriteLine("<Lock>0</Lock>");
                    TextW.WriteLine("");
                }
                TextW.WriteLine("</General>");
                TextW.Flush();
                TextW.Close();         
            }

    Крутобл, создаём XML налету

    Nigma143, 06 Августа 2010

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

    +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
    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
    class recordset {
    /*используется для оптимизации работы с MySQL*/
    var $res;
    function recordset($sql,$link="") {
    if ($link!="")
    	{
        $this->res=mysql_query($sql,$link);
        if (!$this->res)
        	{
            echo $sql;
    		echo mysql_error($link);
    		}
        }
    else
    	{
        $this->res=mysql_query($sql);
        if (!$this->res)
        	{
            echo $sql;
    		echo mysql_error();
    		}
        }
    }
    
    function gr() {
    $row=mysql_fetch_row($this->res);
    if ($row) {for ($i=0;$i<count($row);$i++) $row[$i]=convert_cyr_string($row[$i],"k","w");}
    return $row; }
    
    function ga() {
    $row=mysql_fetch_array($this->res);
    if ($row) {foreach($row as $key=>$val) $row[$key]=convert_cyr_string($val,"k","w");}
    return $row; }
    
    function nr() {
    $num=mysql_num_rows($this->res);
    return $num; }}

    еще один перл того же автора, что и в 2х предыдущих опубликованных мной говнокодах.
    На этот раз старорежимный ООП - великолепный класс.

    Mihard, 06 Августа 2010

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

    +111

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    /// ----------------------------------------------------------------------------- 
    /// <summary> 
    /// Page_Load runs when the control is loaded 
    /// </summary> 
    /// ----------------------------------------------------------------------------- 
    protected void Page_Load(object sender, System.EventArgs e)
    {
       ...
    }

    да ну!! серьезно что-ли???

    Coffeeholic, 04 Августа 2010

    Комментарии (14)
  5. PHP / Говнокод #3805

    +111

    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
    <?
    	class newPage
    	{
    		
    		public $bigMainImage;
    		
    		public $smallMainImage;
    	
    		protected $id;
    		
    		//Фамилия и имя
    		protected $surname;
    		protected $name;
    		
    		//город
    		protected $city;
    
    		//конструктор
    		public __construct($id,
    					$surname,
    					$name,
    					$city)
    		{
    			$this->id = htmlspecialchars($id);
    			$this->surname = htmlspecialchars($surname);
    			$this->name = htmlspecialchars($name);
    			$this->city = htmlspecialchars($city);
    
    			//копируем большое и маленькое изображение 
    			copy("photos/$id/1.jpg","photos/$id/Main.jpg");
    			copy("photos/$id/small/1.jpg","photos/$id/small/Main.jpg");
    			$this->bigMainImage = "photos/$id/Main.jpg";
    			$this->smallMainImage = "photos/$id/small/Main.jpg";
    		}
    		
    		//вывод страницы на экран
    		public get_html()
    		{
    			echo"<title>$this->name $this->surname</title>";
    			echo "
    					<table>
    						<tr>
    							<td>
    								<img src=\"$this->bigMainImage\"><br>Рейтинг:
    							</td>
    							<td>
    								<b>$this->name $this->surname</b>,<br>
    								$this->city								
    							</td>
    						</tr>
    					</table>";
    		}
    		public newFile($id)
    		{
    			$intPage = fopen("page/".$id.".php",w);
    		}
    					
    	}
    ?>

    Ржу не магу.

    Vasiliy, 28 Июля 2010

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

    +164

    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
    std::string str(bool val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }
    
    std::string str(short val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }
    
    std::string str(unsigned short val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }
    
    std::string str(int val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }
    
    std::string str(unsigned int val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }
    
    std::string str(long val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }
    
    std::string str(unsigned long val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }
    
    std::string str(float val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }
    
    std::string str(double val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }
    
    std::string str(long double val) {
      std::stringstream ss;
      ss << val;
      return ss.str();
    }

    Вот что значит невыспанная голова!
    Чуть позже переделал в это

    template<class T>
    std::string str(T val) {
    std::stringstream ss;
    ss << val;
    return ss.str();
    }

    rudvil, 14 Июля 2010

    Комментарии (14)
  7. JavaScript / Говнокод #3678

    +170

    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
    function varEnb(a) {
    n=true
    try {
    z=eval(a)
    } catch(e) {
    n=false
    }
    if(n==true){
    return true
    } else {
    return false
    }
    }

    Проверяем наличие переменной

    eval, 10 Июля 2010

    Комментарии (14)
  8. PHP / Говнокод #3647

    +148

    1. 1
    $isOccupy=($valdet['isOccupy']=='1')?0:1;

    а все по тому что кое кто перепутал логику атрибута=\

    nur, 06 Июля 2010

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

    +176

    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
    //вторая форма
    		$n2 = $_GET['n2'];//Компания
    		$n10 = $_GET['n10'];//Ф.И.О:
    		$n11 = $_GET['n11'];// Должность:
    		$n12 = $_GET['n12'];//Телефон:
    		$n13 = $_GET['n13'];//E-mail:
    		$n14 = $_GET['n14'];//
    		$n15 = $_GET['n15'];
    		$n16 = $_GET['n16'];
    		$n17 = $_GET['n17'];
    		$n18 = $_GET['n18'];
    		$n19 = $_GET['n19'];
    		$n20 = $_GET['n20'];
    		$n21 = $_GET['n21'];
    		$n22 = $_GET['n22'];
    		$n23 = $_GET['n23'];
    		$n24 = $_GET['n24'];
    		$n25 = $_GET['n25'];
    		$n26 = $_GET['n26'];
    		$n27 = $_GET['n27'];
    		$n28 = $_GET['n28'];
    		$n29 = $_GET['n29'];
    		$n30 = $_GET['n30'];
    		$n31 = $_GET['n31'];
    		$n32 = $_GET['n32'];
    		$n33 = $_GET['n33'];
    		$n34 = $_GET['n34'];
    		$n35 = $_GET['n35'];
    		$n37 = $_GET['n37'];//value - другое:
    		$n38 = $_GET['n38'];
    		$n39 = $_GET['n39'];
    		$n40 = $_GET['n40'];//new form - Картонные карты - Тираж(от 10 000 шт.): 
    		$n41 = $_GET['n41'];
    		$n42 = $_GET['n42'];
    		$n43 = $_GET['n43'];
    		$n44 = $_GET['n44'];
    		$n45 = $_GET['n45'];
    		$n46 = $_GET['n46'];
    		$n47 = $_GET['n47'];//new form - Услуги сборки - Количество комплектов: 
    		$n48 = $_GET['n48'];
    		$n49 = $_GET['n49'];
    		$n50 = $_GET['n50'];
    		$n51 = $_GET['n51'];
    		$n52 = $_GET['n52'];
    		$n53 = $_GET['n53'];
    		$n54 = $_GET['n54'];
    		$n55 = $_GET['n55'];
    		$n56 = $_GET['n56'];
    		$n57 = $_GET['n57'];
    		$n58 = $_GET['n58'];
    		$n59 = $_GET['n59'];//new form - Мейлинг - Есть
    		$n60 = $_GET['n60'];
    		$n61 = $_GET['n61'];
    		$n62 = $_GET['n62'];
    		$n63 = $_GET['n63'];
    		$n64 = $_GET['n64'];
    		$n65 = $_GET['n65'];
    		$n66 = $_GET['n66'];
    		$n67 = $_GET['n67'];
    		$n68 = $_GET['n68'];
    		$n69 = $_GET['n69'];
    		$n70 = $_GET['n70'];
    		$n71 = $_GET['n71'];
    		$n72 = $_GET['n72'];
    		$n73 = $_GET['n73'];
    		$n74 = $_GET['n74'];
    		$n75 = $_GET['n75'];
    		$n76 = $_GET['n76'];
    		$n77 = $_GET['n77'];
    		$n78 = $_GET['n78'];
    		$n79 = $_GET['n79'];
    		$n80 = $_GET['n80'];
    		$n81 = $_GET['n81'];
    		$n82 = $_GET['n82'];
    		$n83 = $_GET['n83'];
    		$n84 = $_GET['n84'];
    		$n85 = $_GET['n85'];
    		$n86 = $_GET['n86'];
    		$n87 = $_GET['n87'];
    		$n88 = $_GET['n88'];
    		$n89 = $_GET['n89'];
    		$n90 = $_GET['n90'];
    		
    		$subject2 = "Онлайн просчет";
    		$headers2 = "MIME-Version: 1.0\n";
    		$headers2 .= "Content-type: text/html; charset=utf-8\n";
    		$text2 = "<table border='0' cellspacing='0' cellpadding='0' width='100%' align='center' bgcolor='#f0f0f0'> <tr> 
    		<td><table border='0' cellspacing='0' cellpadding='0' width='600' align='center' bgcolor='#f0f0f0'> <tr> 
    		<td width='178' height='50' valign='center'><font size='2'>&nbsp;&nbsp;&nbsp;Компания* :</font></td> <td 
    		width='329'><input type=TEXT name='n2' value='".$n2."' readonly='readonly' size='49' style='border: 2; 
    		background: #e2e2e2' /></td> </tr> <tr> <td height='50' valign='center'><font

    этот пиздец был найден в коде одного проекта на жумле, в файле темплейта
    в конечном итогде это все отправлялось на мыло

    krasnoukhov, 05 Июля 2010

    Комментарии (14)
  10. Куча / Говнокод #3606

    +133

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    Below is a list of the warning message(s) produced when checking your document. 
     Line 91, Column 31: NET-enabling start-tag requires SHORTTAG YES 
    
            alt="Правильный CSS!" /> </a>                                  ✉ 
    
    The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document...

    Валидатор ругается на иконку, подаренную валидатором

    bugmenot, 30 Июня 2010

    Комментарии (14)
  11. JavaScript / Говнокод #3602

    +194

    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
    function gopic(piciden) {
    piciden=piciden*1;
      if (piciden<0) {
        eval("document.risunki.ris0"+piciden+".disabled=true")
        eval("document.risunki.mark0"+piciden+".disabled=true")
        eval("mark=document.risunki.mark0"+piciden+".options[document.risunki.mark0"+piciden+".selectedIndex].value")
        }
      else {
        eval("document.risunki.ris"+piciden+".disabled=true")
        eval("document.risunki.mark"+piciden+".disabled=true")
        eval("mark=document.risunki.mark"+piciden+".options[document.risunki.mark"+piciden+".selectedIndex].value")
        }
      }
    
    function check_data(elem){
    a=0
    }

    3.14159265, 30 Июня 2010

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