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
-- Adapted from http://rosettacode.org/wiki/Sorting_algorithms/Quicksort#Lua | |
function quicksort (t, start, endi) | |
start = start or 0 | |
endi = endi or table.getSize ( t ) - 1 | |
if(endi - start < 1) then return t end | |
local pivot = start |
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
// Rain of Arrows | |
// Author: Zachary Burke | |
// 5/7/2010 | |
using System; | |
using System.Collections.Generic; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Audio; | |
using Microsoft.Xna.Framework.Content; | |
using Microsoft.Xna.Framework.GamerServices; |
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
-- Author: Zachary Burke | |
-- License: MIT | |
-- | |
-- Steam Achievement Image Converter | |
-- | |
-- /-----------\ ----> Color JPG | |
-- (Color PNG) ----> |This script| | |
-- \-----------/ ----> Grayscale JPG | |
-- | |
-- Each Steam Achievement requires two 64x64 JPG files. One image for the unachieved state and the |
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
-- I have cube whose origin is in the center of the cube. | |
-- I want to place a joint on the end face of the cube, the +Z end. | |
-- -------------- | |
-- | | | |
-- | |<--- Joint here | |
-- | | | |
-- -------------- | |
-- | |
-- I know that the width of the box is boxLength, so the localspace coordinate that gives me the | |
-- end of the box is 0, 0, boxLength * 0.5 (remember that the origin is in the center) |
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
local ex,ey,ez = object.getTranslation ( hEnemy,object.kGlobalSpace ) | |
local ox,oy,oz = object.getTranslation ( o,object.kGlobalSpace ) | |
-- vector pointing at the enemy | |
local dx,dy,dz = math.vectorSubtract ( ex,ey,ez,ox,oy,oz ) | |
-- distance between enemy and object | |
local dist = math.vectorLength ( dx,dy,dz ) | |
-- vector pointing at enemy with length of half the distance |
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
lfs = require "lfs" | |
local sPath = 'D:/temp photos/' | |
function hasExtension ( sFilename, sExt ) | |
if sFilename then | |
return string.match ( string.lower ( sFilename ), "." .. string.lower( sExt ) ) ~= nil | |
end | |
return false | |
end |
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
-- | |
-- Put at the root of your project and run | |
-- | |
lfs = require "lfs" | |
function findAllAI ( ) | |
local t = {} | |
count = 1 | |
for file in lfs.dir('./Resources/AIModels') do | |
local sName, sExt = getFileNameAndExtension ( file ) |
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
@echo off | |
set SOURCE=C:\projects\UnrealEngine | |
set DESTINATION=C:\projects\perforce\UnrealEngine | |
REM Samples | |
xcopy /e /f /r /h /i %SOURCE%\Samples %DESTINATION%\Samples | |
REM Templates | |
xcopy /e /f /r /h /i %SOURCE%\Templates %DESTINATION%\Templates |
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
# http://codingmess.blogspot.com/2009/05/conversion-of-wavelength-in-nanometers.html | |
def wav2RGB(wavelength): | |
w = int(wavelength) | |
# colour | |
if w >= 380 and w < 440: | |
R = -(w - 440.) / (440. - 350.) | |
G = 0.0 | |
B = 1.0 | |
elif w >= 440 and w < 490: |
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
// ==UserScript== | |
// @name Sketchfab Oculus-izer | |
// @namespace https://sketchfab.com/ | |
// @description Replace all model links with dk1/dk2 links | |
// @include https://sketchfab.com/* | |
// ==/UserScript== | |
// DK1 users change this to false | |
var bIsUsingDK2 = true; | |
var dk1String = '/embed?oculus=1' |
OlderNewer