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

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

    +111

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    // BasePage
    public virtual void Page_Error(object sender, EventArgs e) { }
    
    // Page
    public override void Page_Error(object sender, EventArgs e) { }

    Авторы-индусы были по всей видимости не в курсе о существовании OnError(EventArgs)

    abatishchev, 19 Апреля 2011

    Комментарии (1)
  3. JavaScript / Говнокод #6401

    +156

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    try {
        document.domain = "wolframalpha.com";
        context = parent ? parent : document;
        } catch(e){}
        try { 
            if (typeof(context.$) == "undefined") {
                context = window;
            } else {
                $=context.$;
            }
        }
        catch(e){ context = window; }

    Если с первого раза не получилось...

    RaZeR, 19 Апреля 2011

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

    +146

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Ошибка: unterminated regular expression literal
    Источник: http://govnokod.ru/media/ddd20ce56acf1d9ebadd126322495087.js?files=jquery.js,jquery.scrollTo.js,govnokod.js,jshighlight/highlight.pack.js&v=4
    Строка 204, символ 158
    Исходный код:
    return curLoop;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\

    Это не код, а баг, из-за которого в Firefox'е комментарии не подгружаются, а открываются на отдельной странице.
    Короче, минусуйте.

    nsauk, 18 Апреля 2011

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

    +146

    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
    <?php
    /* ...какой-то код... */
    
    /* Как бы та самая с**ная "многозадачность" */
    	$proc = popen("/var/www/test PARAMS", "r");
    
    /* ...какой-то код... */
    ?>
    -----------------------------------------------------------------------------
    #!/bin/sh
    # Содержание /var/www/test
    
    STRING="/usr/bin/php -q /var/www/my/test.php"
    
    	if [ -n "$1" ]
    		then
    			VAR1=$1
    		else
    			VAR1='0'
    	fi
    
    `$STRING $VAR1`&
    
    --------------------------------------------------------------
    <?php
    /* ...какой-то код... */
    	/* 
    	файл /var/www/my/test.php 
    	содержит кой-чего на выполнение...
    	*/
    /* ...какой-то код... */
    ?>

    Кажется это достойно этого сайта...

    istem, 15 Апреля 2011

    Комментарии (1)
  6. PHP / Говнокод #6353

    +161

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    $f = true;
    
    $arOrder = CSaleOrder::GetByID($id_order);
    $f = $f && ($arOrder ? true : false);
    
    if ($f)	$f = $f && CSaleOrder::StatusOrder($id_order,$status);
    if ($f)	$f = $f && CSaleOrder::DeliverOrder($id_order,"Y");
    if ($f)	$f = $f && CSaleOrder::PayOrder($id_order, "Y", true, true);

    elw00d, 14 Апреля 2011

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

    +156

    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
    this.resetFunctions = function() {
      		this.onLoading = function() { };
      		this.onLoaded = function() { };
      		this.onInteractive = function() { };
      		this.onCompletion = function() { };
      		this.onError = function() { };
    		this.onFail = function() { };
    	};
    
    	this.reset = function() {
    		this.resetFunctions();
    		this.resetData();
    	};
    
    	this.createAJAX = function() {
    		try {
    			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    		} catch (e1) {
    			try {
    				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    			} catch (e2) {
    				this.xmlhttp = null;
    			}
    		}

    =)нашел с другом на сайте россдневник http://****/FrontPage.aspx можете сами поскать в JS

    BlackMonolit, 14 Апреля 2011

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

    +76

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    private  void sortPropertyTypeList(List<PropertyTypeDTO> list){
    		Set<PropertyTypeDTO> propertyTypeSet = new TreeSet<PropertyTypeDTO>(propertyTypeComparator);
    		propertyTypeSet.addAll(list);
    		list.clear();
    		list.addAll(propertyTypeSet);
    	}

    Новаторская сортировочка:)

    hellwalker, 08 Апреля 2011

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

    +161

    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
    $tmpProduct = array(
    ...
        'FARE' => $tmpFares,
        '~FARE' => CTRSCurrency::GetStringFull($row['FARE'], $o['CURRENCY']),
        'TAX' => CTRSCurrency::GetString($row['TAX'], $o['CURRENCY']),
        '~TAX' => CTRSCurrency::GetStringFull($row['TAX'], $o['CURRENCY']),
    ...
    );
    
    ...
    	
    $tmpProduct['FARE_'] = $tmpProduct['~FARE'];
    $tmpProduct['TAX_'] = $tmpProduct['~TAX'];
    $tmpProduct['~FARE_'] = $row['FARE'];
    $tmpProduct['~TAX_'] = $row['TAX'];

    Из одного очень большего компонента...

    wwwguru, 08 Апреля 2011

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

    +161

    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
    //стандарт
    		$price_st = mysql_query("select price from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$izmer' and  ves_do>= '$izmer' and `type`='$type_st' limit 1");
    		$price_st = mysql_result($price_st, 0);
    
    		$minprice_st = mysql_query("select minprice from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$izmer' and ves_do >= '$izmer' and `type`='$type_st' limit 1");
    		$minprice_st = mysql_result($minprice_st, 0);
    		$time_st = mysql_query("select time from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$izmer' and ves_do >= '$izmer' and `type`='$type_st' limit 1");
    		$time_st = mysql_result($time_st, 0);
    
    	//экспресс
    		$price_ex = mysql_query("select price from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$izmer' and  ves_do>= '$izmer' and `type`='$type_ex' limit 1");
    		$price_ex = mysql_result($price_ex, 0);
    		$minprice_ex = mysql_query("select minprice from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$izmer' and ves_do >= '$izmer' and `type`='$type_ex' limit 1");
    		$minprice_ex = mysql_result($minprice_ex, 0);
    		$time_ex = mysql_query("select time from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$izmer' and ves_do >= '$izmer' and `type`='$type_ex' limit 1");
    		$time_ex = mysql_result($time_ex, 0);
    
    	//Ритейл
    		$price_pallet = mysql_query("select price from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$pallets' and  ves_do>= '$pallets' and `type`='$type_rit' limit 1");
    		$price_pallet = mysql_result($price_pallet, 0);
    
    		$time_pallet = mysql_query("select time from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$pallets' and ves_do >= '$pallets' and `type`='$type_rit' limit 1");
    		$time_pallet = mysql_result($time_pallet, 0);
    
    	//авиа
    		if ($start==getIdCity('Москва')){
    
    			if ($volume*167>$weight){
    				$izmer=(float)($volume*167);
    				$kol_av = $volume*167;
    			}
    			else
    			{
    				$izmer=$weight;
    				$kol_av = $weight;
    			}
    			$price_av = mysql_query("select price from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$izmer' and  ves_do>= '$izmer' and `type`='$type_av' limit 1");
    			$price_av = mysql_result($price_av, 0);
    			$minprice_av = mysql_query("select minprice from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$izmer' and ves_do >= '$izmer' and `type`='$type_av' limit 1");
    			$minprice_av = mysql_result($minprice_av, 0);
    			$time_av = mysql_query("select time from db_tarif where `from` = '$start' and `to` = '$finish' and ves_ot <= '$izmer' and ves_do >= '$izmer' and `type`='$type_av' limit 1");
    			$time_av = mysql_result($time_av, 0);
    		}
    		else{
    			$cost_av = "Тариф недоступен";
    		}

    калькулятор стоимости перевозки

    Shiz89, 08 Апреля 2011

    Комментарии (1)
  11. PHP / Говнокод #6273

    +159

    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
    public function count_relation($of_type = ""){
    			if ($this->is_login()){
    				$this->get_data($_COOKIE['login']);
    				
    				if (empty($of_type))
    					$relations = $this->sql("SELECT COUNT(id) AS count FROM users_relations WHERE user_id='".$this->id."'", 1);
    				else
    					$relations = $this->sql("SELECT COUNT(id) AS count FROM users_relations WHERE user_id='".$this->id."' WHERE type='".mysql_escape_string($of_type)."'", 1);
    					
    				return $invites->relations;
    			}
    			
    			return false;
    		}

    Не перевелись на Руси говнокодеры

    ener, 07 Апреля 2011

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