This file contains 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
// | |
// range -- generator similar to python's range() | |
// | |
// range() will generate 0..MAX_SAFE_INTEGER | |
// range(end) will generate 0..(end-1) | |
// range(start, end) will generate start..(end-1) | |
// range(start, end, step) will step by step instead of 1 | |
// start can be larger than end if step is negative: | |
// for example range(10, 2, -1) | |
// |
This file contains 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
# | |
# Makefile for force_4k example | |
# | |
PROGS = force_4k | |
CFLAGS = -g -Wall -Werror -std=gnu99 | |
all: $(PROGS) | |
force_4k: force_4k.o | |
$(CC) -o $@ $(CFLAGS) $^ $(LIBS) |
This file contains 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 | |
# | |
# ww -- calculate the current Intel work week (which is slightly different than ISO week) | |
# | |
import datetime | |
def ww(d): | |
# find first day of ww 1 by finding Jan 1 of |
This file contains 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
#include <sys/mman.h> | |
#include <err.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
int | |
main(int argc, char *argv[]) |
This file contains 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
/* | |
* opendir_and_openat.c -- trivial example showing how to use opendir+openat | |
* | |
* usage: a.out path-to-directory | |
*/ | |
#include <stdio.h> | |
#include <dirent.h> | |
#include <err.h> | |
#include <fcntl.h> |
This file contains 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
*.o | |
tester | |
tickle_me_elmo.so |
This file contains 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
*.o | |
tester | |
elmo.so |
This file contains 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
Here are a sequence of examples used to introduce libpmemobj. |
This file contains 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
is a gist containing libvmem examples, so they can be embedded in web pages. |
This file contains 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
This is a gist containing libpmemobj examples, so they can be embedded in web pages. |
NewerOlder