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
LUAHOME = $(HOME)/Work/lunum/lua-5.2.0 | |
CFLAGS = -Wall | |
default : luawrap | |
luawrap : luawrap.cpp | |
$(CXX) $(CFLAGS) -o $@ $^ -L$(LUAHOME)/lib -I$(LUAHOME)/include -llua | |
clean : |
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 <cstdlib> | |
#include <utility> // swap | |
#ifdef GPU | |
#define HD __host__ __device__ | |
#else | |
#define HD | |
#endif | |
using uint = unsigned int; |
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
void TakeScreenshot(const char *fname) | |
{ | |
printf("writing a screenshot to %s\n", fname); | |
int dimx = glutGet(GLUT_WINDOW_WIDTH); | |
int dimy = glutGet(GLUT_WINDOW_HEIGHT); | |
size_t imsize = 3*dimx*dimy; | |
char *pixels = (char*) malloc(imsize*sizeof(char)); | |
glReadPixels(0, 0, dimx, dimy, GL_RGB, GL_UNSIGNED_BYTE, pixels); |
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
-------------------------------------------------------------------------------- | |
-- | |
-- Partial implementation of the Python class model for Lua | |
-- | |
-- Copyright (c) 2012, Jonathan Zrake | |
-- | |
-------------------------------------------------------------------------------- | |
-- | |
-- Exports the following functions: | |
-- |
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 <functional> | |
// ============================================================================ | |
namespace detail | |
{ | |
template <typename T> | |
struct function_traits : public function_traits<decltype(&T::operator())> |
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
import argparse | |
import numpy as np | |
import h5py | |
import matplotlib.pyplot as plt | |
from matplotlib.animation import FuncAnimation | |
class TrackFigure(object): | |
def __init__(self, fig, filename): | |
self.file = h5py.File(filename, 'r') |
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
var http = require('http') | |
var qs = require('querystring'); | |
var mj = require("mathjax-node"); | |
var socketio = require('socket.io'); | |
var server = http.createServer(function(req, res) | |
{ | |
req.on('data', function (chunk) | |
{ | |
var equation = qs.parse(chunk.toString('utf8'))['equation']; |
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
/* ----------------------------------------------------------------------------- | |
* | |
* AUTHOR: Jonathan Zrake, NYU CCPP: zrake@nyu.edu | |
* | |
* | |
* USAGE: $> ./tetrun [number of trials] | |
* | |
* | |
* DESCRIPTION: |
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 "cow.h" | |
double cheese_function(double x, double y, double z) | |
{ | |
return x + y + z; | |
} | |
double butter_function(double x, double y, double z) | |
{ | |
return x + y + z; |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <GL/glut.h> | |
#define ESCAPE_KEY 27 | |
static void GLUTDisplayFunc(); | |
static void GLUTIdleFunc(); | |
static void GLUTReshapeFunc(int width, int height); | |
static void GLUTKeyboardFunc(unsigned char key, int x, int y); |
NewerOlder