V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  pathletboy  ›  全部回复第 1 页 / 共 12 页
回复总数  238
1  2  3  4  5  6  7  8  9  10 ... 12  
30 天前
回复了 Sindo 创建的主题 Android 解决了小米手机谷歌地图没方向的问题
是不是没给 "获取设备动作与方向" 权限?默认禁的,禁了就没方向了。
@sodayo 这题我会,游戏加速里,把网络加速关了,那玩意开 VPN 的。
红绿灯人脸识别 NOT 蓝灯
307 天前
回复了 ytzong 创建的主题 云计算 AWS Lightsail 流量超出的账单问题
1T 内算双向流量,超出 1T 只算出
338 天前
回复了 shiy05 创建的主题 程序员 github copilot X 的免费竞品
@shiy05 试用了下,右下角把 codeium disable globally , 只使用 chat 部分功能,挺不错,当然仅当 chatgpt 用也相当可以。
338 天前
回复了 shiy05 创建的主题 程序员 github copilot X 的免费竞品
2 个同时用会冲突吗?
所有更新数据的地方打 LOG 嘛,很快就能找到。
2023-01-09 11:53:54 +08:00
回复了 rimutuyuan 创建的主题 GitHub Copilot 收到了 gihub 学生包中的 copilot 将要过期的邮件
@rimutuyuan 11 分钟前收到了
要不试试 proxychains4 ?
2022-09-20 12:08:52 +08:00
回复了 xqdoo00o 创建的主题 程序员 crates.io 快像 npm 那样太多重复轮子了
这就是 awesome 存在的意义
2022-06-23 07:13:26 +08:00
回复了 heyinglongsimon 创建的主题 Windows 不懂就问,修改内存信息
这种情况建议 patch 程序而不是系统
2022-06-22 09:38:07 +08:00
回复了 yuhangch 创建的主题 GitHub Copilot Github Copilot 正式上线了
略贵,5 刀还可以考虑考虑。
2022-06-10 15:59:01 +08:00
回复了 daokedao 创建的主题 Go 编程语言 Go 的 http 服务器,同时下载的连接不能超过两个吗?
@daokedao
http.DefaultTransport = &http.Transport{
DisableKeepAlives: true,
}
配置下可以,原因未知
2022-06-10 13:09:05 +08:00
回复了 daokedao 创建的主题 Go 编程语言 Go 的 http 服务器,同时下载的连接不能超过两个吗?
我猜是写入了同个文件 NUL ?
2022-06-07 15:15:31 +08:00
回复了 tctc4869 创建的主题 程序员 用 html、js、css 写客户端软件,除了 electron 还有哪些方案?
2022-06-02 13:20:01 +08:00
回复了 xxjwxc 创建的主题 Go 编程语言 golang 实现的一套 A 股量化系统
老哥,你把 MYSQL 密码给暴露了,看了下应该还是运营站点?
为了灵活性
go 中,可以对 nil 值 channel 进行读写操作,当对值为 nil 的 channel 进行读取操作时会阻塞,但是对值为 nil 值的 channel 调用 close()会 panic 。使用 nil 值 channel 可以帮助在 select 中禁用某个 select 分支,因为阻塞了所以都不会进入分支语句。

下面是 client-go 中对 nil 值 channel 和单向 channel 的使用的函数代码:

func (p *processorListener) pop() {
defer utilruntime.HandleCrash()
defer close(p.nextCh) // Tell .run() to stop

var nextCh chan<- interface{}
var notification interface{}
for {
select {
case nextCh <- notification:
// Notification dispatched
var ok bool
notification, ok = p.pendingNotifications.ReadOne()
if !ok { // Nothing to pop
nextCh = nil // Disable this select case
}
case notificationToAdd, ok := <-p.addCh:
if !ok {
return
}
if notification == nil { // No notification to pop (and pendingNotifications is empty)
// Optimize the case - skip adding to pendingNotifications
notification = notificationToAdd
nextCh = p.nextCh
} else { // There is already a notification waiting to be dispatched
p.pendingNotifications.WriteOne(notificationToAdd)
}
}
}
}
https://go.dev/ref/spec#Channel_types
A nil channel is never ready for communication.
你贴的这个直接运行
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [chan send (nil chan)]:
main.main()
/tmp/sandbox3073028740/prog.go:11 +0x7e

goroutine 5 [chan receive]:
main.main.func1()
/tmp/sandbox3073028740/prog.go:9 +0x4f
created by main.main
/tmp/sandbox3073028740/prog.go:7 +0x6a

Program exited.
2022-05-16 11:59:04 +08:00
回复了 CSGO 创建的主题 前端开发 谁知道这种画面网页代码怎么创出出来的?
1  2  3  4  5  6  7  8  9  10 ... 12  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1016 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 38ms · UTC 19:41 · PVG 03:41 · LAX 12:41 · JFK 15:41
Developed with CodeLauncher
♥ Do have faith in what you're doing.