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 <QDataStream> | |
#include <QString> | |
#include <QDebug> | |
struct Data1 | |
{ | |
bool isOk; | |
int value; | |
QString str; | |
}; |
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 <memory> | |
#include <utility> | |
// 源码已稍作修改,出自:https://en.cppreference.com/w/cpp/utility/forward | |
struct A | |
{ | |
A(int&& n) { std::cout << "rvalue overload, n=" << n << "\n"; } | |
A(int& n) { std::cout << "lvalue overload, n=" << n << "\n"; } | |
}; |
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
#ifndef MYRANDOM_HPP | |
#define MYRANDOM_HPP | |
// 源码:https://evileg.com/en/post/306 | |
#include <random> | |
namespace details | |
{ | |
/// True if type T is applicable by a std::uniform_int_distribution |
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 <QObject> | |
#include <QDebug> | |
class MyClass : public QObject | |
{ | |
Q_OBJECT | |
public: | |
explicit MyClass(QObject *parent = nullptr):QObject(parent){} | |
Q_INVOKABLE void printHello(const QString& text) |
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 "Label.h" | |
#include "Label_p.h" | |
Label::Label(const QString& text, QWidget *parent) : QLabel(text, parent), | |
d_ptr(new LabelPrivate(this)) | |
{ | |
} | |
QString Label::myGetText() | |
{ |
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
#!/bin/bash | |
# Update: 2021-03-17 | |
# Modified by lixingcong | |
# Fork from https://github.com/necan/shadowsocks-libev-static-build | |
# Attention: modified from https://github.com/shadowsocks/shadowsocks-libev/blob/master/docker/mingw/build.sh | |
# The script does not need to run as root |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\Directory\background\shell\git_shell] | |
@="Git Ba&sh Here" | |
"Icon"="D:\\Program_Files\\Git\\git-bash.exe" | |
[HKEY_CLASSES_ROOT\Directory\background\shell\git_shell\command] | |
@="\"D:\\Program_Files\\Git\\git-bash.exe\" \"--cd=%v.\"" | |
[HKEY_CLASSES_ROOT\Directory\shell\git_shell] |
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
# source from phuslu | |
# https://phus.lu/sysctl.conf | |
# bbr | |
net.core.default_qdisc=fq | |
net.ipv4.tcp_congestion_control=bbr | |
net.ipv4.tcp_retries2 = 8 | |
# 系统所有进程一共可以打开的文件数量, 每个套接字也占用一个文件描述字 |
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 "Person.h" | |
#include "PersonPrivate.h" | |
#include "cpp14_pointers.h" | |
Person::Person(std::string name): | |
pimpl(std::make_unique<PersonPrivate>(name)) | |
{ | |
} | |
Person::~Person() |
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
--style=kr | |
--indent=spaces=4 | |
--attach-inlines | |
--indent-cases | |
--indent-col1-comments | |
--break-blocks | |
--pad-oper | |
--align-pointer=type | |
--align-reference=type | |
--max-code-length=100 |