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
//Строка | |
String s = "adsdasd"; | |
//Ридер | |
Reader reader = new StringReader(s); | |
//Сет для посчитанных букв | |
Set<Character> set = new HashSet<>(); | |
int size = Math.min(s.length(),8192); | |
try { | |
Character ch = null; | |
//Читаем по 8192 букве |
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
1.http://platform.nemo.tv/?app_version=2&app_name=android_tablet_10_med_tv&p=nemo.auth.common | |
{"method":"register_prepare_password","params":{"device_model":"unknown::Android SDK built for x86","device_type":"android_phone","password":"469202","device_id":"deviceID","type":"uid","login":"2611889"}} | |
Ответ | |
{"jsonrpc":"2.0","id":null,"result":{"token":"eec657e0cc85438a257dc971b50958e02b5a2ddc"}} | |
2. http://platform.nemo.tv/?app_version=2&app_name=android_tablet_10_med_tv&p=nemo.auth.common | |
{ | |
"method":"auth", | |
"params":{"token":"eec657e0cc85438a257dc971b50958e02b5a2ddc"}} |
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
{ | |
"type":"advertisment", | |
"url": "https://relap.io/r?r=U6EHW1YB5ebL-6KaQpM%3AW0-SCw%3ArPzgCw%3AoGjeOg%3AdXS0kBk1%3AV6SdmQ%3AaHR0cHM6Ly9rd29yay5ydS8_dXRtX3NvdXJjZT10am91cm5hbCZ1dG1fbWVkaXVtPWNwYyZ1dG1fY2FtcGFpZ249cmVsYXAmcmVmPTUyMzczJl9fYWRyb29tX3ZhcmlhdGlvbl9pZF9fPTQ5ZDBiMDY3YTQ2ZjFiNGFiNjJhM2I2YTA2NjQwM2U2%3AuWMJXA%3AeyJpbSI6MCwid2lkIjoxNjk4MCwiYWciOlsiUlUiXSwidWciOiJSVSIsImdzIjoiUlUiLCJnaWQiOjEsInByIjoyLjcsInJyIjozLjN9%3AfKHkEg&_s=IksWHw&from=relap", | |
"title":"Кликните на нашу рекламу, помогите несчастным", | |
"description":"тут может быть длинное описание, но обычно его не будет ибо не нужно", | |
"thumbUrl":"//cdn.relap.io/-mjeOg/0P/1/0PTYCw.jpg", | |
"meta":{ | |
"advType": enum [ "cpm", "cpc" ], платят за клик или за показ, | |
"cpm" : number, //тут будет цена за 1000 показов. Для cpm он точно известен, для cpc - рассчитываем относительный доход на 1000 показов. В случае cpc тут может стоять 0, если показов по |
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
# Nginx image resize + proxy + caching of results. | |
# based on article: http://adw0rd.com/2012/11/10/django-nginx-image/en/ with third party servers support | |
# usage: | |
# http://localhost:8888/resize/365/260/?url=https://meduza.io/image/share_images/32059.png?1470633569#800x420 | |
# http://localhost:8888/crop/365/-/?url=https://meduza.io/image/share_images/32059.png?1470633569#800x420 | |
http { | |
#... | |
proxy_cache_path /usr/local/openresty/nginx/cache levels=1:2 keys_zone=thumb:10m max_size=1G; | |
server { |
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
import asyncnet, asyncdispatch, strutils, tables | |
var clients {.threadvar.}: seq[AsyncSocket] | |
var die {.threadvar.}: bool | |
var dict {.threadvar.}:Table[string, string] | |
const bytes = 1000 | |
# The payload | |
const content = repeatStr(bytes, "x") | |
const response = "HTTP/1.1 200 OK\r\LContent-Length: " & $content.len & "\r\L\r\L" & content |
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
New client | |
Clients count:140 | |
sock received '' | |
client closed | |
Clients count:139 | |
New client | |
Clients count:140 | |
sock received '' | |
client closed | |
Clients count:139 |
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
import reactor/tcp, reactor/loop, reactor/async, reactor/util, reactor/ipaddress, reactor/time | |
proc processClient(client: TcpConnection) {.async.} = | |
var die = false | |
while true: | |
let recvData = await client.input.readLine(255) | |
echo repr(recvData) | |
echo recvData | |
if recvData == "\13\10": | |
echo "end" |
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
#include <event2/listener.h> | |
#include <event2/bufferevent.h> | |
#include <event2/buffer.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <errno.h> |
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
#include <event2/listener.h> | |
#include <event2/bufferevent.h> | |
#include <event2/buffer.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <errno.h> |
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
+ PUDGEDIR=/var/lib/pudge | |
+ BACKUPDIR=/mnt/disk1/bckp/pudge | |
++ date +%Y%m%d-%H%M | |
+ DATE=20170210-0610 | |
+ THR=600 | |
+ THR2=60 | |
+ '[' -d /var/lib/pudge/backup ']' | |
+ '[' -d /mnt/disk1/bckp/pudge ']' | |
++ printf 'env getint backup.last\n' |
OlderNewer