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
// 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
# 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
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
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
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
// 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
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
(defmacro simple [x] (eval x)) | |
(let [y 5] (simple y)) | |
>> can't eval locals |
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
# Copy (yes, literally copy as in copy and paste) all the data from the LD big stats page (http://www.ludumdare.com/compo/ludum-dare-20/?more=1) | |
# and put it into a file called "data" (quotes for clarity). Then run this file with python. | |
data = [l[:-1] for l in file("data")] | |
scores = {} | |
score_category = "" | |
categories = [] | |
for line in data: |
OlderNewer