1、借助<input type="file" />标签上传PDF文件; 2、创建FileReader方法,var reader = new FileReader(); 3、执行reader.onload = function(){console.log(reader.result)}; 4、执行re ...
分类:
其他好文 时间:
2021-03-08 14:06:20
阅读次数:
0
hello world package main import "fmt" func main() { fmt.Println("hello world") } 1 代码结构 1 Go以 包 为单位 2 每个文件必须声明一个包 3 程序必须仅有一个main包 func main() // 程序入口函 ...
分类:
其他好文 时间:
2021-03-08 14:06:02
阅读次数:
0
Design HashMap (E) 题目 Design a HashMap without using any built-in hash table libraries. To be specific, your design should include these functions: pu ...
分类:
其他好文 时间:
2021-03-08 14:02:58
阅读次数:
0
var index=1; left.onclick=function () { index++ if (index>3) { index=0 } one.style.left=-index*800+"px" } right.onclick=function () { index-- if (inde ...
分类:
其他好文 时间:
2021-03-08 13:34:42
阅读次数:
0
||:找到真值则返回 &&:找到假值则返回 一般用于设置默认值,例如: function func(a){ a = a || 1; //如果a传值了则设置为a 如果没传值则设置为1 } ...
分类:
编程语言 时间:
2021-03-08 13:25:17
阅读次数:
0
先给出接口 type Handler interface { do() SetNext(handler Handler) Handler Run() } // 用以复用 type Next struct { nextHandler Handler } func (n *Next) SetNext(h ...
分类:
其他好文 时间:
2021-03-06 14:47:05
阅读次数:
0
奇偶排序 核心思想:奇数位和偶数位的数据交替比较,最终实现排序 代码实现: package main import "fmt" func IsSort(arr []int) []int { flag := false if len(arr) ? 1 for flag == false { flag ...
分类:
编程语言 时间:
2021-03-05 13:26:07
阅读次数:
0
1 消息队列 1 两个服务调用:restful(http协议),rpc(远程过程调用) 2 rpc:远程过程调用 -gRPC:谷歌出的,跨语言 3 不管用rpc或者restful来通信,涉及到同步,异步 4 消息队列解决的问题 -应用解耦 -流量消峰 -消息分发(发布订阅:观察者模式) -异步消息( ...
分类:
其他好文 时间:
2021-03-05 13:13:49
阅读次数:
0
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi ...
分类:
编程语言 时间:
2021-03-04 13:25:22
阅读次数:
0
为什么要控制goroutine的数量? 在我们开发过程中,如果不对goroutine加以控制而进行滥用的话,可能会导致服务整体崩溃。比如耗尽系统资源导致程序崩溃,或者CPU使用率过高导致系统忙不过来。 用什么方法控制goroutine的数量? 尝试 chan func main() { userCo ...
分类:
其他好文 时间:
2021-03-04 13:06:07
阅读次数:
0