Skip to content

Instantly share code, notes, and snippets.

View bennoblumenthal's full-sized avatar

Benno Blumenthal bennoblumenthal

View GitHub Profile
@bennoblumenthal
bennoblumenthal / sample.ps
Created May 4, 2015 20:38
structure sample
expert
structure
/fred integer
/joe real
/sample myname
endstructure
new
25 store fred
250 store joe
@bennoblumenthal
bennoblumenthal / timescales.ps
Created April 6, 2015 21:32
Sample of complicated provenance
expert
0 ds
/UEA3p1 {SOURCES .UEA .CRU .TS3p1 .r2p5 .tmp SOURCES .UEA .CRU .TS3p1 .climatology .c1901-2009 .tmp[X Y]regridLinear sub X /gridtype periodic def pop}def
/GISSL {SOURCES .NASA .GISS .GISSTEMP .d2x2 .LandOnly .tempanomaly SOURCES .NASA .GISS .GISSTEMP .climatology .c1901-2009 .LandOnly .tempanomaly sub /name /tmp def}def
/GISSLO {SOURCES .NASA .GISS .GISSTEMP .d2x2 .Land-Ocean .tempanomaly SOURCES .NASA .GISS .GISSTEMP .climatology .c1901-2009 .Land-Ocean .tempanomaly sub /name /tmp def}def
(UEA3p1)
/refdata parameter
get
exec
T (Jun)
@bennoblumenthal
bennoblumenthal / samplejsonld.ps
Last active August 29, 2015 14:17
Sample JSONLD with preliminary provenance code
SOURCES .NOAA .NCEP .EMC .CMB .GLOBAL .Reyn_SmithOIv2 .weekly .sst
SOURCES .NOAA .NCEP .EMC .CMB .GLOBAL .Reyn_SmithOIv2 .pentad-climatology .sst
[T]1.0 0.0 regridLinear
sub
sstacolorscale
3 mul
[T]average
provenance
tojsonldstring
@bennoblumenthal
bennoblumenthal / JSONLD.ps
Last active August 29, 2015 14:17
Exploration of traversals needed to generate JSON-LD versions of Ingrid objects
Ingrid: /provenance {provhash 1 index getknown { /prov:refcount prov:refcount 1 add def object2Reference nip}{provhash 1 index 1 index length put dup type /arraytype eq {[exch {provenance}forall]}{dup /myproc getknown {currentobject provhash exch get prov:resultFrom 5 object exch /@id exch def exch /prov:proc exch def 1 index .dataset dup null eq {pop}{ /prov:appliedTo exch provenance def}ifelse}{currentobject provhash exch get prov:extractionFrom 5 object exch /@id exch def /prov:proc name def dataset null ne { /prov:appliedTo dataset provenance def}{ /@type /source def}ifelse}ifelse /prov:refcount 1 def exch 1 index exch provhash !}ifelse}ifelse}put
SOURCES .NOAA .NCEP .EMC .CMB .GLOBAL .Reyn_SmithOIv2 .weekly .sst
SOURCES .NOAA .NCEP .EMC .CMB .GLOBAL .Reyn_SmithOIv2 .pentad-climatology .sst
[T]1.0 0.0 regridLinear
sub
sstacolorscale
3 mul
[T]average
provenance
null
@bennoblumenthal
bennoblumenthal / provenancesample.ps
Last active August 29, 2015 14:17
Start of creating JSON rendering of Ingrid provenance
expert
Ingrid: /provhash null
5 object
put
Ingrid: /JSON null
5 object
/==alias /JSON cvx def
/JSONskip null
5 object
def
@bennoblumenthal
bennoblumenthal / gist:5736906
Last active December 18, 2015 05:59
Sample PURE with multiple templates as $p target -- works fine as render, not so fine compiled
File Edit Options Buffers Tools HTML SGML Help
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://rawgithub.com/
@bennoblumenthal
bennoblumenthal / sample.html
Last active December 17, 2015 10:29
I have an issue with iterating over a JSON object using AutoRender -- I can iterate over a JSON object or JSON array with the same directive, but with autoRender it works with an array but not with an object.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>sample html file with PURE error on auto-render nesting</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://github.com/pure/pure/raw/master/libs/pure.js"></script>
</head>
<body>
<style>
@bennoblumenthal
bennoblumenthal / sampl.html
Last active December 17, 2015 09:28
sample html file with PURE error on auto-render nested JSON
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>sample html file with PURE error on auto-render nested JSON</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://github.com/pure/pure/raw/master/libs/pure.js"></script>
</head>
<body>
<script>