1. JavaScript / Говнокод #27688

    +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
    alex@ASD-PC:~/TypeScriptCompiler/3rdParty/llvm-wasm/debug/bin$ node mlir-translate.js --help
    OVERVIEW: MLIR Translation Testing Tool
    USAGE: mlir-translate.js [options] <input file>
    
    OPTIONS:
    
    Color Options:
    
      --color                                              - Use colors in output (default=autodetect)
    
    General options:
    
      --dot-cfg-mssa=<file name for generated dot file>    - file name for generated dot file
      --mlir-disable-threading                             - Disabling multi-threading within MLIR
      --mlir-elide-elementsattrs-if-larger=<uint>          - Elide ElementsAttrs with "..." that have more elements than the given upper limit
      --mlir-pretty-debuginfo                              - Print pretty debug info in MLIR output
      --mlir-print-debuginfo                               - Print debug info in MLIR output
      --mlir-print-elementsattrs-with-hex-if-larger=<long> - Print DenseElementsAttrs with a hex string that have more elements than the given upper limit (use -1 to disable)
      --mlir-print-op-on-diagnostic                        - When a diagnostic is emitted on an operation, also print the operation as an attached note
      --mlir-print-stacktrace-on-diagnostic                - When a diagnostic is emitted, also print the stack trace as an attached note
      -o=<filename>                                        - Output filename
      --split-input-file                                   - Split the input file into pieces and process each chunk independently
      Translation to perform
          --deserialize-spirv                                 - deserialize-spirv
          --import-llvm                                       - import-llvm
          --mlir-to-llvmir                                    - mlir-to-llvmir
          --serialize-spirv                                   - serialize-spirv
          --test-spirv-roundtrip                              - test-spirv-roundtrip
          --test-spirv-roundtrip-debug                        - test-spirv-roundtrip-debug
      --verify-diagnostics                                 - Check that emitted diagnostics match expected-* lines on the corresponding line
    
    Generic Options:
    
      --help                                               - Display available options (--help-hidden for more)
      --help-list                                          - Display list of available options (--help-list-hidden for more)
      --version                                            - Display the version of this program
    program exited (with status: 0), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)
    alex@ASD-PC:~/TypeScriptCompiler/3rdParty/llvm-wasm/debug/bin$

    сказ о том как я LLVM на WASM компилял :)

    ASD_77, 28 Сентября 2021

    Комментарии (21)
  2. Lua / Говнокод #27687

    −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
    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
    94. 94
    95. 95
    function throw_artefact(obj)
    	if obj==nil then
    		return
    	end
    	math.randomseed(time_global())
    	local rnd=math.random(10)
    	local sect = obj:section()
    	local lv = obj:level_vertex_id()
    	local gv = obj:game_vertex_id()
    	local pos = obj:position()
    	local off_x = 2
    	local off_y = 1.5
    	local off_z = 2
    	pos.x = pos.x + off_x
    	pos.y = pos.y + off_y
    	pos.z = pos.z + off_z	
    	if lv and gv and pos then
    		math.randomseed(time_global())
    		if string.find(sect, "witches") then			
    			if string.find(sect, "weak") then
    				math.randomseed(time_global())
    				if math.random(4) == 1 then alife():create("af_electra_sparkler", pos, lv, gv) end
    			elseif string.find(sect, "average") then
    				math.randomseed(time_global())
    				if math.random(6) == 1 then alife():create("af_electra_sparkler", pos, lv, gv) end
    				if math.random(4) == 1 then alife():create("af_electra_flash", pos, lv, gv) end
    			else
    				math.randomseed(time_global())
    				if math.random(4) == 1 then alife():create("af_electra_moonlight", pos, lv, gv) end
    				if math.random(5) == 1 then alife():create("af_electra_flash", pos, lv, gv) end
    				if math.random(5) == 1 then alife():create("af_electra_sparkler", pos, lv, gv) end
    			end
    			
    		elseif string.find(sect, "mosquito") then
    			math.randomseed(time_global())
    			if string.find(sect, "weak") then
    				if math.random(6) == 1 then alife():create("af_cristall_flower", pos, lv, gv) end
    			elseif string.find(sect, "average") then
    				if math.random(4) == 1 then alife():create("af_cristall_flower", pos, lv, gv) end
    				if math.random(5) == 1 then alife():create("af_medusa", pos, lv, gv) end
    			else
    				if math.random(6) 	== 1 then alife():create("af_night_star", pos, lv, gv) end
    				if math.random(4)  == 1 then alife():create("af_medusa", pos, lv, gv) end
    				if math.random(5)  == 1 then alife():create("af_cristall_flower", pos, lv, gv) end
    			end
    			
    		elseif string.find(sect, "mincer") then
    			math.randomseed(time_global())
    			if string.find(sect, "weak") then
    				if math.random(6)==1 then alife():create("af_blood", pos, lv, gv) end
    			elseif string.find(sect, "average") then
    				if math.random(5) == 1 then alife():create("af_blood", pos, lv, gv) end
    				if math.random(4) <= 1 then alife():create("af_mincer_meat", pos, lv, gv) end
    			else
    				if math.random(6) == 1 then alife():create("af_soul", pos, lv, gv) end
    				if math.random(4) == 1 then alife():create("af_mincer_meat", pos, lv, gv) end
    				if math.random(5) == 1 then alife():create("af_blood", pos, lv, gv) end
    			end
    			
    		elseif string.find(sect, "gravi") then
    			math.randomseed(time_global())
    			if string.find(sect, "weak") then
    				if math.random(6)==1 then alife():create("af_vyvert", pos, lv, gv) end
    			elseif string.find(sect, "average") then
    				if math.random(4) == 1 then alife():create("af_vyvert", pos, lv, gv) end
    				if math.random(5) <= 1 then alife():create("af_gravi", pos, lv, gv) end
    			else
    				if math.random(6) == 1 then alife():create("af_gold_fish", pos, lv, gv) end
    				if math.random(4) == 1 then alife():create("af_gravi", pos, lv, gv) end
    				if math.random(5) == 1 then alife():create("af_vyvert", pos, lv, gv) end
    			end
    			
    		elseif string.find(sect, "ameba") or string.find(sect, "burning_fuzz") or string.find(sect, "rusty") then
    				math.randomseed(time_global())
    				if math.random(2) == 1 then alife():create("af_rusty_sea-urchin", pos, lv, gv) end
    				if math.random(2) == 1 then alife():create("af_rusty_kristall", pos, lv, gv) end
    				if math.random(2) == 1 then alife():create("af_rusty_thorn", pos, lv, gv) end
    		elseif string.find(sect, "buzz") then
    			if string.find(sect, "weak") then
    				if math.random(6)==1 then alife():create("af_ameba_slug", pos, lv, gv) end
    			elseif string.find(sect, "average") then
    				if math.random(5) == 1 then alife():create("af_ameba_slime", pos, lv, gv) end
    				if math.random(4) <= 1 then alife():create("af_ameba_slug", pos, lv, gv) end
    			else
    				if math.random(5) == 1 then alife():create("af_ameba_mica", pos, lv, gv) end
    				if math.random(5) == 1 then alife():create("af_ameba_slug", pos, lv, gv) end
    				if math.random(4) == 1 then alife():create("af_ameba_slime", pos, lv, gv) end
    			end
    
    elseif string.find(sect, "doggy") then
    			local n=0
    			math.randomseed(time_global())
    			for n=1, math.random(3) do
    				alife():create("dog_weak", pos, lv, gv)
    			end

    Свиток перебирает аномалии на локации и по рандому спавнит в них артефакты.
    Да, блять - мне пришлось изучить луа. Теперь я тоже "золотой хуй".

    Нижние строки отвечают за функционирование самодельной аномалии, которая после полуночи (по ИВ) плодит гипнособак и прочую нечисть. Стаи собак вырезают целые поселения; таким образом, я стал поистине сталкером. Так как я давно фриплею, надо разнообразить ко-ко-корутину.

    CBuHOKYP, 27 Сентября 2021

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

    0

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

    #88: https://govnokod.ru/27432 https://govnokod.xyz/_27432
    #89: https://govnokod.ru/27435 https://govnokod.xyz/_27435
    #90: https://govnokod.ru/27439 https://govnokod.xyz/_27439
    #91: https://govnokod.ru/27449 https://govnokod.xyz/_27449
    #92: https://govnokod.ru/27460 https://govnokod.xyz/_27460
    #93: https://govnokod.ru/27463 https://govnokod.xyz/_27463
    #94: https://govnokod.ru/27466 https://govnokod.xyz/_27466
    #95: https://govnokod.ru/27473 https://govnokod.xyz/_27473
    #96: https://govnokod.ru/27478 https://govnokod.xyz/_27478
    #97: https://govnokod.ru/27484 https://govnokod.xyz/_27484
    #98: https://govnokod.ru/27495 https://govnokod.xyz/_27495
    #99: https://govnokod.ru/27504 https://govnokod.xyz/_27504
    #100: https://govnokod.ru/27508 https://govnokod.xyz/_27508
    #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

    nepeKamHblu_nemyx, 27 Сентября 2021

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

    +1

    1. 1
    Давайте займёмся анальным сексом.

    .

    pdro11, 26 Сентября 2021

    Комментарии (1)
  5. JavaScript / Говнокод #27681

    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
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    const range = (count) => Array.from(Array(count).keys());
    class Matrix {
    
        static Dot(A, B) {
            // Dot production
            const wA = A[0].length;
            const hA = A.length;
            const wB = B[0].length;
            const hB = B.length;
    
            if (wA != hB)
            {
                throw "A width != B height";
            }
    
            const C = range(hA).map((_, i) => range(wB).map((_, j) => 0));
    
            for (let i = 0; i < hA; ++i)
                for (let j = 0; j < wB; ++j) {
                    let sum = 0;
    
                    for (let k = 0; k < wA; ++k) {
                        const a = A[i][k];
                        const b = B[k][j];
                        sum += a * b;
                    }
    
                    C[i][j] = sum;
                }
    
            return C;                
        }
    
        static Mul(A, B) {
            // Dot production
            const wA = A[0].length;
            const hA = A.length;
            const wB = B[0].length;
            const hB = B.length;
    
            if (wA != wB || hA != hB)
            {
                throw "A width != B width, A height != B height";
            }
    
            const C = range(hA).map((_, i) => range(wA).map((_, j) => A[i][j] * B[i][j]));
            return C;
        }            
    
        static Add(A, B) {
            const wA = A[0].length;
            const hA = A.length;
            const wB = B[0].length;
            const hB = B.length;
    
            if (wA != wB || hA != hB)
            {
                throw "A width != B width, A height != B height";
            }
    
            const C = range(hA).map((_, i) => range(wA).map((_, j) => A[i][j] + B[i][j]));
            return C;
        }
    
        static Sub(A, B) {
            const wA = A[0].length;
            const hA = A.length;
            const wB = B[0].length;
            const hB = B.length;
    
            if (wA != wB || hA != hB)
            {
                throw "A width != B width, A height != B height";
            }
    
            const C = range(hA).map((_, i) => range(wA).map((_, j) => A[i][j] - B[i][j]));
            return C;
        }
    
            static Translate(A, shift) {
            const wA = A[0].length;
            const hA = A.length;
    
            const R = range(hA).map((_, i) => range(wA).map((_, j) => A[i][j] + shift));
            return R;                        
        }         
    
        static Sigmoid(A) {
            const wA = A[0].length;
            const hA = A.length;
    
            const R = range(hA).map((_, i) => range(wA).map((_, j) => 1 / (1 + Math.exp(-A[i][j]))));
            return R;                                        
        }
    //...
    }

    лаба по математике матрици :)

    ASD_77, 26 Сентября 2021

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

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    Тред в котором я после обновления rt ядра на обычное нереалтаймовое чиню связку jack2, jack2-dbus и pulseaudio-jack
    
    Задача в том, чтобы корректно стартовал jack_control start, показывался pulseaudio-jack-sink и можно было прокинуть звук из па приложений в джек.
    
    На данный момент утрачена возможность старта, какая-то хуйня с правами или чем-то таким. Юзер у меня задобавлен в группы audio и realtime, для него
    написаны какие-то повышенные привилегии. С rt-ядром это работало. Сейчас хуй знает почему, но запущенный от юзера QJackCtl не имеет доступа к
    сокетам джек-сервера в /dev/shm, которые все root root.

    vistefan, 25 Сентября 2021

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

    +3

    1. 1
    2. 2
    3. 3
    Как же я ненавижу безвузных дебилов
    Учеников ВУЗА, которые НИХУЯ не могут.
    Нахуя в ВУЗ поступать, если ты ДЕБИЛ и не сможешь ни одной лабы выполнить?

    6E3BY3HuK, 25 Сентября 2021

    Комментарии (334)
  8. C++ / Говнокод #27678

    +1

    1. 1
    for (double x = xn, p = 1, n = 0, y = 0; x > xk ? cout<<p<<' '<<n, false : true; x += dx, y = cos(x) + x*5. / 2, y > 0 ? p *= y : y < 0 ? n++ : n );

    Попросили помочь с задачей:
    > Определить произведение негативных и количество позитивных значений функции y=cos(x)+x*5./2, если значение x изменяется от xn до xk с шагом dx.
    Я постарался, как мог, всё-таки язык мне не очень близок (немного помогли). Возможно, ещё есть, куда "улучшить".

    MetallDoctor, 23 Сентября 2021

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

    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
    а давайте сравним размеры скомпилированного EXE под Винду и Убунту и посмотрим сколько лет надо ждать когда это Г будет собранно в ЕХЕ файл
    
    windows: (+pdb)  
    tsc.exe   159M
    tsc.pdb  872M
    
    ubuntu: (+debug info)
    tsc               1290M (из них debug info 1153M)
    
    
    а вы знаете сколько лет мне надо ждать что бы скомпилять такие файлы? особенно на убунте?
    
    И какой "ур-д" предлагал мне использовать убунту а не винду :)?

    сабж в теме

    ASD_77, 22 Сентября 2021

    Комментарии (190)
  10. PHP / Говнокод #27676

    −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
    <?php
     session_start();
     $db = mysqli_connect("localhost", "root","root");
     mysqli_select_db($db,"Имябазы");
          function send_request(act, login = null, password = null) {
                var var1 = null;
                var var2 = null;
                if(act == 'auth') {
                    var1 = login;
                    var2 = password;
                } else if(act == 'send'){
                var1 = messageInput.value;
                }
    }           $.post('message.php',{
                act: act,
                var1: var1,
                var2: var2
                }).done(function (data){
                message_container.innerHTML = data;
                if(act == 'send') {
                    messageInput.value = '';
                    }
                });

    Выдает ошибку "Parse error: syntax error, unexpected ',', expecting variable (T_VARIABLE) in C:\OpenServer\domains\connect\send.php on line 5"
    я не могу понять, что не так с запятыми?

    JloJle4Ka, 22 Сентября 2021

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