1. JavaScript / Говнокод #7458

    +158

    1. 1
    2. 2
    3. 3
    A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
    
    Script: http://govnokod.ru/media/d10c81f141cf62e45d6f8dba139fa72d.js?files=jquery.js,govnokod.js,livecomments.js,jshighlight/highlight.pack.js&v=4:452

    Говнокод в govnokod e.

    yahoo, 05 Августа 2011

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

    +150

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function Point(){
    	this.x = 0;
    	this.y = 0;
    	if(arguments.length==2){				//if parameters are 2 points
    		this.x = arguments[0] || 0;
    		this.y = arguments[1] || 0;
    	}else
    		if(arguments.length==1){			//if parameter is a point object
    			this.x = arguments[0].x;
    			this.y = arguments[0].y;
    		}
    };

    yahoo, 05 Августа 2011

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

    +126

    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 bool NewOrder {
        get {
            if( !string.IsNullOrEmpty( Request.QueryString[ "NewOrder" ] ) ) {
                ViewState[ "NewOrder" ] = Request.QueryString[ "NewOrder" ] == "true" ? true : false;
            } else {
                if( ViewState[ "NewOrder" ] != null )
                    return ( bool ) ViewState[ "NewOrder" ];
                else
                    ViewState[ "NewOrder" ] = true;
                }
            return ( bool ) ViewState[ "NewOrder" ];
        }
        set { ViewState[ "NewOrder" ] = value; }
    }

    Eugene, 05 Августа 2011

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

    +171

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $('#bc8').html('<style type="text/css">#bc8 {display:none;}</style>');
    $('#bc7').html('<style type="text/css">#bc7 {display:none;}</style>');
    $('#bc12').html('<style type="text/css">#bc12 {display:none;}</style>');
    $('#bc16').html('<style type="text/css">#bc16 {display:none;}</style>');
    $('#bc18').html('<style type="text/css">#bc18 {display:none;}</style>');
    $('#bc17').html('<style type="text/css">#bc17 {display:none;}</style>');
    $('#bc9').html('<style type="text/css">#bc9 {display:none;}</style>');

    Хороший jQuery-программист

    TRANE73, 05 Августа 2011

    Комментарии (19)
  5. C# / Говнокод #7454

    +126

    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
    // Get credit spread rates and tenors
    mDtCreditSpreadTenors = aRDO.GetResultTable(mSelectCreditSpreadRates, mCode, mCreditSpreadCurveDate);
    
    // Check if any credit spread rates are returned
    if (mDtCreditSpreadTenors.Rows.Count == 0)
    {
        // If debugging
        if (System.Diagnostics.Debugger.IsAttached)
            // Get from fixed date
            mDtCreditSpreadTenors = aRDO.GetResultTable(mSelectCreditSpreadRates, mCode, 39396);
        else        
            // Add error
            aMissingData.Add(string.Format("Cannot find credit spread rates for date {0}", mCreditSpreadCurveDate.ToShortDateString()));
    }

    Счастливой отладки, суки!

    xxxcoderxxx, 05 Августа 2011

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

    +146

    1. 1
    2. 2
    3. 3
    public static function correctTextForHTML($inSTR) {
         return preg_replace("/\r\n|\n|\r/", "<br/>", $inSTR);
    }

    Sers, 05 Августа 2011

    Комментарии (20)
  7. PHP / Говнокод #7452

    +147

    1. 1
    2. 2
    3. 3
    public static function prepareHTML ($inStr) {
    		return htmlspecialchars(htmlspecialchars_decode($inStr));
    	}

    Sers, 05 Августа 2011

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

    +163

    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
    /**
    	 * удаляет ненужные нули для дробных значений
    	 *
    	 * @return unknown
    	 */
    	public static function removeExtraZero($power) {
    		if ($power == '') return "";
    
    		$a_tmp = explode('.', $power);
    		$a_tmp[1] = rtrim($a_tmp[1], '0');
    		if ($a_tmp[1] == '') return $a_tmp[0];
    		return $a_tmp[0] . '.' . $a_tmp[1];		
    	}

    Аналогия floatval()

    Sers, 05 Августа 2011

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

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    $em = '';
    	    foreach(array_unique(explode(',', $ae)) as $u) {
    		 if(!$u)
    		    continue;
    		  if($em)
    		    $em .= ',';
    		$em .= $u;
    	    }

    Кому сколько времени понадобилось, чтоб понять, что делает этот код?

    partizan22, 05 Августа 2011

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

    +140

    1. 1
    <a href='javascript:go("http://www.site.ru/?id=2167&lang=ru&ct=3&cid=2167&r=2167")' class="A_ThirdSelected"><nobr>Экономика</nobr></a>

    Функция go просто переадресовывает на нужный адрес. Видать писать ссылки в href уже не модно

    jQuery, 04 Августа 2011

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