This file contains hidden or 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
| classdef air < handle | |
| % AIR Thermal-physical properties of air at 1 atm between temperatures | |
| % of 200 K and 350 K. | |
| % Mark Mikofski | |
| % Version 1-0, 2010-10-29 | |
| properties | |
| description = 'air at 1 atm between 200 and 350 K' | |
| end | |
| properties | |
| Temp |
This file contains hidden or 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/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| `Topological sort by Kahn (1962) on Wikipedia | |
| <http://en.wikipedia.org/wiki/Topological_sorting>`_ | |
| L ← Empty list that will contain the sorted elements | |
| S ← Set of all nodes with no incoming edges | |
| while S is non-empty do | |
| remove a node n from S |
This file contains hidden or 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 ast | |
| allowed_functions = set([ | |
| #math library | |
| 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', | |
| 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'erf', | |
| 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', | |
| 'frexp', 'fsum', 'gamma', 'hypot', 'isinf', 'isnan', 'ldexp', | |
| 'lgamma', 'log', 'log10', 'log1p', 'modf', 'pi', 'pow', 'radians', | |
| 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc', |
This file contains hidden or 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 ast | |
| import math | |
| SAFE_FX = { | |
| 'exp': math.exp, | |
| } | |
| SAFE_NODES = set( | |
| (ast.Expression, | |
| ast.Num, |
This file contains hidden or 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 Tkinter import Canvas, GROOVE, BOTH, X, Y, YES, RIGHT, LEFT, W | |
| from ttk import Frame, Scrollbar, Checkbutton | |
| import logging | |
| import tkMessageBox | |
| class ScrolledCanvas(Frame): | |
| """ | |
| A scrolling canvas of frames with checkboxes. | |
| """ |
This file contains hidden or 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/env python | |
| from Tkinter import * | |
| from ttk import * | |
| import calendar | |
| root = Tk() | |
| master = Frame(root) |
This file contains hidden or 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/env python | |
| from Tkinter import * | |
| from ttk import * | |
| root = Tk() # create a top-level window | |
| master = Frame(root, name='master') # create Frame in "root" | |
| master.pack(fill=BOTH) # fill both sides of the parent |
This file contains hidden or 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
| <!-- begin CSS styles --> | |
| <head><style type="text/css"> | |
| .block-code{ | |
| background-color: pink; | |
| border-style: solid none; | |
| border-color: red white; | |
| font-family: "Courier New", Courier, monospace; | |
| } | |
| .inline-code { |
This file contains hidden or 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
| """ | |
| An example of a combobox that adds user entries using key binding to return | |
| """ | |
| from Tkinter import * | |
| from ttk import * | |
| def on_combobox_selected(event): | |
| new_value = event.widget.get() | |
| is_in_list = event.widget.current() |