-
Как вызвать бота? В
Telegram
ник@oshlibot
-
Как запустить своего бота? Скопировать код. Получить [
apikey
][BotFather link]. Добавитьapikey
в свойства скрипта. Опубликовать скрипт как веб-приложение для всех. Запустить вручнуюsetWebhook()
из модуляScriptService.gs
-
Важно. В настройках необходимо в свойства скрипта добавить
apikey
-
Как получить
apikey
? Необходимо спросить у [@BotFather][BotFather link] -
Какие бывают способы доступа для бота? Два метода API определяют будущее поведение приложения: [getUpdates][getUpdates link] или [setWebhook][setWebhook link]
-
@oshlibot
использует подписку на [Webhooks][setWebhook link]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.010; | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use Marpa::R2 2.082000; | |
my $input = <<'END_OF_STRING'; | |
{ | |
name => 'test hash 1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see http://perldoc.perl.org/perlipc.html#Signals | |
# http://www.calpoly.edu/cgi-bin/man-cgi?wait+2 | |
# and Perl Cookbook, part 16.19. Avoiding Zombie Processes | |
sub REAPER { | |
local ($!, $?); | |
while ( (my $pid = waitpid(-1, WNOHANG)) > 0 ) { | |
say "Process $pid send CHLD with status $?"; | |
if ( WIFEXITED($?) or WIFSIGNALED($?) ) { | |
if ( $kids{$pid} ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use B; | |
use Scalar::Util::LooksLikeNumber 'looks_like_number'; | |
sub positive_int { | |
my $lln = looks_like_number($_[0]); | |
($lln == 1 || $lln & B::SVf_IOK) && $_[0] > 0; | |
} | |
for (0, "0", 123, "123", 123.45, "123.45", "yolki-palki", "nancy") { | |
print "$_ -> " . (positive_int($_) ? "true" : "false"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env tarantool | |
local CONSOLE_SOCKET_PATH = 'unix/:/var/run/tarantool/tarantool.sock' | |
local os = require("os") | |
console = require('console') | |
console.on_start(function(self) | |
local status, reason | |
status, reason = pcall(function() require('console').connect(CONSOLE_SOCKET_PATH) end) | |
if not status then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_G.ls = setmetatable({}, { | |
__serialize = function() | |
local res = {} | |
for _, sp_info in box.space._space:pairs(512, { iterator = "GE" }) do | |
local sp = box.space[sp_info.name] | |
local info = {} | |
info.name = tostring(sp.name) | |
info.engine = tostring(sp.engine) | |
info.len = tostring(sp:len()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> tarantool -l fiber -l clock -e 'fiber.create(function() while true do while clock.time() < fiber.time()+0.1 do end fiber.sleep(0.01) end end)' test.lua | |
entering the event loop | |
e:100.011µs p:0.017µs t:99.998µs | |
e:100.042µs p:0.010µs t:100.035µs | |
e:100.013µs p:0.015µs t:100.004µs | |
e:100.005µs p:0.006µs t:99.994µs | |
e:100.007µs p:0.004µs t:99.996µs | |
e:100.010µs p:0.009µs t:99.993µs | |
e:100.012µs p:0.016µs t:100.000µs | |
e:100.009µs p:0.050µs t:99.999µs |
Недостаточно просто описать задачу в тезисах. Довольно часто бывает так, что заинтересованные слушатели могут это сделать не хуже докладчика. Хорошие же тезисы отличает конкретика: конкретные названия, конкретные числовые показатели (последнее особенно важно для Highload++).
Главное — приоткрыть суть вашего доклада, оставаясь при этом в рамках сжатых тезисов.
И это не так сложно. При подготовке доклада и его тезисов нужно сделать всего лишь три шага.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- RSA bindings for Tarantool | |
--- Carefully adapted from https://github.com/spacewander/lua-resty-rsa | |
local bit = require "bit" | |
local band = bit.band | |
local ffi = require "ffi" | |
local ffi_new = ffi.new | |
local ffi_gc = ffi.gc | |
local ffi_copy = ffi.copy | |
local ffi_str = ffi.string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 8; | |
error_log logs/error.log info; | |
events { | |
worker_connections 4096; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
access_log off; | |
sendfile on; |
OlderNewer