抽取所有英文单词的基本形式,小写,计数。
python to_word_list.py path_to_text.txt min_word_count
e.g.
/** | |
* @param {Socket} socket auto handle 'data' event, and emit 'packet' event. | |
* @param {Object} options options params | |
* options.headSize the size of header | |
* options.getBodySize function(headBuffer) return bodySize | |
*/ | |
exports.autoParsePacket = function (socket, options) { | |
var headSize = options.headSize; | |
var getBodySize = options.getBodySize; | |
if(!headSize || headSize <= 0) { |
_oo0oo_ | |
o8888888o | |
88" . "88 | |
(| -_- |) | |
0\ = /0 | |
___/`---'\___ | |
.' \\| |-- '. | |
/ \\||| : |||-- \ | |
/ _||||| -:- |||||- \ | |
| | \\\ - --/ | | |
storage: | |
dbPath: "/data/db" | |
journal: | |
enabled: true | |
systemLog: | |
destination: file | |
path: "/var/log/mongodb.log" | |
logAppend: true | |
timeStampFormat: iso8601-utc | |
processManagement: |
// golang p2p udp client | |
package main | |
import ( | |
"fmt" | |
"net" | |
"log" | |
"encoding/binary" | |
"encoding/hex" |
/** | |
* Calculates the hash/checksum of a string. Default algorithm is MD5. | |
* | |
* @param {String} str | |
* @param {String} algorithm | |
* @return {String} checksum | |
* @api public | |
*/ | |
exports.hash = function (str, algorithm) { | |
if (algorithm === 'crc32') { |
var express = require('express'), | |
mongoose = require('mongoose'), | |
app; | |
app = module.exports = express.createServer(); | |
app.configure(function() { | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'jade'); | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
// This is an lite version of `async`, see https://github.com/caolan/async | |
// | |
// es5shim.js is required for old version browsers | |
// | |
// Author: Gui Lin | |
// Email: guileen@gmail.com | |
var async = {}; |
#!/bin/sh | |
# If the user is not root | |
if [ "$USERNAME" != "root" ] | |
then | |
# Dislpay a notice and stop | |
echo "Sorry, only root can use this command." | |
exit 1 |