Skip to content

Instantly share code, notes, and snippets.

@pcyu16
pcyu16 / mem_dump.py
Created May 21, 2019 02:04 — forked from savanovich/mem_dump.py
Memory Dump with Python
# http://lwn.net/Articles/655992/
# https://github.com/mfleming/bits/blob/master/python/bits/__init__.py
import bits
from ctypes import *
mem = (c_char * 128).from_address(0xf1390)
print bits.dumpmem(mem)
# 00000000: 2f 68 6f 6d 65 2f 6a 6f 73 68 ... /home/josh...
@pcyu16
pcyu16 / SPFA.cpp
Created May 16, 2010 17:42 — forked from CrBoy/SPFA.cpp
SPFA
/*
* SPFA - Shortest Path Faster Algorithm
*/
#include <cstdio> // printf
#include <cstdlib> // NULL
#include <algorithm> // fill
#include <vector>
#include <queue>
using namespace std;