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
// 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 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
; ParenScript experiment | |
; https://common-lisp.net/project/parenscript/reference.html | |
; https://gitlab.common-lisp.net/parenscript/parenscript | |
; typical functions | |
(defun fib (n) | |
(cond ((= n 0) 0) | |
((= n 1) 1) | |
(t (+ (fib (- n 1)) (fib (- n 2)))))) |
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
# Created By: Justin Meiners (2017) | |
# simple calculations | |
# ------------------------------- | |
import math | |
def volume_cone(radius, height): | |
volume = math.pi * (radius**2.0) * (height / 3.0) | |
return volume |
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
// Created By: Justin Meiners (2018) | |
pragma solidity ^0.4.24; | |
// https://en.wikipedia.org/wiki/Dutch_auction | |
contract DutchAuction { | |
uint public askingPrice; | |
address public auctioneer; | |
address public winner; | |
address public seller; |
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
# 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 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
// how to write a struct to a buffer. | |
typedef struct { | |
int version; | |
int count; | |
char id[8]; | |
} FileInfo; | |
FileInfo info; |
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
// notice that downloader doesn't need to import user interface | |
class Downloader { | |
// delegate has startDownload and finishDownload | |
constructor(delegate) { | |
this.delegate = delegate; | |
} | |
downloadFile() { |
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
python -m json.tool |
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
(use srfi-1) | |
; partition(0) | |
; (null) | |
; partition(n) | |
; (n) + part(0) | |
; (n - 1) + part(1) | |
; (n - 2) + part(2) | |
; ... |
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
fAEBABAAEgDgAAoBAQAAAAEABQAAAAEAAQBOAdwABAAAAAQAAAAAAAEAAAACAAAAAwAAAAEACADmAMQAAQAAAAEABAAAAAEAAADmAEYBAQAAAAEABgAAAAEAAgDqAJIBAQAAAAEABwAAAAEAAwByAP8AAAAAAAAABAAEAAUABgAHAIIB4AABAAAAAQAIAAAAAQAJAMUB4AABAAAAAQAJAAAAAQAKAPwB4gABAAAAAQAKAAAAAQALAP0BFgEBAAEAAQALAAAAAQAMAMQBGAEBAAEAAQAMAAAAAQANAIMBGgEBAAEAAQANAAAAAQAOAIYBUgEBAAAAAQAOAAAAAQAPAMIBUQEBAAAAAQAPAAAAAQAQAAACTwEBAAAAAQAQAAAAAQARAGwC9QABAAAAAQARAAAAAAACAAEAAAABAAMAAQAEAAEABQACAAUAAAAFAAMABQAEAAEABgAGAAcABwAIAAgACQAJAAoACgALAAsADAAMAA0ADQAOAA4ADwA= |