1. Куча / Говнокод #7594

    +130

    1. 1
    Fatal error: Call to a member function getCreated() on a non-object in /home/***/tmp/templates_c/1563503196.file.export_quote_rss.tpl.php-ru.php on line 21

    Заметил только что в вывого RSS этого сайта)

    XyHb, 20 Августа 2011

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

    +146

    1. 1
    $now = strtotime(date('Y-m-d'));

    Ну нахрена!?

    Веб-Система "Социальная сеть" версия 4.0
    /engine/modules/content/afisha/afisha.php on line 41

    XyHb, 20 Августа 2011

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

    +72

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    public void run()
        {
            while(mc.running) 
            {
                try
                {
                    Thread.sleep(0x7fffffffL);
                }
                catch(InterruptedException interruptedexception) { }
            }
        }

    Тоже майнсрафт.
    Может, я что-то не понимаю?

    RaZeR, 19 Августа 2011

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

    +75

    1. 1
    String s = (new StringBuilder()).append("c.").append(Integer.toString(i, 36)).append(".").append(Integer.toString(j, 36)).append(".dat").toString();

    Опять из сорцов минесрафта.
    У нотча видимо StringBuilder головного мозга.

    RaZeR, 19 Августа 2011

    Комментарии (14)
  5. Java / Говнокод #7590

    +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
    if(block == Block.blockDiamond || block == Block.oreDiamond)
            {
                return toolMaterial.getHarvestLevel() >= 2;
            }
            if(block == Block.blockGold || block == Block.oreGold)
            {
                return toolMaterial.getHarvestLevel() >= 2;
            }
            if(block == Block.blockSteel || block == Block.oreIron)
            {
                return toolMaterial.getHarvestLevel() >= 1;
            }
            if(block == Block.blockLapis || block == Block.oreLapis)
            {
                return toolMaterial.getHarvestLevel() >= 1;
            }
            if(block == Block.oreRedstone || block == Block.oreRedstoneGlowing)
            {
                return toolMaterial.getHarvestLevel() >= 2;
            }

    Из сорцов майнсрафта.
    Нахрена делать из двух ifов пять?!

    RaZeR, 19 Августа 2011

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

    +149

    1. 1
    INSERT INTO `wp_posts` (`ID`, `post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES (NULL, '0', '2011-08-19 00:00:00', '2011-08-19 00:00:00', '$content', '$title', '', 'publish', 'open', 'open', '', '$cpu', '', '', '2011-08-19 00:00:00', '2011-08-19 00:00:00', '', '0', '$cpu_num', '0', 'post', '', '0');

    maeln0r, 19 Августа 2011

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

    +167

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $used_vars = Array ("s_user","s_roles","s_error");
    
    	for ($i = 0; $i < sizeof($used_vars); $i++) {
    		eval ("unset(\$".$used_vars[$i].");");
    	}

    humbug, 19 Августа 2011

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

    +76

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    @Override
        public ResponseBag[] send(SmsBag[] smsBag) {
            ArrayList<ResponseBag> responseList = new ArrayList<ResponseBag>();
            for(SmsBag bag : smsBag) {
                responseList.add(super.send(bag));
            }
            ResponseBag[] responseBag = new ResponseBag[responseList.size()];
            return responseList.toArray(responseBag);
        }

    manyrus, 18 Августа 2011

    Комментарии (82)
  9. Pascal / Говнокод #7586

    +108

    1. 1
    if (rmes<>'')and(rmes<>#13#10)and(rmes<>#13#10#13#10)and(rmes<>#13#10#13#10#13#10) then

    Эталонный условный оператор прямо из Парижской Дельфийской палатки мер и весов.

    bugmenot, 18 Августа 2011

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

    +152

    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
    64. 64
    65. 65
    66. 66
    public function getObject()
    	{
    		$args = func_get_args();
    		if (empty($args)) {
    			$this->_throwException('wrong call of method - interface should be as 1st parameter');
    		}
    
    		$interface = array_shift($args);
    		
    		$class = $this->getInjection($interface);
    
            $argsCnt = count($args);
            if ($argsCnt == 0) {
                $object = new $class;
            }
            else if ($argsCnt == 1) {
                $object = new $class($args[0]);
            }
            else if ($argsCnt == 2) {
                $object = new $class($args[0], $args[1]);
            }
            else if ($argsCnt == 3) {
                $object = new $class($args[0], $args[1], $args[2]);
            }
            else if ($argsCnt == 4) {
                $object = new $class($args[0], $args[1], $args[2], $args[3]);
            }
            else if ($argsCnt == 5) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4]);
            }
            else if ($argsCnt == 6) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]);
            }
            else if ($argsCnt == 7) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6]);
            }
            else if ($argsCnt == 8) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7]);
            }
            else if ($argsCnt == 9) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8]);
            }
            else if ($argsCnt == 10) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9]);
            }
            else if ($argsCnt == 11) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10]);
            }
            else if ($argsCnt == 12) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10], $args[11]);
            }
            else if ($argsCnt == 13) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10], $args[11], $args[12]);
            }
            else if ($argsCnt == 14) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10], $args[11], $args[12], $args[13]);
            }
            else if ($argsCnt == 15) {
                $object = new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10], $args[11], $args[12], $args[13], $args[14]);
            }
            else {
        	   $this->_throwException('it looks like you use more than 15 arguments when trying to instantiate an object of class '.$class.' - that\'s ugly');
            }
    
            return $object;
    	}

    webeith, 18 Августа 2011

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