Skip to content

Instantly share code, notes, and snippets.

View pqviet07's full-sized avatar
🎯
Focusing

Phung Quoc Viet pqviet07

🎯
Focusing
View GitHub Profile
#include <condition_variable> // std::condition_variale
#include <cstdlib>
#include <iostream>
#include <mutex>
#include <thread>
using namespace std;
std::mutex g_mutex;
std::condition_variable g_cv;
@pqviet07
pqviet07 / Semaphore.cpp
Created October 14, 2021 08:35
Semaphore C++ 11
#include <mutex>
#include <condition_variable>
class Semaphore {
private:
std::mutex mtx;
std::condition_variable cv;
int count;
public:
@pqviet07
pqviet07 / Build_Boost.md
Last active July 20, 2021 07:22
Cài đặt thư viện Boost

Cài thư viện Boost

  1. Vào thư mục vừa tải về, chạy file bootstrap.bat

    Hoặc gõ một trong các lệnh sau:

    bootstrap vc142 (if you are using Visual Studio 2019)
    bootstrap vc141 (if you are using Visual Studio 2017)

bootstrap vc140 (if you are using Visual Studio 2015)

@pqviet07
pqviet07 / tasks.json
Last active April 8, 2023 14:17
Compile cpp file with boost and opencv library for vscode
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: g++.exe build active file with boost and opencv lib",
"command": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-release-posix-seh-rt_v6-rev0\\mingw64\\bin\\g++",
"args": [
"-g",
"${file}",
@pqviet07
pqviet07 / tasks.json
Last active April 8, 2023 14:18
Task.json for compile c++ with Boost Library for vscode
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: g++.exe build active file with boost lib",
"command": "g++",
"args": [
"-g",
"${file}",
@pqviet07
pqviet07 / auto_mkdir.sh
Last active April 8, 2023 14:14
Bash shell for productivity
#!/bin/bash
#author: Phung Quoc Viet
#description: read all line from filname then create directorys with format: line/no.line
filename="filename.txt"
n=1
while read line; do
# reading each line
mkdir "$n. $line"
touch "./$n. $line/$line.cpp"
echo -n "File No.$n: $line"