Skip to content

Instantly share code, notes, and snippets.

View victoryang00's full-sized avatar
🎯
Focusing

Yiwei Yang victoryang00

🎯
Focusing
View GitHub Profile
@jizhilong
jizhilong / heap.h
Created October 1, 2013 06:54
a generic heap implemented in c++ template.
#include <vector>
#include <algorithm>
using std::vector;
using std::swap;
template <typename T>
class heap
{
public:
@donkirkby
donkirkby / multitasking.py
Last active February 18, 2023 15:20
Worker processes with mpi4py
#! /usr/bin/env python
import argparse
import csv
from mpi4py import MPI
import logging
import time
def parseOptions(comm_world):
parser = argparse.ArgumentParser(
@tevino
tevino / epoll.go
Last active January 20, 2024 22:50
An example of using epoll in Go
package main
import (
"fmt"
"net"
"os"
"syscall"
)
const (
@hngouveia01
hngouveia01 / debugging_kernel.txt
Last active June 6, 2024 21:11
Debugging kernel code line by line with Qemu and GDB
We are going to use buildroot to download, configure and compile the kernel.
First, download and uncompress buildroot: https://buildroot.org/download.html
Go to the directory and:
make qemu_x86_defconfig
make menuconfig
@webframp
webframp / windows.md
Created November 28, 2016 22:12
Minimum Viable Windows

A Mostly usable Windows workstation for macOS or Linux users

Especially starting with Windows 10, it isn't all that bad to work on day to day. It just requires a bit of setup out of the box to make it behave better just like those other platforms, and is sufficiently different so as to be non obvious to experienced Linux or macOS users.

Pick and choose what to do from below that fits your needs.

Note: I use emacs, like emacs keybindings and do a bit of Chef development,

@KageKirin
KageKirin / scaffolding.cpp.md
Last active April 29, 2021 03:42
Scaffolding C++ projects with Google Depot Tools gclient

The following is an internal memo I recently wrote to explain the structure of a project I have been working for the last 2 years. While there are a number of details that can only be understood if you have the mentioned repos in front of you, I figured this might give some interesting ideas to other devs.


Scaffolding C++ projects

about the project scaffolding structure used among other for BADASS and AVALON

Why scaffold a project?

@xymopen
xymopen / linux_magic.cpp
Created October 17, 2017 14:00
C++ equivalences of the famous offset_of and container_of(owner_of) macro from Linux kernel
template< class T, class M >
static inline constexpr ptrdiff_t offset_of( const M T::*member ) {
return reinterpret_cast< ptrdiff_t >( &( reinterpret_cast< T* >( 0 )->*member ) );
}
template< class T, class M >
static inline constexpr T* owner_of( M *ptr, const M T::*member ) {
return reinterpret_cast< T* >( reinterpret_cast< intptr_t >( ptr ) - offset_of( member ) );
}
@dougallj
dougallj / asm.s
Created January 3, 2018 08:55
x86-64 Speculative Execution Harness
global _time_load
global _cache_flush
global _run_attempt
extern _bools
extern _values
extern _pointers
section .text
@1duo
1duo / openmpi.use.gpudirect.rdma.md
Last active May 13, 2022 08:33
Use OpenMPI + GPUDirect RDMA for better performance.
  • Install OpenMPI, make sure enable CUDA support by adding --with-cuda flag.

  • Verify GPU Direct RDMA Information

$ ompi_info --all | grep btl_openib_have_cuda_gdr
   MCA btl: informational "btl_openib_have_cuda_gdr" (current value: "true", data source: default, level: 4 tuner/basic, type: bool)
  • Add flag to mpirun
@ericphanson
ericphanson / diff_eigmin.md
Created August 3, 2019 12:47
Various attempts to differentiate through `eigmin` in Julia

Attempts to differentiate eigmin

Julia 1.1, with Zygote master

Version information:

julia> Pkg.status()
    Status `~/Dropbox (Personal)/Research/Code/julia-projects/DiffEvals/ZygoteMaster/Project.toml`
  [ec485272] ArnoldiMethod v0.0.4
  [14197337] GenericLinearAlgebra v0.1.0