Name: Mr. Ranedeer Author: JushBJJ Version: 2.5
This is the level of depth of the content the student wants to learn. The lowest depth level is 1, and the highest is 10.
package main | |
import ( | |
"bytes" | |
"context" | |
"github.com/golang/protobuf/proto" | |
myproto "github.com/selfboot/demo/proto" // This assumes that the generated protobuf code is in this package | |
"io/ioutil" | |
"log" | |
"net/http" |
package main | |
import ( | |
"github.com/gin-gonic/gin" | |
"io/ioutil" | |
"log" | |
"math/rand" | |
"net/http" | |
"strconv" | |
"time" |
import asyncio | |
from redis.asyncio import Redis | |
async def pipe(reader: asyncio.StreamReader, writer: asyncio.StreamWriter, delay: float, name=''): | |
while data := await reader.read(1000): | |
# print(name, 'received:', data) | |
await asyncio.sleep(delay) | |
writer.write(data) |
from __future__ import print_function | |
import os | |
from bcc import BPF | |
from time import sleep | |
import argparse | |
import ctypes | |
# Argument parsing | |
parser = argparse.ArgumentParser(description="Measure function duration for a specific PID") | |
parser.add_argument("pid", help="The PID of the process") |
#include <iostream> | |
#include <vector> | |
#include <chrono> | |
#include <algorithm> | |
#include <numeric> | |
#include <cmath> | |
#include <thread> | |
class Timer { | |
public: |
from __future__ import print_function | |
import os | |
from bcc import BPF | |
from time import sleep | |
import numpy as np | |
import argparse | |
from collections import defaultdict | |
# Argument parsing | |
parser = argparse.ArgumentParser(description="Measure function duration for a specific PID") |
#include <boost/noncopyable.hpp> | |
#include <pthread.h> | |
#include <stdlib.h> | |
// a superfluous check for pedantic people | |
inline void CHECK_SUCCESS(int ret) | |
{ | |
if (ret != 0) | |
{ | |
abort(); |
/** | |
* traceback for cpp | |
* | |
* Created on: 2018-01-27 | |
* Author: owent | |
* | |
* Released under the MIT license | |
* | |
* @note Required flag -rdynamic or addr2line to get the function name when using gcc/clang in unix like system | |
* @note Using addr2line -Cfpe <exe_path> [func_addr...] for more detail when using gcc/clang |
You can use os.path.expanduser to convert ~ into your home directory:
>>> import os
>>> os.path.expanduser('~/.config.txt')
'/root/.config.txt'
>>>
This works on both *nix and Windows systems.