- Create a bot using @BotFather, get it's token
- Start conversation with bot
- Run following curl command
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
#ifndef CMDL_H_ | |
#define CMDL_H_ | |
#ifdef _WIN32 | |
#include <windows.h> | |
static const char *cmdl_errlist[] = { | |
"No Error.", | |
"CreatePipe() failed: could not create a pipe.", | |
"CreateProcessA() failed: could not create child process.", |
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
#include <stdlib.h> | |
#include <stdio.h> | |
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) | |
#include <fcntl.h> | |
#define PIPE(X) _pipe(X, 2, O_RAW) | |
#else | |
#include <unistd.h> | |
#define PIPE(X) pipe(X) | |
#endif |
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/ | |
create or replace function uuid_generate_v7() | |
returns uuid | |
as $$ | |
begin | |
-- use random v4 uuid as starting point (which has the same variant we need) | |
-- then overlay timestamp | |
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string | |
return encode( |
#pragma once | |
#include <libpq-fe.h> | |
#include <experimental/string_view> | |
#include "PQQuery.h" | |
#include "PQError.h" | |
#include <tuple> |
#include <atomic> | |
#include <chrono> | |
#include <cinttypes> | |
#include <cstdio> | |
#include <thread> | |
using namespace std; | |
#define NUM_PRODUCER 4 | |
#define NUM_CONSUMER NUM_PRODUCER | |
#define NUM_THREADS (NUM_PRODUCER + NUM_CONSUMER) |
In computer science, the event loop, message dispatcher, message loop, message pump, or run loop is a programming construct that waits for and dispatches events or messages in a program.
It works by making a request to some internal or external "event provider" (that generally blocks the request until an event has arrived), and then it calls the relevant event handler ("dispatches the event").
The event-loop may be used in conjunction with a reactor, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling).
The event loop almost always operates asynchronously with the message originator.
https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer
If you haven't got the ASAN libraries installed on the run host, or you are going to use another LD_PRELOAD'd lib like onload, you'll have to build 'static-libasan':
#!/bin/bash | |
# Copyright 2018, 2019, 2020 Azure Zanculmarktum | |
# All rights reserved. | |
# | |
# Redistribution and use of this script, with or without modification, is | |
# permitted provided that the following conditions are met: | |
# | |
# 1. Redistributions of this script must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. |
/* | |
SimpleThread.cpp -- implement for SimpleThread.h | |
Copyright 2018 yni3 | |
License : Public Domain (useful for copy and paste for your project) | |
*/ | |
#include "SimpleThread.h" | |
#if defined(_UNIX) || defined(__ANDROID__) || defined(__APPLE__) | |
#include <pthread.h> |