Murmur32 hash is implemented in uniform_hash in hash.cc. It takes a string and a seed and return uint64_t.
There are two hash modes specified by --hash option.
Strings mode (hashstring in parse_primitives.cc)
| import nltk | |
| text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital | |
| computer or the gears of a cycle transmission as he does at the top of a mountain | |
| or in the petals of a flower. To think otherwise is to demean the Buddha...which is | |
| to demean oneself.""" | |
| # Used when tokenizing words | |
| sentence_re = r'''(?x) # set flag to allow verbose regexps | |
| ([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A. |
| import pandas as pd | |
| from random import random | |
| flow = (list(range(1,10,1)) + list(range(10,1,-1)))*100 | |
| pdata = pd.DataFrame({"a":flow, "b":flow}) | |
| pdata.b = pdata.b.shift(9) | |
| data = pdata.iloc[10:] * random() # some noise | |
| import numpy as np |
| mysql -uroot -p --local-infile | |
| LOAD DATA LOCAL INFILE "file.csv" | |
| INTO TABLE db.table | |
| FIELDS TERMINATED BY ',' | |
| ENCLOSED BY '\"' | |
| LINES TERMINATED BY '\n' |
| #!/bin/bash | |
| echo "Building NGINX along with Echo module" | |
| # install prerequisites | |
| yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel | |
| # download the Echo module | |
| curl -L -O 'https://github.com/openresty/echo-nginx-module/archive/v0.58.tar.gz' | |
| tar -xzvf v0.58.tar.gz && rm v0.58.tar.gz | |
| mv echo-nginx-module-0.58 /tmp/echo-nginx-module |
| var mention_id = 620996; | |
| db.mentionStats.aggregate([ | |
| { $match: {'mention_id': mention_id}}, | |
| { $group: {'_id': { | |
| 'year': { '$year': "$verification_date" }, | |
| 'month': { '$month': "$verification_date" }, | |
| 'day': { '$dayOfMonth': "$verification_date" } | |
| }, | |
| 'retweets': { $last: "$retweets" }}}, |
| #!/bin/bash | |
| # Flushing all rules | |
| iptables -F FORWARD | |
| iptables -F INPUT | |
| iptables -F OUTPUT | |
| iptables -X | |
| # Setting default filter policy | |
| iptables -P INPUT DROP | |
| iptables -P OUTPUT DROP | |
| iptables -P FORWARD DROP |
| #!/bin/bash | |
| # Flushing all rules | |
| iptables -F FORWARD | |
| iptables -F INPUT | |
| iptables -F OUTPUT | |
| iptables -X | |
| # Setting default filter policy | |
| iptables -P INPUT DROP | |
| iptables -P OUTPUT DROP | |
| iptables -P FORWARD DROP |
| #!/usr/bin/env bash | |
| # Use this one-liner to produce a JSON literal from the Git log: | |
| git log \ | |
| --pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \ | |
| $@ | \ | |
| perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \ | |
| perl -pe 's/},]/}]/' |
Get Git log in JSON format
git log --pretty=format:'{%n "commit": "%H",%n "abbreviated_commit": "%h",%n "tree": "%T",%n "abbreviated_tree": "%t",%n "parent": "%P",%n "abbreviated_parent": "%p",%n "refs": "%D",%n "encoding": "%e",%n "subject": "%s",%n "sanitized_subject_line": "%f",%n "body": "%b",%n "commit_notes": "%N",%n "verification_flag": "%G?",%n "signer": "%GS",%n "signer_key": "%GK",%n "author": {%n "name": "%aN",%n "email": "%aE",%n "date": "%aD"%n },%n "commiter": {%n "name": "%cN",%n "email": "%cE",%n "date": "%cD"%n }%n},'The only information that aren't fetched are:
%B: raw body (unwrapped subject and body)%GG: raw verification message from GPG for a signed commit