元字符 | 说明 |
---|---|
* | 匹配除了斜杠(/)之外的所有字符。Windows上是斜杠(/)和反斜杠(\) |
** | 匹配零个或多个目录及子目录。不包含 . 以及 .. 开头的。 |
? | 匹配任意单个字符。 |
[seq] | 匹配 seq 中的其中一个字符。 |
[!seq] | 匹配不在 seq 中的任意一个字符。 |
\ | 转义符。 |
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
#!/usr/bin/env python3 | |
# %%%{CotEditorXInput=AllText}%%% | |
# %%%{CotEditorXOutput=Discard}%%% | |
import sys | |
import urllib.parse | |
import webbrowser | |
content = sys.stdin.read() | |
content = urllib.parse.quote(content) |
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
# 求左闭右开非降序区间 [left, right) 中第一个大于或等于 target 的位置 | |
def lower_bound(array, left, right, target): | |
while left < right: | |
mid = left + (right - left) // 2 # 防止溢出 | |
if array[mid] < target: left = mid + 1 | |
# if !(target < array[mid]): # 小于等于即为 upper_bound | |
else: right = mid | |
return left # 此时 left==right 成立 |
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
resp.setContentType("text/html;charset=UTF-8"); |
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
ByteBuf buf = ...// get ByteBuf | |
int length = buf.readableBytes();//get readable length | |
if(buf.hasArray()){ | |
//ByteBuf in heap | |
byte[] array = buf.array(); | |
int offset = buf.arrayOffset()+buf.readerIndex(); | |
handleArray(array,offset,length);//your method | |
}else{ | |
//ByteBuf in direct buffer | |
byte[] array=new byte[length]; |
首先要连接数据库:
mysql --local-infile -u root -p DATABASE
这里要注意加上关键词 --local-infile
,否则会报 Loading local data is disabled
错误。
然后使用指令
LOAD DATA infile '/src/test.csv' --CSV文件存放路径
INTO TABLE student--要将数据导入的表名
FIELDS TERMINATED BY ','
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
final boolean isMac = | |
System.getProperty("os.name").toLowerCase(Locale.US).contains("mac"); | |
// Configure the server. | |
// See https://netty.io/wiki/native-transports.html | |
EventLoopGroup bossGroup; | |
EventLoopGroup workerGroup; | |
if (isMac) { | |
bossGroup = new io.netty.channel.kqueue.KQueueEventLoopGroup(); | |
workerGroup = new io.netty.channel.kqueue.KQueueEventLoopGroup(5); | |
} else { |