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
using System.DirectoryServices; | |
public class LDAP | |
{ | |
static DirectoryEntry _de = new DirectoryEntry("LDAP://[LDAP server host]", "[service account]", "[service account password]"); | |
static T LookupAnd<T>(string LoginName, System.Func<SearchResult,T> cb) | |
{ | |
using (var dsearch = new DirectorySearcher(_de)) | |
{ |
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
// ported from http://alienryderflex.com/intersect/ | |
public static function LineIntersection(a:Point, b:Point, c:Point, d:Point):Point | |
{ | |
var distAB:Number, cos:Number, sin:Number, newX:Number, ABpos:Number; | |
if ((a.x == b.x && a.y == b.y) || (c.x == d.x && c.y == d.y)) return null; | |
if ( a == c || a == d || b == c || b == d ) return null; | |
b = b.clone(); |
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
using System; | |
using System.Collections.Generic; | |
namespace Microsoft.Xna.Framework.Graphics | |
{ | |
/// <summary> | |
/// Batch-draws a series of lines defined by 3d points (and more). Much faster than drawing one-by-one. | |
/// </summary> | |
/// <typeparam name="VertexType">The vertex type to use (such as VertexPositionColor)</typeparam> | |
public class LineBatch<VertexType> where VertexType : struct, IVertexType |
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
abstract class GUI | |
{ | |
#region Enums | |
public enum ElementState | |
{ | |
None, | |
Hovered, | |
Clicked, |
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
tileset.Texture = Content.Load<Texture2D>(tileset.File); | |
tileset.spacing = (Math.Sqrt(64 * 64 + 48 * 48)); | |
double a = Math.Atan2(48, 64); | |
tileset.cos = Math.Cos(a); | |
tileset.sin = Math.Sin(a); | |
----------------------------------------------- | |
for (int y = 0; y < mapHeight; ++y) | |
{ |
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
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
/* | |
* Disclaimer: No validation, only use on good input | |
* Also, Pants is the name of the game engine I'm working on. | |
*/ | |
namespace Pants { | |
class psr | |
{ |