Skip to content

Instantly share code, notes, and snippets.

View jovo's full-sized avatar

joshua vogelstein jovo

View GitHub Profile
clear
clc
close all
%% sample ER graph & look at it
n=50;
p=0.5;
ER=rand(n)>1-p;
spy(ER)
@jovo
jovo / crcns.m
Created July 25, 2016 03:46
all the code i wrote during the 2 days of instruction/discussion at CRCNS, thanks everyone!
%% sample ER graph & look at it
n=50;
p=0.5;
ER=rand(n)>1-p;
spy(ER)
%% sample large ER graph & look at it
@jovo
jovo / markdown.html
Created January 16, 2016 14:26
a template for a webpage that renders markdown (via @j6k4m8)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/5.0.2/markdown-it.js" charset="utf-8"></script>
<div id="md-raw">
# My Paper
# Import the OCPy access module to get data from the server
import ocpy.access
# Pick a token whose dataset you wish to download.
TOKEN = 'kasthuri11'
RESOLUTION = '1'
DATA_LOCATION = "downloads/" + TOKEN
# Find the bounds of the dataset using `get_info()`:
project_information = ocpy.access.get_info(TOKEN)
@jovo
jovo / citation_prediction.m
Created December 29, 2015 01:44
citation_prediction
clear
figure(1), clf, hold on
%% jovo
years= [2015:-1:2003]';
dyears=years-2000; min(dyears)
cites=[382 315 238 144 105 63 33 19 20 18 11 8 17]';
f=fit(dyears,cites,'exp1');
<body>
<table id="bodyTable" border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td align="center" valign="top">
<table id="emailContainer" border="0" width="600" cellspacing="0" cellpadding="20">
<tbody>
<tr>
<td align="center" valign="top">
<table id="emailHeader" border="0" width="100%" cellspacing="0" cellpadding="20">
\documentclass[12pt]{article}
\usepackage{fullpage,times,subfigure,fancyhdr}
\pagestyle{fancy}
\oddsidemargin=-0.5in
\evensidemargin=0.0in
\textwidth=7.5in
\headwidth=6.5in
\textheight=9in
\headheight=12pt
@jovo
jovo / 2nd_moment_compare
Last active August 29, 2015 14:24
comparing different parameterizations for estimating 2nd moment effects
clear all, clc
nvec=round(logspace(2,5,5));
d=3;
mu=zeros(3,1);
Cov=eye(3);
Cov(1)=2;
Corr=diag(diag(Cov))^(-1/2)*Cov*diag(diag(Cov))^(-1/2);
@jovo
jovo / uploadImages.py
Created March 10, 2015 00:51
upload data to ocp in python
import numpy as np
import tempfile
import h5py
import urllib2
# Initialize the token here
# Remember you have to create this token or this token must exist before you can post to it
token = "ocp_test"
# Create a temp file
@jovo
jovo / downsample.m
Created December 17, 2013 05:00
matlab code to spatially downsample connectomes
function [A] = downsample(fibergraph, down, directed)
% downsamples a sparse connectome fibergraph
% down^3 is the size of one new voxel
% directed is a boolean for whether or not the output graph is directed
% if false the graph will be symmetrified
N = size(fibergraph,1);
Nnew = N/down^3;
[i,j,val] = find(fibergraph);
[x,y,z] = mortonXYZ(i -1);
i = XYZmorton(floor(x/down),floor(y/down),floor(z/down)) +1;