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

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

    +153

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if (filter.getName() == null) {
    			navigator.setModifierName(filter.getName());
    		} else {
    			navigator.setModifierName(filter.getName());
    		}

    guest, 04 Июня 2009

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

    +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
    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
    program Drink;
     
    {$APPTYPE CONSOLE}
     
    uses
      SysUtils,
      Windows;
    
    const
      C: array[0..5] of Cardinal = ($64AABAB8, $54AAA288, $54AB3A90, $54AAAAA0, $563ABBB8,$60820000);
     
    var
      I: Byte;
      B: PByte;
    begin
      for I := 191 downto 0 do
      begin
        B := @C[I div 32];
        Inc(B, (I - (I div 32) * 32) div 8);
        if (B^ and (1 shl (I mod 8))) <> 0 then
          Write('X')
        else
          Write(' ');
        if (I mod 32) = 0 then
          Writeln('');
      end;
      ReadLn;
    end.

    guest, 31 Мая 2009

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

    +153

    1. 1
    2. 2
    3. 3
    4. 4
    class RequiredLibraryClassNotFoundInALibraryDirectoryException extends Exception
    {
    //...
    }

    Ну и имя у класса:)

    guest, 28 Мая 2009

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

    +153

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    function B2R(Bytes: Int64): string;
     const
      k: int64 = 1024;
    begin
     if Bytes < k then result := IntToStr(Bytes) + 'B' else
     if Bytes < k*k then result := FloatToStr(Round(Bytes*10/k)/10) + 'K' else
     if Bytes < k*k*k then result := FloatToStr(Round(Bytes*10/(k*k))/10) + 'M' else
     if Bytes < k*k*k*k then result := FloatToStr(Round(Bytes*10/(k*k*k))/10) + 'G' else
     if Bytes < k*k*k*k*k then result := FloatToStr(Round(Bytes*10/(k*k*k*k))/10) + 'T' else
     result := IntToStr(Bytes);
    end;

    Функция из плагина для JAJC особенно "понравилось" созерцание деления и умножения на 10 ;)

    guest, 20 Мая 2009

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

    +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
    PROCEDURE changeValue ( KeyStore:IN OUT Keys'Class; value: IN INTEGER ) 
      IS 
      BEGIN
       IF value = 1024 THEN
          Message ( "NOT IN RANGE" );
       ELSIF value = 2048 THEN
          Message ( "OUT OF RANGE" );
       ELSIF value = KeyStore.def THEN
    
         KeyStore.val = value;
      ELSE
        Message ( "IN RANGE");
     END IF;
     END changeValue;

    Какой-то наркоманский код.
    Трезвый такого не напишет.
    Почему приходится дорабатывать такое... будто за кем-то ж.. подтираешь:)

    guest, 20 Мая 2009

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

    +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
    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
    function _getUrlToNavigate( $categoryID )
    {
    	$url = "index.php?categoryID=$categoryID";
    	$data = ScanGetVariableWithId( array("param") );
    	if ( isset($_GET["search_name"]) )
    		$url .= "&search_name=".$_GET["search_name"];
    	if ( isset($_GET["search_price_from"]) )
    		$url .= "&search_price_from=".$_GET["search_price_from"];
    	if ( isset($_GET["search_price_to"]) )
    		$url .= "&search_price_to=".$_GET["search_price_to"];
    	foreach( $data as $key => $val )
    	{
    		$url .= "&param_".$key;
    		$url .= "=".$val["param"];
    	}
    	if ( isset($_GET["search_in_subcategory"]) )
    		$url .= "&search_in_subcategory=1";
    	if ( isset($_GET["sort"]) )
    		$url .= "&sort=".$_GET["sort"];
    	if ( isset($_GET["direction"]) )
    		$url .= "&direction=".$_GET["direction"];
    	if ( isset($_GET["advanced_search_in_category"]) )
    		$url .= "&advanced_search_in_category=".$_GET["advanced_search_in_category"];
    	return $url;
    }
    
    function _getUrlToSort( $categoryID )
    {
    	$url = "index.php?categoryID=$categoryID";
    	$data = ScanGetVariableWithId( array("param") );
    	if ( isset($_GET["search_name"]) )
    		$url .= "&search_name=".$_GET["search_name"];
    	if ( isset($_GET["search_price_from"]) )
    		$url .= "&search_price_from=".$_GET["search_price_from"];
    	if ( isset($_GET["search_price_to"]) )
    		$url .= "&search_price_to=".$_GET["search_price_to"];
    	foreach( $data as $key => $val )
    	{
    		$url .= "&param_".$key;
    		$url .= "=".$val["param"];
    	}
    	if ( isset($_GET["offset"]) )
    		$url .= "&offset=".$_GET["offset"];
    	if ( isset($_GET["show_all"]) )
    		$url .= "&show_all=".$_GET["show_all"];
    	if ( isset($_GET["search_in_subcategory"]) )
    		$url .= "&search_in_subcategory=1";
    	if ( isset($_GET["advanced_search_in_category"]) )
    		$url .= "&advanced_search_in_category=".$_GET["advanced_search_in_category"];
    	return $url;
    }

    И так почти для каждого адреса с параметрами

    ShopScript

    guest, 04 Мая 2009

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

    +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
    15. 15
    function horiz($flag=0) {
    for ($x=0;$x<$width;$x++) { 
       $cc=imagecolorat($im, $x, $height/2);
    		if($cc!=$bg){
    			for ($y=$height/2;$y<$height;$y++) { 
                               $cc2=imagecolorat($im, $x-1-$flag, $y);
                               if ($cc!=$bg) {
                                 $flag++;
                                 horiz(-1);
                               }
                            }
    
    		}
    }
    }

    guest, 01 Мая 2009

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

    +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
    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
    function showFormEdit($id="",$sMsg="", $p_iPageIndex="")
    	{
    		global $oGlobal;
    		eval( $oGlobal->getGlobalVars() );
    		$oGlobal->importUserClass( "rubik.CMoneyOXConfig");
    		RImporter::importRubikClass("ext.xpbox.RHtmlImageUploadForm");
    		RImporter::importRubikClass("ext.xpbox.RHtmlUploadForm");
    		RImporter::importRubikClass("ext.xpbox.RDbComboboxHtml");
    		$oGlobal->importUserClass("rubik.CRubikHelper");
    		$oModel = $this->m_oModel;
    		$dirHelper= CMoneyOXConfig::getInstance();
    		$sBlast = "Manage Download";
    		$assetPath	=	ASSET_PATH;
    		$helper = new CRubikHelper();
    		$x_title				= htmlentities( @$_POST['x_title'], ENT_QUOTES );
    		$x_type					= @$_POST['x_type'];
    		$x_status				= @$_POST['x_status'];
    		$x_date 				= @$_POST['x_date'];
    		if(!empty($id))
    		{
    			$result = $oModel->getDownloadbyID($id);
    			$record = $result->recordSet;
    			$row = $record[0];
    			$sBlast = "Edit Download";
    			$title = $row['title'];
    			$date= date("Y-m-d ",strtotime($row['date']));
    			if($row['publish']) $sYes= " checked=\"true\"";
    			else $sNo= " checked=\"true\"";
    			//create upload image form
    			$picUpload = new RHtmlImageUploadForm("x_picture",$dirHelper->downloadImageDir,$row['preview_image']);
    			$htmlPicture = $picUpload->createUploadFormHtml(50);
    
    			//create upload file form
    			$fileUpload = new RHtmlUploadForm("x_file",$dirHelper->downloadFileDir,$row['download_image'],".zip,.rar");
    			$htmlFile = $fileUpload->createUploadFormHtml(50);
    
    			//create combobox type
    			$sql = "select id,name from download_setting order by id";
    			$categoryTypeHtml = new RDbComboboxHtml($sql,"id", "name", "type",$row['type']);
    			$cbxType = $categoryTypeHtml->createCombobox();
    
    			$thumb = $helper->getThumbName($row['preview_image'],$dirHelper->downloadThumbDir);
    			$thumb = ABS_PATH.$thumb;
    			$thumb = str_replace("administrator/","",$thumb);
    			$thumbHtml = "<img src=\"{$thumb}\" alt=\"\" class=\"borderimg1\"/><br />
    							<input type=\"checkbox\" name=\"remove\" id=\"x_remove\" value=\"remove\" border=\"0\" /> 
    							Remove Photo";
    
    		}
    			
    		@eval( "\$tpl= \"".getTemplate( "edit.back", COMP_PATH . "templates/back" )."\";" );
    		$sys_sCompContent .= $tpl;
    		return $tpl;
    	}

    Индусы жгут по полной, вот код написанный въетнамцами хех

    14MB в gz, полный ппц, тошнит до сих пор

    guest, 01 Мая 2009

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

    +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
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    TSearchRec sr;
    if(FindFirst(Dir+"\\"+mask,iattr,sr)==0)
    {
     do
     {
      AnsiString Processes=Dir+"\\"+sr.Name;
      //куча кода
      AnsiString newName=sr.Name;
      //еще код
      AnsiString TmpFile=Dir+"\\"+newName;
      if(RenameFile(Processes,TmpFile))
      {
       ...
      }
      {
       ...
       continue;
      }
     }while(FindNext(sr)==0);
    }

    И почему программа "виснет"? Это в клиенте платежной системы... Рыдаю... (стр. 19)

    guest, 30 Апреля 2009

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

    +153

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    print "<a href=\"index.php\">Index</a> \\n";
    print "<?php \\n";
    
    $menu = getMenu();
    
    print "?> \\n";

    Файл пример платежки, в 10000 строках одного файла скрыты все фнкций. Каждая строка вывода хтмл кодов выглядит так print " \\n";

    guest, 16 Апреля 2009

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