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
| ifstream inFile; | |
| string name; | |
| inFile.open("demofile.txt"); | |
| cout << "Reading information from the file.\n"; | |
| inFile >> name; | |
| cout << name << endl; |
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
| 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; |
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
| - name: Restart a container | |
| docker_container: | |
| name: myapplication | |
| image: someuser/appimage | |
| state: started | |
| restart: yes | |
| links: | |
| - "myredis:aliasredis" | |
| devices: | |
| - "/dev/sda:/dev/xvda:rwm" |
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
| - 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: |
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
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| template <typename Iterator> | |
| struct IteratorRange { | |
| Iterator first, last; | |
| Iterator begin() const { |
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
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: azure-vote-back | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: azure-vote-back | |
| template: |
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 time | |
| import asyncio | |
| start = time.time() | |
| def tic(): | |
| return 'at %1.1f seconds' % (time.time() - start) | |
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 log(message, when=datetime.now()): | |
| print('%s: %s' % (message, when)) | |
| log('one') | |
| sleep(1) | |
| log('two') # the same time |
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
| ПОДГОТОВКА | |
| ~~~~~~~~~~ | |
| Создадим БД, установим некоторые параметры и подключим расширение | |
| pg_stat_statements, с помощью которого будем строить профиль. | |
| => create database db19; | |
| CREATE DATABASE |
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 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) | |