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
public class OrderProcessor | |
{ | |
public OrderProcessor(IOrderAllocator allocator, IOrderFulfiller fulfiller) | |
{ | |
// ... | |
} | |
public void Process() | |
{ | |
} |
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
// An action a mob can take. For example: wander, move towards goal, attack | |
public interface IMobAction | |
{ | |
bool CanExecute(Mob mob); | |
void Execute(Mob mob); | |
} | |
// A simple example: | |
public class WanderAction : IMobAction | |
{ |
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
mkdir -p /tmp/ungood | |
cd -p /tmp/ungood | |
echo 'cat /home/level02/.password' > date | |
chmod a+x date | |
export PATH=/tmp/ungood:$PATH | |
/levels/level01 |
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
var r = new Regex(@"^(?<property>[\w]+):(?<error>.+)$", RegexOptions.Multiline); | |
var lookup = r.Matches("xyz").Cast<Match>().ToLookup( | |
=> m.Groups["property"].Value, | |
=> m.Groups["error"].Value); |
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
public class WhenSomethingSomethingSomething : BaseShippingOverrideContext | |
{ | |
[TestCase(NoOverrideId, new DateTime(2011, 9, 23, 10, 21, 13), true] | |
[TestCase(PennsylvaniaNightSortId, new DateTime(2011, 9, 23, 14, 16, 0), true] | |
[TestCase(PennsylvaniaNightSortId, new DateTime(2011, 9, 23, 12, 0, 0), false] | |
public void CheckTimeRestrictionShouldReturnCorrectValue(int typeId, DateTime orderDate, bool expected) | |
{ | |
var override = ShippingOverridePostalCodeTypeFactory.CreateTypeById(typeId); | |
ServiceUnderTest.CheckTimeRestriction(override, orderDate); | |
} |
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
public class SensitiveStuff | |
{ | |
private List<int> doNotAddToMe = new List<int>(); | |
public IEnumerable<int> DoNotAddToMe | |
{ | |
get { return doNotAddToMe; } | |
} | |
} |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<project source="2.7.1" version="1.0"> | |
This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/). | |
<lib desc="#Wiring" name="0"> | |
<tool name="Splitter"> | |
<a name="facing" val="west"/> | |
</tool> | |
<tool name="Tunnel"> | |
<a name="width" val="8"/> | |
</tool> |
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
public static string GetProductDetails(string id) | |
{ | |
var reader = blahBlahBlah(); | |
var list = new List<object>(); | |
while(reader.Read()) | |
{ | |
list.Add(new { | |
Id = reader["Id"], | |
Name = reader["Name"], |
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
#include <Button.h> | |
// LEDs | |
const int numLedsInArray = 16; | |
const int numPinsPerLed = 3; | |
// Pattern Settings | |
const int patternIncrement = 16; | |
const int incrementDivider = 8; | |
const int patternRange = numLedsInArray * patternIncrement; //* incrementDivider; |
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
const int topPin = 3; | |
const int bottomPin = 4; | |
const int upPin = 5; | |
const int downPin = 6; | |
const int sensorPin = 0; // analog pin | |
const int nightThreshold = 50; | |
const int dayThreshold = 900; | |
const int nightLength = 8 * 60 * 60 * 1000; // 8 hours in ms. |