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

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

    +153

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    }
    </SCRIPT>

    Лёгких путей не ищем. С форума.

    guest, 05 Июля 2009

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

    +143

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    public function some($value)
    {
        ...
        $value = $html;
        return $value;
    }

    guest, 03 Июля 2009

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

    +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
    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
    _strlwr(buf);
    if(buf[0] == '\"') strcpy(buf, &(buf[1]));
    if(strstr(buf, "\""))
    {
    	if(strrchr(buf, '\\'))
    	{
    		if(strchr(strrchr(buf, '\\'), ' '))
    		{
    			*(strchr(strrchr(buf, '\\'), ' ')) = 0;
    		}
    	}
    	strncpy(szPath, buf, (DWORD)strstr(buf, "\"") - (DWORD)buf);
    	return 0;
    }
    else
    {
    	if(strrchr(buf, '\\'))
    	{
    		if(strchr(strrchr(buf, '\\'), ' '))
    		{
    			*(strchr(strrchr(buf, '\\'), ' ')) = 0;
    		}
    	}
    	strcpy(szPath, buf);
    	return 0;
    }

    Определение дефолтного браузера

    guest, 02 Июля 2009

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

    +142.3

    1. 1
    "x_address"			=> $postData['address1']. trim( ' ' . $postData['address2']),

    гениально =)

    guest, 29 Июня 2009

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

    +153

    1. 1
    break; break; break; // PLEASE, BREAK!!!!!!

    guest, 28 Июня 2009

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

    +140.1

    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
    function parce($string)
    
    
    
    {//function open
    $breaktags=array ("<"," ","=","","т");
       
       for ($pos=0;$pos<strlen($string);$pos++)
       {//for text
         
         if (substr($string,$pos,1)=="{" and substr($string,$pos+1,1)=="%")
    		{// if open symbols finded
    		   $tagopened=1;
    		   while($tagopened==1){//while opened
    			   for($inpos=$pos+2;$inpos<10000;$inpos++){// =)
    				   if ( (substr($string,$inpos,1)=="%" and substr($string,$inpos+1,1)=="}") or in_array(substr($string,$inpos,1),$breaktags)) {break 2;$tagopened=0;}//br
    				   $intag=$intag.substr($string,$inpos,1);
    		   }//for inpos
    		}//while opened closing
    		$intag=explode("->",$intag,2);
    		echo("$intag[0] with $intag[1] action!<br>");
    		unset($intag);
    				} else {//if symbols finded
    					$symbol=substr($string,$pos,1);
    					echo("$symbol");
    				}
    				
       }//for all text closing
       
    }//function end;

    guest, 23 Июня 2009

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

    +147

    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
    function sql($query){
    	/* Переменные для соединения с базой данных */ 
    	$hostname = "localhost"; 
    	$username = "modx"; 
    	$password = "22222"; 
    	$dbName = "modx"; 
    	/* создать соединение */ 
    	mysql_connect($hostname,$username,$password) OR DIE("Не могу создать соединение "); 
    	/* выбрать базу данных. Если произойдет ошибка - вывести ее */ 
    	mysql_select_db($dbName) or die(mysql_error());  
    	$res = mysql_query($query);
    	mysql_close(); 
    
    }

    восемь

    guest, 21 Июня 2009

    Комментарии (3)
  9. Куча / Говнокод #1217

    +153

    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
    (defun lagr-poly (lpoints)
      (lambda (x)
        (let ((prod-l nil)
    	  (sum-l nil))
          (loop for point in lpoints do
    	   (let ((x0 (x-coord point))
    		 (y0 (y-coord point)))
    	     (loop for pointn in lpoints do
    		  (let ((xn (x-coord pointn)))
    		    (if (not (eq point pointn))
    			(progn (push (/ (- x xn) (- x0 xn)) prod-l)))))
    	     (push (* (product prod-l) y0) sum-l)
    	     (setq prod-l nil)))
          (loop for l in sum-l sum l))))

    Полином Лагранжа, ёпта!
    Давно написал, сейчас даже понять не могу как работает.

    guest, 17 Июня 2009

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

    +134.2

    1. 1
    2. 2
    3. 3
    4. 4
    public void OnObjectException(EventArgs e, Exception ex)
    {
       throw ex;
    }

    Индусятина!

    guest, 16 Июня 2009

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

    +77

    1. 1
    6432168468453

    вы все говнокоды

    guest, 15 Июня 2009

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