Vim Configuration
- Install maven
sudo apt-get install maven
CC := g++ # This is the main compiler | |
# CC := clang --analyze # and comment out the linker last line for sanity | |
SRCDIR := src | |
BUILDDIR := build | |
TARGET := bin/runner | |
SRCEXT := cpp | |
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT)) | |
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o)) | |
CFLAGS := -g # -Wall |
Quy trình này mình tìm hiểu khi mua những hàng sử dụng International Shipping, lí do nó khiến mình quan ngại là vì:
Sau đây là kinh nghiệm của mình sau 1 buổi sáng hì hục tìm hiểu:
sudo apt-get -y install python-pip python-dev build-essential | |
sudo pip install --upgrade pip | |
sudo pip install --upgrade virtualenv |
echo "Setup the workspace" | |
# pacman -S sudo | |
# install yay | |
git clone https://aur.archlinux.org/yay.git | |
cd yay | |
makepkg -si | |
cd .. & rm -rf yay | |
# essential dev tools |
#include <stdexcept> | |
#include <utility> | |
class Str { | |
public: | |
template <std::size_t N> | |
constexpr Str(const char(&a)[N]) : p(a), s(N - 1) {} | |
constexpr char operator[](std::size_t n) const { |
# source : https://ncrmnt.org/2016/04/21/cmake-atom-clang_complete/ | |
message(STATUS "Generarating ${CMAKE_SOURCE_DIR}/.clang_complete") | |
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) | |
file(WRITE ${CMAKE_SOURCE_DIR}/.clang_complete "") | |
foreach(dir ${dirs}) | |
file(APPEND ${CMAKE_SOURCE_DIR}/.clang_complete "-I${dir}\n") | |
endforeach() | |
if(CMAKE_CXX_FLAGS) | |
string(REPLACE "'" "" CMAKE_C_FLAGS_SPLIT ${CMAKE_CXX_FLAGS}) |
import random | |
import sys | |
def partition(array, lo, hi): | |
pivot = random.randint(lo, hi) | |
i = lo+1 | |
j = hi | |
array[lo], array[pivot] = array[pivot], array[lo] | |
while True: |