Skip to content

Instantly share code, notes, and snippets.

@usamadar
usamadar / numa_sample.c
Created June 23, 2013 23:33
This code can demonstrate 1. Pinning the affinity 2. having NUMA local memory alloc (numa_alloc_local) 3. Also some other NUMA functions like bitmask If you want to compile it, you need the libnuma gcc numatest1.c -lnuma -lpthread -lrt
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <asm/ioctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
@usamadar
usamadar / HttpDigestAuthServlet.java
Created June 11, 2012 19:17
HTTP Servlet Sample Implmentation of HTTP Digest Authentication RFC 2617
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.example.http.authenticate;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;