Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #Copyright (c) 2010-2013 Samuel Sutch [samuel.sutch@gmail.com] | |
| # | |
| #Permission is hereby granted, free of charge, to any person obtaining a copy | |
| #of this software and associated documentation files (the "Software"), to deal | |
| #in the Software without restriction, including without limitation the rights | |
| #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| #copies of the Software, and to permit persons to whom the Software is | |
| #furnished to do so, subject to the following conditions: | |
| # | |
| #The above copyright notice and this permission notice shall be included in |
| <?php defined('SYSPATH') or die('No direct script access.'); | |
| /** | |
| * People API - Example Code | |
| * | |
| * @author icyleaf <icyleaf.cn@gmail.com> | |
| * @link http://icyleaf.com | |
| * @version 0.1 | |
| */ | |
| class Controller_API_People extends Controller_REST { |
| #!/usr/bin/env python | |
| """ | |
| urlnorm.py - URL normalisation routines | |
| urlnorm normalises a URL by; | |
| * lowercasing the scheme and hostname | |
| * taking out default port if present (e.g., http://www.foo.com:80/) | |
| * collapsing the path (./, ../, etc) | |
| * removing the last character in the hostname if it is '.' |