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

    +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
    13. 13
    14. 14
    15. 15
    <?php
    
        if ($update_flag == '1') {
    
            $updat_finished_task = $db->update(
                'tbl_user_task',
                array(
                    'is_finished'               => '0',
                    'user_task_update_datetime' => date('Y-m-d H:i:s')
                ),
                '1=1'
            );
        }
    
        ?>

    UPDATE
    tbl_user
    SET
    is_finished = [is_finished],
    user_task_update_datetime = [data_time]
    WHERE 1 = 1

    MySQL 5

    __proto__, 01 Октября 2013

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

    +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
    for($j = 0; $j < count($_REQUEST['option_question']); $j++)
                    {
                            $max_id = $db->max_field("tbl_task_option","option_question_id","1=1");
                            $max_id = $max_id+1;
                            
                            $tbl_option_insert=array(
                                    'task_id' => $_REQUEST['task_id'],
                                    'subtask_id' => $subtask_id,
                                    'option_question_id' => $max_id,
                                    'option_question' => $_REQUEST['option_question'][$j],
                                    'option_answer' => $_REQUEST['option_ans'][$j][0],
                                    'option_insert_datetime' => date('Y-m-d H:i:s')
                            );
                            $task_option_id = $db->insert($tbl_option_insert,"tbl_task_option");
                            $i = $i + 1;
                    }

    option_question_id INT NOT NULL AUTO_INCREMENT

    __proto__, 01 Октября 2013

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

    +149

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    public function fetchEmployees()
        {
            global $result, $check_u_id, $second_check_u_id, $query123;
    
            ....

    __proto__, 30 Сентября 2013

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

    +116

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    "create": "form[name=save]",
         "edit": "form[name=save]",
         "delete": "form[name=delete]",
    -    "select": "select[name=^employees]"
    +    "select": "select[name^=employees]"
       };
     
       var actionTable = {

    git commit

    __proto__, 30 Сентября 2013

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

    +139

    1. 1
    for (normalize(); n > 0; scanf("%d", &temp, n--)){...}

    Но ведь работает!

    Nex, 30 Сентября 2013

    Комментарии (21)
  6. Куча / Говнокод #13874

    +126

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    <link rel="stylesheet" href="/libraries/mediaelement/mediaelementplayer.min.css">
    <link href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" rel="stylesheet">
    <script type="text/javascript" src="/js/jquery/jquery-latest.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
    <script type="text/javascript" src="/libraries/mediaelement/andplayer.min.js"></script>
    <script type="text/javascript" src="/js/jquery_tools.js"></script>

    Все это, пара десятков строк мутного джаваскрипта и столько же HTMLя и PHP потребовалось опытному филиппинскому сотруднику, чтобы добавить видеоролик на страницу.

    quall, 30 Сентября 2013

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

    +12

    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
    #include <string>
    #include <sstream>
    #include <iostream>
    
    int main() {
        std::string str;
        std::stringstream s("");
        std::getline(s, str, '|');
        std::cout << "good=" << s.good() <<
            " bad=" << s.bad() <<
            " fail=" << s.fail() <<
            " eof=" << s.eof() << std::endl;
        return 0;
    }

    good=0 bad=0 fail=1 eof=1

    http://ideone.com/0Ceg8z

    У меня один вопрос: нахуй так жить?

    bormand, 30 Сентября 2013

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

    +109

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    BusinessLogic.Entity_InheritanceSetting.Save(
                        Session.SessionSettings.Settings.ContactID.Value,
                        Session.SessionSettings.Settings.SessionID.Value, copyID.Value,
                        true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
                        true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
                        true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
                        true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
                        true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);

    kore_sar, 30 Сентября 2013

    Комментарии (84)
  9. JavaScript / Говнокод #13871

    +149

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    function refreshPaymentStatus() {
    }
    
    refreshPaymentStatusJob();
    
    function refreshPaymentStatusJob() {
        setInterval("refreshPaymentStatus()", 10000);
    }

    Бесят люди которые, будучи обмануты кажущейся простотой JS, пишут такие конструкции "по привычке". Job он, @#$%, завёл. А Scheduler, интересно, где забыл? А SchedulerManager? А SchedulerManagerFactory? Зато не забыл передать строкой первый аргумент в setInterval, молодец.

    madhead, 30 Сентября 2013

    Комментарии (51)
  10. JavaScript / Говнокод #13869

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    // Optimize `isFunction` if appropriate.
      if (typeof (/./) !== 'function') {
        _.isFunction = function(obj) {
          return typeof obj === 'function';
        };
      }

    Eblyskin Group Optimization &copy; eternity

    Stealth, 29 Сентября 2013

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