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

    0

    1. 1
    Давайте флудить и троллить ;-)

    Давайте флудить и троллить ;-)

    bot_batbot_batbot, 27 Октября 2021

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

    −1

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

    #101: https://govnokod.ru/27511 https://govnokod.xyz/_27511
    #102: https://govnokod.ru/27518 https://govnokod.xyz/_27518
    #103: https://govnokod.ru/27526 https://govnokod.xyz/_27526
    #104: https://govnokod.ru/27534 https://govnokod.xyz/_27534
    #105: https://govnokod.ru/27544 https://govnokod.xyz/_27544
    #106: https://govnokod.ru/27552 https://govnokod.xyz/_27552
    #107: https://govnokod.ru/27554 https://govnokod.xyz/_27554
    #108: https://govnokod.ru/27557 https://govnokod.xyz/_27557
    #109: https://govnokod.ru/27581 https://govnokod.xyz/_27581
    #110: https://govnokod.ru/27610 https://govnokod.xyz/_27610
    #111: https://govnokod.ru/27644 https://govnokod.xyz/_27644
    #112: https://govnokod.ru/27648 https://govnokod.xyz/_27648
    #113: https://govnokod.ru/27652 https://govnokod.xyz/_27652
    #114: https://govnokod.ru/27659 https://govnokod.xyz/_27659
    #115: https://govnokod.ru/27665 https://govnokod.xyz/_27665
    #116: https://govnokod.ru/27671 https://govnokod.xyz/_27671
    #117: https://govnokod.ru/27675 https://govnokod.xyz/_27675
    #118: https://govnokod.ru/27685 https://govnokod.xyz/_27685
    #119: https://govnokod.ru/27701 https://govnokod.xyz/_27701
    #120: https://govnokod.ru/27703 https://govnokod.xyz/_27703
    #121: https://govnokod.ru/27710 https://govnokod.xyz/_27710
    #122: https://govnokod.ru/27728 https://govnokod.xyz/_27728
    #123: https://govnokod.ru/27729 https://govnokod.xyz/_27729
    #124: https://govnokod.ru/27730 https://govnokod.xyz/_27730
    #125: https://govnokod.ru/27732 https://govnokod.xyz/_27732
    #126: https://govnokod.ru/27733 https://govnokod.xyz/_27733
    #127: https://govnokod.ru/27737 https://govnokod.xyz/_27737
    #128: https://govnokod.ru/27742 https://govnokod.xyz/_27742
    #129: https://govnokod.ru/27747 https://govnokod.xyz/_27747
    #130: https://govnokod.ru/27755 https://govnokod.xyz/_27755

    nepeKamHblu_nemyx, 23 Октября 2021

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

    +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
    waiting_for_data(info, {Driver,Socket,Data},
                     #state{socket=Socket, driver=Driver, driver_mod=DriverMod, peer=Peer, control=Control, list=List} = State) ->
        %% The meat of the whole project: process a function call and return
        %% the data
        try erlang:binary_to_term(Data) of
            {{CallType,M,F,A}, Caller} when CallType =:= call; CallType =:= async_call ->
                {ModVsnAllowed, RealM} = check_module_version_compat(M),
                case check_if_module_allowed(RealM, Control, List) of
                    true ->
                        case ModVsnAllowed of
                            true ->
                                WorkerPid = erlang:spawn(?MODULE, call_worker, [CallType, RealM, F, A, Caller, Socket, Driver, DriverMod]),
                                ?log(debug, "event=call_received driver=~s socket=\"~s\" peer=\"~s\" caller=\"~p\" worker_pid=\"~p\"",
                                     [Driver, gen_rpc_helper:socket_to_string(Socket), gen_rpc_helper:peer_to_string(Peer), Caller, WorkerPid]),
                                {keep_state_and_data, gen_rpc_helper:get_inactivity_timeout(?MODULE)};
                            false ->
                                ?log(debug, "event=incompatible_module_version driver=~s socket=\"~s\" method=~s module=~s",
                                     [Driver, gen_rpc_helper:socket_to_string(Socket), CallType, RealM]),
                                waiting_for_data(info, {CallType, Caller, {badrpc,incompatible}}, State)
                        end;
                    false ->
                        ?log(debug, "event=request_not_allowed driver=~s socket=\"~s\" control=~s method=~s module=~s",
                             [Driver, gen_rpc_helper:socket_to_string(Socket), Control, CallType, RealM]),
                        waiting_for_data(info, {CallType, Caller, {badrpc,unauthorized}}, State)
                end;
            {cast, _M, _F, _A} = Cast ->
                handle_cast(Cast, State),
                {keep_state_and_data, gen_rpc_helper:get_inactivity_timeout(?MODULE)};
            BatchCast when is_list(BatchCast) ->
                [handle_cast(Cast, State) || Cast <- BatchCast],
                {keep_state_and_data, gen_rpc_helper:get_inactivity_timeout(?MODULE)};
            {abcast, Name, Msg} ->
                _Result = case check_if_module_allowed(erlang, Control, List) of
                    true ->
                        ?log(debug, "event=abcast_received driver=~s socket=\"~s\" peer=\"~s\" process=~s message=\"~p\"",
                             [Driver, gen_rpc_helper:socket_to_string(Socket), gen_rpc_helper:peer_to_string(Peer), Name, Msg]),
                        Msg = erlang:send(Name, Msg);
                    false ->
                        ?log(debug, "event=request_not_allowed driver=~s socket=\"~s\" control=~s method=~s",
                             [Driver, gen_rpc_helper:socket_to_string(Socket), Control, abcast])
                    end,
                {keep_state_and_data, gen_rpc_helper:get_inactivity_timeout(?MODULE)};
            {sbcast, Name, Msg, Caller} ->
                Reply = case check_if_module_allowed(erlang, Control, List) of
                    true ->
                        ?log(debug, "event=sbcast_received driver=~s socket=\"~s\" peer=\"~s\" process=~s message=\"~p\"",
                             [Driver, gen_rpc_helper:socket_to_string(Socket), gen_rpc_helper:peer_to_string(Peer), Name, Msg]),
                        case erlang:whereis(Name) of
                            undefined -> error;
                            Pid -> Msg = erlang:send(Pid, Msg), success
                        end;
                    false ->
                        ?log(debug, "event=request_not_allowed driver=~s socket=\"~s\" control=~s method=~s",
                             [Driver, gen_rpc_helper:socket_to_string(Socket), Control, sbcast]),
                         error
                end,
                waiting_for_data(info, {sbcast, Caller, Reply}, State);
            ping ->
                ?log(debug, "event=ping_received driver=~s socket=\"~s\" peer=\"~s\" action=ignore",
                     [Driver, gen_rpc_helper:socket_to_string(Socket), gen_rpc_helper:peer_to_string(Peer)]),
                {keep_state_and_data, gen_rpc_helper:get_inactivity_timeout(?MODULE)};
            OtherData ->
                ?log(debug, "event=erroneous_data_received driver=~s socket=\"~s\" peer=\"~s\" data=\"~p\"",
                     [Driver, gen_rpc_helper:socket_to_string(Socket), gen_rpc_helper:peer_to_string(Peer), OtherData]),
                {stop, {badrpc,erroneous_data}, State}
        catch
            error:badarg ->
                {stop, {badtcp,corrupt_data}, State}
        end;
    
    %% Handle the inactivity timeout gracefully
    waiting_for_data(timeout, _Undefined, #state{socket=Socket, driver=Driver} = State) ->
        ?log(info, "message=timeout event=server_inactivity_timeout driver=~s socket=\"~s\" action=stopping",
             [Driver, gen_rpc_helper:socket_to_string(Socket)]),
        {stop, normal, State};
    
    waiting_for_data(info, {DriverClosed, Socket} = Msg, #state{socket=Socket, driver_closed=DriverClosed} = State) ->
        handle_event(info, Msg, waiting_for_data, State);
    
    waiting_for_data(info, {DriverError, Socket, _Reason} = Msg, #state{socket=Socket, driver_error=DriverError} = State) ->
        handle_event(info, Msg, waiting_for_data, State).

    Срочно требуется учитель литературы, чтобы объяснить, что хотел сказать автор.

    CHayT, 22 Октября 2021

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    make_process_name("client", {Node,Key}) when is_atom(Node) ->
        %% This function is going to be called enough to warrant a less pretty
        %% process name in order to avoid calling costly functions
        KeyStr = erlang:integer_to_list(erlang:phash2(Key)),
        NodeStr = erlang:atom_to_list(Node),
        erlang:list_to_atom("gen_rpc.client." ++ NodeStr ++ "/" ++ KeyStr);

    Самый страшный грех, который только возможен в Erlang.

    CHayT, 22 Октября 2021

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

    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
    Let's count a number of rules that can be built in GoL-like automatas. Rule is the matrix that maps some condition of cells to new state.
    Cell itself could be alive or dead. And cell could have 0-8 neighbors. So, there are 2^(2*9) = 262144 different rules. Well known, that
    the majority of them are primitive and produces some pure pattern or just dies in finite number of generations / infinitely fills the world
    with alive cells. We also know that some rules are symmetric to each other as if we just rename (swap colors of) alive and dead cells.
    
    Conway found the most interesting rule from entropy point of view.
    
    2^18 is not so much. Let's take a look at 2D automata known as Rule 110. State 100 keeps cell dead:
    
    100 -> 0
    
    While state 001 makes cell alive:
    
    001 -> 1
    
    In terms of neighborhood, this two rules are indifferent: both means one live neighbor next to dead cell. But in Rule 110 not only a /number/
    of neighbors is meaningful, but the /position/ of separate neighbor.
    
    Let's imagine the GoL-like rule with the same property: we will look not only at number of neighbors, but at their position. What if to have one
    neighbor at north-west gives not the same result as if neighbor were at south-east.
    
    This change gives us much more different rules. If each neighbor is meaningful, then we have 2 ^ 8 different states of neighborhood, and cell
    could be still alive or dead. If I'm not wrong there must be 2 ^ (2 * (2 ^ 8)) = 2 ^ 512 different rules.
    
    Obviously, this space includes Conway's Game of Life and all different rules from that 262144, and gives billions of new ones. Obviously,
    the majority of them are trivial too. But there may be some interesting entropy-like rules different from the Conway's one.
    
    This space is too huge to be discovered manually, and even with bruteforce algorithms too. But evolution algorithms could be used to find rules
    with some special properties.
    
    So, I have two questions:
    
    1) Does this space has a given name, anybody researched that?
    
    2) I will be glad to hear any ideas on how to make this space simpler by excluding symmetric states etc. to save the time for discovering.

    Any cellular nerds here?

    vistefan, 20 Октября 2021

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

    0

    1. 1
    Время вечерней молитвы.

    Примите положение А1. Постарайтесь сосредоточиться, соберитесь с мыслями. Прочтите молитву.
    Инициализируйте процедуру-коллбек.

    nPOnOBeDHuK, 15 Октября 2021

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

    0

    1. 1
    Application was halted by an exception.

    Error 520
    Ray ID: 69e3d61cfd95169b •
    2021-10-14 21:18:17 UTC
    Web server is returning an unknown error
    You
    Browser Working
    Moscow
    Cloudflare Working
    govnokod.ru
    Host Error
    What happened?

    There is an unknown connection issue between Cloudflare and the origin web server. As a result, the web page can not be displayed.
    What can I do?

    If you are a visitor of this website:

    Please try again in a few minutes.

    If you are the owner of this website:

    There is an issue between Cloudflare's cache and your origin web server. Cloudflare monitors for these errors and automatically investigates the cause. To help support the investigation, you can pull the corresponding error log from your web server and submit it our support team. Please include the Ray ID (which is at the bottom of this error page). Additional troubleshooting resources.
    Cloudflare Ray ID: 69e3d61cfd95169b
    Your IP: 91.197.11.236
    Performance & security by Cloudflare

    OCETuHCKuu_nemyx, 15 Октября 2021

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

    0

    1. 1
    Не сочтите за ханжество, но когда же прекратится этот содом?

    забаньте пидора!

    MaaKut, 12 Октября 2021

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

    −2

    1. 1
    2. 2
    В начале сентября Лицокнига представила т.н. "умные очки" - девайс в виде очков со встроенной камерой.
    ФСБ России уже отнесли гаджет к УНПИ. Наказание за использование спецтехники - до 4 лет лишения свободы.

    Не пойму, как можно назвать "шпионским устройством" предмет, который видит и слышит то же, что и его владелец.

    MaaKut, 12 Октября 2021

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

    +2

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    % Totoro sitting in the snow
    % By Noa Hoffmann and Pascal Günthner, 21.12.2020
    \documentclass[tikz,11pt]{{standalone}}
    \usepackage{calligra}
    \usepackage[T1]{fontenc}
    \usetikzlibrary{%
      shapes, shadows, patterns, calc,
      decorations.shapes,
      decorations.fractals,
      decorations.markings,
      decorations.pathmorphing
    }
    
    \colorlet{bodycolor}{black!35!gray!60!brown!98!green}
    \colorlet{bellycolor}{yellow!70!white!92!green}
    
    \tikzset{
       furspot/.pic = {
        \path [draw = black, thick, fill] (0,0)    
        .. controls +(0.3,0)        and  +(0.25,-0.05)   ..  ++(0.35,-.45)
        .. controls +(-0.45,0.25)   and  +(0.1,0)        ..  ++(-0.85,-0.05)
        .. controls +(-0.3,0.1)     and  +(-0.4, 0)      ..  cycle;
       },
       claw/.pic = {
        \path [fill = bodycolor!70, draw] (0,0) arc (0:45:0.2 and 0.8)
                                               arc (135:180:0.2 and 0.8)
        arc (180:360:0.059) -- cycle;
       },
       whiskers/.pic = {
        \path [fill = bodycolor!70,draw] (0,0) arc (0:45:0.05 and 2.3)
                                            arc (135:180:0.3 and 2.3)
        to[out=-90,in=-90] cycle;
       },
       snowflake/.pic = {
       \fill [decoration = Koch snowflake, white] decorate{ decorate{
              decorate{ (-0.5,-0.3) -- ++(60:1) -- ++(-60:1) -- cycle }}};
       \foreach \i in {30, 90, 150, 210, 270, 330} {
            \draw[blue!50!white,very thin] (0,0) -- +(\i:0.3);
            }
        \draw[decoration = Koch snowflake, blue!50!white, very thin]
              decorate{($(0,0)+(60:0.2)$) -- ($(0,0)+(300:0.2)$) --
                       ($(0,0)+(180:0.2)$) -- cycle};
       }
    }
    \tikzset{
      snow/.style   = {decoration = {random steps, segment length = 2mm,
                       amplitude = 0.4mm}, decorate},
      plush/.style  = {decoration = {random steps, segment length = 1mm,
                       amplitude = 0.5mm},decorate}
    }
    
    \begin{document}
    \begin{tikzpicture}[color = bodycolor, draw = black, thick]
    
    %---------------------background and tail----------------------
    % blue sky
    \fill[blue!30!white] (-8cm,-11cm) rectangle (8cm,10cm);
    % random snowflakes
    \foreach \i in {0.1,0.11,...,1}{
      \pic [scale = \i, opacity = 0.9] at (rand*7.5, rnd*18-10.5) {snowflake};}
    % more tiny snowflakes
    %\foreach \i in {0.1,0.11,...,0.5}{
      %\pic [scale = \i, opacity = 0.9] at (rand*7.5, rnd*18-10.5) {snowflake};}
    % cloud with merry christmas
    \node [cloud,aspect = 6.5, cloud puff arc = 120, cloud puffs = 12.9, fill = white,
           color = white] at (0,7) {\Huge M \hspace{9.8cm}.};
    \node [color = red] at (0,7) {\fontsize{50}{80}
                                  \textbf{Merry Christmas \quad }};
    % tail
    \path [draw, fill, rotate = 50] (-4,-7.5) circle (1.5 and 2.2);
    % snowhill
    \fill [draw, gray!6, snow] (-8,-11) to[in=200, out=0] (-3,-7.5) to (3,-7.5)
          to[out=-20, in=180] (8,-11);
    
    %--------------------body-----------------------------------------
    % right ear
    \path [fill, draw] (0.6,2.3)+(-45:1) arc (-60:35:1 and 1.5) 
                       arc (115:210:1 and 1.5);
    % left ear
    \path [fill, draw] (-0.6,2.3)+(-135:1) arc (-120:-215:1 and 1.5)
                       arc (65:-30:1 and 1.5);
    % head
    \path [draw, fill] ($(0,0)+(170:2.5 and 2)$) arc (170:10:2.5 and 2)
                       arc(35:-20: 3 and 2)
            -- ($(0,-0.8)+(200:3 and 2)$) arc (200:145:3 and 2) -- cycle;
    % body
    \path[fill] ($(0,-4)+(200:4 and 4.5)$) arc (200:-20:4 and 4.5);
    
    %----------------------face----------------------------------------
    % left eye
    \path [draw, fill = white] (-1.4,0.7) circle (0.45 and 0.4);
    \fill [black] (-1.2,0.7) circle (0.16);
    \fill [white] (-1.24,0.74) circle (0.03);
    % right eye
    \path [draw, fill = white, thick] (1.4,0.7) circle (0.4);
    \fill [black] (1.25,0.7) circle (0.16);
    \fill [white] (1.20,0.74) circle (0.03);
    % nose
    \path [draw] (0.35, 0.7) .. controls (0.2,0.8) and (-0.2, 0.8)
                             .. (-0.35, 0.7);

    Какое аниме ))) https://texample.net/tikz/examples/totoro/

    CHayT, 08 Октября 2021

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