Skip to content

Instantly share code, notes, and snippets.

View yuanfeiz's full-sized avatar

YuanfΞi Zhu yuanfeiz

  • The Homestead Arcology
View GitHub Profile
{
"_cpcompat.py": {
"code": [
"Base64"
],
"comment": [
"Python"
],
"all": [
"Base64"
@yuanfeiz
yuanfeiz / esa_balloc.c.xml
Last active January 4, 2016 05:19
ESA result on minix file system balloc.c
<file path="/Volumes/HappyPecanDisk/repos/minix-src/servers/ext2/balloc.c">
<content>
<text><![CDATA[/* This files manages blocks allocation and deallocation.
*
* The entry points into this file are:
* discard_preallocated_blocks: Discard preallocated blocks.
* alloc_block: somebody wants to allocate a block; find one.
* free_block: indicate that a block is available for new allocation.
*
* Created:
{
"adlist.c": [
"linked",
"list"
],
"adlist.h": [
"list"
],
"bitops.c": [
"bit"
{
"adlist.c": [
"linked"
],
"adlist.h": [
"linked",
"list"
],
"redis-cli.c": [
"command"
{
"adlist.c": [
"linked",
"list"
],
"adlist.h": [
"linked",
"list"
],
"bitops.c": [
{
"adlist.c": [
"linked"
],
"adlist.h": [
"linked",
"list"
],
"redis-cli.c": [
"command"
{
"adlist.c": [
"linked",
"list"
],
"adlist.h": [
"list"
],
"ae.c": [
class User
attr_reader :name
def initialize(name)
@name = name
end
def say_my_name
puts @name
end
@yuanfeiz
yuanfeiz / ipc_client.c
Last active March 1, 2024 20:43
My first socket program using nanomsg as in-proc communication method.
#include <nanomsg/nn.h>
#include <nanomsg/pair.h>
#include <stdio.h>
int main() {
int s = nn_socket(AF_SP, NN_PAIR);
int nbytes;
char ch;
char str[100];
@yuanfeiz
yuanfeiz / do_fork.c
Created May 26, 2013 09:51
VM parts of fork in MINIX
/* The kernel call implemented in this file:
* m_type: SYS_FORK
*
* The parameters for this kernel call are:
* m1_i1: PR_ENDPT (parent, process that forked)
* m1_i2: PR_SLOT (child's process table slot)
* m1_p1: PR_MEM_PTR (new memory map for the child)
* m1_i3: PR_FORK_FLAGS (fork flags)
*/