You do this.
const handleEvent = e => {
setState(e.target.value);
console.log(state);
}
import time | |
from telethon import TelegramClient, events | |
# sample API_ID from https://github.com/telegramdesktop/tdesktop/blob/f98fdeab3fb2ba6f55daf8481595f879729d1b84/Telegram/SourceFiles/config.h#L220 | |
# or use your own | |
api_id = 17349 | |
api_hash = '344583e45741c457fe1862106095a5eb' | |
# fill in your own details here |
const Telegraf = require('telegraf') | |
const bot = new Telegraf(process.env.BOT_TOKEN) | |
function unescapeHtml(str){ | |
const map = { | |
amp: '&', | |
lt: '<', | |
le: '≤', | |
gt: '>', | |
ge: '≥', |
function largestBinaryGap(num) { | |
var bin = Math.abs(num).toString(2), | |
finalMax = 0, | |
currentMax; | |
for (var i = 0; i < bin.length; i++) { | |
currentMax = 0; | |
while (bin[i] === "0") { | |
++currentMax && ++i; | |
} |
(?<Current>^[A-Z]{2}[0-9]{2}[A-Z]{3}$)|(?<Prefix>^[A-Z][0-9]{1,3}[A-Z]{3}$)|(?<Suffix>^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(?<DatelessLongNumberPrefix>^[0-9]{1,4}[A-Z]{1,2}$)|(?<DatelessShortNumberPrefix>^[0-9]{1,3}[A-Z]{1,3}$)|(?<DatelessLongNumberSuffix>^[A-Z]{1,2}[0-9]{1,4}$)|(?<DatelessShortNumberSufix>^[A-Z]{1,3}[0-9]{1,3}$)|(?<DatelessNorthernIreland>^[A-Z]{1,3}[0-9]{1,4}$)|(?<DiplomaticPlate>^[0-9]{3}[DX]{1}[0-9]{3}$)
For use in JavaScript (with named groups removed):
(^[A-Z]{2}[0-9]{2}\s?[A-Z]{3}$)|(^[A-Z][0-9]{1,3}[A-Z]{3}$)|(^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(^[0-9]{1,4}[A-Z]{1,2}$)|(^[0-9]{1,3}[A-Z]{1,3}$)|(^[A-Z]{1,2}[0-9]{1,4}$)|(^[A-Z]{1,3}[0-9]{1,3}$)|(^[A-Z]{1,3}[0-9]{1,4}$)|(^[0-9]{3}[DX]{1}[0-9]{3}$)