Skip to content

Instantly share code, notes, and snippets.

View cbcunc's full-sized avatar

Chris Calloway cbcunc

View GitHub Profile
import os.path
from genquery import Query, AS_DICT
def testFunc(rule_args, callback, rei):
callback.writeLine("serverLog", "Entering testFunc")
x = rule_args[0]
y = rule_args[1]
callback.writeLine("serverLog", "x = [{}]".format(x))
callback.writeLine("serverLog", "y = [{}]".format(y))
rule_args[1] = "This is new!"
@cbcunc
cbcunc / nestprop.py
Created September 28, 2020 21:08
Nested Properties
class Outer(object):
"""
>>> Outer.class_attr
'ca0'
>>> outer = Outer("ia0", "ia1", "ia2")
>>> outer.inst_attr
'ia0'
>>> outer.inner
<__main__.Outer.Inner object at 0x...>
>>> outer.inner.class_attr
metadata:
spec:
restartPolicy: Never
volumes:
- flexVolume:
driver: informaticslab/pysssix-flex-volume
options:
readonly: "true"
name: s3
containers:
@cbcunc
cbcunc / SQLite-with-MATLAB.rst
Last active April 23, 2018 07:15
SQLite with MATLAB

I found that that MATLAB has JDBC drivers just for SQLite. These drivers do not expect a client/server database. They work fine with the flat database file SQLite produces.

There are also MEX clients for SQLite. These client would be more difficult to include in a standalone compiled MATLAB program than a JAR file. So I will concentrate on how to use the JDBC drivers.

First things to do is to get that special JDBC driver for SQLite for your platform. There are many different drivers for this purpose.

@cbcunc
cbcunc / myhpom-document-creation-after.png
Last active March 15, 2018 12:32
MyHPOM Document Creation Before and After PR
myhpom-document-creation-after.png
@cbcunc
cbcunc / myhpom-create-document-no-files.png
Last active March 14, 2018 14:06
myhpom-create-document-no-files.png
myhpom-create-document-no-files.png
@cbcunc
cbcunc / gist:d9e4a6c6a36018923a655f49dd2f12f0
Last active July 14, 2017 20:42
Creating a Jupyter Dashbord Bundle Publisher
conda create -c conda-forge -n rsmbund jupyter
source activate rsmbund
conda install -y -c conda-forge/label/rc -c conda-forge h5py
conda install -y -c conda-forge/label/rc -c conda-forge libpng
conda install -y -c conda-forge/label/rc -c conda-forge matplotlib
conda install -c conda-forge/label/rc -c conda-forge ipywidgets
conda install -y -c conda-forge/label/rc -c conda-forge basemap
conda install -y -c conda-forge/label/rc -c conda-forge basemap-data-hires
conda install -y -c conda-forge/label/rc -c conda-forge owslib
pip install ipympl
conda create -c conda-forge -n rsmbund jupyter
source activate rsmbund
conda install -y -c conda-forge/label/rc -c conda-forge h5py
conda install -y -c conda-forge/label/rc -c conda-forge libpng
conda install -y -c conda-forge/label/rc -c conda-forge matplotlib
conda install -c conda-forge/label/rc -c conda-forge ipywidgets
conda install -y -c conda-forge/label/rc -c conda-forge basemap
conda install -y -c conda-forge/label/rc -c conda-forge basemap-data-hires
conda install -y -c conda-forge/label/rc -c conda-forge owslib
pip install ipympl
@cbcunc
cbcunc / gist:3be54ec00e78e657a0df65e65bfb6d92
Created July 13, 2017 19:42
Kludges to deploy a Jupyter Dashboards Bundle to Jupyter Dashboards Server
> jupyter kernelgateway
edit kernel name in index.ipynb of bundle with the output of :
> jupyter kernelspec list
run server and gateway in same env and same dir as unzipped bundle
> jupyter —help # for commands
name: rsmdash
channels: !!python/tuple
- defaults
dependencies:
- conda-forge/label/rc::matplotlib=2.0.0rc1=np111py35_1
- conda-forge::backports.shutil_get_terminal_size=1.0.0=py35_0
- conda-forge::basemap=1.0.8.dev0=np111py35_3
- conda-forge::basemap-data-hires=1.0.8.dev0=2
- conda-forge::ca-certificates=2016.9.26=0
- conda-forge::cairo=1.14.6=0