Skip to content

Instantly share code, notes, and snippets.

#ifndef CONNECTIONPOOL_HPP
#define CONNECTIONPOOL_HPP
#include <memory>
#include <functional>
#include <deque>
#include <mutex>
template <typename Connection>
class ConnectionPool
#include <iostream>
#include <thread>
#include <chrono>
#include <future>
int main()
{
auto future = std::async(std::launch::async, []
{
using namespace std::chrono_literals;
QTableView::resizeEvent(event);
int columns = this->model()->columnCount();
int totalHeaderWidth = 0;
for (int column = 0; column < columns; column++)
{
totalHeaderWidth += horizontalHeader()->sectionSizeHint(column);
}
Observable<String> input = Observable.create(new ObservableOnSubscribe<String>() {
@Override
public void subscribe(ObservableEmitter<String> e) throws Exception {
BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
while (true) {
e.onNext(bfr.readLine());
}
}
});
@matrixd
matrixd / fx-8350e
Last active November 10, 2016 22:24
> 7z b
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.utf8,Utf16=on,HugeFiles=on,64 bits,8 CPUs AMD FX-8320E Eight-Core Processor (600F20),ASM,AES-NI)
AMD FX-8320E Eight-Core Processor (600F20)
CPU Freq: 3684 3682 3680 3687 3687 3682 3687 3687 3686
RAM size: 8020 MB, # CPU hardware threads: 8
RAM usage: 1765 MB, # Benchmark threads: 8
@matrixd
matrixd / util.c
Last active September 26, 2016 00:43
#include <stdio.h>
#include <stdlib.h>
#include <libudev.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/mount.h>
#include <sys/stat.h>
@matrixd
matrixd / write.c
Last active July 13, 2016 14:17
datagram + write size limit
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
#include <errno.h>
ssize_t getSndBufSize(sockfd)
{
@matrixd
matrixd / log.txt
Created April 19, 2016 18:36
vfio bind log
[ 480.367451] INFO: task bash:1191 blocked for more than 120 seconds.
[ 480.367455] Tainted: P O 4.5.1-1-ARCH #1
[ 480.367456] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 480.367458] bash D ffff8800a5d7bb78 0 1191 1190 0x00000000
[ 480.367461] ffff8800a5d7bb78 ffff8800a5d7bb78 ffffffff81811500 ffff880215bbb900
[ 480.367464] ffff8800a5d7c000 ffff8800a5d7bcf0 ffff8800a5d7bce8 0000000000000000
[ 480.367465] ffff880215bbb900 ffff8800a5d7bb90 ffffffff815a9b2c 7fffffffffffffff
[ 480.367467] Call Trace:
[ 480.367474] [<ffffffff815a9b2c>] schedule+0x3c/0x90
[ 480.367476] [<ffffffff815ac613>] schedule_timeout+0x1d3/0x260
sudo udevadm test /sys/devices/platform/i8042/serio1
calling: test
version 229
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
=== trie on-disk ===
tool version: 229
file size: 6845599 bytes
@matrixd
matrixd / WD10EZEX.txt
Created December 13, 2015 21:48
smartctl output
sudo smartctl -a /dev/sda
smartctl 6.4 2015-06-04 r4109 [x86_64-linux-4.2.5-1-ARCH] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Western Digital Blue
Device Model: WDC WD10EZEX-00KUWA0
Serial Number: WD-WCC1S4714769
LU WWN Device Id: 5 0014ee 25e01ec3b
Firmware Version: 15.01H15