This file contains hidden or 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
| /* netBufLib.c - network buffer library */ | |
| /* Copyright 1984 - 2001 Wind River Systems, Inc. */ | |
| /* | |
| modification history | |
| -------------------- | |
| 01r,07may02,kbw man page edits | |
| 01q,15oct01,rae merge from truestack ver 01w, base 01n (SPR #65195 etc.) |
This file contains hidden or 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 "list.h" | |
| #include "../debug.h" | |
| /* Our doubly linked lists have two header elements: the "head" | |
| just before the first element and the "tail" just after the | |
| last element. The `prev' link of the front header is null, as | |
| is the `next' link of the back header. Their other two links | |
| point toward each other via the interior elements of the list. | |
| An empty list looks like this: |
This file contains hidden or 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
| /* Hash table. | |
| This data structure is thoroughly documented in the Tour of | |
| Pintos for Project 3. | |
| See hash.h for basic information. */ | |
| #include "hash.h" | |
| #include "../debug.h" | |
| #include "threads/malloc.h" |
This file contains hidden or 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 <stdlib.h> | |
| #include <stdio.h> | |
| #include "heap.h" | |
| PriorityQueue pq_init(int capacity) | |
| { | |
| PriorityQueue H; | |
| H=(PriorityQueue )malloc(sizeof(struct HeapStruct)); |
This file contains hidden or 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 <arpa/inet.h> | |
| #include <unistd.h> | |
| #include <assert.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <sys/socket.h> | |
| #include <sys/epoll.h> | |
| #include <sys/types.h> | |
| #include <pthread.h> |
This file contains hidden or 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
| all:rbtree-tst | |
| CFLAGS=-g -O0 -Wall | |
| rbtree-tst:rbtree-tst.o rbtree.o | |
| rbtree.o:rbtree.h rbtree.c | |
| rbtree-tst.o:rbtree-tst.c |
This file contains hidden or 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
| /************************************************************************** | |
| * simpletun.c * | |
| * * | |
| * A simplistic, simple-minded, naive tunnelling program using tun/tap * | |
| * interfaces and TCP. Handles (badly) IPv4 for tun, ARP and IPv4 for * | |
| * tap. DO NOT USE THIS PROGRAM FOR SERIOUS PURPOSES. * | |
| * * | |
| * You have been warned. * | |
| * * | |
| * (C) 2009 Davide Brini. * |
This file contains hidden or 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
| /* ====================================================================== | |
| * Copyright (c) 2000,2006 Theo Schlossnagle | |
| * All rights reserved. | |
| * The following code was written by Theo Schlossnagle for use in the | |
| * Backhand project at The Center for Networking and Distributed Systems | |
| * at The Johns Hopkins University. | |
| * | |
| * This is a skiplist implementation to be used for abstract structures | |
| * and is release under the LGPL license version 2.1 or later. A copy | |
| * of this license can be found file LGPL. |
This file contains hidden or 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
| // A simple LRU cache written in C++ | |
| // Hash map + doubly linked list | |
| #include <iostream> | |
| #include <vector> | |
| #include <ext/hash_map> | |
| using namespace std; | |
| using namespace __gnu_cxx; | |
| template <class K, class T> | |
| struct Node{ |
This file contains hidden or 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> | |
| using namespace std; | |
| int lis(int A[], int n){ | |
| int *d = new int[n]; | |
| int len = 1; | |
| for(int i=0; i<n; ++i){ | |
| d[i] = 1; | |
| for(int j=0; j<i; ++j) | |
| if(A[j]<=A[i] && d[j]+1>d[i]) |