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
| <?php | |
| /** | |
| * Not truely a visitor pattern as no accept() methods are being implemented; in this case | |
| * there's just no need to complicate things | |
| */ | |
| interface VisitorPattern | |
| { | |
| static public function visit(&$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 urllib2 | |
| import threading | |
| from Queue import Queue | |
| import sys, os, re | |
| class ThreadedDownload(object): | |
| REGEX = { | |
| 'hostname_strip':re.compile('.*\..*?/', re.I) | |
| } |
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
| # Uses PySQLPool (http://code.google.com/p/pysqlpool/) for the database connection. | |
| from PySQLPool.PySQLConnection import PySQLConnection | |
| from PySQLPool.PySQLQuery import PySQLQuery | |
| import urllib2 | |
| import threading | |
| import sys | |
| dbconn = PySQLConnection(host='localhost',user='user',password='password',port=3306,db='schema',charset='utf8') | |
| query = PySQLQuery(dbconn, commitOnEnd=True) |
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 copy | |
| class State(object): | |
| solutions = [] | |
| def __init__(self): | |
| self.zombied = [] | |
| self.bridged = [] | |
| self.flashlight = 'zombied' | |
| self.weight = 0 |
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
| THREE.Vector3.prototype.lerp = function ( a, t ) { | |
| return this.clone().addSelf( a.clone().subSelf( this ).multiplyScalar( t ) ); | |
| }; | |
| THREE.Vertex.prototype.interpolate = function( other, t ) { | |
| var v = new THREE.Vertex( this.position.lerp( other.position, t ) ); | |
| v.normal = this.normal.clone(); | |
| return v; | |
| }; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="csg.js"></script> | |
| <script type="text/javascript" src="http://chandler.prallfamily.com/threebuilds/builds/r46/ThreeDebug.js"></script> | |
| <script type="text/javascript" src="ThreeBSP.js"></script> |
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
| /* | |
| THREE.CSG | |
| @author Chandler Prall <[email protected]> http://chandler.prallfamily.com | |
| Wrapper for Evan Wallace's CSG library (https://github.com/evanw/csg.js/) | |
| Provides CSG capabilities for Three.js models. | |
| Provided under the MIT License | |
| */ |
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 strict'; | |
| var collisionsound1 = new buzz.sound( "assets/sounds/collision1", { | |
| formats: [ 'wav' ] | |
| }); | |
| collisionsound1.load(); | |
| var collisionsound2 = new buzz.sound( "assets/sounds/collision2", { | |
| formats: [ 'wav' ] | |
| }); |
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
| TerraFrame.TerrainShader = function ( shader_config ) { | |
| var i, vertexShader, fragmentShader; | |
| shader_config = TerraFrame.utils.merge( | |
| { | |
| uniforms: [], | |
| textures: [], | |
| pieces: [], | |
| pervertex_textures: [] |
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
| terrain_shader = new TerraFrame.TerrainShader({ | |
| uniforms: [ | |
| { name: 'sunlight_dir', type: 'v3', value: new THREE.Vector3( -.5, .8, .7 ) } | |
| ], | |
| textures: [ | |
| { name: 'grass', asset: 'terrain.grass', repeat: new THREE.Vector2( 2, 2 ) }, | |
| { name: 'rock', asset: 'terrain.rock', repeat: new THREE.Vector2( 3, 3 ) }, | |
| { name: 'sand', asset: 'terrain.sand', repeat: new THREE.Vector2( 2, 2 ) } | |
| ], | |
| pieces: [ |
OlderNewer