- 1
- 2
- 3
- 4
#pragma aux __cdecl "_*" \
parm caller [ ] \
value struct float struct routine [eax] \
modify [eax ecx edx]
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1
#pragma aux __cdecl "_*" \
parm caller [ ] \
value struct float struct routine [eax] \
modify [eax ecx edx]
0
.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();
}
да что вы знаете о неоптимизированном коде
+1
#include <stdio.h>
int main(void)
{
(
*********************
** ** ** ***** *
* ** * **** ** *** **
* ** * **** *** * ***
* ** * **** **** ****
* ** * **** *** * ***
* ** ** *** *** **
*********************
printf)("pidor");
}
+1
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
};
красивое
0
// 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;
}
−1
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;
благо поиск по проекту работает
+1
if x == 2 or 3: # если x равен 2 или 3
print('Пыщь.')
Вот уже не впервый раз натыкаюсь на подобный "машинный перевод с русского на питон".
−1
While 1:
twy:
throu Excertion(process(input(> ))
except Exxepton as s:
pront(s)
Я напесавл говнокод. Как вам,
−2
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 часть с кнопкой ПТО, а то не получается спарсить
0
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])
Парочка моих функций на всеобщее обозрение, что скажете?