1. JavaScript / Говнокод #10503

    +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
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    String.prototype.startsWith=function(b){
        if(this.length<b.length){
    	return false
        }
        for(var a=0;a<b.length;++a){
    	if(this.charAt(a)!==b.charAt(a)){
    	    return false
    	}
        }
        return true
    };
    
    String.prototype.endsWith=function(b){
        if(this.length<b.length){
    	return false
        }
        var c=b.length-1;
        for(var a=this.length-1;a>this.length-1-b.length;--a){
    	if(b.charAt(c--)!==this.charAt(a)){
    	    return false
    	}
        }
        return true
    };
    
    String.prototype.contains=function(a){
        return this.indexOf(a)!==-1
    };
    
    String.prototype.LastIndexOf=function(d,c){
        if(this.length===0||d===null){
    	return -1
        }
        if(d.length>this.length){
    	return -1
        }
        if(isNaN(c)){
    	c=this.length-d.length
        }
        var a=false;
        for(var b=c;b>=0;--b){
    	a=true;
    	for(var e=0;e<d.length;++e){
    	    if(this.charAt(b+e)!==d.charAt(e)){
    		a=false;
    		break
    	    }
    	}
    	if(a){
    	    return b
    	}
        }
        return -1
    };
    
    String.prototype.LastIndexOf_char=function(a){
        for(var b=this.length-1;b>=0;--b){
    	if(this.charAt(b)===a){
    	    return b
    	}
        }
        return -1
    };
    
    String.prototype.setCharAt=function(b,a){
        if(b>this.length-1){
    	return str
        }
        return this.substr(0,b)+a+this.substr(b+1)
    };
    
    String.prototype.countCharAppearances=function(a){
        var b=0;
        for(var c=0;c<this.length;++c){
    	if(this.charAt(c)==a){
    	    ++b
    	}
        }
        return b
    };

    Сорри, что много буков, но тут каждую функцию можно воспринимать как отдельное произведение.
    Разбираю бред какого-то безымянного идиота :(

    wvxvw, 31 Мая 2012

    Комментарии (53)
  2. Python / Говнокод #10502

    −91

    1. 1
    2. 2
    3. 3
    >>>from itertools import chain, repeat
    >>>tuple(chain(tuple(chain(*tuple(repeat(tuple(chain((6,), repeat(7,5), (8,))),5)))),repeat(9, 7),repeat(10, 7)))
    (6, 7, 7, 7, 7, 7, 8, 6, 7, 7, 7, 7, 7, 8, 6, 7, 7, 7, 7, 7, 8, 6, 7, 7, 7, 7, 7, 8, 6, 7, 7, 7, 7, 7, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10)

    Zapix, 31 Мая 2012

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

    +82

    1. 1
    bool IsClient = level == "Client" ? true : false;

    startrack, 31 Мая 2012

    Комментарии (4)
  4. C# / Говнокод #10491

    +96

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    public bool IsStandart
    {
        get { return IsStandart; }
        set { IsStandart = value; }
    }

    Maps, 31 Мая 2012

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

    −96

    1. 1
    2. 2
    3. 3
    4. 4
    import sys, os
    
    # include project path like an EVIL
    sys.path.append('/'+os.path.join(*os.getcwd().split(os.path.sep)[1:-1]))

    Включении в поиск родительской директории

    mindinpanic, 31 Мая 2012

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

    +78

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    public function monthToString($month)
    {	
    	$months = array('никогдарь', 'январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь');
    	if(is_numeric($month))
    	{
    		$month = ltrim($month, "0");
    		$month = $months[$month];
    	}
    	return $month;
    }

    Стажер нашел весьма нетривиальный способ получить месяц текстом =D

    s1Paris, 31 Мая 2012

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

    +111

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    // WARNING!
    // This has to be optional=true so that OpenJPA uses
    // LEFT JOIN instead of INNER JOIN. Otherwise, MySQL tries
    // using a temporary table (horrible for performance) and dies.
    @ManyToOne(optional = true)
    @NotNull
    private Font font;

    someone, 31 Мая 2012

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

    +136

    1. 1
    http://www.jackrussell-italy.it/

    Весь сайт - одни картинки с мапами.
    Страница, на ней картинка, к ней привязана карта.
    Причем разные версии для каждого языка.
    Fuck html5! Fuck css3!

    7ion, 30 Мая 2012

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

    −43

    1. 1
    int eger;

    dos_, 30 Мая 2012

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

    −32

    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
    #pragma once
    
    #include <vector>
    #include <assert.h>
    
    class Obj
    {
    public:
    	virtual ~Obj(void) { }
    };
    
    
    class Sig
    {
    	typedef void (Obj::*slot_t)(void*);
    	mutable std::vector<std::pair<Obj*, Sig::slot_t>> m_connSlots;
    
    public:
    	void operator()(void* arg) const
    	{
    		std::vector< std::pair<Obj *, slot_t> >::const_iterator iter = m_connSlots.cbegin();
    		while(iter != m_connSlots.cend())
    		{
    			Obj * object = iter->first;
    			slot_t slot = iter->second;
    			(object->*slot)(arg);
    			iter++;
    		}
    	}
    
    	template<class obj_T> void connect(obj_T* object, void (obj_T::*slot)(void*)) const
    	{
    		assert(dynamic_cast<Obj*>(object)!=0);
    		m_connSlots.push_back(std::make_pair(reinterpret_cast<Obj*>(object),
    			reinterpret_cast<Sig::slot_t>(slot)));
    	}
    };

    QBicycle

    Xom94ok, 30 Мая 2012

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