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

    +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
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    Definition uilv_add_trivial {N} te (t : list TE) (traces : Traces N)
                 i j (Ht : MInt_ trace_elems_don't_commute j true traces t)
                 s s' (Hls : LongStep s (te :: t) s')
                 (Htriv : trivial_add i j traces) :
        MInt_ trace_elems_don't_commute i true (push_te traces i te) (te :: t).
      Proof with autorewrite with vector; eauto with vector; try vec_forall_eq_contradiction.
        unfold push_te.
        unfold trivial_add in Htriv.
        destruct (Fin.eq_dec i j) as [Hij|Hij].
        (* [i=j], solving by constructor: *)
        { subst.
          unfold trivial_add.
          eapply mint_keep with (rest := traces[@j])...
        }
        remember traces[@j] as t2_.
        destruct t2_ as [|te2 t2]; subst.
        { inversion Ht as [vec Hvec|? ? ? ? ? Hj Hcont|? ? ? ? ? ? Hjj0 Hswitch Hj Hcont];
            subst.
          - eapply mint_keep with (prog := true)...
            eapply mint_nil...
          - rewrite Hj in Heqt2_.
            discriminate.
        }
        remember traces[@i] as t1_.
        destruct t1_ as [|te1 t1]; subst.
        (* [te] is the last element in i-th trace: *)
        { eapply mint_keep with (rest := []) (prog := false)...
          inversion Ht as [vec Hvec|? ? ? ? ? Hj Hcont|? ? ? ? ? ? Hjj0 Hswitch Hj Hcont];
            subst...
          rewrite Heqt1_ in *.
          eapply mint_switch...
          rewrite <-Heqt1_...
        }
        destruct Htriv as [|[Hij' Hcomm]]; [contradiction Hij|idtac].
        eapply mint_keep with (rest := te1 :: t1) (prog := false)...
        rewrite Heqt1_, Vec.replace_id.
        inversion Ht as [vec Hvec|? ? ? ? ? Hj Hcont|? ? ? ? ? ? Hjj0 Hswitch Hj Hcont]; subst...
        replace te0 with te2 in * by congruence.
        eapply mint_switch...
        rewrite <-Heqt1_...
      Defined.

    Кто сказал, что хуже C++ темплейтов ничего уже нет? Вы ничего не понимаете в метушне. Это говно разворачивается в 12000 строк, например.

    CHayT, 20 Августа 2020

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    #include <string>
    
    std::string greet(){
      return "hello world!";
    }

    пользуйтесь пока я добрый

    achtonepon, 19 Августа 2020

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

    +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
    Хрюкни №3
                 ._     __,
                  |\,../'\
                ,'. .     `.
               .--         '`.
              ( `' ,          ;
              ,`--' _,       ,'\
             ,`.____            `.
            /              `,    |
           '                \,   '
           |                /   /`,
           `,  .           ,` ./  |
           ' `.  ,'        |;,'   ,@
     ______|     |      _________,_____jv______
            `.   `.   ,'
             ,'_,','_,
             `'   `'

    №2 https://govnokod.xyz/_26868/
    №1 https://govnokod.xyz/_26863/

    TOPT, 19 Августа 2020

    Комментарии (497)
  4. Python / Говнокод #26880

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    >>> def f(positional_only, /, regular, *varargs, kw_only, **kw_varargs):
        print(positional_only, regular, varargs, kw_only, kw_varargs)
    
    f(1, 2, 3, 4, 5, kw_only='kw_only', kw_var1='var1', kw_var2='var2')
    # 1 2 (3, 4, 5) kw_only {'kw_var1': 'var1', 'kw_var2': 'var2'}

    Блядь, как всё сложно…

    https://www.python.org/dev/peps/pep-0570/

    gost, 18 Августа 2020

    Комментарии (17)
  5. PHP / Говнокод #26879

    0

    1. 1
    https://ru.wikihow.com/%D0%B8%D0%B7%D1%83%D1%87%D0%B8%D1%82%D1%8C-PHP-%D0%B8-MySQL

    Stallman, 18 Августа 2020

    Комментарии (15)
  6. JavaScript / Говнокод #26878

    −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
    updateTimer() {
                requestAnimationFrame(() => {
                    this.timeLeft = this.resendTimeDuration - (Date.now() * 0.001 - this.lastTimeLeft);
    
                    if (this.timeLeft <= 0) {
                        this.resetTimer();
                        return;
                    } else {
                        this.lastTimeLeft = this.timeLeft;
                        this.updateTimer();
                    }
                });
    }

    А как сделать таймер обратного отсчета?

    somebodyoncetoldme, 18 Августа 2020

    Комментарии (1)
  7. Python / Говнокод #26877

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    def fake_bin(x):
        k = ''
        while len(x) > 0:
            if int(x) % 10 >= 5:
                k += '1'
                x = x[0:-1]
            else:
                k += '0'
                x = x[0:-1]
        return k[::-1]

    achtonepon, 18 Августа 2020

    Комментарии (87)
  8. Python / Говнокод #26876

    +2

    1. 1
    https://pythoninstitute.org/certification/

    кто последний в сертификацию напитон?

    defecate-plusplus, 17 Августа 2020

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
        cout << "is_same_v: " << std::is_same_v<int, const int> << endl;
    }

    https://en.cppreference.com/w/cpp/types/is_same

    > If T and U name the same type (taking into account const/volatile qualifications), provides the member constant value equal to true. Otherwise value is false.

    OlegUP, 17 Августа 2020

    Комментарии (27)
  10. bash / Говнокод #26874

    +2

    1. 1
    2. 2
    tar -czvf arhiv.tar.hz .
    tar -xzf arhiv.tar.hz

    Как запомнить эти команды? Бывает гуглю их в день по нескольку раз )))
    Сделать алиаснюшню "tar pack" и "tar unpack"?

    3_dar, 17 Августа 2020

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