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 <cstdlib> | |
#include <utility> // swap | |
#ifdef GPU | |
#define HD __host__ __device__ | |
#else | |
#define HD | |
#endif | |
using uint = unsigned int; |
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 <functional> | |
// ============================================================================ | |
namespace detail | |
{ | |
template <typename T> | |
struct function_traits : public function_traits<decltype(&T::operator())> |
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
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 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
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 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
from OpenGL.GLUT import * | |
from OpenGL.GLU import * | |
from OpenGL.GL import * | |
rotationX = 0.0 | |
rotationY = 0.0 | |
last_x = 0 | |
last_y = 0 |
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 <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 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 <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); |
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
/* | |
* AUTHOR: Jonathan Zrake | |
* | |
* DATE: 3/31/2013 | |
* | |
* PURPOSE: Solve the compressible Navier-Stokes equation in 1d with a | |
* polytropic equation of state. | |
* | |
* SCHEME: semi-implicit Runge-Kutta / Backward Euler | |
* |
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
-------------------------------------------------------------------------------- | |
-- | |
-- Partial implementation of the Python class model for Lua | |
-- | |
-- Copyright (c) 2012, Jonathan Zrake | |
-- | |
-------------------------------------------------------------------------------- | |
-- | |
-- Exports the following functions: | |
-- |
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
""" | |
Author: Jonathan Zrake, NYU CCPP | |
Code demonstrates solving an elliptic equation using an iterative solver. | |
""" | |
import itertools | |
import numpy as np | |
import matplotlib.pyplot as plt |
NewerOlder