C/C++ How do you set GDB debug flag (-g) with cmake?
转载: C/C++: How do you set GDB debug flag (-g) with cmake? – Bytefreaks.net
# Solution 1: Modify the CMakeLists.txt file
Add the following line to your CMakeLists.txt file to set the compilation mode to Debug (non-optimized code with debug symbols):
1set(CMAKE_BUILD_TYPE Debug)
Add the following...
more...
VSCode C++ Compile Multi Files
# Sorce Files
swap.h
1void swap(int &a, int &b);
swap.cpp
123456#include "swap.h"void swap(int &a, int &b){ (a ^= b), (b ^= a), (a ^= b);}
main.cpp
12345678910111213141516171819202122#include <iostream>#include...
more...
ISO 8601 the better date format
转载: ISO 8601: the better date format
If you haven’t been living under a rock, you’ve probably heard that there are different date formats in the world such as the American one (mm/dd/yyyy) and the European one (dd.mm.yyyy). If you’re smart enough, you’ve probably also noticed that the American one...
more...
Linux Grep Sed And Awk
# grep
grep 是文本查找命令,可以通过正则查找匹配。
1234567891011$ grep 'root' passwdroot:x:0:0:root:/root:/bin/bash$ grep '^\w\{4\}:'...
more...
Hashing in Action Understanding bcrypt
转载: Hashing in Action Understanding bcrypt
The bcrypt hashing function allows us to build a password security platform that scales with computation power and always hashes every password with a salt.
In previous posts to this Authentication Saga, we learned that storing passwords in plaintext must...
more...
Discovering Python 3’s pathlib
转载: Discovering Python 3’s pathlib – Dante’s Python musings
The pathlib is one of the new features in Python 3 I loved immediatly when I recognized it’s advantages. The pathlib a sort of a swiss knife tool and more than capable to replace os.path because it gives object orientated programming a...
more...
Python XMLの要素・属性・内容を削除する(ElementTree)
转载:【Python】XML の要素・属性・内容を削除する (ElementTree) | 鎖プログラム
# サンプル XML
# sports.xml
1234567891011<?xml version="1.0" encoding="UTF-8" ?><sports> <sport order="001"> <name>サッカー</name>...
more...