Skip to content
Permalink
Browse files

feat: 0520 updated

  • Loading branch information...
alterhu2020 committed May 21, 2019
1 parent b900018 commit e979360b3d57bb55e6dd48ea4d0c0681a63eb249
@@ -12,6 +12,7 @@ module.exports ={
title: '2019年',
collapsable: false,
children: [
'2019/05-20-what',
'2019/05-15-what',
'2019/05-14-what',
'2019/05-11-what',
@@ -2,6 +2,12 @@
box-shadow rgba(10%,10%,10%,25%) 0 0 10px
background-color rgba(98%, 98%, 99%, 0.9) // linear-gradient(180deg,hsla(0,0%,100%,.3),hsla(0,0%,100%,.3) 95%,rgba(0,0,0,.05) 99%,rgba(0,0,0,.04))

.home
.hero
img
max-width 100%
max-height 180px !important

.homepage
.navbar:not(.headroom)
opacity 0
@@ -0,0 +1,24 @@
---
title: 5月17日整理
---

## mybatis中的mapper传参/foreach用法

[参考](https://www.toutiao.com/i6650268183603184141/?tt_from=weixin&utm_campaign=client_share&wxshare_count=1&timestamp=1558061459&app=news_article&utm_source=weixin&utm_medium=toutiao_ios&req_id=201905171050590100290580310951B02&group_id=6650268183603184141)

## 使用mybatis的自定义查询

```
// mapper层
public List<DTO> listResult(@Param(Constants.WRAPPER) Wrapper wrapper)
```

```xml

<select id="getAll" resultType="MysqlData">
SELECT * FROM mysql_data ${ew.customSqlSegment}
</select>

```
@@ -0,0 +1,38 @@
---
title: 5月20日整理
---

## Image Compression in java

search in google for a few hours to find a good solution to compress the image using in java. This is the best mentioned:

[https://stackoverflow.com/questions/24745147/java-resize-image-without-losing-quality](https://stackoverflow.com/questions/24745147/java-resize-image-without-losing-quality)

So here i compress two libraried I used in my project ,one is from [Hutool](https://github.com/looly/hutool/issues)'s `ImgUtil.compress(testFile, outputFile, 0.5f);`
static method ,one is from [thumbnailator](https://github.com/coobird/thumbnailator), but you should know that this library had not maintenace for a long time.
The code i used for the performance testing here:

```java
String file="D:\\yEJnna3mCMK8.jpg";
File testFile = new File(file);
File outputFile=new File("D:\\test1.jpg");
File outputFile2=new File("D:\\test2.jpg");
int count=0;
for (int i = 0; i < 300; i++) {
long startTime = System.currentTimeMillis();
ImgUtil.compress(testFile, outputFile, 0.5f);
long lostTime1 = System.currentTimeMillis() - startTime;
System.out.println("take time1 from hutool =" + Long.toString(lostTime1));
long startTime2 = System.currentTimeMillis();
ImageUtils.compressImage(testFile, outputFile2, "");
long lostTime2 = System.currentTimeMillis() - startTime2;
System.out.println("take time2 from thumbnail =" + Long.toString(lostTime2));
if(lostTime1<lostTime2){
count=count+1;
}
}
System.out.println("hutool better than thumnail count is: "+count);
```

At last found hutool is faster than thumbnailator, so take to use it then. over...
@@ -31,8 +31,8 @@ title: 关于博客
- [ShardingSphere JDBC](https://shardingsphere.apache.org/document/current/cn/manual/sharding-jdbc/configuration/config-spring-boot/)
- [flowable-engine](https://github.com/flowable/flowable-engine)
- [pinpoint](https://github.com/naver/pinpoint)
- [Hutool](https://www.hutool.cn/docs/)
- [guava](https://github.com/google/guava/wiki)
- [Hutools (国人开源的)](https://www.hutool.cn/docs/)
- [Google Guava & Apache Commons](https://github.com/google/guava/wiki)

#### Containers

@@ -12,3 +12,6 @@ title: 权利的游戏-第八季
附链接:
- [美剧天堂](https://www.meijutt.com/content/meiju23621.html)
- [人人字幕](http://www.yyets.com/) (感觉网站基本废了,可能访问网站看神剧的流量太大...)


> 烂尾了啊,最后的结局实在没有太多新意,也很牵强...

0 comments on commit e979360

Please sign in to comment.
You can’t perform that action at this time.