Install elasticsearch-head: – for Elasticsearch 5.x
Running as a plugin of Elasticsearch
- Install elasticsearch-head:
– for Elasticsearch 5.x:
site plugins are not supported. Run elasticsearch-head as a standalone server
Running with built in server
- enable cors by adding
http.cors.enabled: true
in elasticsearch configuration. Don’t forget to also sethttp.cors.allow-origin
because no origin allowed by default.http.cors.allow-origin: "*"
is valid value, however it’s considered as a security risk as your cluster is open to cross origin from anywhere. Check Elasticsearch documentation on this parameter:https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html#modules-http git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
grunt server
open
http://localhost:9100/
https://github.com/mobz/elasticsearch-head#running-with-built-in-server
1、windows下的NodeJS安装是比较方便的(v0.6.0版本之后,支持windows native),只需要登陆官网(http://nodejs.org/),便可以看到首页的“INSTALL”按钮,直接点击就会自动下载安装了。


4、npm的安装。由于新版的NodeJS已经集成了npm,所以之前npm也一并安装好了。同样可以使用cmd命令行输入"npm -v"来测试是否成功安装。如下图,出现版本提示便OK了。

http://blog.csdn.net/html5_/article/details/40896091
步骤3:
MINGW64 /e/elasticsearch-head (master)
$ npm install
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
> phantomjs-prebuilt@2.1.13 install E:\workspace-demo\elasticsearch-head\node_modules\phantomjs-prebuilt
> node install.js
PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-windows.zip
Saving to C:\Users\TANG~1.CHE\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip
Receiving...
Received 17767K total.
Extracting zip contents
Removing E:\workspace-demo\elasticsearch-head\node_modules\phantomjs-prebuilt\lib\phantom
Copying extracted folder C:\Users\TANG~1.CHE\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip-extract-1479521265399\phantomjs-2.1.1-windows -> E:\workspace-demo\elasticsearch-head\node_modules\phantomjs-prebuilt\lib\phantom
Writing location.js file
Done. Phantomjs binary available at E:\workspace-demo\elasticsearch-head\node_modules\phantomjs-prebuilt\lib\phantom\bin\phantomjs.exe
elasticsearch-head@0.0.0 E:\workspace-demo\elasticsearch-head
`-- grunt-contrib-jasmine@1.0.3
+-- grunt-lib-phantomjs@1.1.0
| +-- phantomjs-prebuilt@2.1.13
| | +-- es6-promise@4.0.5
| | +-- extract-zip@1.5.0
| | | +-- concat-stream@1.5.0
| | | | `-- typedarray@0.0.6
| | | +-- debug@0.7.4
| | | +-- mkdirp@0.5.0
| | | | `-- minimist@0.0.8
| | | `-- yauzl@2.4.1
| | | `-- fd-slicer@1.0.1
| | | `-- pend@1.2.0
| | +-- fs-extra@0.30.0
| | | +-- jsonfile@2.4.0
| | | `-- klaw@1.3.1
| | +-- hasha@2.2.0
| | | `-- is-stream@1.1.0
| | +-- kew@0.7.0
| | +-- progress@1.1.8
| | +-- request@2.74.0
| | | +-- aws-sign2@0.6.0
| | | +-- aws4@1.5.0
| | | +-- bl@1.1.2
| | | +-- caseless@0.11.0
| | | +-- combined-stream@1.0.5
| | | | `-- delayed-stream@1.0.0
| | | +-- forever-agent@0.6.1
| | | +-- form-data@1.0.1
| | | | `-- async@2.1.2
| | | | `-- lodash@4.17.2
| | | +-- har-validator@2.0.6
| | | | +-- commander@2.9.0
| | | | | `-- graceful-readlink@1.0.1
| | | | `-- is-my-json-valid@2.15.0
| | | | +-- generate-function@2.0.0
| | | | +-- generate-object-property@1.2.0
| | | | | `-- is-property@1.0.2
| | | | +-- jsonpointer@4.0.0
| | | | `-- xtend@4.0.1
| | | +-- hawk@3.1.3
| | | | +-- boom@2.10.1
| | | | +-- cryptiles@2.0.5
| | | | +-- hoek@2.16.3
| | | | `-- sntp@1.0.9
| | | +-- http-signature@1.1.1
| | | | +-- assert-plus@0.2.0
| | | | +-- jsprim@1.3.1
| | | | | +-- extsprintf@1.0.2
| | | | | +-- json-schema@0.2.3
| | | | | `-- verror@1.3.6
| | | | `-- sshpk@1.10.1
| | | | +-- asn1@0.2.3
| | | | +-- assert-plus@1.0.0
| | | | +-- bcrypt-pbkdf@1.0.0
| | | | +-- dashdash@1.14.0
| | | | | `-- assert-plus@1.0.0
| | | | +-- ecc-jsbn@0.1.1
| | | | +-- getpass@0.1.6
| | | | | `-- assert-plus@1.0.0
| | | | +-- jodid25519@1.0.2
| | | | +-- jsbn@0.1.0
| | | | `-- tweetnacl@0.14.3
| | | +-- is-typedarray@1.0.0
| | | +-- isstream@0.1.2
| | | +-- json-stringify-safe@5.0.1
| | | +-- node-uuid@1.4.7
| | | +-- oauth-sign@0.8.2
| | | +-- qs@6.2.1
| | | +-- stringstream@0.0.5
| | | +-- tough-cookie@2.3.2
| | | | `-- punycode@1.4.1
| | | `-- tunnel-agent@0.4.3
| | `-- request-progress@2.0.1
| | `-- throttleit@1.0.0
| `-- rimraf@2.5.4
`-- lodash@2.4.2
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
grunt
是一套前端自动化工具,一个基于nodeJs的命令行工具,一般用于:
① 压缩文件
② 合并文件
③ 简单语法检查
对于其他用法,我还不太清楚,我们这里简单介绍下grunt的压缩、合并文件,初学,有误请包涵
准备阶段
1、nodeJs环境
因为grunt是基于nodeJs的,所以首先各位需要安装nodeJS环境,这块我们便不管了
http://www.cnblogs.com/yexiaochai/p/3527418.html
2、安装grunt
有了nodeJs环境后,我们便可以开始搞grunt了,因为我们可能在任何目录下运行打包程序,所以我们需要安装CLI
官方推荐在全局安装CLI(grunt的命令行接口)
- npm install -g grunt-cli
这条命令将会把grunt命令植入系统路径,这样就能在任意目录运行他,原因是
每次运行grunt时,它都会使用node的require查找本地是否安装grunt,如果找到CLI便加载这个本地grunt库
然后应用我们项目中的GruntFile配置,并执行任务
步骤4:
/e/elasticsearch-head (master)
$ npm install -g grunt-cli
C:\Users\admin\AppData\Roaming\npm\grunt -> C:\Users\admin\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt
C:\Users\admin\AppData\Roaming\npm
`-- grunt-cli@1.2.0
+-- findup-sync@0.3.0
| `-- glob@5.0.15
| +-- inflight@1.0.6
| | `-- wrappy@1.0.2
| +-- inherits@2.0.3
| +-- minimatch@3.0.3
| | `-- brace-expansion@1.1.6
| | +-- balanced-match@0.4.2
| | `-- concat-map@0.0.1
| +-- once@1.4.0
| `-- path-is-absolute@1.0.1
+-- grunt-known-options@1.1.0
+-- nopt@3.0.6
| `-- abbrev@1.0.9
`-- resolve@1.1.7
ANTS-SH-0063 MINGW64 /e/elasticsearch-head (master)
$ grunt server
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
IK Analysis for Elasticsearch
The IK Analysis plugin integrates Lucene IK analyzer (http://code.google.com/p/ik-analyzer/) into elasticsearch, support customized dictionary.
Analyzer: ik_smart
, ik_max_word
, Tokenizer: ik_smart
, ik_max_word
Versions
IK version | ES version |
---|---|
master | 5.x -> master |
5.0.1 | 5.0.1 |
1.10.1 | 2.4.1 |
1.9.5 | 2.3.5 |
1.8.1 | 2.2.1 |
1.7.0 | 2.1.1 |
1.5.0 | 2.0.0 |
1.2.6 | 1.0.0 |
1.2.5 | 0.90.x |
1.1.3 | 0.20.x |
1.0.0 | 0.16.2 -> 0.19.0 |
Install
1.compile
checkout ik version respective to your elasticsearch version
git checkout tags/{version}
mvn package
copy and unzip target/releases/elasticsearch-analysis-ik-{version}.zip
to your-es-root/plugins/ik
2.restart elasticsearch
Tips:
ik_max_word: 会将文本做最细粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,中华人民,中华,华人,人民共和国,人民,人,民,共和国,共和,和,国国,国歌”,会穷尽各种可能的组合;
ik_smart: 会做最粗粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,国歌”。
Quick Example
1.create a index
- curl -XPUT http://localhost:9200/index
2.create a mapping
- curl -XPOST http://localhost:9200/index/fulltext/_mapping -d'
- {
- "fulltext": {
- "_all": {
- "analyzer": "ik_max_word",
- "search_analyzer": "ik_max_word",
- "term_vector": "no",
- "store": "false"
- },
- "properties": {
- "content": {
- "type": "text",
- "analyzer": "ik_max_word",
- "search_analyzer": "ik_max_word",
- "include_in_all": "true",
- "boost": 8
- }
- }
- }
- }'
3.index some docs
- curl -XPOST http://localhost:9200/index/fulltext/1 -d'
- {"content":"美国留给伊拉克的是个烂摊子吗"}
- '
- curl -XPOST http://localhost:9200/index/fulltext/2 -d'
- {"content":"公安部:各地校车将享最高路权"}
- '
- curl -XPOST http://localhost:9200/index/fulltext/3 -d'
- {"content":"中韩渔警冲突调查:韩警平均每天扣1艘中国渔船"}
- '
- curl -XPOST http://localhost:9200/index/fulltext/4 -d'
- {"content":"中国驻洛杉矶领事馆遭亚裔男子枪击 嫌犯已自首"}
- '
4.query with highlighting
- curl -XPOST http://localhost:9200/index/fulltext/_search -d'
- {
- "query" : { "match" : { "content" : "中国" }},
- "highlight" : {
- "pre_tags" : ["<tag1>", "<tag2>"],
- "post_tags" : ["</tag1>", "</tag2>"],
- "fields" : {
- "content" : {}
- }
- }
- }
- '
Result
- {
- "took": 14,
- "timed_out": false,
- "_shards": {
- "total": 5,
- "successful": 5,
- "failed": 0
- },
- "hits": {
- "total": 2,
- "max_score": 2,
- "hits": [
- {
- "_index": "index",
- "_type": "fulltext",
- "_id": "4",
- "_score": 2,
- "_source": {
- "content": "中国驻洛杉矶领事馆遭亚裔男子枪击 嫌犯已自首"
- },
- "highlight": {
- "content": [
- "<tag1>中国</tag1>驻洛杉矶领事馆遭亚裔男子枪击 嫌犯已自首 "
- ]
- }
- },
- {
- "_index": "index",
- "_type": "fulltext",
- "_id": "3",
- "_score": 2,
- "_source": {
- "content": "中韩渔警冲突调查:韩警平均每天扣1艘中国渔船"
- },
- "highlight": {
- "content": [
- "均每天扣1艘<tag1>中国</tag1>渔船 "
- ]
- }
- }
- ]
- }
- }
https://github.com/medcl/elasticsearch-analysis-ik
配置 JDBC 数据源
1. 安装 openjdk(本人用的ubuntu)
sudo apt-get install openjdk-7-jre
2.下载安装 elasticsearch
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.deb
sudo dpkg -i elasticsearch-1.4.4.deb
/etc/init.d/elasticsearch start
3.安装JDBC 插件
1
./bin/plugin --install jdbc --url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.4.0.10/elasticsearch-river-jdbc-1.4.0.10.zip
4.安装MySQL JDBC 驱动
curl -o mysql-connector-java-5.1.33.zip -L 'http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.33.zip/from/http://cdn.mysql.com/'
unzip mysql-connector-java-5.1.33.zip
cp mysql-connector-java-5.1.33-bin.jar $ES_HOME/plugins/jdbc/
chmod 644 $ES_HOME/plugins/jdbc/*
/etc/init.d/elasticsearch restart
http://localhost:9200/_nodes?settings=true&pretty=true 配置信息(安装路径、插件...)
更多参数见:https://github.com/jprante/elasticsearch-river-jdbc
5.测试mysql (用户root 密码passwd 库jdbctest 表名posts)
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://localhost:3306/jdbctest",
"user" : "root",
"password" : "passwd",
"sql" : "select * from posts"
}
}'
curl 'localhost:9200/jdbc/_search'
npm install pkg - 本地安装
运行如下命令,就会在当前目录下安装grunt-cli
(grunt命令行工具)
npm install grunt-cli
安装结束后,当前目录下回多出一个node_modules
目录,grunt-cli就安装在里面。同时注意控制台输出的信息:
简单说明一下:
- grunt-cli@0.1.9:当前安装的package为grunt-cli,版本为0.19
- node_modules/grunt-cli:安装目录
- resolve@0.3.1:依赖的包有resolve、nopt、findup-sync,它们各自的版本、依赖在后面的括号里列出来
npm install -g pkg- 全局安装
上面已经安装了grunt-cli,然后你跑到其他目录下面运行如下命令
grunt
果断提示你grunt命令不存在,为什么呢?因为上面只是进行了本地安装,grunt命令只能在对应安装目录下使用。
-bash: grunt: command not found
如果为了使用grunt命令,每到一个目录下都得重新安装一次,那不抓狂才怪。肿么办呢?
很简单,采用全局安装就行了,很简单,加上参数-g
就可以了
npm install -g grunt-cli
于是,在所有目录下都可以无压力使用grunt
命令了。这个时候,你会注意到控制台输入的信息有点不同。主要的区别在于安装目录,现在变成了/usr/local/lib/node_modules/grunt-cli
,/usr/local/lib/node_modules/
也就是之前所说的全局安装目录啦。
- grunt-cli@0.1.9 /usr/local/lib/node_modules/grunt-cli
- ├── resolve@0.3.1
- ├── nopt@1.0.10 (abbrev@1.0.4)
npm包管理
npm的包管理命令是使用频率最高的,所以也是我们需要牢牢记住并熟练使用的。其实无非也就是几个动作:安装、卸载、更新、查看、搜索、发布等。
安装最新版本的grunt-cli
npm install grunt-cli
安装0.1.9版本的grunt-cli
npm install grunt-cli@"0.1.9"
通过package.json进行安装
如果我们的项目依赖了很多package,一个一个地安装那将是个体力活。我们可以将项目依赖的包都在package.json这个文件里声明,然后一行命令搞定
npm install
其他package安装命令
运行如下命令,列出所有npm install
可能的参数形式
npm install --help
输出如下,有兴趣的童鞋可以了解下
npm install <tarball file>
npm install <tarball url>
npm install <folder>
npm install <pkg>
npm install <pkg>@<tag>
npm install <pkg>@<version>
npm install <pkg>@<version range>
卸载grunt-cli
比如卸载grunt-cli
npm uninstall grunt-cli
卸载0.1.9版本的grunt-cli
npm uninstall grunt-cli@"0.1.9"
npm ls:查看安装了哪些包
运行如下命令,就可以查看当前目录安装了哪些package
npm ls
输出如下
/private/tmp/npm
└─┬ grunt-cli@0.1.9
│ ├─┬ glob@3.1.21
│ │ ├── graceful-fs@1.2.3
│ │ ├── inherits@1.0.0
│ │ └─┬ minimatch@0.2.12
│ │ ├── lru-cache@2.3.0
│ │ └── sigmund@1.0.0
│ └── lodash@1.0.1
├─┬ nopt@1.0.10
│ └── abbrev@1.0.4
└── resolve@0.3.1
输出如下,同样,如果是要查看package的全局安装信息,加上-g
就可以
npm ls pkg:查看特定package的信息
运行如下命令,输出grunt-cli的信息
npm ls grunt-cli
输出的信息比较有限,只有安装目录、版本,如下:
/private/tmp/npm
└── grunt-cli@0.1.9
如果要查看更详细信息,可以通过npm info pkg
,输出的信息非常详尽,包括作者、版本、依赖等。
npm info grunt-cli
npm update pkg:package更新
npm update grunt-cli
npm search pgk:搜索
输入如下命令
npm search grunt-cli
返回结果如下
NAME DESCRIPTION AUTHOR DATE KEYWORDS
grunt-cli The grunt command line interface. =cowboy =tkellen 2013-07-27 02:24
grunt-cli-dev-exitprocess The grunt command line interface. =dnevnik 2013-03-11 16:19
grunt-client-compiler Grunt wrapper for client-compiler. =rubenv 2013-03-26 09:15 gruntplugin
grunt-clientside Generate clientside js code from CommonJS modules =jga 2012-11-07 01:20 gruntplugin
npm发布
这个命令我自己也还没实际用过,不误导大家,语法如下,也可参考官方对于package发布的说明https://npmjs.org/doc/developers.html:
npm publish <tarball>
npm publish <folder>
NPM配置
npm的配置工作主要是通过npm config
命令,主要包含增、删、改、查几个步骤,下面就以最为常用的proxy配置为例。
设置proxy
内网使用npm很头痛的一个问题就是代理,假设我们的代理是 http://proxy.example.com:8080,那么命令如下:
npm config set proxy http://proxy.example.com:8080
由于npm config set
命令比较常用,于是可以如下简写
npm set proxy http://proxy.example.com:8080
查看proxy
设置完,我们查看下当前代理设置
npm config get proxy
输出如下:
同样可如下简写:
npm get proxy
删除proxy
代理不需要用到了,那删了吧
npm delete proxy
查看所有配置
npm config list
直接修改配置文件
有时候觉得一条配置一条配置地修改有些麻烦,就直接进配置文件修改了
npm config edit
关于package.json
这货在官网似乎没有详细的描述,其实就是包的描述信息啦。假设当我们下载了node应用,这个node应用依赖于A、B、C三个包,如果没有package.json,我们需要人肉安装这个三个包(如果对版本有特定要求就更悲剧了):
npm install A
npm install B
npm install C
有了package.json,一行命令安装所有依赖。
npm install
package.json字段简介
字段相当多,但最重要的的是下面几个
- name: package的名字(由于他会成为url的一部分,所以 non-url-safe 的字母不会通过,也不允许出现"."、"_"),最好先在http://registry.npmjs.org/上搜下你取的名字是否已经存在
- version: package的版本,当package发生变化时,version也应该跟着一起变化,同时,你声明的版本需要通过semver的校验(semver可自行谷歌)
- dependencies: package的应用依赖模块,即别人要使用这个package,至少需要安装哪些东东。应用依赖模块会安装到当前模块的node_modules目录下。
- devDependencies:package的开发依赖模块,即别人要在这个package上进行开发
- 其他:参见官网
package版本
在package.json里,你经常会在包名后看到类似"~0.1.0"这样的字符串,这就是包的版本啦。下面会列举最常见的版本声明形式,以及版本书写的要求:
常见版本声明形式
a、"~1.2.3" 是神马意思呢,看下面领悟
"~1.2.3" = ">=1.2.3 <1.3.0"
"~1.2" = ">=1.2.0 <1.3.0"
"~1" = ">=1.0.0 <1.1.0"
b、"1.x.x"是什么意思呢,继续自行领悟
"1.2.x" = ">=1.2.0 <1.3.0"
"1.x.x" = ">=1.0.0 <2.0.0"
"1.2" = "1.2.x"
"1.x" = "1.x.x"
"1" = "1.x.x"
版本书写要求
- 版本可以v开头,比如 v1.0.1(v只是可选)
- 1.0.1-7,这里的7是所谓的“构建版本号”,不理是神马,反正版本大于1.0.1
- 1.0.1beta,或者1.0.1-beta,如果1.0.1后面不是 “连字符加数字” 这种形式,那么它是pre release 版本,即版本小于 1.0.1
- 根据b、c,有:0.1.2-7 > 0.1.2-7-beta > 0.1.2-6 > 0.1.2 > 0.1.2beta
写在后面
内容只是简单地把最常见的命令,以及一些需要了解的内容列了出来。如要进一步了解,可参考官网说明。此外,npm help
是我们最好的朋友,如果忘了有哪些命令,命令下有哪些参数,可通过help进行查看。
最关键的:如果文章内容有误,请指出!!!
新浪微博:http://weibo.com/chyingp
站酷主页:http://www.zcool.com.cn/u/346408/
http://www.cnblogs.com/chyingp/p/npm.html
Install elasticsearch-head: – for Elasticsearch 5.x的更多相关文章
- 【ElasticSearch篇】--ElasticSearch从初识到安装和应用
一.前述 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口,在企业中全文搜索时,特别常用. 二.常用概念 clu ...
- 批量搞机(二):分布式ELK平台、Elasticsearch介绍、Elasticsearch集群安装、ES 插件的安装与使用
一.分布式ELK平台 ELK的介绍: ELK 是什么? Sina.饿了么.携程.华为.美团.freewheel.畅捷通 .新浪微博.大讲台.魅族.IBM...... 这些公司都在使用 ELK!ELK! ...
- 【原创】《从0开始学Elasticsearch》—初识Elasticsearch
目录 1. Elasticsearch 是什么2. Elasticsearch 中基本概念3. Elasticsearch 安装4. 访问 Elasticsearch 1. Elasticsearch ...
- 【分布式搜索引擎】Elasticsearch之开启Elasticsearch的用户名密码验证
一.首先在elasticsearch配置文件中开启x-pack验证, 修改config目录下面的elasticsearch.yml文件,在里面添加如下内容,并重启 xpack.security.ena ...
- Elasticsearch学习之ElasticSearch 5.0.0 安装部署常见错误或问题
ElasticSearch 5.0.0 安装部署常见错误或问题 问题一: [--06T16::,][WARN ][o.e.b.JNANatives ] unable to install syscal ...
- Elasticsearch笔记(一)—Elasticsearch安装配置
原文链接:https://my.oschina.net/jhao104/blog/644909 摘要: ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文 ...
- Elasticsearch 学习笔记 Elasticsearch及Elasticsearch head安装配置
一.安装与配置 1.到官网下载Elasticsearch,https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6. ...
- 【分布式搜索引擎】Elasticsearch之安装Elasticsearch可视化平台Kibana
一.Kibana简单介绍 Kibana 是为 Elasticsearch设计的开源分析和可视化平台.你可以使用 Kibana 来搜索,查看存储在 Elasticsearch 索引中的数据并与之交互.你 ...
- python使用elasticsearch模块操作elasticsearch
1.创建索引 命令如下 from elasticsearch import Elasticsearch es = Elasticsearch([{"host":"10.8 ...
- Elasticsearch 系列3 --- Elasticsearch配置
一. 位置 ES的配置文件位于安装目录\config下面,主要有 (1) elasticsearch.yml ES系统的配置: (2) jvm.options Java虚拟机配置: (3) log4j ...
随机推荐
- SQLite中的SELECT子句使用表达式
SQLite中的SELECT子句使用表达式 在SELECT语句中可以只有SELECT子句不写FROM子句.这些表达式列表将被单次计算,生成一行,然后组成工作表.这对于测试和判断独立表达式很有用.例如, ...
- bzoj3545: [ONTAK2010]Peaks 重构树 主席树
题目链接 bzoj3545: [ONTAK2010]Peaks 题解 套路重构树上主席树 代码 #include<cstdio> #include<algorithm> #de ...
- Shiro笔记(二)身份验证
Shiro笔记(二)身份验证 一.核心代码 @Test public void helloWorldTest(){ IniSecurityManagerFactory factory = new In ...
- [HackerRank]Choosing White Balls
[HackerRank]Choosing White Balls 题目大意: 有\(n(n\le30)\)个球排成一行,每个球的颜色为黑或白. 执行\(k\)次操作,第\(i\)次操作形式如下: 从\ ...
- Pyinstaller安装以及参数使用
一.安装 pip install pyinstaller (注:win7系统安装有pywin32依赖包,先按pywin32在进行以上的步骤) 二.参数说明(这里要注意大小写) -F 表示生成单个可 ...
- java运行时could not open ........jvm.cfg问题的解决
我相信这个问题肯定让不少人头疼.小编也纠结了将近3个小时的时间,终于弄明白这是怎么回事并且解决 java都知道时运行命令,不能打开...jvm.cfg很明显是jre虚拟机出现了问题(要么时jre的路径 ...
- C#导出Excel文件,过长数值显示为科学计数法解决方法 C#
C#导出EXCEL文件,身份证号码或某些ID内容长度超过15个数字,这样导出的Excel文件中默认情况下将这个值以科学计数方式显示,下面提供两种解决方式:1.在转出的内容前,加上一个TAB符号,C# ...
- C#编程(七十五)----------C#使用指针
原文链接: http://blog.csdn.net/shanyongxu/article/details/47321441 在C#中使用指针的语法 如果想在C#中使用指针,首先对项目进行过配置: 看 ...
- 计算请假天数JavaScript方法
前言 最近,有这么个需求,给用户做个请假审批系统,要输入请假开始时间和结束时间,同时计算出请假天数,如果年假数量不够提示不能提交,如果年假数量够的话,就走审批工作流,审批通过以后,自动在年假上减去这个 ...
- iOS开发-NSUndoManager撤销(undo)和重做(redo)
程序开发中我们经常会用到的两个快捷键Ctrl+Z和Ctrl+C,撤销和复制,Cocoa开发也可以实现这两个操作,为我们提供非常简单的操作类NSUndoManger,也可以称之为撤销管理器,NSUndo ...