1. PHP / Говнокод #10220

    +73

    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
    [production]
    phpSettings.display_startup_errors = 0
    phpSettings.display_errors = 0
    includePaths.library = APPLICATION_PATH "/../library"
    bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
    bootstrap.class = "Bootstrap"
    appnamespace = "Application"
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    resources.frontController.params.displayExceptions = 0
    
    resources.log.khuy.writerName = "Firebug"
    
    resources.view.helperPath.Zend_View_Helper = APPLICATION_PATH "/../library/Zend/View/Helper"
    resources.view.helperPath.My_View_Helper = APPLICATION_PATH "/views/helpers"
    [staging : production]
    
    [testing : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    
    [development : production]
    phpSettings.display_startup_errors = 1
    phpSettings.display_errors = 1
    resources.frontController.params.displayExceptions = 1

    __proto__, 08 Мая 2012

    Комментарии (2)
  2. PHP / Говнокод #10219

    +88

    1. 1
    2. 2
    3. 3
    4. 4
    if( $tpl_name == '' || ! file_exists( $this->dir . DIRECTORY_SEPARATOR . $tpl_name ) ) {
    			return "Отсутствует файл шаблона: " . $tpl_name ;
    			return false;
    		}

    dle

    trororom, 08 Мая 2012

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Controller::Controller(QObject *parent)
      : QObject(parent) {
      connect( &rcvr, SIGNAL(deviceMessage(QString,QString,QString,QString,QString,QString,QString,QString)),
               this,   SLOT(processMessage(QString,QString,QString,QString,QString,QString,QString,QString)) );
    }

    По порядку: таймштамп, домен, хост, логон, вендор флешки, модель, ревизия, серийник. Задвинул на полном серьёзе ))

    niko, 08 Мая 2012

    Комментарии (13)
  4. ActionScript / Говнокод #10215

    −159

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    appendExclamation("one")("two")("three")("four")("five");
    function appendExclamation(str:String):Function{
      trace(str + "! ");
      return appendExclamation;
    }
    /* outputs:
    one!
    two!
    three!
    four!
    five!
    */

    как-то натолкнулся на одном из блогов

    lammar, 08 Мая 2012

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

    −155

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public function initCounter():void
    {
    	_timeDisplayer.text = (_type == COUNT) ? "00:00" : ((_timeLimit < 10) ? "0" + _timeLimit.toString() + ":00" : _timeLimit.toString() + ":00");
    	_seconds = (_type == COUNT) ? 0 : 60;
    	_minutes = (_type == COUNT) ? 0 : _timeLimit;
    	_counterCompleted = false;
    }

    еще одно тернарное извращение:)

    lammar, 08 Мая 2012

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

    +75

    1. 1
    2. 2
    3. 3
    4. 4
    require( "./configuration.php" );
    include( "./include.php" );
    $returned = @( );
    if ( ( $returned ) != @( "harper" ) )

    cthulhu25, 07 Мая 2012

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

    +86

    1. 1
    2. 2
    3. 3
    int createStageCycles = 0;
    createStageCycles = Integer.parseInt(strCycle);
    int nextVal = new Integer(createStageCycles) + 1;

    int двойного отжима

    zloizerg, 07 Мая 2012

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

    +80

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $F = 0;
    if ($F == "0") {
    include ("index-bd.php");
    }
    else {
    include ("../index-bd.php");
    };

    И так подключатся все файлы в проекте.

    Evil_Wolf, 07 Мая 2012

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

    −428

    1. 1
    2. 2
    3. 3
    4. 4
    url = request.get_full_path()
    if 'show_error' in url:
        show_param = url.split('?show_error=')
        error = show_param[1]

    Кусок кода из Django проекта
    Взяли индуса на работу. Вот так он достает GET параметры

    larikov, 07 Мая 2012

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

    +123

    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
    <table border="0" id="table" width="800" align="center">
    <tr><td colspan="5" align="center">Ваш заказ:</td></tr>
    
    <? $query=mysql_query("Select * from `$name`");
    for ($c=0; $c<mysql_num_rows($query);$c++){
    ?><?
    $result=mysql_fetch_array($query);
    $a=$result['menu_id'];
    $query1=mysql_query("SELECT * FROM menu WHERE id=$a");
    $result1=mysql_fetch_array($query1);
    ?>
    
    <tr><td width="50"><? echo $c+'1'; ?></td><td width="50" align="center"><img src="img/tira.png" style="height:20px; width:20px;"/></td><td><? echo $result1['name'];?></td><td><a href="#">-</a><input type="text" min="1" value="<? echo $result['count'];?>" max="40" size="2" /><a href="#" onclick="up()">+</a></td><td>удалить</td></tr>
    <script language="javascript" type="application/javascript">
    var a=parseInt("<? echo $result['count'];?>");
    function up(){
    var b = a + 1;
    document.write(b);
    }
    </script>
    <?
    }
    ?>

    "Создаю корзину покупателя! Формирую таблицу выбранных пользователем товаров и его кол-во в цикле! добавил функцию на OnClick с выводом значение в ячейке! при нажатии выводит только значение последнего товара из цикла." Слов нет.

    zloirock, 06 Мая 2012

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