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 fd.fd_stencil as fd | |
import numpy as np | |
import math | |
import matplotlib.pyplot as plt | |
""" | |
Approximate u''(x) = sin^2(x/2), 0 < x < 2*Pi | |
with boundary conditions u(0) = 0 and u(2*Pi) = 2*Pi. | |
using: | |
- 2nd-order accurate finite-difference approximation; |
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 toolutils | |
# Works in Houdini 16.5, assumes points are selected inside /obj/geo1. | |
selection = toolutils.sceneViewer().currentGeometrySelection() | |
node = selection.nodes()[0] | |
points = node.geometry().globPoints(selection.mergedSelectionString()) | |
curve = hou.node('/obj/geo1/').createNode('curve') | |
pstr = '' | |
for i in range(len(points)): |
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
struct SillyFunction | |
{ | |
SillyFunction() {} | |
Vec3d operator()(const Vec3d& xyz) const | |
{ | |
return Vec3d(3.0 * xyz.y() + 1.0, 5.0 * xyz.z() + 7.0, -1.0 * xyz.x() - 9.0); | |
} | |
}; | |
TEST(Grids, MacGrid) |
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
struct SillyFunction | |
{ | |
SillyFunction() {} | |
Vec3d operator()(const Vec3d& xyz) const | |
{ | |
return Vec3d(3.0 * xyz.y() + 1.0, 5.0 * xyz.z() + 7.0, -1.0 * xyz.x() - 9.0); | |
} | |
}; | |
TEST(Grids, MacGrid) |
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 csv | |
import base64 | |
import hashlib | |
f = open('guests.csv', "r", encoding='utf-8', errors='ignore') | |
csv_f = csv.reader(f) | |
for row in csv_f: | |
s = '' | |
for element in row: | |
s += element |
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 string | |
import requests | |
html = 'https://s3.amazonaws.com/.../email.htm' | |
content = requests.get(html) | |
DJANGO_MAILGUN_SERVER_NAME = '' | |
DJANGO_MAILGUN_API_KEY = '' | |
recipient_list = ['[email protected]', '[email protected]'] |
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
## This is very Mac-specific, but there are other ways of obtaining the same package | |
brew install graphviz | |
pip install pygraphviz | |
## django-cookiecutter ships with 'django_extensions' | |
## if not being used, do it manually by | |
pip install django-extensions | |
## and in the settings.py config file of your django app, | |
## 'django_extensions' has to be added. |