This file contains 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 List<List<Cell>> World; // 100x100 2d list of Struct | |
private void FloodFill() | |
{ | |
var edge = new List<Cell> { World[0][0] }; | |
var seen = new HashSet<Cell> { }; | |
//while (edge.Count > 0) | |
for (var i = 0; i < 50; i++) // Just run 50 iterations | |
{ |
This file contains 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 what the data looks like | |
interface Battle { | |
entries: number[]; | |
host: string; | |
id: number; | |
major: boolean; | |
timestamp: string; | |
title: string; | |
} |
This file contains 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
DEBUG:TS:Body sequence#: 610 | |
DEBUG:TS:Read body of length: 83 | |
DEBUG:TS:Body sequence#: 611 | |
DEBUG:TS:Read body of length: 83 | |
DEBUG:TS:Body sequence#: 612 | |
DEBUG:TS:Read body of length: 83 | |
DEBUG:TS:Body sequence#: 613 | |
DEBUG:TS:Read body of length: 83 | |
DEBUG:TS:Body sequence#: 614 |
This file contains 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
DEBUG:TS:Body sequence#: 358 | |
DEBUG:TS:Read body of length: 83 | |
DEBUG:TS:Body sequence#: 359 | |
DEBUG:TS:Read body of length: 83 | |
DEBUG:TS:Body sequence#: 360 | |
DEBUG:TS:Read body of length: 83 | |
DEBUG:TS:Body sequence#: 361 | |
DEBUG:TS:Read body of length: 83 | |
DEBUG:TS:Body sequence#: 362 | |
DEBUG:TS:Read body of length: 83 |
This file contains 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 DbPerson.cs { | |
var id: int | |
var email: string | |
var snippet: string | |
var bio: string | |
var created: DateTime | |
var firstname: string | |
var lastname: string | |
var birthdate: DateTime? | |
var gender: string |
This file contains 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
# TODO | |
# * Parse out name of class | |
# * Parse nested objects | |
# * Since they are explicitly marked with ForeignKey("nameOfProperty"), this should be a single regex | |
# * test against different files | |
import re | |
filename = "DbPerson.cs" | |
test = "".join([line for line in open(filename)]) |
This file contains 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
// JSON String -> Object | |
// Still TODO: | |
// 1. Nested JSON object parsing | |
// 2. String -> JSON data type | |
// Data structures to hold JSON | |
// Probably not necessary but they make the code nice and I wanted to learn about them | |
enum JSONItem { | |
case StringEntry(String, String) |
This file contains 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 re | |
CLASS_RE = r'(export )?class ([^\s]+)' | |
MODULE_RE = r'(declare )?module ([^\s]+)' | |
INTERFACE_RE = r'interface ([^\s]+)' | |
FUNCTION_RE = r'^\s*(static)?\s*([^\(]+)\(' | |
PARAM_RE = r'^\s*(static)?\s*([^:^\(]+):' | |
DOCS_START = r'^\s*/\*\*\s*$' | |
DOCS_END = r'^\s*\*/\s*$' | |
CLOSE_BRACKET_RE = r'^\s*\};?\s*$' |
This file contains 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
haxe -cp /Users/grantm/code/punktest/src/ -cp /Users/grantm/code/punktest/fp/src/ -lib nmedev --remap flash:nme -cpp /Users/grantm/code/punktest/Main -D st_display --display /Users/grantm/code/punktest/src/Main.hx@262 --no-output | |
VS | |
Popen(['haxe', '-cp', '/Users/grantm/code/punktest/src/', '-cp', '/Users/grantm/code/punktest/fp/src/', '-lib', 'nmedev', '--remap', 'flash:nme', '-cpp', '/Users/grantm/code/punktest/Main', '-D', 'st_display', '--display', '/Users/grantm/code/punktest/src/Main.hx@262', '--no-output', ''], stdout=PIPE, stderr=PIPE).communicate() |
This file contains 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
// Go ahead, try and guess what this will do. | |
for (var i:int = 0; i < 10; i++) { | |
var k:int; | |
k++; | |
trace(k); | |
} |