[ create a new paste ] login | about

eshamay

Name: Eric Shamay
Email:
Site/Blog:
Location: Eugene, OR
Default language: C++
Favorite languages: C++, C, python, lisp, bash
About:

Saved pastes by eshamay:

C++, pasted on Sep 8:
1
2
3
4
// A huge file has all the integers starting from 0 that it can hold in the amount of space it takes... i.e. 32GB worth of integers.// One of the integers is missing
// Find the missing number in a file

int FindTheMissingNumber (int * intFilePointer, int numInts, int maxBits) {
...
view (24 lines)
C++, pasted on Aug 30:
1
2
3
4
#include <cstdio>
#include <cstdlib>

typedef int val_t;
...
view (32 lines)
C++, pasted on Aug 30:
1
2
3
4
5
#include <cstdlib>
#include <cstdio>


int main (int argc, char ** argv) {
...
view (25 lines)
Python, pasted on Aug 22:
1
2
3
4
5
import random
import numpy
import matplotlib.pyplot as plt 

GOODNUMBERS = [2,3,5,6,8,10,12]
...
view (38 lines)
C++, pasted on Jul 25:
1
2
3
4
5
#include <boost/thread.hpp>
#include <iostream>

void hello()
{
...
view (16 lines)
Python, pasted on Jul 1:
1
2
3
4
5
import sys 
import glob
# CDF is of my own creation
from ColumnDataFile import ColumnDataFile as CDF 
import matplotlib.pyplot as plt 
...
view (60 lines)
Python, pasted on May 17:
1
2
3
4
5
import nlopt
from numpy import *

def myfunc(x, grad):
    if grad.size > 0:
...
view (46 lines)
Python, pasted on Apr 29:
1
2
3
4
5
''' Brute force calculation of the correlation function '''
def ManualCorrelate(func,tau,x,y=None):
    Nstep = float(len(x))
    Ncorr = tau
    Nshift = 1
...
view (38 lines)
Python, pasted on Apr 29:
1
2
3
4
5
def ManualCorrelate(func,tau,x,y=None):
    Nstep = float(len(x))
    Ncorr = tau
    Nshift = 1
    Nav = int((Nstep-Ncorr)/Nshift)
...
view (32 lines)
Haskell, pasted on Mar 9:
1
2
3
4
-- Easy vector routines
module HaskellMD.Vector
(Position,
 Coordinates,
...
view (52 lines)
Python, pasted on Feb 4:
1
2
3
4
5
import numpy

# Here's how I do autocorrelation. There's no ensemble average going on here, yet.
# Given a list of discrete data points, returns the ACF
def autocorr(x):
...
view (28 lines)
C++, pasted on Aug 27:
1
2
3
4
#include <cstdlib>
#include <stdio.h>
#include <iostream>
#include <mkl_cblas.h>
...
view (36 lines)
C++, pasted on Jun 21:
1
2
3
    using namespace boost::numeric::ublas;
    typedef matrix<double> matrix_t;
    typedef matrix_slice<matrix_t> submatrix;
...
view (27 lines)
C++, pasted on Jun 21:
1
2
3
    using namespace boost::numeric::ublas;
    typedef matrix<double> matrix_t;
    typedef matrix_slice<matrix_t> submatrix;
...
view (27 lines)