This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import typing | |
import sys | |
''' | |
What this does: | |
Take in a representative jsonb blob and generate hierarchical sql accessors for | |
all its fields. You can use this with a querry like: | |
select twi.workflow_state, twi.workflow_type from temporal_workflow_indicies twi where twi.workflow_type = 'siteVisitWorkflow' limit 5; | |
to grab some representative JSON and then put it into Sigma with something like: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import typing | |
import sys | |
''' | |
What this does: | |
Take in a representative jsonb blob and generate hierarchical sql accessors for all its fields. | |
Usage: | |
python3 jsonbSQLAccessorGenerator.py 'representative json blob' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sin, atan, degrees | |
numberOfShelves = 13 | |
shelfSpacing = 8.0 ##inches | |
shelfBaseOffsetFromFloor = 4.0 ##inches | |
l_s = 5.0 ## inches, length of the shelf before the pole to the books | |
poleHeight = 106.0 ## inches, 8' 8" in inches | |
sumM_b = 0 | |
for shelfNumber in range(0,numberOfShelves): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import pyscreenshot as ss | |
import matplotlib.pyplot as plt | |
im=ss.grab() | |
im = np.array( im.convert('RGB') ) | |
numPixels = 1.0 * im.shape[0] * im.shape[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def actualTime(a, m, b): | |
te = (a + (4*m) + b )/6 | |
return te | |
def variance(a, b): | |
var = ( (b-a)/6 )**2 | |
return var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message = raw_input('Message to code is: ') | |
shift_value = 1 | |
newMessage = '' | |
for letter in message: | |
letter = ord(letter) + shift_value | |
newMessage = newMessage + chr(letter) | |
print 'Message is: ', newMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pylab as plt | |
plt.clf(); plt.close() | |
coNos = [1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0] | |
readingScores=[526,493,500,494,483,481,459,449,405] | |
mathScores = [562,496,487,492,466,483,468,421,387] | |
scienceScores=[542,501,502,514,470,488,478,447,415] | |
countries = ["Singapore", | |
"OECD\nAverage", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calculateElasticModulusInstron(x,y) | |
%%%% Compute the elastic modulus from experamental data. | |
%%%% INPUT VARIABLE DEF: x=load of sample from experamental data, | |
%%%% y=elongation of sample from experamental data. | |
%%prep matlab environment: | |
clc; clf; | |
%% Define length of the slope which you want to calculate Elastic Modulus for: | |
lengths1 = 300:1800; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Prepare environment | |
clear all; clc; clear figure; | |
%initialize vecctors for plotting: | |
Tgraph=[]; | |
Wgraph=[]; | |
%cycle through temperature range: | |
for T1=273.6:340.6 | |
Tgraph=[Tgraph,T1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
"""Copyright 2011 Phidgets Inc. | |
This work is licensed under the Creative Commons Attribution 2.5 Canada License. | |
To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/ | |
""" | |
__author__="Adam Stelmack" | |
__version__="2.1.8" | |
__date__ ="14-Jan-2011 2:29:14 PM" |