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

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

    +128

    1. 1
    2. 2
    3. 3
    4. 4
    XmlNodeList list = xdoc.GetElementsByTagName("Customer");
    for (int i = 0; i < list.Count; i++)
    {
    XmlElement cl = (XmlElement)xdoc.GetElementsByTagName("Customer")[i];

    Написано расовым индусом.
    http://www.c-sharpcorner.com/UploadFile/vimalkandasamy/Xml03032009055848AM/Xml.aspx - чисто индусский бложик. Там много подобного.

    koodeer, 26 Сентября 2011

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

    +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
    <?php 
    include "dbconfig.php"; 
    $db = mysql_connect("$dbhost","$dbuser","$dbpass");
    mysql_select_db("$dbname",$db);
    
    
    $mysqlsite = mysql_query("SELECT * FROM site WHERE id='1'");
    $site = mysql_fetch_array($mysqlsite);
    
    $titlesite = $site['title'];
    $titlesite = iconv("CP1251", "UTF-8", "$titlesite");
    
    $descriptionsite = $site['description'];
    $descriptionsite = iconv("CP1251", "UTF-8", "$descriptionsite");
    
    $keywordssite = $site['keywords'];
    $keywordssite = iconv("CP1251", "UTF-8", "$keywordssite");
    
    
    $contsite = $site['cont'];
    $contsite = iconv("CP1251", "UTF-8", "$contsite");
    ?>

    "CMS" Хостинг провайдера ultrahost.com.ua D

    SaNcHeS, 24 Сентября 2011

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

    +103

    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
    ...
    var count: integer;
          summ: integer;
    begin
     try
      case count of
        1: summ:=StrToInt(EditBox1.Text);
        2: summ:=StrToInt(EditBox1.Text)+StrToInt(EditBox2.Text);
        3: summ:=StrToInt(EditBox1.Text)+StrToInt(EditBox2.Text)+StrToInt(EditBox3.Text);
        4: summ:=StrToInt(EditBox1.Text)+StrToInt(EditBox2.Text)+StrToInt(EditBox3.Text)+StrToInt(EditBox4.Text);
        5: summ:=StrToInt(EditBox1.Text)+StrToInt(EditBox2.Text)+StrToInt(EditBox3.Text)+StrToInt(EditBox4.Text)+StrToInt(EditBox5.Text);
        6: summ:=StrToInt(EditBox1.Text)+StrToInt(EditBox2.Text)+StrToInt(EditBox3.Text)+StrToInt(EditBox4.Text)+StrToInt(EditBox5.Text)+StrToInt(EditBox6.Text);
        7: summ:=StrToInt(EditBox1.Text)+StrToInt(EditBox2.Text)+StrToInt(EditBox3.Text)+StrToInt(EditBox4.Text)+StrToInt(EditBox5.Text)+StrToInt(EditBox6.Text)++StrToInt(EditBox7.Text);
        8: summ:=StrToInt(EditBox1.Text)+StrToInt(EditBox2.Text)+StrToInt(EditBox3.Text)+StrToInt(EditBox4.Text)+StrToInt(EditBox5.Text)+StrToInt(EditBox6.Text)++StrToInt(EditBox7.Text)++StrToInt(EditBox8.Text);
        9: summ:=StrToInt(EditBox1.Text)+StrToInt(EditBox2.Text)+StrToInt(EditBox3.Text)+StrToInt(EditBox4.Text)+StrToInt(EditBox5.Text)+StrToInt(EditBox6.Text)++StrToInt(EditBox7.Text)++StrToInt(EditBox8.Text)+StrToInt(EditBox9.Text);
        10: summ:=StrToInt(EditBox1.Text)+StrToInt(EditBox2.Text)+StrToInt(EditBox3.Text)+StrToInt(EditBox4.Text)+StrToInt(EditBox5.Text)+StrToInt(EditBox6.Text)++StrToInt(EditBox7.Text)++StrToInt(EditBox8.Text)+StrToInt(EditBox9.Text)+StrToInt(EditBox9.Text);
        0: summ:= 0;
      end;
     except
       ShowMessage('Error');
     end;
    end;

    Сегодня увидал у однокурсника в универе.
    Самый оптимальные метод подсчета суммы элементов EditBox, не правдали???

    alexprey, 20 Сентября 2011

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

    +128

    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
    <th style='border-left: 1px solid #97cbee;'>Premium<br />without<br />excess<span><img src='Artog/Images/empty/empty.gif' /></span>
    					<div style='position: relative; top: 0'>
    						<IMG class='str3' width='16' heigth='16' title='The excess can be removed from some plans in return for a higher premium.<br/>You can select this option when purchasing the plan from the insurer.' src="Artog/Images/Icons/InfoIcon28x28.png" />
    					</div>
    				</th>
    				<th style='border-left: 1px solid #97cbee'>Luggage/<br />Personal<br />effects<span><img src='Artog/Images/empty/empty.gif' /></span>
    					<div style='position: relative'>
    						<IMG class='str3' width='16' heigth='16' title='Coverage on luggage (typically important for people with a lot of good quality travel gear)' src="Artog/Images/Icons/InfoIcon28x28.png" />
    					</div>
    				</th>
    				<th style='border-left: 1px solid #97cbee'>Medical<br />expenses<span><img src='Artog/Images/empty/empty.gif' /></span>
    					<div style='position: relative'>
    						<IMG class='str2' width='16' heigth='16' title='How much will be contributed to any doctor's bills, emergency surgery etc. (for obvious reasons this is generally important for all travelers)' src="Artog/Images/Icons/InfoIcon28x28.png" />
    					</div>
    				</th>
    				<th style='border-left: 1px solid #97cbee'>Cancellation<br />costs<span><img src='Artog/Images/empty/empty.gif' /></span>
    					<div style='position: relative'>
    						<IMG class='str2' width='16' heigth='16' title='How much will be paid from inconvenience due to cancellation of flights etc. (typically important for people with a complex itinerary)' src="Artog/Images/Icons/InfoIcon28x28.png" />
    					</div>
    				</th>

    разбираю тут 1 проект
    <th style='border-left: 1px solid #97cbee'> <---------- индусы не знают ,что такое класс в css

    Rubaka, 20 Сентября 2011

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

    −113

    1. 1
    2. 2
    3. 3
    4. 4
    def a
    print rand(1)
    end
    puts a

    Попытался нагадить… короче, puts puts 0

    nbvec222, 10 Сентября 2011

    Комментарии (8)
  7. Java / Говнокод #7803

    +79

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    public void restore(HashMap<String, Object> dump) {
    		if(dump != null) {
    			if(isInitialized()) {
    				if(isInitialized()) {
    					clear();

    "Проинициализировано? Точно-точно?"

    lucidfox, 08 Сентября 2011

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

    +173

    1. 1
    $lib = $app['memcache.wrapper'] === false ? false : $app['memcache.wrapper'];

    я туплю????? или кто-то получает за количество символов ????

    AlexanderC, 07 Сентября 2011

    Комментарии (8)
  9. Си / Говнокод #7774

    +107

    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
    char *getcwd(char *buf, size_t size)
    {
    	if (!buf)
    	{
    		errno = EFAULT;
    		return NULL;
    	}
    	if (size < 2)
    	{
    		errno = ERANGE;
    		return NULL;
    	}
    	buf[0] = '.';
    	buf[1] = '\0';
    	return buf;
    }

    -- Где мы находимся, Сэр?
    -- В корзине воздушного шара.

    P.S. Ссылка на коммит - http://git.altlinux.org/people/ldv/packages/?p=girar.git;a=commit;h=3ff0ce7b00907ba1 dce6406f6

    raorn, 05 Сентября 2011

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

    +172

    1. 1
    2. 2
    char readByffer[102]={0};
    std::string dataStrong = readByffer;

    CPPGovno, 01 Сентября 2011

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

    +128

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    private static void ListXmlSerialize<T>(List<T> UserList, string Obj, string FileName)
    {
          object obj = new object();
          lock (obj)
          {
               XmlSerializer UserXmlFormat = new XmlSerializer(typeof(List<T>), Obj);
               Stream UserFileStream = new FileStream(FileName, FileMode.Create, FileAccess.Write, FileShare.Write);
               UserXmlFormat.Serialize(UserFileStream, UserList);
               UserFileStream.Close();
         }
    }

    wpfDev, 31 Августа 2011

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