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!
| <?php | |
| //more info at:http://dev.duoshuo.com/threads/5023323ce9b7bde608000012 | |
| class duoshuo extends CI_Controller | |
| { | |
| public $short_name=""; | |
| public $secret =""; | |
| public $remote_auth =""; | |
| public $access_token =""; |
This tutorial guides you through creating your first Vagrant project.
We start with a generic Ubuntu VM, and use the Chef provisioning tool to:
Afterwards, we'll see how easy it is to package our newly provisioned VM
| def runserver(port=5000, profile_log=None): | |
| """Runs a development server.""" | |
| from gevent.wsgi import WSGIServer | |
| from werkzeug.serving import run_with_reloader | |
| from werkzeug.debug import DebuggedApplication | |
| from werkzeug.contrib.profiler import ProfilerMiddleware | |
| port = int(port) | |
| if profile_log: |
| #include "HMyClass.h" | |
| #include <stdio.h> | |
| void my_eh( const char * error_message, void * unused) | |
| { | |
| printf("my_eh: %s\n", error_message); | |
| } | |
| int main() | |
| { |
| "\e[A": history-search-backward | |
| "\e[B": history-search-forward | |
| set show-all-if-ambiguous on | |
| set completion-ignore-case on |
| /* | |
| Example usage: | |
| ajaxEnqueue(Resource.get, {id: 1}, function(val) {console.log("API returned "+val)"}) | |
| Where Resource is an angular $resource object. | |
| This queue will throttle AJAX requests so that only a limited number (ajaxParallel) are in flight at a time. |
| from __future__ import print_function | |
| from tornado.gen import Task, Return, coroutine | |
| import tornado.process | |
| from tornado.ioloop import IOLoop | |
| import subprocess | |
| import time | |
| STREAM = tornado.process.Subprocess.STREAM |
| #!/usr/bin/python | |
| # -*- encoding: UTF-8 -*- | |
| import codecs | |
| import sys | |
| from math import log | |
| from collections import defaultdict | |
| class Trie (object): | |
| class TrieNode: |
| #!/usr/bin/env bash | |
| # Step 1: Fill in EMAIL, TOKEN, DOMAIN and SUBDOMAIN. Your API token is here: https://dash.cloudflare.com/profile/api-tokens | |
| # Make sure the token is the Global token, or has these permissions: #zone:read, #dns_record:read, #dns_records:edit | |
| # If you want to set the root domain instead of a subdomain, set SUBDOMAIN to "@" | |
| # Step 2: Create an A record on Cloudflare with the subdomain you chose | |
| # Step 3: Run "./ddns.sh -l" to get the zone_id and rec_id of the record you created. | |
| # Fill in ZONE_ID and REC_ID below | |
| # This step is optional, but will save you 2 requests every time you run this script | |
| # Step 4: Run "./ddns.sh". It should tell you that record was updated or that it didn't need updating. |