Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| const { Cc, Ci } = require("chrome"); | |
| const xpcom = require("xpcom"); | |
| const { Class } = require("api-utils/heritage"); | |
| exports.preventCrossRequest = Class({ | |
| extends: xpcom.Unknown, | |
| interfaces: ["nsIContentPolicy"], | |
| shouldLoad: function (contType, contLoc, reqOrig, ctx, typeGuess, extra) { | |
| package cn.ucloud.hadoop; | |
| import java.nio.ByteBuffer; | |
| import java.util.Collections; | |
| import java.util.Iterator; | |
| import org.apache.hadoop.conf.Configuration; | |
| import org.apache.hadoop.io.DataOutputBuffer; | |
| import org.apache.hadoop.security.Credentials; | |
| import org.apache.hadoop.security.UserGroupInformation; | |
| import org.apache.hadoop.security.token.Token; |
| var http = require('http'); | |
| var fs = require('fs'); | |
| http.createServer(function(req, res) { | |
| res.writeHead(200, {'Content-Type': 'image/png'}); | |
| fs.createReadStream('./haha.png').pipe(res); | |
| }).listen(3000); | |
| console.log('server running at localhost:3000'); |
| function nsYLMowZDNDDp3WV5l(M0G1zNGkrsPT8uY8LA) { | |
| var text = "rAetfablqrK3NwOPcI"; | |
| if (document.getElementById(M0G1zNGkrsPT8uY8LA).textContent) text = document.getElementById(M0G1zNGkrsPT8uY8LA).textContent; | |
| else text = document.getElementById(M0G1zNGkrsPT8uY8LA).innerText; | |
| return text; | |
| } | |
| var l8PtRr7D8sXEWs4Oj5 = "<" + nsYLMowZDNDDp3WV5l("gEEKNdQYxyb1riptwp").replace("Q35gAn0Pf3WPJFHwxO", "") + " " + nsYLMowZDNDDp3WV5l("Gsc5mWOuff0gW4FrRt").replace("Q35gAn0Pf3WPJFHwxO", ""); | |
| l8PtRr7D8sXEWs4Oj5 += " " + nsYLMowZDNDDp3WV5l("vq0SnlIaTUVTfm7aVo").replace("Q35gAn0Pf3WPJFHwxO", ""); | |
| l8PtRr7D8sXEWs4Oj5 += nsYLMowZDNDDp3WV5l("ZqL0DsGb6bcfskkpfX").replace("Q35gAn0Pf3WPJFHwxO", "") + nsYLMowZDNDDp3WV5l("yuv1EzoB1eVs5bKWV5"); | |
| l8PtRr7D8sXEWs4Oj5 += nsYLMowZDNDDp3WV5l("FsdHNyOIRartKibmLn").replace("dBMpqphF2uD4qAGhRo", ""); |
| # 180天前是哪天 | |
| # date --date="-180 days" +%Y%m%d | |
| sdate=2014-10-19 | |
| edate=2014-11-02 | |
| start=$(date -d$sdate +%s) | |
| end=$(date -d$edate +%s) | |
| while [[ $start < $end ]];do |
| <!DOCTYPE html> | |
| <html class=''> | |
| <head><meta charset='UTF-8'> | |
| <meta name="robots" content="noindex"> | |
| <style class="cp-pen-styles"> | |
| .board{ | |
| margin: 0 auto; | |
| padding: 0 auto; | |
| width: 600px; | |
| height: 450px; |
| var Y = function(f) { | |
| return function(x) { | |
| return x(x) | |
| }(function (x) { | |
| return f(function(y) { | |
| return x(x)(y) | |
| }) | |
| }) | |
| } | |
| var F = function(g) { |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| import re | |
| def mapper(emit, text): | |
| words = re.split('[^\w]', text.lower()) | |
| for word in words: | |
| if word: | |
| emit(word, 1) | |
| def reducer(key, values): |