上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 49 下一页
摘要: main.go package main import ( "net/rpc" "net" "log" "net/rpc/jsonrpc" ) //自己的数据类 type MyMath struct{ } //加法--只能两个参数 func (mm *MyMath) Add(num map[stri 阅读全文
posted @ 2024-07-10 10:08 朝阳1 阅读(48) 评论(0) 推荐(0)
摘要: composer dump-autoload --optimize composer install --no-dev --prefer-dist --prefer-stable 这两个命令是在使用Composer时常用的,Composer是PHP的依赖管理工具。下面是这两个命令的解释: 1. `c 阅读全文
posted @ 2024-07-10 09:47 朝阳1 阅读(85) 评论(0) 推荐(0)
摘要: 分表分库,不使用第三方中间件的话,自己根据分库分表的逻辑进行重写表名、库名 use Illuminate\Support\Str; class Item extends Model { public $uid; //设置用户id,根据用户id进行取模(测试而已,正常用户信息可以放到token里,这样 阅读全文
posted @ 2024-07-09 17:36 朝阳1 阅读(106) 评论(0) 推荐(0)
摘要: 在 PHP 中,对象可以被当作数组来调用,这通常是通过实现 ArrayAccess 接口来实现的。ArrayAccess 接口要求实现以下五个方法: offsetSet($offset, $value) offsetExists($offset) offsetUnset($offset) offse 阅读全文
posted @ 2024-07-06 14:58 朝阳1 阅读(73) 评论(0) 推荐(0)
摘要: offer.go package main import ( "bufio" "encoding/base64" "encoding/json" "fmt" "github.com/pion/webrtc/v4" "log" "os" "strconv" "time" ) func main() { 阅读全文
posted @ 2024-06-28 15:50 朝阳1 阅读(160) 评论(0) 推荐(0)
摘要: 电脑需要有摄像头 main.go //go:build !js // +build !js // sfu-ws is a many-to-many websocket based SFU package main import ( "encoding/json" "flag" "github.com 阅读全文
posted @ 2024-06-28 15:32 朝阳1 阅读(128) 评论(0) 推荐(0)
摘要: proto.go package proto import ( "bufio" "bytes" "encoding/binary" ) // Encode 将消息编码 func Encode(message string) ([]byte, error) { // 读取消息的长度,转换成int32类 阅读全文
posted @ 2024-06-27 17:25 朝阳1 阅读(14) 评论(0) 推荐(0)
摘要: package main import ( "fmt" "time" "github.com/go-redis/redis" ) func err_handler(err error) { fmt.Printf("err_handler, error:%s\n", err.Error()) pani 阅读全文
posted @ 2024-06-27 16:50 朝阳1 阅读(35) 评论(0) 推荐(0)
摘要: 有个同事,之前一直写弱类型语言,连链表结构都不知道。。。。下面是gpt解释 链表是一种常见的数据结构,用于存储一系列元素。与数组不同,链表中的元素在内存中不是连续存放的,而是通过每个元素(称为节点)中的指针(或引用)连接起来。链表的结构具有以下特点: 节点:链表由一系列节点组成,每个节点通常包含两部 阅读全文
posted @ 2024-06-27 16:46 朝阳1 阅读(51) 评论(0) 推荐(0)
摘要: package main import ( "fmt" ) func array_trunk(m map[string]int, n int) []map[string]int { l := len(m) s := l / n if l%n != 0 { s += 1 } res := make([ 阅读全文
posted @ 2024-06-27 16:33 朝阳1 阅读(10) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 49 下一页