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

    +1

    1. 1
    -


    #
    ## #### #### ##### ######
    # # # # # # # #
    # # #### # # #####
    # ### # # ##### #
    # ### # # # # # # #
    ##### ### #### #### # # #


    # # ###### ##### # ###### # #### ## ##### # #### # #
    # # # # # # # # # # # # # # # # ## #
    # # ##### # # # ##### # # # # # # # # # # #
    # # # ##### # # # # ###### # # # # # # #
    # # # # # # # # # # # # # # # # # ##
    ## ###### # # # # # #### # # # # #### # #


    ###### ##### ##### #### #####
    # # # # # # # # #
    ##### # # # # # # # #
    # ##### ##### # # #####
    # # # # # # # # #
    ###### # # # # #### # #

    Konardyan, 05 Сентября 2018

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

    −2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    if(spForActiveActivityDetect.getBoolean( "active", false) == false) {
                        
                        Intent cabinetManagerAct = new Intent(this, EmployeeCabinetActivity.class );
                        finish();
                        startActivity(cabinetManagerAct );
    
                    }else {
    
                   //...
                  }

    Равно ли getBoolen из false false ?


    по мне, заслуженное звание: топ - говенная проверка из говен, так как особенно выносит мозг

    Sergdev, 04 Сентября 2018

    Комментарии (18)
  3. Ruby / Говнокод #24717

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    FILE_TYPES_EXTENSIONS.each do |t, e|
          if e.include? extension
            return t
          elsif e.any? {|_e| _e.is_a? Hash}
            if _t = e.reduce({}) { |m, x| m = m.merge(x) if x.is_a?(Hash); m }.find{|_t, _e| _e.include? extension}
              return retrieve_parent ? t : _t.first
            end
          end
        end
        nil

    только создатель поймет, насрал и пропал

    ruby_noname, 04 Сентября 2018

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

    0

    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
    #include<iostream>
    #include<fstream>
    #include<vector>
    using namespace std;
    string rec(const string str, char c){return str;} //syntax error : missing ';' before identifier 'rec', ')' before 'const',  ')', ';' before '{', 
                                                                                    //'str' : undeclared identifier, 'rec': identifier not found
    
    void cer(){}                                                            //'cer' : local function definitions are illegal
    
    main(){                                                                  //'main': identifier not found
    
    	string s, d="Math.cos",a;                  //missing '}' before identifier 's',  ';' before identifier 's', 's', 'd', 'a' : undeclared identifier
    	
            ifstream fin;
    	vector<string> mas; // 'std::vector' : 'string' is not a valid template type argument for parameter '_Ty', 'mas' : unknown size
                                                  //'std::vector' : no appropriate default constructor available
    
    fin.open(mDocWrite); //'void std::basic_ifstream<char,std::char_traits<char>>::open(const char *,std::ios_base::open_mode)' : 
                                            //cannot convert argument 1 from 'nsAutoPtr<nsHtml5Tokenizer>' to 'const wchar_t *'
                         //No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    
    //if (fin.is_open()) cout<<"1";else	cout<<"0";
    while(fin>>s)    //'s' : undeclared identifier, fatal error C1903: unable to recover from previous error(s); stopping compilation
    	{bool f=0;
    		for(int i=0; i<s.size(); ++i)
    			if (s[i]==d[0])
    				{
    					f=1;
    					for (int j=0; j<s.size()&&j<d.size(); ++j)
    						if (d[j]!=s[i+j]) f=0;
    					if (f)
    						{
    							a.clear();
    							for (int j=0; j<i; ++j)
    								a=a+s[j];
    							a=a+"0.5*";
    							for (int j=i; j<s.size(); ++j)
    								a=a+s[j];
    						}
    				}
    						if (f)	{mas.push_back("\n");mas.push_back(a);mas.push_back("\n");}
    			else mas.push_back(s);
    			s=rec(s,'0');
    	}
    	ofstream fout;
    fout.open(mDocWrite);
    for (int i=0; i<mas.size(); ++i) fout<<mas[i]<<"\t";
    }

    предполагалось, что код будет уменьшать cos угла в два раза, но при компиляции выдает ошибки, логику большинства которых не могу понять. Ошибки указал в коде. Подскажите, что не так.

    DrAli, 04 Сентября 2018

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

    −3

    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
    Dies irae, dies illa
    solvet saeclum in favilla
    teste David cum Sibylla
    
    Quantus tremor est futurus
    quando judex est venturus
    cuncta stricte discussurus
    
    Tuba mirum spargens sonum
    Per sepulcra regionum,
    Coget omnes ante thronum.
    
    Mors stupebit et natura
    Cum resurget creatura
    judicanti responsura
    
    Liber scriptus proferetur
    in quo totum continetur
    unde mundus judicetur
    
    Judex ergo cum sedebit
    quidquid latet apparebit
    nil inultum remanebit
    
    Quid sum miser tunc dicturus
    quem patronum rogaturus
    cum vix justus sit securus?
    
    Rex tremendae majestatis,
    qui salvandos salvas gratis,
    salva me, fons pietatis.
    
    Recordare, Jesu pie,
    quod sum causa tuae viae:
    ne me perdas illa die.
    
    Quaerens me sedisti lassus;
    redemisti crucem passus.
    Tantus labor non sit cassus.
    
    Juste Judex ultionis
    donum fac remissionis
    ante diem rationis.
    
    Ingemisco tanquam reus:
    culpa rubet vultus meus.
    supplicanti parce, Deus.
    
    Qui Mariam absolvisti
    et latronem exaudisti,
    mihi quoque spem dedisti.
    
    Preces meae non sunt dignae,
    sed tu bonus fac benigne,
    ne perenni cremer igne.
    
    Inter oves locum praesta
    et ab haedis me sequestra,
    statuens in parte dextra.
    
    Confutatis maledictis
    flammis acribus addictis,
    voca me cum benedictis.
    
    Oro supplex et acclinis
    cor contritum quasi cinis,
    gere curam mei finis.
    
    Lacrimosa dies illa
    qua resurget ex favilla
    judicandus homo reus.
    
    huic ergo parce, Deus.
    Pie Jesu Domine,
    dona eis requiem.
    
    Amen.

    yet_another_one_shit, 666_N33D135

    Милосердный Господи Админе,
    Даруй им покой!

    Админь.

    ASMOZDOT, 03 Сентября 2018

    Комментарии (16)
  6. Python / Говнокод #24709

    −2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" dir="ltr">
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    		<meta name="keywords" content="Kabel Deutschland, digitale Belegung, Frequenzen, Kanäle, Sender" />

    Вся страница тут https://helpdesk.kdgforum.de/sendb/belegung.html
    Ебучий lxml при попытке парсить документ в неправильной кодировке (Невалидный utf8, в meta name="keywords" содержимое в однобайтовой кодировке. Как такое получили - другой вопрос) тихо сваливается в какую-то однобайтовую кодировку. Браузер всё показывает нормально. Несмотря на xhtml, который вроде должен заставлять строго парсить.

    syoma, 01 Сентября 2018

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

    −5

    1. 1
    Перепись долбоёбов.

    Отписываемся в комментах.

    Faika_Bormanda, 01 Сентября 2018

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

    −4

    1. 1
    2. 2
    3. 3
    Как называется физическая сеть, разбитая на подсети?
    
    (man dhcpd.conf)

    OlegUP, 01 Сентября 2018

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

    −2

    1. 1
    if type(colType) == type(0): # it's a length

    Библиотека csv, встроенная в питон.

    syoma, 01 Сентября 2018

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

    −6

    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
    class Foo {
    // ...
    private:
        std::vector<int>     v1_;
        std::vector<int>     v2_;
        
        void bar( const std::vector<int>& v ); 
    
    public:
        void doAction( int choice ) {
            if ( choice == 1 ) 
                bar( v1_ );
            else
                bar( v2_ );
        }
    };

    Почему передавать поля класса в свои же методы по ссылке\указателю -- это говнокод?
    Как этого избегать, чтобы получилось универсальней?

    OlegUP, 01 Сентября 2018

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