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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <netinet/tcp.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <netinet/in.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
package ca.jbrains.pos.test; | |
import static org.junit.Assert.*; | |
import java.util.*; | |
import org.junit.*; | |
public class SellOneItemTest { | |
private Display display; |
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
/* Compile with: g++ -Wall –Werror -o shell shell.c */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/wait.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
#ifndef _LINUX_LIST_H | |
#define _LINUX_LIST_H | |
#include <stdio.h> | |
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | |
/** | |
* container_of - cast a member of a structure out to the containing structure | |
* @ptr: the pointer to the member. |
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
/* | |
============================================================================ | |
Name : branch_mispred.c | |
Author : John Demme | |
Version : Mar 21, 2011 | |
Description : A template for perf_event. Requires Linux 2.6.32 or higher | |
============================================================================ | |
*/ | |
#define _GNU_SOURCE |
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
diff -PurN dummy/gu_page.c get_user_pages/gu_page.c | |
--- dummy/gu_page.c 1970-01-01 01:00:00.000000000 +0100 | |
+++ get_user_pages/gu_page.c 2012-06-14 14:41:31.797310260 +0100 | |
@@ -0,0 +1,124 @@ | |
+#include <linux/module.h> | |
+#include <linux/mm.h> | |
+#include <linux/sched.h> | |
+#include <linux/slab.h> | |
+#include <linux/vmalloc.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
# !/usr/bin/python | |
# -*- encoding: utf-8 -*- | |
import sys | |
dp = [] | |
for i in range(100): | |
dp.append(0) | |
dp[0] = 0 | |
dp[1] = 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
iproute commands | |
Prerequisites | |
iproute2 package | |
kernel configure options: | |
CONFIG_IP_ADVANCED_ROUTER=y | |
CONFIG_IP_MULTIPLE_TABLES=y | |
CONFIG_IP_ROUTE_MULTIPATH=y | |
menuconfig path: |
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 <iostream> | |
#include <atomic> | |
#include <vector> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cmath> | |
#include <stdint.h> | |
#include <limits.h> | |
class bloom_filter |
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
/* | |
* Demonstrate a trivial filesystem using libfs. | |
* | |
* Copyright 2002, 2003 Jonathan Corbet <corbet@lwn.net> | |
* This file may be redistributed under the terms of the GNU GPL. | |
* | |
* Chances are that this code will crash your system, delete your | |
* nethack high scores, and set your disk drives on fire. You have | |
* been warned. | |
*/ |
OlderNewer