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
| level = 0 | |
| def trace(f): | |
| def g(*args): | |
| global level | |
| indent = '| ' * level + '|-- ' | |
| argstr = ", ".join([repr(a) for a in args]) | |
| print indent + f.__name__ + argstr | |
| level += 1 |
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
| .csharpcode, .csharpcode pre | |
| { | |
| font-size: small; | |
| color: black; | |
| font-family: Consolas, "Courier New", Courier, Monospace; | |
| background-color: #ffffff; | |
| /*white-space: pre;*/ | |
| } | |
| .csharpcode pre { margin: 0em; } |
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 lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <title>google_maps_custom_point</title> | |
| <style> | |
| body { | |
| margin: 0; |
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.Net; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| using System.Threading.Tasks; | |
| namespace ConsoleApp27 | |
| { |
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 void DrawRuler(int nInches, int majorLength) | |
| { | |
| DrawLine(majorLength, 0); | |
| for (int j = 1; j <= nInches; j++) | |
| { | |
| DrawInterval(majorLength - 1); | |
| DrawLine(majorLength, j); | |
| } | |
| } | |
| private static void DrawInterval(int centerLength) |
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
| /// <summary> | |
| /// A collection that returns the highest priority item first and lowest priority item last. | |
| /// </summary> | |
| /// <typeparam name="T">The type of data stored in the collection</typeparam> | |
| public class PriorityQueue<T> : IEnumerable<T> where T : IComparable<T> | |
| { | |
| LinkedList<T> _items = new LinkedList<T>(); | |
| /// <summary> | |
| /// Adds an item to the queue in priority order |
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; | |
| namespace longestCommonSubstring | |
| { | |
| 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
| public static class Permutations | |
| { | |
| public static IEnumerable<IEnumerable<T>> Get<T>(IEnumerable<T> set, IEnumerable<T> subset = null) | |
| { | |
| if (subset == null) subset = new T[] { }; | |
| if (!set.Any()) yield return subset; | |
| for (var i = 0; i < set.Count(); i++) | |
| { | |
| var newSubset = set.Take(i).Concat(set.Skip(i + 1)); |
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
| import java.util.Scanner; | |
| public class QueueJakes { | |
| public static void main (String [] args) { | |
| Scanner myscan = new Scanner(System.in); | |
| System.out.print("Enter max queue size: "); | |
| int qSize = myscan.nextInt(), choice; | |
| Queue q = new Queue(qSize); |
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
| <!-- | |
| Install dependencies with Bower: | |
| bower install PolymerElements/paper-elements#^1.0.7 | |
| --> | |
| <html> | |
| <head> | |
| <title>Auth Example</title> | |
| <link rel="shortcut icon" href="/favicon.png" type="image/x-icon"> |