Skip to content

Instantly share code, notes, and snippets.

View ceth-x86's full-sized avatar

ceth ceth-x86

  • Amsterdam, Netherlands
View GitHub Profile
ifstream inFile;
string name;
inFile.open("demofile.txt");
cout << "Reading information from the file.\n";
inFile >> name;
cout << name << endl;
package com.pluralsight.pension.setup;
import static com.pluralsight.pension.setup.AccountOpeningService.UNACCEPTABLE_RISK_PROFILE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.*;
import com.pluralsight.pension.AccountRepository;
- name: Restart a container
docker_container:
name: myapplication
image: someuser/appimage
state: started
restart: yes
links:
- "myredis:aliasredis"
devices:
- "/dev/sda:/dev/xvda:rwm"
- name: Make sure Docker is installed correctly
hosts: docker_hosts
tasks:
- name: Is this a registered RHEL host
redhat_subscription:
state: present
username: "{{ rh_user }}"
password: "{{ rh_pass }}"
pool_ids: "{{ pool_ids }}"
when:
#include <iostream>
#include <vector>
using namespace std;
template <typename Iterator>
struct IteratorRange {
Iterator first, last;
Iterator begin() const {
apiVersion: apps/v1
kind: Deployment
metadata:
name: azure-vote-back
spec:
replicas: 1
selector:
matchLabels:
app: azure-vote-back
template:
import time
import asyncio
start = time.time()
def tic():
return 'at %1.1f seconds' % (time.time() - start)
def log(message, when=datetime.now()):
print('%s: %s' % (message, when))
log('one')
sleep(1)
log('two') # the same time
ПОДГОТОВКА
~~~~~~~~~~
Создадим БД, установим некоторые параметры и подключим расширение
pg_stat_statements, с помощью которого будем строить профиль.
=> create database db19;
CREATE DATABASE
def run_sleep(period):
proc = subprocess.Popen(['sleep', str(period)])
return proc
start = time()
procs = []
for _ in range(10):
proc = run_sleep(0.1)
procs.append(proc)