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

    +155

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    public function throwExceptions($flag = null)
        {
            if ($flag !== null) {
                $this->_throwExceptions = (bool) $flag;
                return $this;
            }
    
            return $this->_throwExceptions;
        }

    Зенд

    getme, 11 Августа 2009

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

    +34

    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
    void dump_indexes(map<int,stride_slices> picks, ofstream &f);
    {
      f<<"# full size: "<<picks.size()<<endl;
      for(map<int, stride_slices>::iterator
    	p=picks.begin(); p!=picks.end(); ++p)
        {
          f<<"## "
           <<p->first<<"'st stride slices count: "
           <<p->second.size()<<endl;
          
          for(stride_slices::iterator
    	    pp=p->second.begin(); pp!=p->second.end(); ++pp)
    	{
    	  f<<"### "
    	   << p->first<<"'st stride, "
    	   <<pp->first<<"'st slice size: "
    	   <<pp->second.size()<<endl;
    	  for(max_slice::iterator
    		ppp=pp->second.begin(); ppp!=pp->second.end(); ++ppp)
    	    {
    	      f<<"#### "
    	       <<p->first<<"'st stride, "
    	       <<pp->first<<"'st slice, "
    	       <<ppp->first<<"'st chunk size:"
    	       <<ppp->second.size()<<endl;
    	      
    	      for(max_chunk::iterator
    		    pppp=ppp->second.begin(); pppp!=ppp->second.end(); ++pppp)
    		f<<"       "
    		 <<p->first<<" "
    		 <<pp->first<<" "
    		 <<ppp->first<<" "
    		 <<pppp->first<<" : "
    		 <<pppp->second<<endl;	
    	    }
    	}
        }
    }

    а как нормально просмотреть кучу вложенных контейнеров?

    Biburath, 11 Августа 2009

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

    +144.9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $data=funny_parser($data);
    //модуль недобавления слов вконец
    
    $andtr=array('Андатра','Выпь','Пеликан','Пучеглаз','Хвостозуб','Декроль','Устрица','Челюстёлог','Рукоед','Йыждивение','Оторопь','Осётр','Кингура','Большой лось','Пученоска','Вомбат','Плоскогубка','');
    $data=$data.' <span style="color:#93FF4A;font-size:15px">'.$andtr[rand(0,count($andtr)-1) ].'</span>';

    кусок кода из upyachka.ru =)
    этим всё сказано

    pusher, 11 Августа 2009

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

    +155

    1. 1
    if ($id=$trips->create($user['id'], strip_tags($_POST['name']), $_POST['country'], strip_tags($_POST['city']), strip_tags($_POST['place']), $depart, $arrive, strip_tags($_POST['text']), $type)) {

    simpsonoid, 11 Августа 2009

    Комментарии (0)
  5. 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)
  6. 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)
  7. 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)
  8. Assembler / Говнокод #1520

    +129.5

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

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

    OlegD, 11 Августа 2009

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