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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import json | |
| with open("temp.txt", 'r') as f: | |
| lines = f.readlines() | |
| output = [] | |
| for line in lines: |
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 | |
| src_dir=/home/wzl/OneDrive/quant/data/data_md5 | |
| dst_dir=oss://edaoquant | |
| check_file() { | |
| src_file=$1 | |
| dst_file=$2 | |
| echo $dst_file | |
| echo $src_file |
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 LAT_BREAKDOWN_H_ | |
| #define LAT_BREAKDOWN_H_ | |
| #include <chrono> | |
| namespace utils { | |
| struct LatBreakdown { | |
| std::chrono::nanoseconds total_lat_ = static_cast<std::chrono::nanoseconds>(0); | |
| std::vector<std::chrono::nanoseconds> lats_; |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import sys | |
| import argparse | |
| import matplotlib.axes | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import pandas as pd |
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
| #!/usr/bin/env bash | |
| repo=$(basename -s .git $(git config --get remote.origin.url)) | |
| tag=$(git name-rev --tags --name-only $(git rev-parse HEAD)) | |
| branch=$(git rev-parse --abbrev-ref HEAD) | |
| timestamp=$(hostname)-$(uname -r)-$(date -I'seconds') | |
| msg=$(git log -1 | cat) | |
| DIR=~/testdata/${repo}/"${timestamp}-${branch}-${tag}" |
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
| #usage: include Makefile.common at the end of your Makefile | |
| # no builtin rules/vars (CC, CXX, etc. are still defined but will be empty) | |
| MAKEFLAGS += -r -R | |
| HDR = $(addsuffix .h,$(MODULES) $(HEADERS)) | |
| SRC = $(addsuffix .c,$(MODULES) $(SOURCES)) | |
| ASM = $(addsuffix .S,$(ASSMBLY)) | |
| OBJ = $(addsuffix .o,$(MODULES) $(SOURCES) $(ASSEMBLY)) | |
| DEP = Makefile.common Makefile $(HDR) $(EXTERNDEP) $(EXTERNSRC) |
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
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| SERVER = "smtp.office365.com" | |
| PORT = "587" | |
| FROM = "wzl574402791@outlook.com" | |
| TO = ["zl31wang@gmail.com"] | |
| SUBJECT = "A job finished" | |
| TEXT = "Hi! A job finished. Please take a look." |
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 | |
| unshared () { | |
| grep '^[0-9]\+$' "$1" > /dev/null | |
| } | |
| for cpu in $(ls -d /sys/devices/system/cpu/cpu[0-9]* | sort -t u -k 3 -n); do | |
| echo "${cpu##*/}: [Package #$(cat $cpu/topology/physical_package_id), Core #$(cat $cpu/topology/core_id)]" | |
| if ! unshared $cpu/topology/core_siblings_list; then | |
| echo " same package as $(cat $cpu/topology/core_siblings_list)" |
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
| import sys | |
| import asyncio | |
| async def handle_echo(reader, writer): | |
| while True: | |
| message = await reader.read(1000) | |
| print(f'get message {message}') | |
| writer.write(message) |
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 | |
| # Trace system calls in [ftrace] binary file | |
| # Output to ftrace_out.log | |
| tracefs=/sys/kernel/debug/tracing | |
| gcc -o ftrace ftrace.c | |
| echo nop > ${tracefs}/current_tracer # Use NOP tracer at first | |
| echo 0 > ${tracefs}/tracing_on # Disable tracing |
NewerOlder