- 浏览: 49981 次
- 性别:
- 来自: 北京
最新评论
文章列表
# spring boot hello world
## 概念
spring boot 是一个框架,能够让使用者更快速 更少配置地建立一个可用的 可发布的spring应用.
## 安装
spring boot安装依赖
1.jdk 1.8或以上版本
2.这里最佳实践是通过spring.io创建一个spring maven 项目 with spring boot
https://start.spring.io/
![](media/15221185243951/15231735064448.jpg)
直接将生成好的project文件解压后,已经是创建好的maven project了.
. ...
search_1='hello'
search_2='Hello'
str='helloworld'
if [[ $str =~ $search_1 ]]
then
echo 'get search_1'
fi
if [[ $str =~ $search_2 ]]
then
echo 'get search_2'
fi
#忽略大小写只是先转化为大小或小写
search_3=$(echo $search_2 | tr '[A-Z]' '[a-z]')
echo $search_3
if [[ $str =~ $search_3 ]]
then
...
python 写文件换行
- 博客分类:
- python
result_file=open("/Users/hbjava1985/Desktop/result.log",'w')
for index in range(len(result)):
result_file.writelines(result[index][0]+","+result[index][1]+","+result[index][2]+"\n")
python获取文件名
- 博客分类:
- python
files=glob.glob("/Users/hbjava1985/Desktop/meipai_ip/*.log")
result=[]
for file in files:
print os.path.basename(file)
hive 导入配置数据表(内部表)
- 博客分类:
- hive
hive> create table alter_tmp(id INT, name STRING,dt STRING)
> row format delimited fields terminated by ',';
OK
Time taken: 2.078 seconds
hive> load data local inpath '/home/work/data/alter_test.txt' into table alter_tmp;
Copying data from file:/home/work/data/alter_test.txt
Copy ...
hive用户可以通过alter语句更改table属性
Alter Partitions
增加partitions:
ALTER TABLE table_name
ADD [IF NOT EXISTS]
PARTITION partition_spec [LOCATION 'location1']
partition_spec [LOCATION 'location2'] ...
partition_spec:
(partition_col = partition_col_value, partition_c ...
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<!-- 是否替换资源中的属性 -->
...
rabbitmq 管理插件的安装和使用
- 博客分类:
- rabbitmq
启动管理插件
./rabbitmq-plugins enable rabbitmq_management
查看已经安装的插件
./rabbitmq-plugins list
访问:http://127.0.0.1:55672/ 默认登录名和密码都是guest
注意 .3.3版本以上默认使用15672端口,而且对guest用户做了访问限制,只允许本地访问
所以需要如下操作:
1执行添加用户命令 rabbitmqctl add_user root root
2执行设置权限命令 rabbitmqctl set_permissions -p / root ".*" &quo ...
wget http://www.erlang.org/download/otp_src_17.3.tar.gz
tar xzvf otp_src_17.3.tar.gz
cd otp_src_17.3
./configure --with-ssl --without-javac
make
make install
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.3/rabbitmq-server-generic-unix-3.4.3.tar.gz
tar xzvf rabbitmq-server-generic-unix-3. ...
用hive跑一个比较复杂包含子查询数据量大的sql,报错
Container [pid=48338,containerID=container_1417574466181_3484_01_000043] is running beyond physical memory limits. Current usage: 1.0 GB of 1 GB physical memory used; 2.0 GB of 2.1 GB virtual memory used. Killing container. Dump of the process-tree for container_1417574 ...
rabbitmq 常用命令
- 博客分类:
- rabbitmq
启动node和rabbit应用 ./rabbitmq-server
在后台启动Rabbit node ./rabbitmq-server -detached
关闭整个节点(包括应用) ./rabbitmqctl stop
重启整个节点 ./rabbitmqctl reset
仅仅关闭应用 ./rabbitmqctl stop_app
仅仅启动应用 ./rabbitmqctl start_app
查看队列信息
watch ./rabbitmqctl list_queues name messages_ready
mybatis 接口传多参数的三种方式
- 博客分类:
- mybatis
第一种方式:直接多参数
@Delete("delete from ABROAD_AGENT_BILL where CHANNEL_ID=#{channelID} and ABROAD_AGENT_ID=#{abroadAgent} and BUSINESSTYPE=#{businessType} and day between to_date(#{startTime},'yyyy-mm-dd hh24:mi:ss') and to_date(#{endTime},'yyyy-mm-dd hh24:mi:ss')")
public void deleteData ...
junit 测试期望异常
- 博客分类:
- junit
@Test(expected = BuzException.class)
public void checkDayStrFailedNotDayStr() throws BuzException {
RefreshService.checkDayStr("aaaaaaaaaaa");
}
mybatis foreach 示例
- 博客分类:
- mybatis
public List<PreloadData> getDatas(Map<String, Object> params);
<resultMap id="preloadData" type="com.chinacache.entity.PreloadData">
<result column="time_num" property="timeNum" />
<result column="count& ...
package com.chinacache.entity;
import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import javax.validation.constraints.Max;
import javax.validation.constraints. ...