首先要连接数据库:
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 ','
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 { |
首先要连接数据库:
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 ','
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]; |
resp.setContentType("text/html;charset=UTF-8"); |
# 求左闭右开非降序区间 [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 成立 |
#!/usr/bin/env python3 | |
# %%%{CotEditorXInput=AllText}%%% | |
# %%%{CotEditorXOutput=Discard}%%% | |
import sys | |
import urllib.parse | |
import webbrowser | |
content = sys.stdin.read() | |
content = urllib.parse.quote(content) |