中文乱码的根源在于 windows 基于一些历史原因无法全面支持 utf-8 编码格式,并且也无法通过有效手段令其全面支持。
- 安装
# -*- coding: utf-8 -*- | |
'''recorder.py | |
Provides WAV recording functionality via two approaches: | |
Blocking mode (record for a set duration): | |
>>> rec = Recorder(channels=2) | |
>>> with rec.open('blocking.wav', 'wb') as recfile: | |
... recfile.record(duration=5.0) | |
Non-blocking mode (start and stop recording): |
#!/bin/bash | |
# 放在 <git_directory>/.git/hooks/pre-commit | |
echo "执行 Maven clean test 检查单元测试是否通过..." | |
# retrieving current working directory | |
CWD=`pwd` | |
MAIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
# 返回项目主目录 | |
cd $MAIN_DIR/../../ |
function readData(imageURI) { | |
function gotFileEntry(fileEntry) { | |
console.log("got image file entry: " + fileEntry.fullPath); | |
fileEntry.file(function (file) { | |
var reader = new FileReader(); | |
reader.onloadend = function (evt) { | |
console.log(evt.target.result); | |
}; | |
//reader.readAsText(file); |
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F | |
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl | |
curl http://index.websolr.com/solr/a0b1c2d3/update -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>' |
express是nodejs平台上一个非常流行的框架,4.2.0是最新的版本,相比3.x版本优化了代码和api,去除了connect模块,自己实现了一个router组件,实现http请求的顺序流程处理,去除了很多绑定的中间件,使代码更清晰。
##1.使用express 如何使用express在官网有很好的讲解,只用experssjs实例app的几个函数,就可以构建构建web程序。
# For more options and information see | |
# http://rpf.io/configtxtreadme | |
# Some settings may impact device functionality. See link above for details | |
# uncomment if you get no picture on HDMI for a default "safe" mode | |
#hdmi_safe=1 | |
# uncomment this if your display has a black border of unused pixels visible | |
# and your display can output without overscan | |
#disable_overscan=1 |
'use strict' | |
/** | |
* 该函数将传入的数组整理成 [小于等于v的数],v,[大于v的数], v为数组的第一个数; | |
* 如果传入的不是数组,则会抛出异常 | |
* | |
* @param {any} array | |
* @returns | |
*/ | |
function part(array) { |
tlthistory |
[alias] | |
st = status | |
ch = checkout | |
br = branch | |
ci = commit |