Skip to content

Instantly share code, notes, and snippets.

View centralhardware's full-sized avatar

Alexey Fedechkin centralhardware

View GitHub Profile
public void saveStatisticOutcome(Object object){
String chatId;
String text;
if (object instanceof SendMessage sendMessage){
chatId = sendMessage.getChatId();
text = sendMessage.getText();
} else if (object instanceof SendPhoto sendPhoto){
chatId = sendPhoto.getChatId();
text = sendPhoto.getCaption();
} else if (object instanceof DeleteMessage deleteMessage){
repositories {
mavenLocal()
mavenCentral()
}
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
import json
import logging
import os
from json.decoder import JSONDecodeError
from aiohttp import web
from telethon.sync import TelegramClient
def str2bool(boolean_string):
public class InlineKeyboardBuilder {
private final List<List<InlineKeyboardButton>> keyboard = new ArrayList<>();
private String text;
private List<InlineKeyboardButton> row = null;
private InlineKeyboardBuilder() { }
public static InlineKeyboardBuilder create() {
return new InlineKeyboardBuilder();
private <T extends Handler> boolean processHandler(Update update, List<T> handlers){
for (var handler : handlers) {
if (handler.isAcceptable(update)) {
handler.handle(update);
return true;
}
}
return false;
}
package me.centralhardware.znatoki.telegram.statistic.telegram;
import org.telegram.telegrambots.meta.api.objects.Update;
public interface Handler {
void handle(Update update);
boolean isAcceptable(String data);
[1042792.846146] sd 0:0:0:0: [sda] tag#9 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[1042792.846161] sd 0:0:0:0: [sda] tag#9 Sense Key : Aborted Command [current]
[1042792.846163] sd 0:0:0:0: [sda] tag#9 Add. Sense: I/O process terminated
[1042792.846166] sd 0:0:0:0: [sda] tag#9 CDB: Write(10) 2a 00 05 20 18 08 00 00 08 00
[1042792.846168] I/O error, dev sda, sector 85989384 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2
[1042792.846437] Buffer I/O error on dev dm-0, logical block 10485761, lost async page write
[1042792.846604] sd 0:0:0:0: [sda] tag#26 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[1042792.846606] sd 0:0:0:0: [sda] tag#26 Sense Key : Aborted Command [current]
[1042792.846607] sd 0:0:0:0: [sda] tag#26 Add. Sense: I/O process terminated
[1042792.846609] sd 0:0:0:0: [sda] tag#26 CDB: Write(10) 2a 00 07 a0 18 08 00 00 08 00
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>редактирование ученика</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
</head>
<body>
<h2>Редактирование ученика</h2>
@centralhardware
centralhardware / LuceneConfiguration.java
Last active July 29, 2023 16:48
scheduled fixed rate
@Component
@RequiredArgsConstructor
@Slf4j
public class Scheduler {
@Scheduled(fixedRate = 10, timeUnit = TimeUnit.MINUTES)
public void getAnalyzer() throws IOException {
log.info("Start update lucene index");