Skip to content

Instantly share code, notes, and snippets.

View neiled's full-sized avatar

Neil Edwards neiled

View GitHub Profile
@neiled
neiled / min_spanning_tree
Created February 7, 2014 16:23
min spanning tree
private void connectRooms(List<Room> rooms)
{
/*
Input: A non-empty connected weighted graph with vertices V and edges E (the weights can be negative).
Initialize: Vnew = {x}, where x is an arbitrary node (starting point) from V, Enew = {}
Repeat until Vnew = V:
Choose an edge {u, v} with minimal weight such that u is in Vnew and v is not
* (if there are multiple edges with the same weight, any of them may be picked)
Add v to Vnew, and {u, v} to Enew
Output: Vnew and Enew describe a minimal spanning tree
public void AddDoors(Level level)
{
for (int y = RoomStart.Y - 1; y <= RoomStart.Y + Height; y++)
{
for (int x = RoomStart.X-1; x <= RoomStart.X + Width; x ++)
{
if (y != RoomStart.Y - 1 && y != RoomStart.Y + Height && x != RoomStart.X - 1 && x != RoomStart.X + Width)
continue;
if (y < 0) continue;

Keybase proof

I hereby claim:

  • I am neiled on github.
  • I am neiled (https://keybase.io/neiled) on keybase.
  • I have a public key whose fingerprint is 6A8E 50E5 EC89 2C66 18B1 FD19 8663 92CE 7C80 AAB5

To claim this, I am signing this object:

@neiled
neiled / keybase.md
Created April 30, 2014 16:25
keybase.md

Keybase proof

I hereby claim:

  • I am neiled on github.
  • I am neiled (https://keybase.io/neiled) on keybase.
  • I have a public key whose fingerprint is B733 DCCB 65F0 0747 5F25 99CE B406 ABAE F9F3 8E18

To claim this, I am signing this object:

@neiled
neiled / gist:a46f9d89fecdeeacc619
Created May 11, 2015 18:53
Verifying I am +neiled on my passcard. https://onename.com/neiled
Verifying I am +neiled on my passcard. https://onename.com/neiled
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activeresource (3.0.3)
activesupport (3.0.3)
arel (2.0.4)
bcrypt-ruby (2.1.2)
builder (3.0.0, 2.1.2)
@neiled
neiled / AUAT.txt
Created July 19, 2011 15:52
Automated User Acceptance Tests
Contents:
Outside in development. BDD in .NET
Scenarios & Features
Automating acceptance testing -> BDD
-->Using MSTest
-->Using MSpec/SpecFlow
=========================================
@neiled
neiled / GivenSpecification.cs
Created August 2, 2011 12:00
GivenSpecification for Automated Acceptance Testing
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace IntegrationTestUtils
{
public abstract class GivenSpecification
{
public TestContext TestContext { get; set; }
/// <summary>
/// Steps that are run before each test.
Build 9 for DivaRemotingServer 1.0 (12.12.2011 14:05:00)
Action Group 5: Integration Tests
Action 1: Run MSTest tests on ~\_extracted\IntegrationTests\DivaRemoting.Tests.Integration.dll
Initializing Action...
Source and Target directory same; splitting.
RemoteAction Initialization Complete:
Temp Directory: C:\BuildMaster\_AGTTMP\_A7\_S0\TMP
Source Directory: C:\BuildMaster\_AGTTMP\_A7\_S0\SRC
Target Directory: C:\BuildMaster\_AGTTMP\_A7\_S0\WRK
Server: Build Server (Id: 8)
@neiled
neiled / req.json
Created May 18, 2012 06:39
Req Object
{ socket:
{ _handle:
{ writeQueueSize: 0,
socket: [Circular],
onread: [Function: onread] },
_pendingWriteReqs: 0,
_flags: 0,
_connectQueueSize: 0,
destroyed: false,
errorEmitted: false,