对接雅虎日语文本校对
青年时种下什么,老年时就收获什么——易卜生 API地址:https://developer.yahoo.co.jp/webapi/jlp/kousei/v2/kousei.html 代码: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758package com.ruben;import cn.hutool.core.map.MapUtil;import cn.hutool.core.text.CharPool;import cn.hutool.core.text.StrPool;import cn.hutool.http.HttpRequest;import cn.hutool.http.HttpUtil;import cn.hutool.json.JSONObject;import cn.hutool.json.JSONUtil;import cn.hutool.log.StaticLog;import cn....
kotlin相关依赖
朋友间保持一定的距离,而使友谊永存——查尔卡 第一次用kt写东西的时候,没引入GAV都可以用…应该是idea集成了kt环境,到线上打包就没有了 新建了一个kotlin项目,发现需要GAV才能打包进去 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253<properties> <maven.compiler.source>8</maven.compiler.source> <maven.compiler.target>8</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <kotlin.version>1.7.10</kotlin.version></properties...
ubuntu安装jdk Unable to locate package openjdk-8-jre ubuntu
年轻人在科学的进程中要有冲刺力,当你老了,就会越来越胆小——杨振宁 需要首先执行: 1apt-get update 然后再次安装: 1apt-get install openjdk-8-jre-headless 弹出的提示按Y 即可成功安装
maven版本号插件
莫等闲,白了少年头,空悲切——岳飞 我们maven项目除了使用这种方式修改版本号,还有一种统一管理版本号的方式: 项目地址:https://github.com/mojohaus/flatten-maven-plugin 官方文档:http://www.mojohaus.org/flatten-maven-plugin/ 引入: 12345678910111213141516171819<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>flatten-maven-plugin</artifactId> <!--<version>INSERT LATEST VERSION HERE</version>--> <executions> <execution> ...
canvas视频截帧
礼貌是儿童和青年都应该特别小心地养成习惯的第一件大事——约翰·洛克 先放代码: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136<script> /** * * @param src string 视频url * @param currentTime double 视频截取位置,单位秒 * @return 截取图片的 base64 */ ...
h2下update set字段重复处理拦截器
慷慨是友谊的精华——王尔德 今天发现Mybatis-Plus在h2下,同时使用UpdateWrapper和entity会出现 update 表名 set 字段1=xxx,字段1=xxx 这样的sql,在mysql下是正确的语法,h2会抛出异常 所以写了个mybatis拦截器,放在了streampark里: pr地址:https://github.com/streamxhub/streampark/pull/1493 源码: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128/* * ...
blob和base64互转
交易场上的朋友胜过柜子里的钱款——托·富勒 blob转base64 1234567891011121314151617// blob转base64async function blobToBase64(blob) { let buffer = await blob.arrayBuffer() let bytes = new Uint8Array(buffer); console.log(bytes) // do anything with the byte array here let binary = '' var len = bytes.byteLength; for (var i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } base64 = 'data:image/webp;base64,' + window.btoa(binary) co...
资源路径与blobUrl互转
害怕树敌的人永远得不到真正的朋友——哈兹里特 首先是普通资源URL转换为blobUrl 12345678910111213// 生成blobURLconst xhr = new XMLHttpRequest();xhr.open('GET', 'https://VampireAchao.github.io/imgs/preview/3356_3.jpg', true);xhr.responseType = 'blob';xhr.onload = function (e) { if (this.status == 200) { var blob = this.response; console.log(blob); // document.getElementById("myImg").src = URL.createObjectURL(blob); console.log(URL.createObjectURL(bl...
get请求包含参数属性为数组
凡是夫妇不吵架的家庭,准是一块阴森之地,既没有冲击,故也没有快乐——柏杨 有些时候,我们需要使用GET请求传递数组,但是使用很多前端请求框架,以及EcmaScript自带的URLSearchParams转换的URL参数都无法直接进行转换: 例如以下格式: 1234567891011121314{ "current": 1, "size": 1, "orders": [ { "column": "age", "asc": true }, { "column": "name", "asc": true } ]} 使用URLSearchParams转换结果: 1234let se...
xnio坑
恶名不治,恶伤可治——佚名 今天拉取StreamPark发现其引用了xnio 并且项目运行时抛出了nvalid file path的异常提示 发现源码部分: 其去寻找了NUL:这个路径 1new FileOutputStream("NUL:") 解决方式: 启动参数带上-Djdk.io.File.enableADS=true: 1-Djdk.io.File.enableADS=true -Dapp.home=streamx-console/streamx-console-service/target/streamx-console-service-1.2.4 如果没有这一栏,可以在右侧蓝字Modify options开启
