Skip to content

Instantly share code, notes, and snippets.

View lgordon's full-sized avatar

Lyle Gordon lgordon

View GitHub Profile
public static float[] getFloatC(String filename)
throws FileNotFoundException, IOException{
File fl = new File(filename);
FileInputStream str = new FileInputStream(fl);
FileChannel ch = str.getChannel();
MappedByteBuffer mb = ch.map( FileChannel.MapMode.READ_ONLY, 0L, ch.size( ));
int numfloats = (int) ch.size()/4;
float[] result = new float [numfloats];
try{
for(int j=0;j<numfloats;j++){
@lgordon
lgordon / ACLset.sh
Created June 20, 2012 01:31
acl setting script
#!/usr/bin/env bash
/usr/bin/chmod -R A+everyone@:list_directory/read_data/add_file/write_data/add_subdirectory/append_data/read_xattr/write_xattr/execute/delete_child/read_attributes/write_attributes/delete/read_acl/write_acl/write_owner/synchronize:file_inherit/dir_inherit/inherited:allow "$1"
@lgordon
lgordon / volrender
Created May 31, 2012 02:10
volume rendering with mathematica
dims = Dimensions@data;
coords = Table[{x, y, z}, {x, 1, dims[[1]]}, {y, 1, dims[[2]]}, {z, 1,
dims[[3]]}];
cubes = {Hue @@ #1, EdgeForm[], Cuboid@#2} &
output = MapThread[cubes, {data, coords}, 3];
Graphics3D@output
@lgordon
lgordon / newznab
Created May 17, 2012 03:40
newznab providers
Running as of Aug 28, 2012
http://nzb.su/
http://dognzb.cr
http://beta.nzbs.org
http://usenet-collector.com/
@lgordon
lgordon / homebrew rsync build log
Created April 25, 2012 00:36
homebrew rsync build log
Lyles-MacBook-Air:.ssh lyle$ brew install rsync -v
==> Downloading http://rsync.samba.org/ftp/rsync/src/rsync-3.0.9.tar.gz
Already downloaded: /Library/Caches/Homebrew/rsync-3.0.9.tar.gz
/usr/bin/tar xf /Library/Caches/Homebrew/rsync-3.0.9.tar.gz
==> Downloading patches
/usr/bin/curl -qf#LA Homebrew 0.9 (Ruby 1.8.7-249; Mac OS X 10.7.2) http://gitweb.samba.org/?p=rsync-patches.git;a=blob_plain;hb=v3.0.9;f=fileflags.diff -o 000-homebrew.diff http://gitweb.samba.org/?p=rsync-patches.git;a=blob_plain;hb=v3.0.9;f=crtimes.diff -o 001-homebrew.diff http://gitweb.samba.org/?p=rsync-patches.git;a=blob_plain;hb=v3.0.9;f=hfs-compression.diff -o 002-homebrew.diff
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
@lgordon
lgordon / hack.sh
Created March 31, 2012 15:34 — forked from ghuntley/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@lgordon
lgordon / aclset.sh
Created December 6, 2011 20:30
Solaris ACL Script for downloads (SABnzbd/Torrents/Sick-beard)
#!/bin/bash
/usr/bin/chmod -R A+everyone@:list_directory/read_data/add_file/write_data/add_subdirectory/append_data/read_xattr/write_xattr/execute/delete_child/read_attributes/write_attributes/delete/read_acl/write_acl/write_owner/synchronize:file_inherit/dir_inherit/inherited:allow "$1"