1. Си / Говнокод #28061

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    #pragma aux __cdecl "_*"                            \
                    parm caller [ ]                          \
                    value struct float struct routine [eax] \
                    modify [eax ecx edx]

    kcalbCube, 28 Февраля 2022

    Комментарии (11)
  2. Assembler / Говнокод #28059

    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
    .org 80h
    inc:
    	push %bp
    	mov %bp %sp
    	sub %sp 0010h
    	mov [%bp + FFFEh] %sp
    	mov [%bp + FFFCh] %b
    	lea %a [%bp + FFFCh]
    	mov %a [%a]
    	push %a
    	inc %a
    	pop %si
    	mov [%si] %a
    	jmp @.return.inc
    .return.inc:
    	mov %sp %bp
    	pop %bp
    	ret
    main:
    	push %bp
    	mov %bp %sp
    	sub %sp 0010h
    	mov [%bp + FFFCh] %sp
    	memset [%bp + FFFEh] 0002h 0h
    	lea %a [%bp + FFFEh]
    	push %a
    	mov %a 0000h
    	pop %si
    	mov [%si] %a
    .L.begin.1:
    	mov %a 0001h
    	cmp %a 0h
    	jz @.0
    	lea %a [%bp + FFFEh]
    	push %a
    	pop %b
    	call @inc
    	push %a
    	mov %a 0050h
    	pop %si
    	cmp %si %a
    	jgz @.compare3
    	mov %al 1h
    	.compare3:
    	mov %ah 0h
    	cmp %a 0h
    	jz  @.else.2
    	jmp @.0
    	jmp @.end.2
    .else.2:
    .end.2:
    .1:
    	jmp @.L.begin.1
    .0:
    .return.main:
    	mov %sp %bp
    	pop %bp
    	ret
    start:
    	mov %sp FFFFh
    	call @main
    .return.start:
    	int 0h
    
    <-------------------->
    
    short inc(short* i)
    {
    	return ++(*i);
    }
    
    void main(void)
    {
    	short i = 0s;
    	while(1) 
    	{
    		if(inc(&i) > 0x50)
    			break;
    	}
    }
    
    void start(void)
    {
    	asm("mov %sp FFFFh");
    	main();
    }

    да что вы знаете о неоптимизированном коде

    kcalbCube, 27 Февраля 2022

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

    +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
    #include <stdio.h>
    
    int main(void)
    {
    	(
    		*********************
    		**  **     ** ***** *
    		* ** * **** ** *** **
    		* ** * **** *** * ***
    		* ** * **** **** ****
    		* ** * **** *** * ***
    		* ** **    *** *** **
    		*********************
    	printf)("pidor");
    }

    kcalbCube, 26 Февраля 2022

    Комментарии (13)
  4. Си / Говнокод #28056

    +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
    static char *cast_table[][11] = {
      // i8   i16     i32     i64     u8     u16     u32     u64     f32     f64     f80
      {NULL,  NULL,   NULL,   i32i64, i32u8, i32u16, NULL,   i32i64, i32f32, i32f64, i32f80}, // i8
      {i32i8, NULL,   NULL,   i32i64, i32u8, i32u16, NULL,   i32i64, i32f32, i32f64, i32f80}, // i16
      {i32i8, i32i16, NULL,   i32i64, i32u8, i32u16, NULL,   i32i64, i32f32, i32f64, i32f80}, // i32
      {i32i8, i32i16, NULL,   NULL,   i32u8, i32u16, NULL,   NULL,   i64f32, i64f64, i64f80}, // i64
    
      {i32i8, NULL,   NULL,   i32i64, NULL,  NULL,   NULL,   i32i64, i32f32, i32f64, i32f80}, // u8
      {i32i8, i32i16, NULL,   i32i64, i32u8, NULL,   NULL,   i32i64, i32f32, i32f64, i32f80}, // u16
      {i32i8, i32i16, NULL,   u32i64, i32u8, i32u16, NULL,   u32i64, u32f32, u32f64, u32f80}, // u32
      {i32i8, i32i16, NULL,   NULL,   i32u8, i32u16, NULL,   NULL,   u64f32, u64f64, u64f80}, // u64
    
      {f32i8, f32i16, f32i32, f32i64, f32u8, f32u16, f32u32, f32u64, NULL,   f32f64, f32f80}, // f32
      {f64i8, f64i16, f64i32, f64i64, f64u8, f64u16, f64u32, f64u64, f64f32, NULL,   f64f80}, // f64
      {f80i8, f80i16, f80i32, f80i64, f80u8, f80u16, f80u32, f80u64, f80f32, f80f64, NULL},   // f80
    };

    красивое

    kcalbCube, 26 Февраля 2022

    Комментарии (2)
  5. Си / Говнокод #28055

    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
    // Takes a printf-style format string and returns a formatted string.
    char *format(char *fmt, ...) {
      char *buf;
      size_t buflen;
      FILE *out = open_memstream(&buf, &buflen);
    
      va_list ap;
      va_start(ap, fmt);
      vfprintf(out, fmt, ap);
      va_end(ap);
      fclose(out);
      return buf;
    }

    kcalbCube, 25 Февраля 2022

    Комментарии (6)
  6. Си / Говнокод #28054

    −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
    typedef enum {
      FILE_NONE, FILE_C, FILE_ASM, FILE_OBJ, FILE_AR, FILE_DSO,
    } FileType;
    
    StringArray include_paths;
    bool opt_fcommon = true;
    bool opt_fpic;
    
    static FileType opt_x;
    static StringArray opt_include;
    static bool opt_E;
    static bool opt_M;
    static bool opt_MD;
    static bool opt_MMD;
    static bool opt_MP;
    static bool opt_S;
    static bool opt_c;
    static bool opt_cc1;
    static bool opt_hash_hash_hash;
    static bool opt_static;
    static bool opt_shared;
    static char *opt_MF;
    static char *opt_MT;
    static char *opt_o;
    
    static StringArray ld_extra_args;
    static StringArray std_include_paths;
    
    char *base_file;
    static char *output_file;
    
    static StringArray input_paths;
    static StringArray tmpfiles;

    благо поиск по проекту работает

    kcalbCube, 25 Февраля 2022

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

    +1

    1. 1
    2. 2
    if x == 2 or 3: # если x равен 2 или 3
        print('Пыщь.')

    Вот уже не впервый раз натыкаюсь на подобный "машинный перевод с русского на питон".

    Vindicar, 25 Февраля 2022

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

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    While 1:
        twy:
           throu Excertion(process(input(> ))
        except Exxepton as s:
          pront(s)

    Я напесавл говнокод. Как вам,

    BOPEHHOE, 24 Февраля 2022

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

    −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
    96. 96
    97. 97
    98. 98
    99. 99
    from lib2to3.pgen2 import token
    import logging
    import re
    
    import requests
    import pandas as pd
    
    from bs4 import BeautifulSoup
    
    from aiogram import Bot, Dispatcher, executor, types
    from aiogram.dispatcher.filters import Text
    
    bot = Bot(token="5243563589:AAHZL9JyJ0Q36dBpuXcjgzDuM-0n9OEWhpk")
    dp = Dispatcher(bot)
    logging.basicConfig(level=logging.INFO)
    
    sso = "http://pinskgptklp.brest.by/sso.html"
    pto = "http://pinskgptklp.brest.by/pto2.html"
    logg = ""
    
    response = requests.get(sso)
    soup = BeautifulSoup(response.text, "lxml")
    quotes = soup.find_all("tbody")
    t = str(quotes)
    arr = t.split('</tbody>, ')
    stroka = arr[1]
    stroki = stroka.split('<tr')
    
    i = 1
    j = 0
    
    tablica = [0] 8
    ttt = [[]] 8
    
    tab1 = [0] len(stroki)
    while i < len(tab1):
    j = 0
    tab1 = re.sub(r'\n+', '\n', stroki)
    tab1 = re.sub(r'\<[^>]\>', '', "<" + stroki).split('\n')
    while j < len(tab1):
    if tab1[j] != "" and tab1[j] != "]":
    logg += '|' + tab1[j]
    
    j = j + 1
    
    logg += '~'
    i = i + 1
    
    q = []
    rem = logg.split('~')
    o = 0
    while o < len(rem):
    q.append(rem.split('|'))
    o = o + 1
    
    o = 0
    while o < len(rem):
    o = o + 1
    
    print(q)
    
    sso_sh = q[4][1] + q[4][2] + q[4][3] + q[4][4] + '\n' + q[0][2] + " - " + q[4][5] + '\n' + q[0][3] + " - " + q[4][8]
    sso_p = q[5][1] + q[5][2] + q[5][3] + q[5][4] + '\n' + q[0][2] + " - " + q[5][5] + '\n' + q[0][3] + " - " + q[5][8]
    
    @dp.message_handler(commands="start")
    async def cmd1(message: types.Message):
    keyboard = types.InlineKeyboardMarkup()
    keyboard.add(types.InlineKeyboardButton(text="ПТО", callback_data="n1"))
    keyboard.add(types.InlineKeyboardButton(text="CCO", callback_data="n2"))
    await message.answer("Действия:", reply_markup=keyboard)
    
    #@dp.message_handler(Text(equals="Показать что-то"))
    #async def cmd2(message: types.Message):
    #await message.reply(stroki[1])
    
    @dp.callback_query_handler(text="see")
    async def see(call: types.CallbackQuery):
    await call.message.answer("123123123")
    await call.answer()
    
    @dp.callback_query_handler(text="n1")
    async def next(call: types.CallbackQuery):
    keyboard = types.InlineKeyboardMarkup()
    keyboard.add(types.InlineKeyboardButton(text=q[4][3], callback_data="pto1"))
    keyboard.add(types.InlineKeyboardButton(text=q[5][3], callback_data="pto2"))
    await call.message.answer("Что именно?", reply_markup=keyboard)
    await call.answer()
    
    @dp.callback_query_handler(text="n2")
    async def next(call: types.CallbackQuery):
    keyboard = types.InlineKeyboardMarkup()
    keyboard.add(types.InlineKeyboardButton(text=q[4][3], callback_data="sso1"))
    keyboard.add(types.InlineKeyboardButton(text=q[5][3], callback_data="sso2"))
    await call.message.answer("Что именно?", reply_markup=keyboard)
    await call.answer()
    
    @dp.callback_query_handler(text="sso1")
    async def next(call: types.CallbackQuery):
    await call.message.answer(sso_sh)

    Саб, нужна помощь с ботом, нужно сделать 2 часть с кнопкой ПТО, а то не получается спарсить

    dddccc, 24 Февраля 2022

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

    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
    def count_dupes(serials):
        dupes = {}
        for item in serials:
            if dupes.get(item):
                dupes[item] = dupes.get(item) + 1
            else:
                dupes[item] = 1
        return dupes
    
    factory = Functions.get_factory()
        for serial in dupes: 
            for row in factory:
                if serial == row['serial']:
                    result[serial] = row
                    keys = row.keys()
                    for key in keys:
                        if not row[key] == 0:
                            print(key, row[key])

    Парочка моих функций на всеобщее обозрение, что скажете?

    Sciti, 22 Февраля 2022

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