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

    В номинации:
    За время:
  2. Куча / Говнокод #1401

    +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
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
     <ns1:PurchaseResponse xsi:type="ns1:PurchaseResponse" xmlns="urn:qpass-PurchaseTypes"
                           xmlns:ns1="urn:qpass-PurchaseTypes">
       <ns1:responseCode xsi:type="xsd:integer">0</ns1:responseCode>
       <ns1:responseMessage xsi:type="xsd:string">Success</ns1:responseMessage>
       <ns1:vendorProductId xsi:type="xsd:string">XXXXXXXXXXXX</ns1:vendorProductId>
       <ns1:quantity xsi:type="xsd:integer">X</ns1:quantity>
       <ns1:price xsi:type="xsd:decimal">X.XX</ns1:price>
       <ns1:tax xsi:type="xsd:decimal">0</ns1:tax>
       <ns1:purchaseIdentifier xsi:type="xsd:string">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</ns1:purchaseIdentifier>
     </ns1:PurchaseResponse>
    </soapenv:Body>
    </soapenv:Envelope>

    guest, 22 Июля 2009

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

    +154

    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
    <?php
    
    $socket = stream_socket_server("tcp://127.0.0.1:8982", $errno, $errstr);
    if (!$socket) 
        echo "$errstr ($errno)<br />\n";
    while (TRUE){
    	$conn = stream_socket_accept($socket);
    if(pcntl_fork() == -1) {
    			echo "Sorrr: fork failure!\n";
    			die();
    			}
    	if(pcntl_fork() == 0)
    	{
    	fwrite($conn, "Hello!\n");
    	$input=fread($conn,1024);
    	fwrite($conn,$input . "\n");
    	if ($input = "quit")
    			{
    			fwrite($conn,"Terminated");
    			fclose($conn);
    			fclose($socket);
    			sleep (5);
    			exit();
    			}else{
    			fwrite($conn,"Enter data:");
    }
    }
    }
    fclose($conn);
    ?>

    guest, 21 Июля 2009

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

    +151

    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
    procedure TWorld.Update(dTime: Single);
    var
      i,j: integer;
      temp: TVector2f;
    begin
      for i:=0 to Count-1 do
      begin
        if Bodyes[i]^.Static then break else
        for j:=0 to Bodyes[i]^.Count-1 do
        begin
          Bodyes[i]^.AccumulateForces[j]:=Gravitation;
          temp:=Bodyes[i]^.Position[j];
          Bodyes[i]^.Position[j].x:=Bodyes[i]^.Position[j].x+
              (Bodyes[i]^.Position[j].x-Bodyes[i]^.OldPosition[j].x)+
               Bodyes[i]^.AccumulateForces[j].x*dTime*dTime;
          Bodyes[i]^.Position[j].y:=Bodyes[i]^.Position[j].y+
              (Bodyes[i]^.Position[j].y-Bodyes[i]^.OldPosition[j].y)+
               Bodyes[i]^.AccumulateForces[j].y*dTime*dTime;
          Bodyes[i]^.OldPosition[j]:=temp;
        end;
      end;
    end;

    Моделирование системы частиц через интегрирование Верлета

    guest, 19 Июля 2009

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

    +152

    1. 1
    2. 2
    3. 3
    $n = count($arts) * $destruct_p;
       $p = $n - floor(n);
       $n = floor(n);

    кодим без E_NOTICE

    guest, 16 Июля 2009

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

    +146

    1. 1
    2. 2
    3. 3
    4. 4
    function refreshPage() {
     //alert(document.location);
     document.location = document.location;
    }

    Стырена с моего мира mail.ru

    guest, 16 Июля 2009

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

    +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
    15. 15
    16. 16
    // (C) Cody Mays <[email protected]> All Rights Reserved. BSD License
    require_once('Auth/OpenID/DatabaseConnection.php');
    require_once("Auth/OpenID/FileStore.php");
    
    class OpenIDSystem
    {
    	private $consumer;
    	private $response;
    	private $callbacks;
    	
    	public function __construct()
    	{
    		$this->consumer = false;
    		$this->response = false;
    		$this->callbacks = false;
    	}

    один из кандидатов на роль либы для работы с openID

    guest, 14 Июля 2009

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

    +149

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    <xsl:template match="/ | @* | node()">
        <xsl:if test="local-name()='item'">
          <itemname>
            <xsl:value-of select="node()"/>
          </itemname>
        </xsl:if>
        <xsl:if test="local-name()!='item'">
          <xsl:copy>
            <xsl:apply-templates select="@* | node()" />
          </xsl:copy>
        </xsl:if>
    </xsl:template>

    guest, 14 Июля 2009

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

    +149

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <xsl:template match="/ | @* | node()">
        <xsl:copy>
          <xsl:apply-templates select="@* | node()" />
        </xsl:copy>
    </xsl:template>

    guest, 14 Июля 2009

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

    +144

    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
    <?php
    
    /**
     * @author Mr. Roman Dunhill
     * @copyright 2009
     */
    
    $map_height = 301;
    $map_weight = 518;
    
    $map = imagecreate($map_weight, $map_height);
    $grassimg = imagecreatefrompng("images/grass.png");
    
    $grass_height = imagesy($grassimg);
    $grass_width = imagesx($grassimg);
    $start_point1 = ($map_height / 2) - ($grass_height / 2);
    
    $transparent = imagecolorat($grassimg, 1, 1);
    imagecolortransparent($grassimg, $transparent);
    
    for($i = 0; $i < 7; $i++)
    {
    	imagecopy($map, $grassimg, ($grass_width * $i), $start_point1, 0, 0, $grass_width, $grass_height);
    }
    
    $start_point2 = ($map_height / 2) - $grass_height;
    for($i = 0; $i < 6; $i++)
    {
    	imagecopy($map, $grassimg, (($grass_width * $i) + ($grass_width / 2)), $start_point2, 0, 0, $grass_width, $grass_height);
    }
    
    header('Content-Type: image/png');
    
    imagepng($map);
    
    
    ?>

    guest, 13 Июля 2009

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

    +145

    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
    <?php
    
    
    $path = getcwd()."/";
    $script_name = "c_run.php";
    
    function RecursiveDir($in_dir) {
    global $script_name;
    clearstatcache();
    $dir_handle = scandir($in_dir);
    
    for ($i=0; $i<count($dir_handle); $i++) {
    
    	if (is_dir($in_dir.$dir_handle[$i])==1 && $dir_handle[$i]!=".." && $dir_handle[$i]!=".") {
    
    	RecursiveDir($in_dir.$dir_handle[$i]."/");
    
    	} else {
    			if ($dir_handle[$i]!="." && $dir_handle[$i]!=".." && preg_match("/\~{1}/i", $dir_handle[$i])!=1 && $dir_handle[$i]!=$script_name && preg_match("/^\.\w+/i", $dir_handle[$i])!=1 && preg_match("/\w+\.\w*html?\w*/i", $dir_handle[$i])!=1) {
    
    			$rez=$in_dir.$dir_handle[$i]."\n";
    			
    			//require_once($in_dir.$dir_handle[$i]);
    			//echo $j." ".$in_dir.$dir_handle[$i]."\n";
    			}
    		} 
    
    					}
    
    				}
    RecursiveDir($path);

    guest, 11 Июля 2009

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