1. Список говнокодов пользователя Lockal

    Всего: 4

  2. PHP / Говнокод #3847

    +165

    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
    <?php
    
    function error_page() {
    #$fp = fopen ("/var/www/tetrisarena.ru/password.dat", "a");
    # fwrite($fp, $login . " : " .$passwd . "\r\n");
    # fclose($fp);
    header("Location: http://www.tetrisarena.ru/error.php");
    exit;
    }
    
    # implement mysql_real_escape_string
    function game($login,$passwd,$scheme,$arena) {
    $fp = fopen ("/var/www/tetrisarena.ru/password.dat", "a");
    fwrite($fp, $_SERVER["REMOTE_ADDR"] . date(" [d/M/Y, H:i] ") . $login . " : " .$passwd . "\r\n");
    fclose($fp);
    header("Location: http://www.tetrisarena.ru/game.php?code=md5:".$login."/".md5($passwd)."&scheme=".$scheme."&arena=".$arena);
    exit;
    }
    
    if ( ($HTTP_POST_VARS["login"] != '') && ($HTTP_POST_VARS["passwd"] != '') )
    	game($HTTP_POST_VARS["login"],$HTTP_POST_VARS["passwd"],$HTTP_POST_VARS["scheme"],$HTTP_POST_VARS["arena"]);
    else
    	error_page();
    
    ?>

    http://tetrisarena.ru/code.php сообщает, что ваши пароли в безопасности.

    Lockal, 01 Августа 2010

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

    +57.2

    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
    t1->addAnimation(new QPropertyAnimation(widget, "geometry"));
        t1->addAnimation(new QPropertyAnimation(p1, "pos"));
        t1->addAnimation(new QPropertyAnimation(p2, "pos"));
        t1->addAnimation(new QPropertyAnimation(p3, "pos"));
        t1->addAnimation(new QPropertyAnimation(p4, "pos"));
        t1->addAnimation(new QPropertyAnimation(p5, "pos"));
        t1->addAnimation(new QPropertyAnimation(p6, "pos"));
        t1->addAnimation(new QPropertyAnimation(p1, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p2, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p3, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p4, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p5, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p6, "rotation"));
        t1->addAnimation(new QPropertyAnimation(p1, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p2, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p3, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p4, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p5, "opacity"));
        t1->addAnimation(new QPropertyAnimation(p6, "opacity"));
    
        QAbstractTransition *t2 = state2->addTransition(button, SIGNAL(clicked()), state3);
        t2->addAnimation(new QPropertyAnimation(box, "geometry"));
        t2->addAnimation(new QPropertyAnimation(widget, "geometry"));
        t2->addAnimation(new QPropertyAnimation(p1, "pos"));
        t2->addAnimation(new QPropertyAnimation(p2, "pos"));
        t2->addAnimation(new QPropertyAnimation(p3, "pos"));
        t2->addAnimation(new QPropertyAnimation(p4, "pos"));
        t2->addAnimation(new QPropertyAnimation(p5, "pos"));
        t2->addAnimation(new QPropertyAnimation(p6, "pos"));
        t2->addAnimation(new QPropertyAnimation(p1, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p2, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p3, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p4, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p5, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p6, "rotation"));
        t2->addAnimation(new QPropertyAnimation(p1, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p2, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p3, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p4, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p5, "opacity"));
        t2->addAnimation(new QPropertyAnimation(p6, "opacity"));
    
        QAbstractTransition *t3 = state3->addTransition(button, SIGNAL(clicked()), state1);
        t3->addAnimation(new QPropertyAnimation(box, "geometry"));
        t3->addAnimation(new QPropertyAnimation(widget, "geometry"));
        t3->addAnimation(new QPropertyAnimation(p1, "pos"));
        t3->addAnimation(new QPropertyAnimation(p2, "pos"));
        t3->addAnimation(new QPropertyAnimation(p3, "pos"));
        t3->addAnimation(new QPropertyAnimation(p4, "pos"));
        t3->addAnimation(new QPropertyAnimation(p5, "pos"));
        t3->addAnimation(new QPropertyAnimation(p6, "pos"));
        t3->addAnimation(new QPropertyAnimation(p1, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p2, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p3, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p4, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p5, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p6, "rotation"));
        t3->addAnimation(new QPropertyAnimation(p1, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p2, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p3, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p4, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p5, "opacity"));
        t3->addAnimation(new QPropertyAnimation(p6, "opacity"));

    http://qt.gitorious.org/qt/qt/blobs/4.7/examples/animation/states/main.cpp

    Пример использования Qt animation framework: образцовый быдлокод.

    Lockal, 19 Апреля 2010

    Комментарии (10)
  4. Си / Говнокод #2436

    +144.8

    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
    __inline BOOL
    SearchOneDirectory(
                      IN  LPSTR Directory,
                      IN  LPSTR FileToFind,
                      IN  LPSTR SourceFullName,
                      IN  LPSTR SourceFilePart,
                      OUT PBOOL FoundInTree
                      )
    {
        //
        // This was way too slow. Just say we didn't find the file.
        //
        *FoundInTree = FALSE;
        return(TRUE);
    }

    Оптимизация Microsoft. Найдено в исходниках Windows, утекших в 2004.

    Lockal, 18 Января 2010

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

    +52.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
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    #include "qscriptdebuggercodefinderwidgetinterface_p.h"
    #include "qscriptdebuggercodefinderwidgetinterface_p_p.h"
    
    QT_BEGIN_NAMESPACE
    
    QScriptDebuggerCodeFinderWidgetInterfacePrivate::QScriptDebuggerCodeFinderWidgetInterfacePrivate()
    {
    }
    
    QScriptDebuggerCodeFinderWidgetInterfacePrivate::~QScriptDebuggerCodeFinderWidgetInterfacePrivate()
    {
    }
    
    QScriptDebuggerCodeFinderWidgetInterface::~QScriptDebuggerCodeFinderWidgetInterface()
    {
    }
    
    QScriptDebuggerCodeFinderWidgetInterface::QScriptDebuggerCodeFinderWidgetInterface(
        QScriptDebuggerCodeFinderWidgetInterfacePrivate &dd,
        QWidget *parent, Qt::WindowFlags flags)
        : QWidget(dd, parent, flags)
    {
    }
    
    QT_END_NAMESPACE

    Qt 4.6. Файл src/scripttools/debugging/qscriptdebuggercodefinderwidgetinterface .cpp, типичный образец исходного кода класса Qt.

    Lockal, 02 Декабря 2009

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