This file contains hidden or 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 numpy as np | |
| # make memmap file and fill it with some random data | |
| # create a memmap file | |
| fp = np.memmap('data.memmap', dtype='float32', mode='w+', shape=(100000, 40000)) | |
| for chunk in range(100): | |
| # fill the memmap file with some random data | |
| fp[chunk*1000:(chunk+1)*1000] = np.random.rand(1000, 40000) |
This file contains hidden or 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
| #VERSION=2020.12.0 | |
| VERSION=2021.1.1 |
This file contains hidden or 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
| def prepare_data(data): | |
| data['service'] = None | |
| data['service'][data['upstream_addr'] == '-'] = 'static' | |
| data['service'][data['upstream_addr'] == '127.0.0.1:4091'] = 'backend' | |
| data['service'][data['upstream_addr'] == '127.0.0.1:4092'] = 'screenshot' | |
| data['service'][data['upstream_addr'] == '127.0.0.1:9000'] = 'frontend' | |
| data['request_time_xx'] = '-' | |
| data['request_time_xx'][data['request_time'].between(0, 0.5)] = '0-500ms' | |
| data['request_time_xx'][data['request_time'].between(0.5, 1)] = '500ms-1s' |
This file contains hidden or 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
| <p | |
| data-style-tablet_portrait="font-size: 37px; line-height: 46px; padding-right: 0px;" | |
| data-style-phone_portrait="font-size: 28px; line-height: 35px; padding-right: 0px;" | |
| data-class-tablet_portrait="empty" | |
| data-class-phone_portrait="empty" | |
| data-size-leading-linked-tablet_portrait="true" | |
| data-size-leading-linked-phone_portrait="true" | |
| data-size-leading-ratio-tablet_portrait="1.25" | |
| data-size-leading-ratio-phone_portrait="1.25" | |
| style="font-size: 31px; line-height: 39px; padding-right: 0px;" |
This file contains hidden or 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
| ideas <- function(x) { | |
| Sys.sleep(1) | |
| re_coordinates = 'shadow%3Afalse%7C(\\d+\\.\\d+)%2C(\\d+\\.\\d+)' | |
| url <- paste('http://moscowidea.ru/ideas/', x, sep="") | |
| read_data <- function(){ | |
| thepage = readLines(url) | |
| coord_page <- thepage[grep(re_coordinates, thepage)] | |
| mypattern_in = 'part_idea__summary__suggestion' | |
| mypattern_out = 'part_idea__summary__purpose' | |
| sugg_start = grep(mypattern_in, thepage) + 2 |
This file contains hidden or 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
| log_format jsonlog '{' | |
| '"time_local": "$time_local", ' | |
| '"request": "$request", ' | |
| '"msec": "$msec", ' | |
| '"status": "$status", ' | |
| '"body_bytes_sent": "$body_bytes_sent", ' | |
| '"request_time": "$request_time", ' | |
| '"remote_addr": "$remote_addr", ' | |
| '"remote_user": "$remote_user", ' |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| # apt-get install python-pandas python-boto | |
| AWS_ACCESS_KEY_ID = | |
| AWS_SECRET_ACCESS_KEY = | |
| import datetime | |
| import gzip | |
| import json |
This file contains hidden or 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
| res <- data.frame(session=NA, dt=NA) | |
| for(event_str in unique(summary$event)) { | |
| event_name <- gsub(pattern=' ', replacement='.', x=event_str, ) | |
| tmp <- summary[ summary$event == event_str, c('session', 'dt', 'count')] | |
| names(tmp)[3] <- event_name | |
| res <- merge(x=res, y=tmp, by=c('session', 'dt'), all=TRUE) | |
| } |
This file contains hidden or 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 sys | |
| import csv | |
| r = csv.reader(sys.stdin) | |
| data = list(r) | |
| for line in data[1:]: line[-1] += '\n\n http://jira.ent3.ru/issues/%s' % (line[0],) | |
| w = csv.writer(sys.stdout) | |
| w.writerows(data) |
This file contains hidden or 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
| public class EastActivity extends Activity { | |
| @Override | |
| public void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.main); | |
| final EditText username = (EditText)findViewById(R.id.clientid); | |
| final EditText password = (EditText)findViewById(R.id.passwordid); | |
| final Button button = (Button)findViewById(R.id.ok); | |
| final TextView txtResult = (TextView)findViewById(R.id.content); |
NewerOlder