Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| (function () { | |
| if ("undefined" !== typeof Send2eg300) { | |
| return | |
| }; | |
| window.Send2eg300 = Send2eg300 = { | |
| server: "http://send2.eg300.com/", | |
| jQuery: "js/jquery-1.8.3.min.js", | |
| params: { | |
| "isLinkConverted": false | |
| }, |
| data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/python");</script> |
| #!/usr/bin/env python | |
| #coding:utf-8 | |
| import sys, os, re | |
| import logging | |
| from tornado.ioloop import IOLoop | |
| from tornado.iostream import IOStream | |
| from tornado.netutil import TCPServer |
| from time import sleep | |
| import tornado | |
| from multiprocessing.pool import ThreadPool | |
| _workers = ThreadPool(10) | |
| class BackgroundMix(tornado.web.RequestHandler): | |
| """将block任务放入线程池中执行 | |
| EXAMPLE: | |
| # blocking task like querying to MySQL |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # Copyright (c) 2010, Philip Plante of EndlessPaths.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 |
| #!/usr/bin/env python | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| Usage: python -m SimpleHTTPServerWithUpload 8888 | |
| """ |
| # Copyright (c) 2010, Philip Plante of EndlessPaths.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 |
| # Adapted from here: https://gist.github.com/489093 | |
| # Original credit goes to pplante and copyright notice pasted below | |
| # Copyright (c) 2010, Philip Plante of EndlessPaths.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 |
| diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim | |
| index 4b5aac7..1714c72 100644 | |
| --- a/autoload/vimwiki/html.vim | |
| +++ b/autoload/vimwiki/html.vim | |
| @@ -1347,7 +1347,7 @@ endfunction " }}} | |
| function! s:use_custom_wiki2html() "{{{ | |
| let custom_wiki2html = VimwikiGet('custom_wiki2html') | |
| - return !empty(custom_wiki2html) && s:file_exists(custom_wiki2html) | |
| + return !empty(custom_wiki2html) |