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
#Michael Shoemate | |
#This program calculates BMI | |
.data | |
npr:.asciiz "Name: " | |
wpr:.asciiz "Weight (whole pounds): " | |
hpr:.asciiz "Height (whole inches): " | |
bpr:.asciiz " Calculated BMI: " | |
name: .space 20 | |
weight: .word |
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/env python | |
from math import pi | |
from gimpfu import * | |
def composite_rotate(image, drawable, quantity): | |
pdb.gimp_image_undo_group_start(image) | |
visibility = {} | |
for layer in image.layers: |
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 gimpfu import * | |
from math import pi, sin, cos | |
# Quantity of lines to draw per period | |
# Lower - performance | |
# Higher - quality | |
granularity = 2000 | |
# Base formula: r = sin(n * theta) |
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
n := 3 | |
origin := 0 | |
offset := .0001 | |
f[x_] := (x + 1)^0.5 | |
precision := 40 | |
Sum[(((SeriesCoefficient[f[x], {x, x, i}]) /. x -> SetPrecision[origin, precision])*(SetPrecision[offset, precision])^i), {i, 0, n - 1}] | |
Sqrt[SetPrecision[1.0001, precision]] |
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
environment = [4, 5, 7, 8]; | |
expectation = 23; | |
% Initial weight | |
theta = 0.5; | |
theta_old = theta - 0.25; | |
while abs(theta - theta_old) > 1e-12 | |
% Derivative of squared error: ln = (expectation - reinforcement)^2 | |
dln_dr = -2 * (expectation - theta * environment); |
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
; Binds the Numlock key to a calculator. | |
; Double tap to launch or close. | |
; Single tap to focus or minimize. | |
; Place in start folder to automatically run. | |
#NoEnv | |
SendMode Input | |
SetWorkingDir %A_ScriptDir% | |
SetNumLockState AlwaysOn |
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 cos, sin, pi | |
import numpy as np | |
deg = 4 | |
rotations = [] | |
mirrors = [] | |
for i in range(deg): | |
rotat = np.array([[cos(2 * pi * i / deg), -sin(2 * pi * i / deg)], |
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 numpy as np | |
from mpl_toolkits.mplot3d import Axes3D | |
from mpl_toolkits.mplot3d.art3d import Poly3DCollection | |
from matplotlib.pyplot import figure, show | |
octahedron = np.array([[1,0,0], [-1,0,0], | |
[0,1,0], [0,-1,0], | |
[0,0,1], [0,0,-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
#!/usr/bin/env python | |
from gimpfu import * | |
def diagonal_flip(image, drawable, downward_diag, upward_diag): | |
pdb.gimp_image_undo_group_start(image) | |
if downward_diag: | |
pdb.gimp_item_transform_perspective(drawable, 0, 0, 0, drawable.height, | |
drawable.width, 0, drawable.width, drawable.height) |
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/env python | |
from gimpfu import * | |
def reflection_tile(image, drawable): | |
canvas = gimp.Image(drawable.width * 4, drawable.height * 4, RGB) | |
for layer in reversed(image.layers): | |
layer_tile = canvas.new_layer(layer.name) |