Skip to content

Instantly share code, notes, and snippets.

Ian Ross ian-ross

Block or report user

Report or block ian-ross

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ian-ross
ian-ross / test_bugs.py
Created Mar 10, 2016
Possible tutelary bug
View test_bugs.py
import rest_framework.generics as generic
import simplejson as json
from rest_framework.test import APIRequestFactory
from tutelary.models import Policy
from tutelary.mixins import PermissionRequiredMixin
from tutelary.decorators import permissioned_model
from django.db import models
View results.txt
[seneca:~] $ ./tst.py
Making an A
Calling a.m1
In A.m1
In A._m2
In A._m3
Making an B
Calling b.m1
In A.m1
In A._m2
@ian-ross
ian-ross / calc-markov-matrices.hs
Created Apr 2, 2015
Haskell data analysis: Markov matrix calculation
View calc-markov-matrices.hs
module Main where
import Control.Applicative ((<$>))
import Control.Monad (forM_, zipWithM_)
import Data.List (intercalate)
import System.FilePath
import qualified Data.Vector.Storable as SV
import Data.NetCDF
import Data.NetCDF.HMatrix
@ian-ross
ian-ross / make-hist.hs
Last active Aug 29, 2015
Haskell data analysis: spherical PDF significance testing
View make-hist.hs
module Main where
import Numeric
import Control.Applicative ((<$>))
import Control.Monad
import System.FilePath
import Data.NetCDF
import Data.NetCDF.HMatrix
import Data.NetCDF.Vector
@ian-ross
ian-ross / make-pdf-cuda.hs
Last active Aug 29, 2015
Haskell data analysis: CUDA speedups for KDE
View make-pdf-cuda.hs
module Main where
import Numeric
import Control.Applicative ((<$>))
import System.FilePath
import Data.NetCDF
import Data.NetCDF.HMatrix
import Data.NetCDF.Vector
import Foreign.C
@ian-ross
ian-ross / kde-1d.hs
Last active Aug 29, 2015
Haskell data analysis: kernel density estimation
View kde-1d.hs
module Main where
import Prelude hiding (enumFromThenTo, length, map, mapM_, replicate, zipWith)
import Data.Vector hiding ((++))
import System.Random
import System.IO
-- Number of sample points.
n :: Int
n = 10
@ian-ross
ian-ross / z500-pca-offline.hs
Last active Aug 29, 2015
Haskell data analysis: Z500 anomaly data PCA calculation
View z500-pca-offline.hs
module Main where
import Control.Applicative ((<$>))
import Control.Monad (forM_, foldM, when)
import System.FilePath
import qualified Data.Array.Repa as Repa
import qualified Data.Array.Repa.Eval as Repa
import Data.Array.Repa.Repr.ForeignPtr (F)
@ian-ross
ian-ross / pca-2d.cabal
Created Sep 18, 2014
Two-dimensional PCA example
View pca-2d.cabal
name: pca-2d
version: 0.1
synopsis: Two-dimensional PCA example
license: BSD3
author: Ian Ross
maintainer: ian@skybluetrades.net
copyright: Copyright (2014) Ian Ross
category: Data
build-type: Simple
cabal-version: >=1.8
@ian-ross
ian-ross / seasonal-cycle.hs
Last active Aug 29, 2015
Haskell data analysis: atmospheric non-diffusive flow data pre-processing
View seasonal-cycle.hs
module Main where
import Prelude hiding (length, maximum, minimum, sum, map)
import Control.Applicative ((<$>))
import Control.Monad
import Data.List (foldl')
import qualified Data.Map as M
import Foreign.C
import qualified Data.Vector.Generic as GV
import qualified Data.Vector.Unboxed as VU
View Prime-FFT.hs
{-# LANGUAGE ScopedTypeVariables, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
module PrimeFFT where
import Prelude hiding (length, sum, map, zipWith, (++), foldr, foldr1, or, and,
concat, concatMap, replicate, scanl, scanl1, scanr, null,
init, last, tail, head, filter, reverse, product,
maximum, zip, dropWhile, enumFromTo, all, take)
import Data.List (sort, nub)
import qualified Prelude as P
You can’t perform that action at this time.