Yimo 的讨论

发布于: 雪球回复:0喜欢:1
程序问题感觉还是得上stackoverflow综合多个回答才能得出靠谱一点的答案,所以还是得用谷歌入口。各种问答平台的回答虽然大概也差不多算对,但总是有细微偏差,有些我能识别,能修正或忽略,有些识别不了但觉得有点怪,最终为了能确定还是得放狗,那还不如一开始就放[笑哭]

热门回复

04-18 10:25

举个例子吧,我想知道java里future.get多次调用是不是总能得到相同的结果,这个是谷歌给我的第一个链接 网页链接
而这个是perplexity的回答
No, future.get() does not always return the same results through multiple invocations. The behavior depends on the implementation of the Future and the asynchronous operation it represents.
In Java, a Future represents the result of an asynchronous computation. When you call future.get(), it blocks until the asynchronous operation completes and returns the result of that operation. However, if you call get() multiple times on the same Future instance, the behavior can vary:
1. If the Future represents a one-time computation, calling get() multiple times will return the same result after the initial computation completes.[1] Subsequent calls to get() will not trigger a new computation.
2. If the Future represents a recurring or stateful operation, calling get() multiple times may return different results each time, depending on the implementation.[1] For example, if the Future represents a periodic task or a stateful service, each call to get() could return a new result based on the current state.
3. If the asynchronous operation fails with an exception, calling get() will throw that exception on the first invocation. Subsequent calls to get() on the same Future instance will continue to throw the same exception.[1]
In summary, the behavior of multiple invocations of future.get() depends on the semantics of the asynchronous operation represented by the Future. If it's a one-time computation, get() will return the same result after the initial computation. If it's a recurring or stateful operation, get() may return different results on each invocation. And if the operation fails, get() will consistently throw the same exception.[1]
Citations:
[1] 网页链接
[2] 网页链接
[3] 网页链接
[4] 网页链接
[5] 网页链接
st上的回答简单直接有效,ai的回答也不能说错,但总有点不着边际抓不住重点,看完还是有点不确定,但也想不出怎么进一步发问。
ai某些时候更高效,但google更能发挥主观能动性,减少"问了感觉还是白问"的机率,当然有经验的用户会知道某类问题在哪个平台问更有效

04-18 11:19

claude回答得非常好,我刚才就是看到J大推荐了p站一时心痒所以顺手试了一下。谷歌给的答案,都是懂编程的人类回答的,感觉会更懂你的心,更直达你的灵魂,比如上来就一句"call as often as you like"。我不懂预训练,单就程序问题而言,感觉放狗搜再点开链接并没有比直接在ai平台发问繁琐多少,但更有一种玄学上的安全感和把控感[笑哭]

04-18 10:43

我关心的是get会不会改变future的状态,比如get一次之后再get就返回null或者抛异常,至于get出来的东西是什么(stateful sevcie或者periodic task)根本无关紧要。st上的回答就很有效,"call as often as you like",但p站明显就理解偏了

04-18 11:00

你可以直接就问你说的这个问题作为后续追问啊。还有你这个问题其实是不需要搜索的,有预训练就行,可能问最强模型会比较好。你瞧瞧这个Claude3答得如何?

04-18 10:30

这感觉答得不错啊,你觉得怎么答会更好?如果要简洁一点可以让它回答短一点,用bullets来格式。

04-18 09:59

这个问题是两面的。第一是stack overflow 在GPT推出以后流量确实跌了,可见总体而言,找stack overflow的需求少了。第二,当然perplexity之流给的答案可能不够综合,但是首先提问的时候可以让它给出多个结果。另外,LLM有一个追问的能力,可以解决残留的疑问。比如我看了代码答案之后,觉得确实能用,但是有几处它的用法我不明白为什么这样用,这时候我可以直接问这个地方这样用的问题,就能得到答案,而原来找谷歌就很不容易,得再问,再给语境,再读它抓到的整个再搞懂这个是为什么。