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 SafeCollection<T> : ICollection<T> | |
| { | |
| private readonly ConcurrentDictionary<T, bool> _inner = new ConcurrentDictionary<T, bool>(); | |
| public void Add(T item) | |
| { | |
| _inner.TryAdd(item, true); | |
| } | |
| public void Clear() |
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
| class Program | |
| { | |
| static void Main() | |
| { | |
| //This method will cause the CPU to be at 100% | |
| //However it will only create enough threads | |
| //based on the # of cores in your system. | |
| //(As long as you don't pass LongRunning as an option | |
| Run(SpinWait); |
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
| namespace ConsoleApplication403 | |
| { | |
| using System; | |
| using System.ComponentModel; | |
| using System.IO; | |
| class Program | |
| { | |
| static void Main() | |
| { |
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
| (function ($, undefined) { | |
| var parrot = { | |
| parse: function(params) { | |
| var defaults = { host: [], model: null, source: "" }; | |
| $.extend(defaults, params); | |
| var parser = new Parser(); | |
| var view = new ParrotDocumentView(parser.parse(params.source)); | |
| return view.render(params.host, params.model); | |
| } | |
| }; |
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
| <html> | |
| <head> | |
| <style type='text/css'> | |
| #container { | |
| width: 1240px; | |
| border-top: solid 1px #282828; | |
| border-left: solid 1px #282828; | |
| overflow: auto; | |
| } |
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 src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <!-- normally you wouldn't show this --> | |
| <div id="paste" contenteditable="true"></div> | |
| <script type="text/javascript"> |
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
| namespace BST | |
| { | |
| using System; | |
| using System.Collections; | |
| public class BloomFilter<T> | |
| { | |
| private readonly int _size; | |
| //how many times to run the hash method |
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 parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
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
| namespace WorldDomination.Web.Authentication.OpenId | |
| { | |
| using System; | |
| using System.Collections.Specialized; | |
| using DotNetOpenAuth.Messaging; | |
| using DotNetOpenAuth.OpenId; | |
| using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; | |
| using DotNetOpenAuth.OpenId.RelyingParty; | |
| /// <summary> |
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
| namespace WorldDomination.Web.Authentication.OpenId | |
| { | |
| using System; | |
| using System.Collections.Specialized; | |
| using DotNetOpenAuth.Messaging; | |
| using DotNetOpenAuth.OpenId; | |
| using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration; | |
| using DotNetOpenAuth.OpenId.RelyingParty; | |
| /// <summary> |