from random import choice
import telebot
from telebot import types
API_TOKEN = ""
bot = telebot.TeleBot(API_TOKEN)
guessing_game = {
0: {'question': 'Кто убил Кеннеди?', 'choices': ['Lee Harvey Oswald', 'Pamela Denise Anderson', 'Joseph Robinette Biden'] , 'answer': 'Lee Harvey Oswald'},
1: {'question': 'Кто президент России?', 'choices': ['Горбачёв', 'Путин', 'Медведев'] , 'answer': 'Путин'},
2: {'question': 'Что?Где?Когда?', 'choices': ['1', '2', '3'] , 'answer': '2'}
}
answer_guessing_game = {
0: 'Lee Harvey Oswald',
1: 'Путин',
2: '2',
}
@bot.message_handler(commands=["start"])
def start_message(message):
keyboardmain = types.InlineKeyboardMarkup()
ask_button = types.InlineKeyboardButton(text="Угадывать!", callback_data="play")
keyboardmain.add(ask_button)
try:
bot.send_message(message.chat.id, "Привет, я бот помощник по тестам!", reply_markup=keyboardmain)
except telebot.apihelper.ApiException:
print('Error')
@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
if call.data == "play":
keyboard_main = types.InlineKeyboardMarkup()
question_id = choice(list(guessing_game.keys()))
question = guessing_game[question_id]['question']
choices = guessing_game[question_id]['choices']
choices_buttons = [types.InlineKeyboardButton(text=x, callback_data=f"{question_id}_answer_{x}") for x in choices]
keyboard_main.add(*choices_buttons)
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text=question, reply_markup=keyboard_main)
if "answer" in call.data:
question_id, _, answer = call.data.split('_')
right_answer = answer_guessing_game.get(int(question_id))
keyboard = types.InlineKeyboardMarkup()
if right_answer == answer:
back_button = types.InlineKeyboardButton(text="back", callback_data="play")
keyboard.add(back_button)
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text="Правильно!", reply_markup=keyboard)
else:
back_button = types.InlineKeyboardButton(text="back", callback_data="play")
keyboard.add(back_button)
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text="Не правильно!", reply_markup=keyboard)
if __name__ == '__main__':
bot.infinity_polling()
import os
print('Start')
file = r"C:\Users\ashab\Downloads\libbinaryninjacore.1.dylib\libbinaryninjacore.1.dylib"
search_pattern = b'\xD6\x6C\x9E\xC8\xDC\x86\xF3\xDB\x68\xB2\xB8\xBF\x66\x05\x51\x63\x05\x27\xF4\xEC\x31\x19\x3B\x69\x74\x3E\xE1\xE6\x50\xAB\xB1\xA2\x27\x63\x61\xB0\x03\x83\xF2\x3D\x66\x68\x0A\x68\x1E\xB3\xB8\xDC\x4A\x7F\x91\x51\xE7\x32\xF6\xD4\xB7\x69\x63\xD1\x12\x2A\x8F\x58\x99\x73\x6B\xDE\x7B\x91\x1C\x9F\x2A\x55\xE4\x2D\xAA\x85\x66\xCB\xAD\x43\xBE\x68\x1B\x2F\x38\x15\x49\xC3\x42\xFC\x19\xF1\xF5\x93\xD2\x44\x54\x74\x1D\x17\xAD\xF2\x21\xF6\x33\xA5\xAC\x4D\xE8\x5E\xF6\x02\x36\x28\xF8\xF9\x36\x8C\x61\x6B\x19\x49\xD7\x02\xC4\x19\x5D\x41\x1D\xD5\x1A\x2F\x1B\x84\x59\x83\x22\x99\x03\x5E\xEF\x68\xBE\x1E\xE3\x7D\x92\xA4\xDF\x75\x8F\x58\x92\xC8\xAA\xF6\x35\xA4\x06\xA7\xAD\x4F\x9E\xBF\x03\xEB\x0E\x44\xDA\x48\x5B\xBB\xF0\x98\x3D\xF8\x39\x20\x42\x0A\xE8\x24\xF4\xDA\x3C\xC9\xD1\x69\x95\x35\x63\x5F\x71\x51\xB2\x79\xD2\x71\x44\xB8\xA2\x9A\x65\xB6\xE2\x8C\xCB\xAF\xFD\xDB\xAB\x3F\xDE\x84\xCB\xF0\xE1\xFF\x4E\x28\xAB\x65\x19\x7E\xC9\xFD\x02\x7D\xCD\x7A\xF5\x28\x80\xBF\x14\x32\x75\x78\x2F\x07\x82\xC3\x04\x3B\x47\x02\x04\xB6\x3C\x40\xFC\x7B\xAF\x33'
replace_bytes = b'\xD2\xBF\x80\x69\xB2\x98\x61\x8B\x54\x27\x2B\x13\xCE\x40\x2C\x37\x82\x6D\x90\x6F\xA0\xDB\x47\xC9\x16\xE3\x04\xD6\x1C\xFE\x84\x73\x06\xAD\x17\x63\xA3\x32\xA6\xFA\xCB\xEF\x13\x3D\xE5\xE6\x34\xB3\x33\x73\x9E\xFF\xFE\x9F\x75\x13\xF7\xC3\x8C\xDF\x4E\xB7\xCE\x27\xB5\x6B\x72\x84\x24\xF9\x41\x0D\xB4\xCD\x3A\xB3\x3D\x2A\x36\x71\x23\x47\x0D\x62\x32\x42\x11\x87\x6D\x83\xC1\x5B\x59\xFB\x7A\x4D\x5A\x74\xE5\x6F\x9E\x44\x3D\xBE\xFF\x30\x28\x9D\x3E\x4F\x84\xE5\x8E\x6A\xB2\x3A\xD4\xF4\x38\x70\x03\x46\x05\xE6\x8E\xDF\x1F\xF9\x02\x56\xAA\x02\x7C\x61\x02\x98\x1B\x8A\x77\x42\xC3\xDC\xFC\x53\x6A\x4D\x98\xC4\xE2\x27\x02\xF2\xBF\xFD\xE2\x98\x5E\x23\x2A\x24\x46\xD5\x75\x0E\x20\xED\xD2\x7E\x59\xFA\x24\x75\xCF\xF2\x88\x2C\xA3\x33\x47\x20\x9F\x62\xDE\xD6\x96\x5D\x85\xB0\x3B\xDE\x6E\x02\xB9\x9F\x68\x0F\x33\xB7\xDC\x08\xF8\x73\x0C\x0B\xCE\x62\x25\x6F\xCA\x56\x13\x21\x3A\x11\x82\xC0\x0A\x36\xA9\xD4\x96\x62\x9D\x15\xC1\xB6\x04\x55\x0F\x97\x38\x8C\x2D\xFD\x60\xCC\x8D\xC1\x5C\xF5\xD6\x1A\x82\x91\x67\xCE\x07\xF9\x79\x81\x68\xC9\x2D\x60\x37\x47'
with open(file, 'rb') as f:
file_bytes = f.read()
position = file_bytes.find(search_pattern)
if position:
print(f'Search pattern position - {position}')
file_bytes.replace(search_pattern, replace_bytes)
out_file_path = os.path.dirname(file)
new_file_name = 'result.dylib'
with open(os.path.join(out_file_path, new_file_name), 'wb') as f:
f.write(file_bytes)
print('File update success')
else:
print('Pattern not found')
print('Exit')
public class SourEmailer {
SMTPNotifierWithCcImpl myMail = new SMTPNotifierWithCcImpl()
Logger logger = LoggerFactory.getLogger(SourEmailer.class)
MattermostNotifierImpl matterSend = new MattermostNotifierImpl()
SourCompanies sourSet = new SourCompanies()
HashSet sourHashSet = sourSet.getSourCompanies()
public booleand sendEmailForSour(Issue issue, String message) {
int errors = 0
final String copyForMail = "${issue.getReporter()}"
int numberSet = sourHashSet.size()
def pool = Executors.newFixedThreadPool(numberSet)
sourHashSet.each { comp ->
String themeEmail = "Заявка ${issue.getKey()}. Статус - ${issue.getStatus().name}."
String emailRequestTemplate = "${comp.salesContact}, добрый день.\n\nБольшое спасибо за интерес, проявленный к заявке: ${issue.key}, '${issue.summary}'."
String finalBodyEmail = emailRequestTemplate + message
try {
pool.submit{myMail.sendMessage(comp.email, copyForMail, themeEmail, finalBodyEmail, 'text/plain')}
logger.info("Письмо отправлено ${comp.email}")
} catch (Exception ex) {
logger.error("Письмо не отправлено ${comp.email}")
logger.error("Ошибка ${ex.message}")
errors += 1
}
}
if (errors > 0) {
return false as booleand
} else {
return true as booleand
}
} // sendEmailForSour
} // SourEmailer
SELECT
p.*,
pp.*
FROM
`Product` p
LEFT JOIN `Popular_product` pp ON p.ID = pp.ID_regularProduct;
users_text = [message.text]
mistake = 0
def mistake1(word):
global mistake
if s =='a':
mistake += 1
print("Mistake increment")
else:
mistake -= 1
print("Mistake decrement")
if __name__ == "__main__":
ask_flag = True
while ask_flag:
try:
s = input("Input word: ")
if s != "q":
mistake1(s)
except KeyboardInterrupt:
ask_flag = False
print(f"Current Count mistake = {mistake}")
print('Exit')
def _report_GaussianNB(self):
report_GaussianNB = classification_report(y_train.values, pred_train_GaussianNB)
return report_GaussianNB
message = "\n".join(f"[{elem['clan_tag']}] {elem['nickname']} - {elem['score']}" for elem in data['result'])
await ctx.send(message)
[PWNZ] Luc1que_ - 6585
[CONTX] boonchlchi - 6478
[2XX] perdyyn - 6421
[MERCV] BrokenSouI - 6390
[CUMZN] Ego_281 - 6348
[CXNDY] lex_2785 - 6331
[A_FOX] nE_BuHoBeH_B_cJIuBe_ - 6300
[SOULC] Afonin17 - 6292
[_S0L_] TTeJlbMeHbKa - 6269
[BRAWO] RenamedUser_69163298 - 6251
[NAVI] MOJIODOU_3JIODEU_99 - 6215
[PINK-] Sk1leks_YouTube - 6209
[ZOMBI] lllllllllllllIlIlIlIIl - 6183
[] V_Solo_Slivay - 6152
[2_POY] extra_slim - 6144
[] KUBYK__RUBYK_ - 6095
[SUBRA] 1kiss21 - 6060
[UGKP] FURY_CHALLENGER_HELL_UAS - 6053
[VESNA] Andrej_kondrashyov - 6045
[KASTV] HoCKu_B_MoLoKe - 6036
[COURT] MuHucTP_OxPaHbI - 6017
[TR-L] 40peJlb - 6016
[PINK-] aHcKuJlbHblu_MeJloMaH - 6003
[] Grisha_X_x_X - 6001
[-DAM-] BcE_JLeHHa_9_6EcKO_He4Ha - 5958
[PWNZ] Riqwerty - 5913
[OXLKI] Evil_GrannYYY - 5904
[M_E_F] Smisterr - 5903
[] JlerKo_u_I7p0cTo - 5898
[ABQBA] yanakrzh - 5883
CREATE TABLE custom (
meta_id INTEGER,
post_id INTEGER,
meta_key VARCHAR(32),
meta_value VARCHAR(32)
);
INSERT INTO
custom
VALUES
(6, 2, 'seo_descr', 'Описание стр 2');
INSERT INTO
custom
VALUES
(7, 2, 'seo_title', 'Заголовок стр 2');
INSERT INTO
custom
VALUES
(8, 1, 'seo_descr', 'Описание стр 1');
INSERT INTO
custom
VALUES
(9, 1, 'seo_title', 'Заголовок стр 1');
SELECT
DISTINCT t1.post_id AS id,
t2.meta_value AS seo_title,
t3.meta_value AS seo_descr
FROM
custom t1
LEFT JOIN custom t2 ON t1.post_id = t2.post_id
AND t2.meta_key = 'seo_title'
LEFT JOIN custom t3 ON t1.post_id = t3.post_id
AND t3.meta_key = 'seo_descr'
ORDER BY
t1.post_id;
SELECT
@ids := (
SELECT
GROUP_CONCAT(DISTINCT id SEPARATOR ',')
FROM
(
SELECT
id
FROM
test
WHERE
date >= '2022-12-10 08:00:00'
AND date <= '2022-12-10 20:00:00'
ORDER BY
date DESC
LIMIT
2
) AS sub
);
SELECT @ids;
SELECT
SUM(bunker_sum)
FROM
test
WHERE
find_in_set(id, @ids);
def decode_str(text: str):
type_text, string_num = text.split("#")
string_text, num_text = string_num.split("&")
return type_text, string_text, num_text
test_string = [
"str#qwerty&444",
"asd#omg&777122",
"hjkl#adsf&8811"
]
for t in test_string:
result = decode_str(t)
print(f"decode string - {t}")
print(f"result decode - {result}")