- The application is a simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.
- There are no other obstructions on the table surface.
- The robot is free to roam around the surface of the table, but must be prevented from falling to destruction. Any movement that would result in the robot falling from the table must be prevented, however further valid movement
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
| /* | |
| This is a quick example of how to fake out the response for calling a Google API endpoint. | |
| I'm using the QPX Express api as an example, but I'm _assuming_ this could apply accross the board | |
| for other Google API's. | |
| The reason you would want to do this, is so you don't need to hit the internet to get your results | |
| (think, coding on a plane, no internet coverage, no hurting your API allowance, etc). | |
| The main trick here is that we need to do two things: | |
| 1. Create a fake HttpMessageHandler |
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
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| using Raven.Client; | |
| using Raven.Client.Linq; | |
| using Raven.Tests.Helpers; | |
| using Xunit; | |
| namespace ClassLibrary1 | |
| { |
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
| private ConcurrentQueue<Message> _queue = new ConcurrentQueue<Message>(); | |
| private SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1); | |
| public async Task DoTheThing() | |
| { | |
| var tasks = new Task[20]; | |
| for (var i = 0; i < tasks.Length; i++) | |
| { | |
| tasks[i] = UploadMessages(); | |
| } |
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
| $isPr = "No"; | |
| if ($env:APPVEYOR_PULL_REQUEST_NUMBER) | |
| { | |
| $isPr = "Yes = PR #: $env:APPVEYOR_PULL_REQUEST_NUMBER" | |
| } | |
| $isTag = "No"; | |
| if ($env:APPVEYOR_REPO_TAG -eq $TRUE) | |
| { | |
| $isTag = "Yes = Tag: $env:APPVEYOR_REPO_TAG_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
| using System; | |
| using System.Configuration; | |
| using System.Text; | |
| using System.Threading; | |
| using System.Web.Mvc; | |
| using StackExchange.Redis; | |
| namespace WebApplication2.Controllers | |
| { | |
| public class HomeController : Controller |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Raven.Client.Document; | |
| namespace ConsoleApplication5 | |
| { | |
| class Program |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using Raven.Client.Document; | |
| namespace ConsoleApplication5 | |
| { | |
| class Program |
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
| // How can I create a CatValidator and EagleValidator that both use (inherit) an AnimalValidator? | |
| public abstract class Animal | |
| { | |
| public string Name { get; set; } | |
| } | |
| public class Cat : Animal | |
| { |
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
| using System.Collections.Generic; | |
| using System.Linq; | |
| using Nancy; | |
| using Nancy.Testing; | |
| using Newtonsoft.Json; | |
| using Shouldly; | |
| using Xunit; | |
| namespace ConsoleApplication4 | |
| { |