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

    +159.3

    1. 1
    2. 2
    3. 3
    4. 4
    for ($x=5;$x<135;$x+=25){
        $cislo=mt_rand(0,9);
        $string.=$cislo;
    }

    Interfere, 11 Августа 2009

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

    +76.3

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    try {
        ....
    } catch (Exception ex) {
        if (ex != null) {
            try {
                ex.printStackTrace();
            } catch(Exception ex1) {
                ....
            }
        }
    }

    Rudolf_Abel, 11 Августа 2009

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

    +133.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
    for (int i = 0; i < gvOrderMain.RowCount - EditIndex; i++)
                                {
                                    float tempQuantity = GetRow(i).Quantity;
                                    int partyLen = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray().Length;
                                    for (int j = 0; j < partyLen; j++)
                                    {
                                        if (DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity > 0)
                                        {
                                            float CurSQuantity = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity.Value;
                                            if (tempQuantity > CurSQuantity)
                                            {
                                                Documents_Product dp = new Documents_Product();
                                                dp.PrimePriceExcVAT = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].PrimePriceExcVAT;
                                                dp.PrimePriceIncVAT = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].PrimePriceIncVAT;
                                                dp.Quantity = -1 * DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity;
                                                dp.OldQuantity = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity;
                                                dp.PartyNumber = DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].PartyNumber;
                                                DB.Documents_Products.InsertOnSubmit(dp);
                                                DB.SubmitChanges();
    
                                                Documents_ProductsOrder dro = new Documents_ProductsOrder();
                                                dro.PriceSum = GetRow(i).RealPrice * DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity;
                                                tempQuantity = tempQuantity - DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity.Value;
                                                DB.PrInStOrderByPartyNum(GetRow(i).ProductId, curStockId).ToArray()[j].Quantity = 0;
                                                DB.Documents_ProductsOrders.InsertOnSubmit(dro);
    
                                                DB.SubmitChanges();
    ..........

    Rudolf_Abel, 11 Августа 2009

    Комментарии (5)
  4. Assembler / Говнокод #1520

    +129.5

    1. 1
    2. 2
    call LABEL
    LABEL: pop eax

    Получение адреса текущей инструкции убийственным для производительности методом.

    OlegD, 11 Августа 2009

    Комментарии (40)
  5. Perl / Говнокод #1519

    −55.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
    #!/etc/Tivoli/bin/perl
    ##############################################################
    #  Name: Default.cgi
    #
    #  Description: Generates translated Default HTML page
    #               according to browser's language
    #  TMF 4.1
    #  Licensed Materials- Property of IBM
    #  (C) Copyright IBM Corp. 2000. All Rights Reserved
    #
    #  US Government Users Restricted Rights- Use, duplication,
    #  or disclosure restricted by GSA ADP Schedule Contract with
    #  IBM Corp.
    ##############################################################
    
    # wupddefhtml will bind all messages contained in default page
    # accordingly ( LANG is set to the browser's locale )
    
    $defaultPage=`wupddefhtml -out`;
    
    # all links in the default page are absolute or relative to root
    # so we need to fix them because we have changed location
    
    $defaultPage =~ s|href=|href=../|g;
    $defaultPage =~ s|//|/|g;
    
    print("HTTP/1.0 200 OK
    Contents-Type: text/html
    
    ");
    
    print "$defaultPage";

    строка print("HTTP/1.0 200 OK
    явно говорит о глубоких знаниях протокола :))
    (C) Copyright IBM Corp. - ИТ лидер - что еще сказать

    pdp_dp, 11 Августа 2009

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

    +33.2

    1. 1
    cStaticObject * CreateStaticObject	( obj_id_t object_id, mesh_id_t mesh_id, material_id_t material_id, int32_t coord_x, int32_t coord_y, int32_t coord_z, int32_t angle_azimuth, int32_t angle_zenith, int32_t angle_longitudinal, uint32_t size_x, uint32_t size_y, uint32_t size_z, uint16_t flags );

    stup, 11 Августа 2009

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

    +46.3

    1. 1
    delete ptr + int(ptr=0);

    Освобождение памяти и обнуление указателя.

    k06a, 11 Августа 2009

    Комментарии (20)
  8. Java / Говнокод #1516

    +74

    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
    StringBuffer sql = new StringBuffer();
            sql.append("INSERT INTO ");
            sql.append("    APPLIED_TABLE ");
            sql.append(" ( ");
            sql.append("    PROJECT_ID, ");
            sql.append("    APPLIED_ID, ");
            sql.append("    APPLIED_DAY, ");
            sql.append("    USER_ID, ");
            sql.append("    APPLIED_NAME, ");
            sql.append("    APPLIED_LIMIT, ");
            sql.append("    APPLIED_COMMENT, ");
            sql.append("    CATEGORY_ID, ");
            sql.append("    DB_ID, ");
            sql.append("    EXCEL_ID, ");
            sql.append("    UPDATE_DATE, ");
            sql.append("    UPDATE_NAME ");
            sql.append(" ) VALUES ( ");
            sql.append("    ?, ");
            sql.append("    ?, ");
            sql.append("    SYSDATE, ");
            sql.append("    ?, ");
            sql.append("    ?, ");
            sql.append("    ?, ");
            sql.append("    ?, ");
            sql.append("    ?, ");
            sql.append("    ?, ");
            sql.append("    ?, ");
            sql.append("    SYSDATE, ");
            sql.append("    ? ");
            sql.append(" ) ");

    Китайцы составляют SQL запрос. Обратите внимание, что буфер склеиваетсо токо из литералов. Что мешало им написать просто строку с содержимым объединяющим енто все, остается загадкой.

    cheap_chinese, 11 Августа 2009

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

    +157

    1. 1
    <?php echo ((strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) ? "top: 35px;" : ""); ?>

    Постоянно натыкаюсь, разбирая старые проекты. Народ просто не знал, про CC в осле.

    cheerfulboy, 11 Августа 2009

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

    +171.5

    1. 1
    $now = mktime(date("G"), date("i"), date("s"), date("m")  , date("d"), date("Y"));

    получение текущего времени :)
    читайте доки, юзернеймы.

    Mihard, 11 Августа 2009

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