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

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

    −46.4

    1. 1
    2. 2
    3. 3
    4. 4
    WHILE LEFT(@newstr,1)=' ' 
    BEGIN
        SET @newstr=SUBSTRING(@newstr,2,LEN(@newstr))
    END

    Альтернативная реализация LTRIM

    guest, 08 Мая 2009

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

    +48

    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
    int print(int *p)
    {
    		int n;
    		int i;
    		char c;
    		clrscr();
    
    	   Y cprintf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n\r",
    				201,205,205,205,209,
    				205,205,205,205,205,205,205,205,205,205,205,205,209,
    				205,205,205,205,205,205,205,205,205,205,205,205,209,
    				205,205,205,205,205,205,205,205,205,205,205,205,209,
    				205,205,205,205,209,
    				205,205,205,205,205,205,205,205,205,205,205,205,205,209,
    				205,205,205,205,205,205,205,187);
    		cprintf("%c %c %c   Surname  %c    Name    %c Patronymic %cYear%c  Profession %c Wages %c\n\r",
    				186,252,179,179,179,179,179,179,186);
    		cprintf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n\r",
    				199,196,196,196,197,
    				196,196,196,196,196,196,196,196,196,196,196,196,197,
    				196,196,196,196,196,196,196,196,196,196,196,196,197,
    				196,196,196,196,196,196,196,196,196,196,196,196,197,
    				196,196,196,196,197,
    				196,196,196,196,196,196,196,196,196,196,196,196,196,197,
    				196,196,196,196,196,196,196,186);
    		for(i = 0; i < *p; i++)
    		{
    		cprintf("%c", 186);
    		W cprintf("%3i", i +1);
    		Y cprintf("%c",179);
    		W cprintf("%12s", rabota[i].fam);
    		Y cprintf("%c",179);
    		W cprintf("%12s", rabota[i].name);
    		Y cprintf("%c",179);
    		W cprintf("%12s", rabota[i].otch);
    		Y cprintf("%c",179);
    		W cprintf("%4i", rabota[i].year);
    		Y cprintf("%c",179);
    		W cprintf("%13s", rabota[i].prof);
    		Y cprintf("%c",179);
    		W cprintf("%7i", rabota[i].zarpl);
    		Y cprintf("%c\n\r", 186);
            }
            cprintf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n\r",
                    200,205,205,205,207,
                    205,205,205,205,205,205,205,205,205,205,205,205,207,
                    205,205,205,205,205,205,205,205,205,205,205,205,207,
                    205,205,205,205,205,205,205,205,205,205,205,205,207,
                    205,205,205,205,207,
                    205,205,205,205,205,205,205,205,205,205,205,205,205,207,
                    205,205,205,205,205,205,205,188);
    		W cprintf("Continue Y/N ?");
            scanf("%s", &c);
            if(c == 'Y' || c == 'y')
                    return 1;
            else
                    exit(1);
            return 0;
    }

    бд

    guest, 06 Мая 2009

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

    +150

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    void log(boolean e) {
    	if (String.valueOf(e).length() < 5) {
    		System.err.println("Something bad happened.");
    	}
    }

    Логгер

    guest, 05 Мая 2009

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

    +148

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <?php if ($curauth->user_status == "Фотограф" && $curauth->konkurs) { echo "
    	<div class=\"bio-left\"><h1>Участие в конкурсах:</h1></div>
    	<div class=\"bio-right\">";
    	echo $curauth->konkurs;
    	echo "</div><div class=\"c-left\"></div>"; } } ?>

    guest, 02 Мая 2009

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

    +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
    <?php
    /*
     *
     *
     *
     */
    
    if(!isset($_POST["links"])){
    	echo '<form action="links.php" method="post">
    <p>Ссылки:</p>
    <p><textarea rows="10" cols="45" name="links"></textarea></p>
    <p><input type="submit" value="Отправить"></p>
    </form>';
    } else {
    	$array = explode("\r\n", $_POST["links"]);
    	foreach($array as $link){
    		if(preg_match("/^(http:\/\/{1})((\w+\.){1,})\w{2,}$/i", $link)){
    			echo "<a href=\"$link\">$link</a><br>";	
    		}
    	}
    }
    ?>

    guest, 02 Мая 2009

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

    +140.9

    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
    $src= fgets($fp,1000);
    if (strpos($src,"301") && $op_2) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 301 Moved Permanently\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"lime\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: lime;\">HTTP 301 Moved Permanently</span><br>";
    }
    
    if (strpos($src,"302") && $op_2) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 302 Found\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"lime\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: lime;\">HTTP 302 Found</span><br>";
    }
    
    if (strpos($src,"200")) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 200 OK\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"yellow\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: yellow;\">HTTP 200 OK</span><br>";
    }
    
    if (strpos($src,"403")&& $op_1) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 403 Forbidden\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"red\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: red;\">HTTP 403 Forbidden</span><br>";
    }
    if (strpos($src,"401")) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 401 Authorization Required\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"red\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: red;\">HTTP 401 Authorization Required</span><br>";
    }
    
    if (strpos($src,"503")) {
    $mk .= "http://".$www."/".$files[$a]." HTTP 503 Service Unavailable\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"blue\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: blue;\">HTTP 503 Service Unavailable</span><br>";
    }
    if (strpos($src,"504")) {
    $mk .= "http://".$www."/".$files[$a]." HTTP 504 Gateway Timeout\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"blue\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: blue;\">HTTP 504 Gateway Timeout</span><br>";
    }

    снова вебкакер.ру ))
    А что такое массивы? о_0

    guest, 30 Апреля 2009

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

    +136.9

    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
    $src= fgets($fp,1000);
    if (strpos($src,"301") && $op_2) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 301 Moved Permanently\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"lime\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: lime;\">HTTP 301 Moved Permanently</span><br>";
    }
    
    if (strpos($src,"302") && $op_2) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 302 Found\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"lime\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: lime;\">HTTP 302 Found</span><br>";
    }
    
    if (strpos($src,"200")) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 200 OK\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"yellow\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: yellow;\">HTTP 200 OK</span><br>";
    }
    
    if (strpos($src,"403")&& $op_1) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 403 Forbidden\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"red\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: red;\">HTTP 403 Forbidden</span><br>";
    }
    if (strpos($src,"401")) {
    Pravile($src,$files[$a],1);
    $mk .= "http://".$www."/".$files[$a]." HTTP 401 Authorization Required\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"red\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: red;\">HTTP 401 Authorization Required</span><br>";
    }
    
    if (strpos($src,"503")) {
    $mk .= "http://".$www."/".$files[$a]." HTTP 503 Service Unavailable\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"blue\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: blue;\">HTTP 503 Service Unavailable</span><br>";
    }
    if (strpos($src,"504")) {
    $mk .= "http://".$www."/".$files[$a]." HTTP 504 Gateway Timeout\r\n";
    echo "<a href=http://".$www."/".$files[$a]." target=\"_blank\" class=\"blue\">http://".$www."/".$files[$a]."</a>    <span style=\"font-weight: bold;color: blue;\">HTTP 504 Gateway Timeout</span><br>";
    }

    снова вебхакер.ру ))
    А что такое массивы? о_0

    guest, 30 Апреля 2009

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

    +145.5

    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
    case 'top':
    		$nick=$_GET["nick"];
    		$pass=$_GET["pass"];
    		mysql_query("SELECT * FROM users WHERE nick = '$nick' and pass = '$pass'");
    		if (@mysql_affected_rows($link)!=0){
    			$sub=$_POST["sub"];
    			$text=addslashes(strip_tags(nl2br($_POST["text"]),'<br>'));
    			$ip=$_SERVER["REMOTE_ADDR"];
    			$cat_id=$_GET["cat_id"];
    			mysql_query("insert into f_subject values (NULL, '$sub', '$nick', '0' , '$nick', NOW(), NOW(), '$ip' , '$text', '$cat_id')");
    			$row= mysql_fetch_array(mysql_query("SELECT *FROM f_cat WHERE id ='$cat_id'"));
    			$topics=$row["topics"]+1;
    			mysql_query("UPDATE f_cat SET topics='$topics' WHERE id ='$cat_id'");
    		}
    		Header("Location: index.php?cat=".$cat_id);
    	break;

    guest, 30 Апреля 2009

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

    +166.3

    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
    require_once ("dbsettings.inc");
    require_once ("User.inc");
    require_once ("UserFactory.inc");
    require_once ("UserGroup.inc");
    
    $login = "aa";//$_POST["login"];
    $pass = "as";//$_POST ["pass"];
    
                       $__o__III___o__ = new dbsettings (
                    
                    "localhost",
                      "root",
                    "*********",
                      "WEBSITE",
                      "Users"                           );
    
                                        $__o__IV___o__=  new UserFactory (
                                        $__o__III___o__);
                             $TempUser= $__o__IV___o__->createUser( $login, $pass );

    Ну и фантазия! ()

    guest, 28 Апреля 2009

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

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    include <stdio.h>
    int main()
    {
        unsigned char a;
         a='Я';
         printf("\n%c=%d",a,a);
         return 0;
    }

    guest, 27 Апреля 2009

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