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

    0

    1. 1
    IT Оффтоп #78

    #49: https://govnokod.ru/26750 https://govnokod.xyz/_26750
    #49: https://govnokod.ru/26776 https://govnokod.xyz/_26776
    #50: https://govnokod.ru/26804 https://govnokod.xyz/_26804
    #51: https://govnokod.ru/26809 https://govnokod.xyz/_26809
    #52: https://govnokod.ru/26817 https://govnokod.xyz/_26817
    #53: https://govnokod.ru/26833 https://govnokod.xyz/_26833
    #54: https://govnokod.ru/26840 https://govnokod.xyz/_26840
    #55: https://govnokod.ru/26844 https://govnokod.xyz/_26844
    #56: https://govnokod.ru/26862 https://govnokod.xyz/_26862
    #57: https://govnokod.ru/26890 https://govnokod.xyz/_26890
    #58: https://govnokod.ru/26916 https://govnokod.xyz/_26916
    #59: https://govnokod.ru/26934 https://govnokod.xyz/_26934
    #60: https://govnokod.ru/26949 https://govnokod.xyz/_26949
    #61: https://govnokod.ru/26980 https://govnokod.xyz/_26980
    #62: https://govnokod.ru/26999 https://govnokod.xyz/_26999
    #63: https://govnokod.ru/27004 https://govnokod.xyz/_27004
    #64: https://govnokod.ru/27020 https://govnokod.xyz/_27020
    #65: https://govnokod.ru/27027 https://govnokod.xyz/_27027
    #66: https://govnokod.ru/27040 https://govnokod.xyz/_27040
    #67: https://govnokod.ru/27049 https://govnokod.xyz/_27049
    #68: https://govnokod.ru/27061 https://govnokod.xyz/_27061
    #69: https://govnokod.ru/27071 https://govnokod.xyz/_27071
    #70: https://govnokod.ru/27097 https://govnokod.xyz/_27097
    #71: https://govnokod.ru/27115 https://govnokod.xyz/_27115
    #72: https://govnokod.ru/27120 https://govnokod.xyz/_27120
    #73: https://govnokod.ru/27136 https://govnokod.xyz/_27136
    #74: https://govnokod.ru/27160 https://govnokod.xyz/_27160
    #75: https://govnokod.ru/27166 https://govnokod.xyz/_27166
    #76: https://govnokod.ru/27168 https://govnokod.xyz/_27168
    #77: https://govnokod.ru/27186 https://govnokod.xyz/_27186

    nepeKamHblu_nemyx, 20 Января 2021

    Комментарии (2440)
  2. Куча / Говнокод #27213

    0

    1. 1
    'x'.repeat(a).concat('x'.repeat(b)).length

    Сложение чисел a и b без использования операторов + и -

    Мистер Хэнки, 12 Января 2021

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

    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
    # ------------------- fUnicodeToUTF8----------------------
    :global fUnicodeToUTF8
    :if (!any $fUnicodeToUTF8) do={ :global fUnicodeToUTF8 do={
      :global fByteToEscapeChar
    #  :local Ubytes [:tonum $1]
      :local Nbyte
      :local EscapeStr ""
    
      :if ($1 < 0x80) do={
        :set EscapeStr [$fByteToEscapeChar $1]
      } else={
        :if ($1 < 0x800) do={
          :set Nbyte 2
        } else={  
          :if ($1 < 0x10000) do={
            :set Nbyte 3
          } else={
            :if ($1 < 0x20000) do={
              :set Nbyte 4
            } else={
              :if ($1 < 0x4000000) do={
                :set Nbyte 5
              } else={
                :if ($1 < 0x80000000) do={
                  :set Nbyte 6
                }
              }
            }
          }
        }
        :for i from=2 to=$Nbyte do={
          :set EscapeStr ([$fByteToEscapeChar ($1 & 0x3F | 0x80)] . $EscapeStr)
          :set $1 ($1 >> 6)
        }
        :set EscapeStr ([$fByteToEscapeChar (((0xFF00 >> $Nbyte) & 0xFF) | $1)] . $EscapeStr)
      }
      :return $EscapeStr
    }}

    угадай язык

    MAKAKA, 12 Января 2021

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

    +3

    1. 1
    Новогодний оффтоп #1

    Перекатить через год.

    gostinho, 31 Декабря 2020

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

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    The reboot() call reboots the system, or enables/disables the reboot keystroke (abbreviated CAD, since the de‐
           fault is Ctrl-Alt-Delete; it can be changed using loadkeys(1)).
    
           This system call fails (with the error EINVAL) unless magic equals LINUX_REBOOT_MAGIC1 (that  is,  0xfee1dead)
           and  magic2  equals LINUX_REBOOT_MAGIC2 (that is, 672274793).  However, since 2.1.17 also LINUX_REBOOT_MAGIC2A
           (that is, 85072278) and since 2.1.97 also LINUX_REBOOT_MAGIC2B (that is,  369367448)  and  since  2.5.71  also
           LINUX_REBOOT_MAGIC2C  (that  is,  537993216)  are  permitted as values for magic2.  (The hexadecimal values of
           these constants are meaningful.)

    man 2 reboot

    MAKAKA, 23 Декабря 2020

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

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    В России предложили перейти на Rust при разработке ПО для «проектов повышенной надёжности».
    
    Языком Rust предлагают ограничить все проекты по разработке ядерного оружия, 
    атомных станций, авиации, электроэнергетики, банковской сферы и т.д. 
    Но не стоит переживать. Если проект примут, то разработчикам дадут 
    от полугода до года, «чтобы успели переучиться». Как говорится, и на том спасибо.
    
    Голосовать, если что, можно тут: https://www.roi.ru/71821/

    YpaHeLI_, 26 Ноября 2020

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

    0

    1. 1
    https://journal.tinkoff.ru/diary-quality-manager-moscow-950k/

    OCETuHCKuu_nemyx, 19 Ноября 2020

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

    0

    1. 1
    Mi sidim v servernoy!

    Vse kto nas chitaet! Mi sidim v servernoy, v zaperty, mobillnyi ne beret! Pozovonite na ohrany po telefony на okrany 762-23-96 i skagite chtobi nas vypustili!

    3vservernoy, 19 Ноября 2020

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

    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
    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
    Fixpoint mint_add0 {N} (i k : Fin.t N) te_i te' t0 vec
                 (Ht : MInt nonCommRel N k vec (te' :: t0))
                 (Hik : k < i)
                 (Hcomm0 : trace_elems_commute te_i te')
                 {struct Ht} :
          exists t' : list TE,
              MInt nonCommRel N k (vec_append i te_i vec) (te' :: t') /\
              Permutation trace_elems_commute (te_i :: te' :: t0) (te' :: t').
        Proof with eauto.
          (* Welcome to the hell proof! *)
          remember (te' :: t0) as t_.
          destruct Ht as [k
                         |k j vec te_k t Hij Ht
                         |k j vec te_k te_j t Hij Hcomm Ht
                         ];
            [discriminate
            |replace te' with te_k in * by congruence; clear Heqt_..
            ].
          2:{ destruct (trace_elems_commute_dec te_i te_j).
              - apply mint_add0 with (te_i := te_i) (i := i) in Ht; [|lia|assumption].
                destruct Ht as [t' [Ht' Hperm']].
                exists (te_j :: t'). split.
                + swap_vec_append.
                  eapply mint_cons2...
                + apply permut_cons with (a := te_k) in Hperm'.
                  eapply permut_trans...
                  now apply permut_head'.
              - exists (te_i :: te_j :: t). split.
                + swap_vec_append.
                  apply mint_cons1 with (j0 := i); [lia|].
                  apply mint_cons2 with (j0 := j); [lia|auto..].
                + now apply permut_head'.
          }
          { inversion_ Ht.
            - exists [te_i]. split.
              + swap_vec_append.
                apply mint_cons1 with (j0 := i); [lia|].
                apply mint_cons1 with (j0 := i); [lia|].
                constructor.
              + now apply permut_head'.
            - rename te into te_j.
              destruct (PeanoNat.Nat.lt_ge_cases j i).
              2:{ exists (te_i :: te_j :: t1). split.
                  - swap_vec_append.
                    apply mint_cons1 with (j1 := i); [lia|].
                    apply mint_cons1 with (j1 := j); [lia|assumption].
                  - now apply permut_head'.
              }
              { destruct (trace_elems_commute_dec te_i te_j) as [Hte_ij|Hte_ij].
                - apply mint_add0 with (i := i) (te_i := te_i) in Ht; [|lia|assumption].
                  destruct Ht as [t' [Ht' Hperm']].
                  exists (te_j :: t'). split.
                  + swap_vec_append.
                    eapply mint_cons1...
                  + apply permut_cons with (a := te_k) in Hperm'.
                    now apply permut_head.
                - exists (te_i :: te_j :: t1). split.
                  + swap_vec_append.
                    apply mint_cons1 with (j1 := i); [lia|].
                    apply mint_cons2 with (j1 := j); [lia|assumption..].
                  + apply permut_head; [assumption|constructor].
              }
            - rename j0 into i0. cbn in H0.
              destruct (PeanoNat.Nat.lt_ge_cases j i).
              2:{ exists (te_i :: te_i0 :: te_j :: t1). split.
                  + swap_vec_append.
                    apply mint_cons1 with (j0 := i); [lia|].
                    apply mint_cons1 with (j0 := j); [lia|assumption].
                  + now apply permut_head'.
              }
              { destruct (trace_elems_commute_dec te_i te_i0).
                - apply mint_add0 with (i := i) (te_i := te_i) in Ht; [|lia|assumption].
                  destruct Ht as [t' [Ht' Hperm']].
                  exists (te_i0 :: t'). split.
                  + swap_vec_append.
                    eapply mint_cons1...
                  + apply permut_cons with (a := te_k) in Hperm'.
                    now apply permut_head.
                - exists (te_i :: te_i0 :: te_j :: t1). split.
                  + swap_vec_append.
                    apply mint_cons1 with (j0 := i); [lia|].
                    apply mint_cons2 with (j0 := j); [lia|assumption..].
                  + apply permut_head.
                    * assumption.
                    * constructor.
              }
          }
        Qed.

    Мой magnum opus. Часть доказательства про выкидывание из рассмотрения коммутирующих системных вызовов.

    CHayT, 17 Ноября 2020

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

    0

    1. 1
    bp kernelbase!VirtualAlloc " .printf \"\n\n\n\nBytes allocated: %lu (k)\n\n\n\",(@rdx/0n1024); k 8"

    Давайте течь от windbg

    MAPTbIwKA, 13 Ноября 2020

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