Skip to content

Instantly share code, notes, and snippets.

View neuralvis's full-sized avatar

Madhu Srinivasan neuralvis

View GitHub Profile
@neuralvis
neuralvis / foo.rs
Created December 31, 2013 11:52 — forked from anonymous/foo.rs
#[no_uv];
extern mod native;
#[start]
fn start(argc: int, argv: **u8) -> int {
do native::start(argc, argv) {
main();
}
}
@neuralvis
neuralvis / fp textures
Created August 1, 2013 07:39
Creating floating point textures in threejs. Taken from here: https://github.com/mrdoob/three.js/issues/386
function createTextureFromData ( width, height, data ) {
if (!gl.getExtension("OES_texture_float")) {
throw("Requires OES_texture_float extension");
}
texture = new THREE.Texture( );
texture.needsUpdate = false;
texture.__webglTexture = gl.createTexture();
gl.bindTexture( gl.TEXTURE_2D, texture.__webglTexture );
@neuralvis
neuralvis / README.md
Created February 9, 2013 08:41 — forked from emeeks/README.md

The range sliders at the top change the values for the force-directed algorithm and the buttons load new graphs and apply various techniques. This will hopefully serve as a tool for teaching network analysis and visualization principles during my Gephi courses and general Networks in the Humanities presentations.

Notice this includes a pretty straightforward way to load CSV node and edge lists as exported from Gephi.

It also includes a pathfinding algorithm built for the standard data structure of force-directed networks in D3. This requires the addition of .id attributes for the nodes, however.

Now with Clustering Coefficients!

Also, it loads images for nodes but the images are not in the gist. The code also refers to different network types but the data files on Gist only refer to the transportation network.

@neuralvis
neuralvis / tiff-extractor.sh
Last active December 11, 2015 21:58
Extracting a page from a pyramidal tiff file
vips im_tiff2vips CancerImage.tif:0 ~/test.png
#creating a tiff
vips im_vips2tiff view1.png test-image.tif:deflate,tile:256x256,pyramid
@neuralvis
neuralvis / neser-pvserver.sh
Last active October 13, 2015 13:28
Job template file for llsubmit
#!/bin/sh
# @ account_no = xxxx
# @ error = $(job_name).$(jobid).outerr
# @ output = $(job_name).$(jobid).out
# @ job_name = paraview
# @ wall_clock_limit = 1:00:00
# @ environment = COPY_ALL
# @ job_type = parallel
# @ node = 4
# @ tasks_per_node = 4
@neuralvis
neuralvis / ArrayBuffers
Created November 5, 2012 11:49
ArrayBuffer-Buffer Conversion
function toArrayBuffer(buffer) {
var ab = new ArrayBuffer(buffer.length);
var view = new Uint8Array(ab);
for (var i = 0; i < buffer.length; ++i) {
view[i] = buffer[i];
}
return ab;
}
@neuralvis
neuralvis / reactive-templates.js
Created August 5, 2012 20:55
Doing templates in meteor
if (Meteor.is_client) {
Meteor.startup(function(){
Session.set('first', 1);
Session.set('last', 'Srinivasan');
var fragment = Meteor.ui.render(function (){
return Template.hello({
first: Session.get('first'),
@neuralvis
neuralvis / reactive-templates.js
Created August 5, 2012 20:54
Doing templates in meteor
if (Meteor.is_client) {
Meteor.startup(function(){
Session.set('first', 1);
Session.set('last', 'Srinivasan');
var fragment = Meteor.ui.render(function (){
return Template.hello({
first: Session.get('first'),
@neuralvis
neuralvis / command line shell
Created July 24, 2012 11:38 — forked from blakmatrix/command line shell
Getting Meteor leaderboard up on nodejitsu/jitsu
meteor create --example leaderboard
meteor bundle myapp.tgz
tar xzf myapp.tgz
cd bundle
(create package json with settings below)
jitsu databases create mongo <dbname>
(grab dbstring)
jitsu env set PORT 3000
jitsu env set MONGO_URL <dbstring>
jitsu deploy
@neuralvis
neuralvis / command line shell
Created July 24, 2012 11:38 — forked from blakmatrix/command line shell
Getting Meteor todos up on nodejitsu/jitsu
meteor create --example todos
meteor bundle myapp.tgz
tar xzf myapp.tgz
cd bundle
(create package json with settings below)
jitsu databases create mongo <dbname>
(grab dbstring)
jitsu env set PORT 3000
jitsu env set MONGO_URL <dbstring>
jitsu deploy