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
#define N 8 | |
double unitcell[3] = {2.0, 2.0, 2.0}; | |
double x[N][3] = {{0,0,0},{0,0,1},{0,1,0},{0,1,1},{1,0,0},{1,0,1},{1,1,0},{1,1,1}}; | |
double q[N] = {1,-1,-1,1,-1,1,1,-1}; | |
static double dot(double a[3], double b[3]) | |
{ | |
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; | |
} |
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 MTRAND_H__ | |
#define MTRAND_H__ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
/* Mersenne Twister was developed by Makoto Matsumoto and Takuji Nishimura */ | |
#define MT_N 624 |
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> | |
#define xnew(x, n) \ | |
if ((x = calloc(n, sizeof(*(x)))) == NULL) { \ | |
fprintf(stderr, "no memory for %s x %u\n", #x, (unsigned) (n)); \ | |
exit(1); } | |
/* return the best match of two strings */ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
.score_table { | |
background-color: #ffffd0; | |
font-family: "Courier New", monospace; | |
border-collapse: collapse; | |
border: 5px #ffffff groove; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>Lennard-Jones equation of state</title> | |
<script type="text/javascript" src="dygraph-combined.js"></script> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
/* compute reference thermal dynamics variables |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
font: 90% "MS Trebunchet", "Lucida Grande", 'Verdana', 'Tahoma', 'Calibri', sans-serif; | |
width: 600px; | |
margin: auto; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
function mcgetPi() { | |
var c = document.getElementById("mcpi"); | |
var ctx = c.getContext("2d"); | |
var w = c.width; | |
var h = c.height; | |
var r = Math.min(w/2, h/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
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct { | |
int n; /* number of integers */ | |
int m; /* current number of bits */ | |
int top; /* current top */ | |
int *st; /* current stack */ |
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 <stdlib.h> | |
#include <string.h> | |
typedef unsigned char BYTE; /* one byte (0-255) */ | |
typedef unsigned short WORD; /* two bytes */ | |
typedef unsigned int DWORD; /* four bytes */ | |
/* Bitmap format cf. | |
* http://en.wikipedia.org/wiki/BMP_file_format |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8"> | |
<title>Lights out</title> | |
<style type="text/css"> | |
/*<![CDATA[*/ | |
body { | |
font: 90% "MS Trebunchet", "Lucida Grande", 'Verdana', 'Tahoma', 'Calibri', sans-serif; | |
width: 600px; |
OlderNewer