V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  supuwoerc  ›  全部回复第 1 页 / 共 87 页
回复总数  1723
1  2  3  4  5  6  7  8  9  10 ... 87  
4 天前
回复了 owlzhang95 创建的主题 生活 打呼噜影响家庭生活状态了
减肥
牛,刚刚生成了一个简单的课程,看起来很棒
@supuwoerc 是的,需要补充下,atomic.StoreUint32(&o.done, 1)应该 defer 执行,避免 happens before
存在 data race ,你想要双重检查标识位,但是第一次检查没在加锁之后,是存在潜在问题的。

问题出现在 done uint32 的读写并不是原子的,你需要换成原子读写,你这段代码和 sync.Once 的区别就是这里。

```
func (o *Once) Do(f func()) {
if atomic.LoadUint32(&o.done) == 1 {
return
}

o.m.Lock()
defer o.m.Unlock()

fmt.Println("bing: ", o.done)

if atomic.LoadUint32(&o.done) == 0 {
atomic.StoreUint32(&o.done, 1)
f()
}
}
```
@supuwoerc 对我来说是吃灰了,对我爸来说还没吃灰,估计过段时间也会走向吃灰
ipad 2019 年买的,虽然自己不用了,但是给我爸看视频用了,屏幕大,不用盯着手机戴着老花镜看了。
不知道有没有人专门弄虚拟机去薅骗子🐶
8 天前
回复了 albin504 创建的主题 程序员 笔记本上语音输入使用豆包体验真不错
别吵!我在豆包!🐶
8 天前
回复了 TingLen 创建的主题 React 关于低代码的选型,请佬们帮我分析一下
都接触过,都不推荐,这玩意是真的恶心,除了那种临时搭建问卷/广告之类的地方,不建议任何业务使用🤢
2025 年 12 月 30 日
回复了 muluc 创建的主题 问与答 你们的女朋友也这样吗?
楼主赶紧转行月嫂赛道吧!天赋异禀了属于是
2025 年 12 月 29 日
回复了 BingoW 创建的主题 职场话题 刚刚失业,有个小小的创业想法
个人觉得大屏这种烂大街的东西真的没必要搞,这种东西就是面子工程,我 19 年毕业的时候和低代码一起吹出来东西,看似页面酷炫,实际 low 的不行... 各种国产化和信息化衍生出来的东西,当然,可能我没见过真的厉害的这种项目吧,我见到的,听说的基本都是 echarts 加上一堆贴图,能会用 Three.js 和 D3 的都少的很,说个暴论:能熟练掌握 Three.js ,D3 ,Canvas 常见场景的脏区域渲染,4 叉树之类的人不会去承接这种业务的公司... 后端也是一堆超长 SQL 聚合查数据,虽然技术再差也不影响挣钱,但是这种活干多了人真的恶心,而且各个行业削减开支,慢慢也不流行搞这种面子工程了,长久不了。
2025 年 12 月 26 日
回复了 shinonome 创建的主题 Go 编程语言 go 返回错误的时候, 返回的值应该可用吗
```
// Reader is the interface that wraps the basic Read method.
//
// Read reads up to len(p) bytes into p. It returns the number of bytes
// read (0 <= n <= len(p)) and any error encountered. Even if Read
// returns n < len(p), it may use all of p as scratch space during the call.
// If some data is available but not len(p) bytes, Read conventionally
// returns what is available instead of waiting for more.
//
// When Read encounters an error or end-of-file condition after
// successfully reading n > 0 bytes, it returns the number of
// bytes read. It may return the (non-nil) error from the same call
// or return the error (and n == 0) from a subsequent call.
// An instance of this general case is that a Reader returning
// a non-zero number of bytes at the end of the input stream may
// return either err == EOF or err == nil. The next Read should
// return 0, EOF.
//
// Callers should always process the n > 0 bytes returned before
// considering the error err. Doing so correctly handles I/O errors
// that happen after reading some bytes and also both of the
// allowed EOF behaviors.
//
// If len(p) == 0, Read should always return n == 0. It may return a
// non-nil error if some error condition is known, such as EOF.
//
// Implementations of Read are discouraged from returning a
// zero byte count with a nil error, except when len(p) == 0.
// Callers should treat a return of 0 and nil as indicating that
// nothing happened; in particular it does not indicate EOF.
//
// Implementations must not retain p.
type Reader interface {
Read(p []byte) (n int, err error)
}
```
每一个开发者的设计不同,上面的代码是 Reader 的注释,说了应该总是先处理 p ,再处理错误。

我遇到的基本都是有错误只有错误会有意义,其余均是 0 值。
2025 年 12 月 26 日
回复了 yw121141111 创建的主题 生活 面对现实该如何抉择
这个事情得看你对象决定,她才是最终下决定的人,你需要和他谈清楚你的规划和目前的实际困难,她如果选择继续下去要面临家人的反对和未来一段时间拮据的生活,她选择分手你也要理解接受。

如果你有勇气的话你可以找你对象爸妈谈一次,你起码要能证明自己是一个靠谱的人,也要说清楚你自己有哪些困难,有没有计划改善目前的境遇,谁也不希望自己的闺女找了个鬼火黄毛男孩,这一点你要理解。

一分钱难倒英雄汉,楼主需要准备提升自己的收入(虽然这很难),为未来你自己或是家庭有更好的生活质量想办法,毕竟有句老话:贫贱夫妻百事哀。

结婚只是一个为期一天的仪式,此后还要开始长久的家庭生活。

不要自卑家庭糟糕的经济状况,这并不是你造成的,相反你需要努力摆脱这种现状。

祝好~
cursor 读取 commit 总结我干了啥,生成 markdown 丢给夸克生成 ppt ,再用 excalidraw 生成一些图片补充下。
2025 年 12 月 24 日
回复了 ErnestSu 创建的主题 职场话题 对于上班,大家有这样的感觉吗?
@HotieCutie 最残酷的是,上了一辈子班也没挣到啥钱😭。
2025 年 12 月 23 日
回复了 rcj6056 创建的主题 生活 突然感觉人生好难
哎,配上今天上海灰蒙蒙的天,难受...
2025 年 12 月 23 日
回复了 xxxiong 创建的主题 iPhone 首发的 iPhone 13,你们还好吗?
13pm 两周前换了电池,还能战下去。
2025 年 12 月 22 日
回复了 weiwenhao 创建的主题 程序员 Nature vs Golang: 性能基准测试
大佬太牛了
2025 年 12 月 17 日
回复了 yuhuij 创建的主题 职场话题 求职半个月,感觉快撑不住了,想听听大家的意见
外包真的不如狗,hr 都经常会问外包的 hc 要不要压缩掉...
2025 年 12 月 17 日
回复了 qiuzhifei 创建的主题 问与答 求推荐:电子体温计
家里有孩子,之前媳妇买了博朗耳温枪,还算准确
1  2  3  4  5  6  7  8  9  10 ... 87  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   972 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 41ms · UTC 22:20 · PVG 06:20 · LAX 14:20 · JFK 17:20
♥ Do have faith in what you're doing.