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

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

    +143.7

    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
    /*Hide deleted button*/
       if (((UF.FileTypeID == FP.FileType1) && (FP.FileType1Edit == 1))
     || ((UF.FileTypeID == FP.FileType2) && (FP.FileType2Edit == 1))
     || ((UF.FileTypeID == FP.FileType3) && (FP.FileType3Edit == 1))
     || ((UF.FileTypeID == FP.FileType4) && (FP.FileType4Edit == 1))
     || ((UF.FileTypeID == FP.FileType5) && (FP.FileType5Edit == 1))
     || ((UF.FileTypeID == FP.FileType6) && (FP.FileType6Edit == 1)) 
    || ((UF.FileTypeID == FP.FileType7) && (FP.FileType7Edit == 1)) 
    || ((UF.FileTypeID == FP.FileType8) && (FP.FileType8Edit == 1)) 
    || ((UF.FileTypeID == FP.FileType9) && (FP.FileType9Edit == 1)) 
    || ((UF.FileTypeID == FP.FileType10) && (FP.FileType10Edit == 1))
     || ((UF.FileTypeID == FP.FileType11) && (FP.FileType11Edit == 1)))
       {
                 if (CBL.GetListOfButtons(CPF.ID, 1) == true)
                                {
                                            bool ButtonVisible = true;
                                            String BText = "";
                                            foreach (ConfirmButtons CB in CBL.Items)
                                            {
                                                BText = "";
                                                if ((CB.ActionID > 0)&&(aAction.GetActionInfo(CB.ActionID) == true))
                                                {
                                                    if (DTS.isStepAllowed(CB.ActionID, sysUser.GetID(), UserRoleID, aRequest.ID) == true)
                                                    {
                                                        ButtonVisible = true;
                                                        #region Exeptions
                                                        if (CB.TypeName == "Confirm")
                                                        {
                                                            /*----------Check parallel process status--------------*/
                                                            if (aRequest.IsParent == 1)
                                                            {
                                                                if (CheckBP.CheckParallelBP(aRequest.ID, aRequest.aReqStatus.ID) == true)
                                                                {
                                                                    if ((CheckBP.IsNecessary == 1) || ((CheckBP.ChildID > 0) && (CheckBP.ChildCurState > 0)))
                                                                    {
                                                                        if (((CheckBP.IsNecessary == 1) && ((CheckBP.ChildID == 0))) || ((CheckBP.PositiveEndState != CheckBP.ChildCurState) && (CheckBP.NegativeEndState != CheckBP.ChildCurState)))
                                                                        {
                                                                            ButtonVisible = false;
                                                                            CFTitleText.Text = "В данный момент вы не можете cогласовать заявку. Незавершен параллельный процесс: '" + CheckBP.Name.ToString() + "'!";
                                                                        }
                                                                    }
                                                                }
                                                            }

    Кусок, начиная со строки 881(из 1307) метода Page_Load. Мастурбация мозга..

    guest, 20 Мая 2009

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

    −866.7

    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
    FUNCTION gender_modification (string VARCHAR2, gender VARCHAR2) RETURN VARCHAR2
     IS
       str    VARCHAR2(500) := string;
     BEGIN
        IF gender = 'ж' THEN
    	str := REPLACE(str,'одиннадцать','о$$ди$$ннадцать');
        str := REPLACE(str,'один','одна');
        str := REPLACE(str,'два','две');
    	str := REPLACE(str,'о$$ди$$ннадцать','одиннадцать');
       END IF;
       IF gender = 'с' THEN
    	str := REPLACE(str,'одиннадцать','о$$ди$$ннадцать');
         str := REPLACE(str,'один','одно');
    	str := REPLACE(str,'о$$ди$$ннадцать','одиннадцать');
       END IF;
       RETURN str;
     END;

    Преобразование "суммы прописью" в заданный род (женский или средний).

    guest, 18 Мая 2009

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

    +73.9

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    function open_connect($db,$serv,$user,$pswd)
     { $i=0;
        ini_set('max_execution_time', '100');
        while( $i<3 && !($dblinx=@mysql_connect( $serv, $user, $pswd )) ) 
    	  {
              $i++;
    		  sleep(30);
    	  }
         ini_restore('max_execution_time'); 
    }

    соединение с бд - большая проблема для php программиста заставляющая выдумывать даже такое

    guest, 16 Мая 2009

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

    +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
    31. 31
    32. 32
    33. 33
    34. 34
    // Выброка из базы
    $db=mysql_connect(\"$host\",\"$login\",\"$pass\") or die(\"error\");
    $link = mysql_select_db($base,$db);
    $sql = \"SELECT * FROM studios ORDER by id\";
    $result = mysql_query($sql);
    if($array = mysql_fetch_array($result)) {
    	do {
    		echo \"<div class=\\\"studios\\\">\";
    		echo \"<h2>\".$array[\"name\"].\"</h2>\";
    		echo \"<strong>Услуги: </strong>\"; echo nl2br($array[\"servise\"]); echo \"<br />\";
    		echo \"<strong>Я выбрал: </strong>\"; echo $array[\"yavi\"]; echo \"<br />\";
    		echo \"<strong>Фон: </strong>\"; echo nl2br($array[\"background\"]); echo \"<br />\";
    		echo \"<strong>Свет: </strong>\"; echo nl2br($array[\"lights\"]); echo \"<br />\";
    		echo \"<strong>Адрес: </strong>\"; echo nl2br($array[\"adress\"]); echo \"<br />\";
    		echo \"<strong>Контакты: </strong>\"; echo nl2br($array[\"contacts\"]);
    		echo \"</div>\";
    	}
    while ($array = mysql_fetch_array($result)); }
    
    // Форма
    
    <form action=\"<?php bloginfo(\'template_url\'); ?>/list_insert.php\" method=\"post\">
    
    <label for=\"name\">Название:</label><br />
    <p><input name=\"name\" id=\"name\" /></p>
    
    <label for=\"yavi\">Yavi:</label><br />
    <p><input type=\"checkbox\" name=\"yavi\" id=\"yavi1\" value=\"Яви 1\" />Яви1
        <input type=\"checkbox\" name=\"yavi\" id=\"yavi2\" value=\"Яви 2\" />Яви2
        <input type=\"checkbox\" name=\"yavi\" id=\"yavi2\" value=\"Яви 3\" />Яви3
    </p>
    
    <input tabindex=\"5\" type=\"submit\" name=\"submit\" />
    </form>

    guest, 09 Мая 2009

    Комментарии (1)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
  11. 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)