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
# Created By: Justin Meiners (2012) | |
# This was really useful at one point. I doubt it still is. | |
from pymel.all import * | |
import pymel | |
selection_list = pymel.core.ls(type="transform", selection=True) | |
for node in selection_list: | |
node.centerPivots() | |
point = node.getRotatePivot(space="world") |
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
(define (eval-html templ env) | |
(define (lookup-var key env) | |
(let ((pair (assoc key env))) | |
(if (pair? pair) | |
(cdr pair) | |
'()))) | |
(define (tag? templ) |
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 math | |
def sqrt(x_0, guess, tol): | |
x = guess | |
while math.fabs(x*x - x_0) > tol: | |
x = (x*x - x_0) / (2.0 * x) | |
return x | |
print(sqrt(2.0, 2.0, 0.0001)) |
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
(use srfi-1) | |
(define (advance ls n) | |
(if (< n 1) | |
ls | |
(advance (cdr ls) (- n 1)))) | |
(define (subset ls start count) | |
(define (build-cell it i) | |
(if (= i count) |
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
// See my SO answer https://stackoverflow.com/questions/35208476/unity3d-difference-between-multiplypoint-and-multiplypoint3x4 | |
// https://github.com/jameslinden/unity-decompiled/blob/master/UnityEngine/UnityEngine/Matrix4x4.cs | |
public Vector3 MultiplyPoint(Vector3 v) | |
{ | |
Vector3 vector3; | |
vector3.x = ( m00 * v.x + m01 * v.y + m02 * v.z) + m03; | |
vector3.y = ( m10 * v.x + m11 * v.y + m12 * v.z) + m13; | |
vector3.z = ( m20 * v.x + m21 * v.y + m22 * v.z) + m23; | |
float num = 1f / ( ( m30 * v.x + m31 * v.y + m32 * v.z) + m33); | |
vector3.x *= 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
(define (prime-sieve count) | |
(let ((marked (make-vector count #f))) | |
(define (build-list index) | |
(if (>= index count) | |
'() | |
(if (vector-ref marked index) | |
(build-list (+ index 1)) | |
(cons (+ index 1) (build-list (+ index 1)))))) |
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
(use srfi-1) | |
; partition(0) | |
; (null) | |
; partition(n) | |
; (n) + part(0) | |
; (n - 1) + part(1) | |
; (n - 2) + part(2) | |
; ... |
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
#include <stdint.h> | |
#include <stdio.h> | |
typedef struct | |
{ | |
float x, y, z; | |
} Vec3; | |
typedef struct |
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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <regex> | |
#include <ctype.h> | |
namespace Lisp | |
{ |
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
#include <iostream> | |
template <typename T> | |
struct vector | |
{ | |
constexpr static int DEFAULT_SIZE = 16; | |
vector() | |
{ | |
size = 0; | |
capacity = 0; |