1. C++ / Говнокод #27471

    +3

    1. 1
    2. 2
    3. 3
    //! Set this value as an empty object.
    /*! \post IsObject() == true */
    GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; }

    Парсер json'ок писали сверхлюди

    https://github.com/Tencent/rapidjson/blob/master/include/rapidjson/document.h#L1188

    mvngr, 16 Июня 2021

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    /**
      * Gets a customer
      *
      * @param customerId customer's id
      * @return Customer 
      */
    Customer getCustomer(int customerId) {
          . . .
    }

    В джава-джава-городе, на джава-джава-улице, живёт джавамен и пишет JAVADOC *шокирующий писк*

    JloJle4Ka, 16 Июня 2021

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

    +1

    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
    @echo off
    wget https://dl.google.com/android/repository/build-tools_r25.0.3-windows.zip
    unzip -j build-tools_r25.0.3-windows.zip android*/lib/dx.jar 
    rem  --- Получаем уробороса ---
    dx --dex --output=dx-dexed.jar --min-sdk-version=24 dx.jar
    rem  +++  Уроборос получен  +++
    echo class nemyx                                                                                >nemyx.java
    echo {                                                                                         >>nemyx.java
    echo   public static void main(String[] args) throws java.lang.Exception                       >>nemyx.java
    echo   {                                                                                       >>nemyx.java
    echo     java.io.PrintStream nemyxStream = new java.io.PrintStream(System.out, true, "UTF-8"); >>nemyx.java
    echo     nemyxStream.printf("%%.2fдар идёт напитон.\n", Math.PI);                              >>nemyx.java
    echo   }                                                                                       >>nemyx.java
    echo }                                                                                         >>nemyx.java
    javac -encoding utf-8 -source 1.7 -target 1.7 nemyx.java 
    jar cf nemyx.jar nemyx.class
    adb push dx-dexed.jar /sdcard/Download/
    adb push nemyx.jar /sdcard/Download/
    adb shell "cd /sdcard/Download; dalvikvm -cp dx-dexed.jar com.android.dx.command.Main --dex --output nemyx-dexed.jar nemyx.jar"
    adb shell dalvikvm -cp /sdcard/Download/nemyx-dexed.jar nemyx

    Сон разума рождает чудовища.

    npopa6, 13 Июня 2021

    Комментарии (98)
  4. JavaScript / Говнокод #27465

    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
    function ToggleClients(id, translit)
    {
        long_clients = document.getElementById(id);
        elemID = translit + '_short_clients';
        button = document.getElementById(elemID);
        long_clients.style.display = "";
        button.style.display = "none";
    
        return false;
    }
    
    function ToggleClients2(id, translit)
    {
        long_clients = document.getElementById(id);
        elemID2 = translit + '_long_clients';
        button = document.getElementById(elemID2);
        long_clients.style.display = "";
        button.style.display = "none";
        
        return false;
    }

    Компания делает рейтинги других компаний.. имеет в своих сорцах такое.. а судьи кто?

    denqo, 09 Июня 2021

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

    +1

    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
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    insert(Alias, Tab, Val) ->
        ok.
    
    delete(_Alias, _Tab, _Key) ->
        ok.
    
    add_aliases(_) ->
        ok.
    
    remove_aliases(_) ->
        ok.
    
    check_definition(_Alias, _Tab, _Nodes, _Properties) ->
        ok.
    
    close_table(_Alias, _Tab) ->
        ok.
    
    create_table(_Alias, _Tab, _Properties) ->
        ok.
    
    delete_table(_Alias, _Tab) ->
        ok.
    
    first(_Alias, _Tab) ->
        '$end_of_table'.
    
    fixtable(_Alias, _Tab, _Bool) ->
        ok.
    
    last(_Alias, _Tab) ->
        '$end_of_table'.
    
    index_is_consistent(_Alias, _IxTag, _Bool) ->
        ok.
    
    init_backend() ->
        ok.
    
    info(_Alias, Tab, memory) ->
        0;
    info(Alias, Tab, size) ->
        0;
    info(_Alias, _Info, _Item) ->
        nobody_here_but_us_chicken.
    
    lookup(_Alias, _Tab, _Key) ->
        [].
    
    is_index_consistent(_Alias, _IxTag) ->
        true.
    
    load_table(_Alias, _Tab, _Reason, _CsList) ->
        ok.
    
    match_delete(_Alias, _Tab, _Pattern) ->
        ok.
    
    next(_Alias, _Tab, _Key) ->
        '$end_of_table'.
    
    prev(_Alias, _Tab, _Key) ->
        '$end_of_table'.
    
    real_suffixes() ->
        [].
    
    repair_continuation(Continuation, _MatchSpec) ->
        Continuation.
    
    select(_Continuation) ->
        '$end_of_table'.
    
    select(_Alias, _Tab, _Pattern) ->
        '$end_of_table'.
    
    select(_Alias, _Tab, _Pattern, _Limit) ->
        '$end_of_table'.
    
    
    semantics(_Alias, storage) -> ram_copies;
    semantics(_Alias, types  ) -> [set, ordered_set, bag];
    semantics(_Alias, index_types) -> [];
    semantics(_Alias, _) -> undefined.
    
    slot(_Alias, _Tab, _Pos) ->
        '$end_of_table'.
    
    sync_close_table(_Alias, _Tab) ->
        ok.
    
    tmp_suffixes() ->
        [].

    If /dev/null is fast in web scale I will use it. Is it web scale? Does /dev/null support sharding?

    CHayT, 09 Июня 2021

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

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    #include <iostream>
    #include <map>
    
    int main()
    {
      std::string name;
      std::map<int, int> m = { {1, 1}, {2, 2} };
      m.erase(m.end());
      std::cout << "Kokoko " << m[1] << std::endl;
    }

    На моем проекте уходит в бесконечный цикл.

    YpaHeLI_, 08 Июня 2021

    Комментарии (58)
  7. JavaScript / Говнокод #27461

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    function main() {
        const trees = [ [1, "redwood"], [2, "bay"], [3, "cedar"], [4, "oak"], [5, "maple"] ];
    
        for (const [k, v] of trees)
        {
    	print (k, v);
        }
    
        print("done.");
    }

    пока с вами тут трепался - наклипал новую конструкцию

    результат работы

    1 redwood
    2 bay
    3 cedar
    4 oak
    5 maple
    done.

    ASD_77, 07 Июня 2021

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

    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
    if (1 != 1)
    {
        1 = 1;
    }
    else if (2 != two)
    {
        2 = 1;
    }
    else if (1 == one)
    {
        3 = two;
    }
    else if (two != three)
    {
        3 != 2;
    }
    else
    {
        DynamicSenseMessage("Are you coding with JavaScript, son?");
    }

    BelCodeMonkey, 07 Июня 2021

    Комментарии (0)
  9. JavaScript / Говнокод #27458

    −1

    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
    function main() {
        // Arrays
        const trees = ["redwood", "bay", "cedar", "oak", "maple"];
        print(0 in trees); // returns true
        print(3 in trees); // returns true
        print(6 in trees); // returns false
    
        for (let i = 0; i in trees; i++)
        {
    	print (trees[i]);
        }
    
        print("done.");
    }

    Продолжаем будни говнокодера говнокомпилятора. Сравниваем с компилятором "С".

    как говориться, а ты так можешь?

    ASD_77, 07 Июня 2021

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

    +4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    Tactic Notation "sleep" integer(seconds) :=
        do seconds try solve [ timeout 1 (repeat eapply proj1) ].
    
    Goal True.
        sleep 3.
        exact I.
    Qed.

    Какой пруф )))

    bormand, 06 Июня 2021

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