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

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

    +133

    1. 1
    string[] res = value.Split("$".ToCharArray(), StringSplitOptions.None);

    shtaff, 19 Сентября 2012

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

    +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
    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
    #!/bin/bash
    hl=`cat $1`
    wrdl=`cat ~/worlds.txt`
    addr=$PWD'/extra_hosts.txt'
    rm -f $addr && echo "Deleted host list file "$addr
    touch $addr && echo "Created file "$addr
    for address in $hl
    do
    rm $PWD/`basename $address`.txt && echo "Deleted file "$PWD/`basename $address`.txt
    done
    for address in $hl
    do
    #echo $address
    export address
    tmp=$PWD/`basename $address`.txt
    trc=$PWD/`basename $address`.tr.txt
    mytmp=/tmp/`basename $address`.txt
    curl -Ss --retry 2 --trace $trc --tr-encoding --tcp-nodelay $address > $mytmp &
    sleep 10s
    cat $mytmp \
     | grep -e '<a href=\"[^"]*\"' | grep -E -o '[^"]+'\
     | grep htm | perl -pe 's/$ENV{address}//'| \
     perl -pe 's/^\//$ENV{address}\//' | perl -pe 's/text\/html//'|\
      sed -e 's/<[^>]*>//g' -e '/\/http:/d;/^http/p;d;' | sort | uniq >> $addr &
    for wrd in `cat ~/worlds.txt`
    do
    export wrd
    cat -b $mytmp\
    | sed -e 's/<[^>]*>//g' |grep -i $wrd \
     | perl -pe 's/^/$ENV{address}:$ENV{wrd}:/' | tee -a $tmp &
    done
    done
    mkdir -p extra_hosts && echo "Made dir extra_hosts"
    cd extra_hosts
    $0 $addr

    AliceGoth, 18 Сентября 2012

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

    +11

    1. 1
    clEnqueueReleaseGLObjects(queue, objects.size(), objects.data(), 9, NULL, NULL);

    В целом ничего страшного, но почему на клавиатуре девятка так рядом с нулём?

    bazhenovc, 15 Сентября 2012

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

    +53

    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
    <?if($arElement["PROPERTIES"]["POSTAV"]["VALUE_ENUM_ID"]==73){?>
    <?if($arElement["PREVIEW_PICTURE"]["HEIGHT"]<105){?><div width="115px" height="105px"><?}?>
    
      <a href="<?=$arElement["DETAIL_PICTURE"]["SRC"]?>" class="preview" onclick="return false;" onmousedown="window.location.href='<?=$arElement["DETAIL_PAGE_URL"]?>';"><img src="<?=$arElement["PREVIEW_PICTURE"]["SRC"]?>"  width="115" border="0px" alt="<?=$arElement["PREVIEW_PICTURE"]["ALT"]?>" title="<?=$arElement["NAME"]?>"/></a></div>
    <?if($arElement["PREVIEW_PICTURE"]["HEIGHT"]<105){?></div><?}?>
    <?}else{?>
        <a href="<?=$arElement["DETAIL_PICTURE"]["SRC"]?>" class="preview" onclick="return false;" onmousedown="window.location.href='<?=$arElement["DETAIL_PAGE_URL"]?>';"><img src="<?=$arElement["PREVIEW_PICTURE"]["SRC"]?>" width="115" height="105" border="0px" alt="<?=$arElement["PREVIEW_PICTURE"]["ALT"]?>" title="<?=$arElement["NAME"]?>"/></a>
    <?}?>
    	<br>&nbsp;
    					<?endif?></td>
                                              </tr>
                                            </table></td>
    									</tr>
    								</table>
    
                                    </div>
    		  </td>
    		<?$cell++;
    		if($cell%$arParams["LINE_ELEMENT_COUNT"] == 0):?>
    	</tr>
    		<?endif?>
    
    		<?endforeach; // foreach($arResult["ITEMS"] as $arElement):?>
    
    		<?if($cell%$arParams["LINE_ELEMENT_COUNT"] != 0):?>
    			<?while(($cell++)%$arParams["LINE_ELEMENT_COUNT"] != 0):?>
    
    			<?endwhile;?>
    			</tr>
    		<?endif?>
    
    </table></div>
     <?if($arParams["DISPLAY_BOTTOM_PAGER"]):?>
    	<br />
    	<?
    	$arResult["NAV_STRING"] = str_replace('|&nbsp;<a href="/e-store/rings/diamond.php?bitrix_include_areas=Y&amp;bitrix_show_mode=configure&amp;login=yes&amp;SHOWALL_1=1">Все</a>','',$arResult["NAV_STRING"]);
    	?>
    	<?=$arResult["NAV_STRING"]?>
    <?endif;?>

    randombot, 13 Сентября 2012

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

    +142

    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
    program maze;{МАЗЬ}
    
    ...
    
    REPEAT UNTIL KEYPRESSED;
    
    ...
    
    case {коза} с of:
    ...
    
    
    /* FILE NAME   : IMAGE.C
     * PURPOSE     : Fig it knows.
    ...
    */
    
      BYTE *buf = 0L;
      if (!(buf += malloc(WWW * HHH)))
      {
        printf(" У меня склероз ...\n Press Ctrl-Alt-Del.");
        return;
      }
    
    for(int C=0;C<n;/*Borland*/C++)
    ...

    Петросянство в школокоде :-\

    (+= - чтобы избавиться от варнинга.)

    Steve_Brown, 31 Августа 2012

    Комментарии (9)
  7. C# / Говнокод #11678

    +141

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    var number = new Random();
    if (number.Next(10)%2  == 0)
    {...}
    else
    {...}

    Нашёл такой шедевр в индокоде, которые мне дали модернизировать.

    badstarosta, 30 Августа 2012

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

    +57

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    function SetImage($row=array())
    	{
         foreach($row as $property=>$value)
         	{
         	eval("\$this->".$property." = '".$value."';");
         	}
    	}

    minramilka, 30 Августа 2012

    Комментарии (9)
  9. Java / Говнокод #11667

    +76

    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
    while (!cp.isEnd()) {
               if (!pause(200)) {
                   break;
               }
           }
    
    private boolean pause(int millisecond) {
           try {
               Thread.sleep(200);
           } catch (InterruptedException ex) {
               Logger.getLogger(Visualizer.class.getName()).log(Level.ERROR, null, ex);
               return false;
           }
           return true;
       }

    Dougrinch, 29 Августа 2012

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

    +129

    1. 1
    2. 2
    3. 3
    4. 4
    <li title="document.location='http://handleopenurl.com/scheme/buffer' null" href="http://handleopenurl.com/scheme/buffer" class="scheme" onclick="document.location='http://handleopenurl.com/scheme/buffer'">
    <h1>Buffer</h1>
    <h2 class="code">bufferapp</h2>
    </li>

    И это всё вместо <a>.

    Vindicar, 29 Августа 2012

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

    +53

    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
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    class MYSQL_ACTIONS
    {      
    		public $arguments = array();
    		public $values;
    		public $rows;
    		public $check = true;
    		public $list_array = array();
    		function __construct ()
    		{
    			$this->arguments = func_get_args();
    			$z = '';
    			foreach ($this->arguments as $value)
    			{
    				$y ="$value,";
    				$z .= $y;
    			}
    			$this->rows = substr("$z",0,-1);
    		}
    		function check_isset()
    		{
    			$argument = func_get_args();
    			for ($i = 0; $i < count($argument); $i++)
    			{
    				foreach ($argument as $value)
    				{      
    					${$value} = $this->list_array[$i++];
    				}
    			 
    			}
    		 
    			for($i = 0; $i < count($argument); $i++)
    			{
    				$x = ${$argument[$i]};
    				if (empty($x))
    				{
    					$this->check = false;
    					break;
    				}
    			}
    		}
    		function mysql_action($table)
    		{
    			$processing = new GET_(processing);
    			$date = date("Y-m-d H:i:s");
    		 
    			for ($i = 0; $i < count($this->arguments); $i++)
    			{
    				foreach ($this->arguments as $value)
    				{      
    					${$value} = $this->list_array[$i++];
    				}
    						 
    			}
    		 
    			$x ='';
    			foreach ($this->arguments as $value)
    			{
    				$y =" '${$value}',";
    				$x .= $y;
    			}
    			$this->values = substr("$x",0,-1);
    		 
    			if ($processing->variable == "add")
    			{              
    				if ($this->check == true)
    				{
    					$result = mysql_query("INSERT INTO {$table} ({$this->rows}) VALUES ({$this->values})");
    					if ($result == true)
    					{
    						echo "";
    					}
    					else
    					{
    						echo "";
    					}
    				}
    				else
    				{
    					echo "";
    				}
    			}
    		}
    }

    Очередное говно с просторов интернета

    BioMan, 22 Августа 2012

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