Last active
August 29, 2015 13:56
-
-
Save QQ1350995917/9092776 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
参考链接:http://books.sonatype.com/mvnref-book/reference/android-dev.html | |
1:修改DgroupId和DartifactID为合适的值然后执行 | |
mvn archetype:generate \ | |
-DarchetypeArtifactId=android-quickstart \ | |
-DarchetypeGroupId=de.akquinet.android.archetypes \ | |
-DarchetypeVersion=1.0.6 \ | |
-DgroupId=my.pk.name \ | |
-DartifactId=my-app-name | |
2:经过以上步骤就已经建立了maven构建的android项目,然后在项目目录下执行一下命令 | |
(1):git init初始化为被git跟踪的文件结构 | |
(2):git status查看git状态 | |
(3):git add . 跟踪文件 | |
(4):git commit -m "message" 提交 | |
(5) :git remote add origin https://github.com/username/artifactId.git | |
(6):git push -u origin master 提交到github | |
3:执行步骤2中的第五个命令时候要求输入用户名和密码,可在.git/config文件中配置用户名和密码如url = https://username:password@github.com/username/artifactId.git | |
网页编辑器:web editer:data:text/html, <html contenteditable> | |
整站下载:wget -r -p -np -k http://www.test.com | |
代码行数统计: | |
统计代码行数脚本 | |
cat $(find . -type f -name '*java') | wc -l | |
增加一个过滤空行的功能: | |
cat $(find . -type f -name '*java') | awk '{if(length($0)>0) print $0}' | wc -l | |
增加一个去掉空白字符的功能: | |
cat $(find . -type f -name '*java') |sed -e 's/^[ \t]*//' | awk '{if(length($0)>0) print $0}'| wc -l | |
把win下的^M去掉: | |
cat $(find . -type f -name '*java') |sed -e 's/^[ \t]*//' | sed s/^M//g | awk '{if(NF) print $0}' | wc -l | |
*注:^M的输入: ctrl+V, 然后回车键,这个才是真正的^M | |
安装一个jar到本地:mvn install:install-file -DgroupId=com.bea.xml -DartifactId=jsr173-ri -Dversion=1.0 -Dpackaging=jar -Dfile=[path to file] | |
ES安装配置分词器: | |
1:通过git clone https://github.com/medcl/elasticsearch-analysis-ik,下载分词器源码 | |
2:然后进入下载目录,执行命令:mvn clean package,打包生成elasticsearch-analysis-ik-1.2.5.jar。 | |
3:将这个jar拷贝到ES_HOME/plugins/analysis-ik目录下面,如果没有该目录,则先创建该目录。 | |
4:将下载目录中的ik目录拷贝到ES_HOME/config目录下面。 | |
5:分词器配置,打开ES_HOME/config/elasticsearch.yml文件,在文件最后加入如下内容: | |
index: | |
analysis: | |
analyzer: | |
ik: | |
alias: [ik_analyzer] | |
type: org.elasticsearch.index.analysis.IkAnalyzerProvider | |
ik_max_word: | |
type: ik | |
use_smart: false | |
ik_smart: | |
type: ik | |
use_smart: true | |
index.analysis.analyzer.default.type: “ik” | |
6:请重新启动ES | |
7:ik分词测试 | |
7.1:创建一个索引,名为index:curl -XPUT http://localhost:9200/index | |
7.2:为索引index创建mapping:curl -XPOST http://localhost:9200/index/fulltext/_mapping -d' | |
{ | |
"fulltext": { | |
"_all": { | |
"analyzer": "ik" | |
}, | |
"properties": { | |
"content": { | |
"type" : "string", | |
"boost" : 8.0, | |
"term_vector" : "with_positions_offsets", | |
"analyzer" : "ik", | |
"include_in_all" : true | |
} | |
} | |
} | |
}' | |
7.3、测试:curl 'http://localhost:9200/index/_analyze?analyzer=ik&pretty=true' -d ' | |
{ | |
"text":"中华人民共和国" | |
}' | |
Google Play下载APK:http://apps.evozi.com/apk-downloader/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment