Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| # This is the framework for graphs we use on this work | |
| import networkx as nx | |
| # Tool to determine wether elements are on the same set | |
| from networkx.utils import UnionFind | |
| # We need this in python to "clone" objects | |
| import copy |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # | |
| # STL GDB evaluators/views/utilities - 1.03 | |
| # | |
| # The new GDB commands: | |
| # are entirely non instrumental | |
| # do not depend on any "inline"(s) - e.g. size(), [], etc | |
| # are extremely tolerant to debugger settings | |
| # | |
| # This file should be "included" in .gdbinit as following: | |
| # source stl-views.gdb or just paste it into your .gdbinit file |
| #!/Usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| ''' | |
| Searches a graph and yields all the minimum spanning trees in order of increasing cost. | |
| This could be used to solve minimum spanning trees with constraints by yielding trees until | |
| we reach the first one which satisfies a constraint. | |
| For example it could solve the degree constrained minimum spanning tree DCMST | |
| ''' |
Prerequisites:
Software components used:
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
See Also:
| Level | Score | Regex | Credit |
|---|
This document describes the C# language features currently featured in the March CTP. There's also discussion of a few of the VB features in the preview, where those are intended to be eventually implemented in C# as well.
Note that we have more language features planned that are not yet implemented. So look out for more to come in future CTPs and eventually a shipping version of C#.
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| # The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
| # | |
| # Current known FCC address ranges: | |
| # https://news.ycombinator.com/item?id=7716915 | |
| # | |
| # Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
| # | |
| # In your nginx.conf: | |
| location / { |