Skip to content

Instantly share code, notes, and snippets.

View jlisic's full-sized avatar

Jonathan Lisic jlisic

View GitHub Profile
use Lingua::EN::Fathom;
# this is a simple perl file to go along with linga.sas
# this work is derived from the example at CPAN:
# http://search.cpan.org/dist/Lingua-EN-Fathom/lib/Lingua/EN/Fathom.pm
# create object
my $text = new Lingua::EN::Fathom;
# read in text file
@jlisic
jlisic / 01.configure
Created December 21, 2014 14:08
Python 2.7.9 Failure
2014-12-18 17:46:49 -0500
./configure
--prefix=/home/lisijo/.linuxbrew/Cellar/python/2.7.9
--enable-ipv6
--datarootdir=/home/lisijo/.linuxbrew/Cellar/python/2.7.9/share
--datadir=/home/lisijo/.linuxbrew/Cellar/python/2.7.9/share
--enable-shared
checking build system type... x86_64-unknown-linux-gnu
@jlisic
jlisic / rasterTool.R
Last active June 28, 2017 14:44
Simple tools to use gdal to polygonize and rasterize
library(cdlTools)
library(rgdal)
library(raster)
library(rgeos)
# rasterize in the R 'raster' package is really slow, depending on your needs this may work better
# Author: Jonathan Lisic
# License BSD
polyExtract <- function(x) {
@jlisic
jlisic / sas2csv.R
Created May 27, 2015 02:15
Convert a sas binary file to a cvs without sas (but with R).
#!/usr/local/bin/Rscript
# get the usual argv
args <- commandArgs(trailingOnly == TRUE)
# get the input sas file name
inFile <- args[1]
# get the output csv file name
inFile <- args[1]
@jlisic
jlisic / downloadRate.R
Last active October 28, 2015 15:27
A tool to get CDL state level accuracies from R.
#Copyright (c) 2015, Jonathan Lisic
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
#
#1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
@jlisic
jlisic / atp.sh
Last active September 3, 2016 07:32
ATP Live Stream Recorder or Something Like That!
#!/bin/bash
# script to use with cron to capture the live stream
# this script is under no real license, and may give your dog
# lice, catch you on file, and is not warranted for any purpose
# what-so-ever
# to use with cron every 10min use
# crontab -e
# fun with sp objects
library(sp)
set.seed(100)
n <- 8
m <- rpois(lambda=2,n)+1
x_range <- c(0,100)
@jlisic
jlisic / App.R
Created November 17, 2017 13:56
Map Shiny Gist
library(shiny)
library(ggmap)
library(rgdal)
library(sp)
library(broom)
library(dplyr)
library(magrittr)
library(raster)
library(rgeos)
@jlisic
jlisic / meltdown_test.c
Created January 6, 2018 20:14
A simple program that shows the impact of meltdown.
/* a simple program that invokes the kernel */
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <linux/random.h>
int main() {
@jlisic
jlisic / Sample_Tessellation.R
Created January 16, 2018 18:23
Create a tessellation from a subset of sampled data.
# create a tessalation
sampleVoronoi <- function(x, sampled,rw=NULL) {
require(raster)
vor <- tile.list( deldir(x[sampled,1], x[sampled,2],rw=rw) )
vorPoly <- lapply( 1:length(vor) ,
function(i) {