eshamay
|
codepad
|
|
eshamay
|
Saved pastes by eshamay:
// 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) |
import random
import numpy
import matplotlib.pyplot as plt
GOODNUMBERS = [2,3,5,6,8,10,12]
|
view (38 lines) |
import sys
import glob
# CDF is of my own creation
from ColumnDataFile import ColumnDataFile as CDF
import matplotlib.pyplot as plt
|
view (60 lines) |
''' 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) |
def ManualCorrelate(func,tau,x,y=None):
Nstep = float(len(x))
Ncorr = tau
Nshift = 1
Nav = int((Nstep-Ncorr)/Nshift)
|
view (32 lines) |
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) |
using namespace boost::numeric::ublas;
typedef matrix<double> matrix_t;
typedef matrix_slice<matrix_t> submatrix;
|
view (27 lines) |