V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  zuisong  ›  全部回复第 1 页 / 共 2 页
回复总数  26
1  2  
21 天前
回复了 ylsAGI 创建的主题 OpenAI 免费高并发 GPT-3.5-Turbo 模型,支持沉浸翻译
接收到的内容为空,请检查您的 API 是否支持 Stream 流式输出,可询问服务提供方具体详情。如果不支持流式输出,可在高级设置中关闭 [流式逐字回复] 的开关后重试。
太酷啦 已经 star. 希望看完代码后有提 PR 的机会 https://i.imgur.com/2spsghH.png
45 天前
回复了 DIYgods 创建的主题 程序员 一个六岁开源项目的崩溃与新生
可以考虑部署在 deno deploy 上
@wingtao #17 是的 notion 仅支持 mermaid ,kroki 支持更多的文本绘图语言
10 块钱一个币回收 有意向的可以联系 微信: enVpc29uZzEyMzAK
我也开发了一个类似的插件 https://github.com/zuisong/notion-kroki
支持 plantuml ,D2 等众多 kroki.io 支持的文本绘图语言
@iorilu 感觉和 gpt3.5 差不多
支持一下
187 天前
回复了 dzdh 创建的主题 macOS 有没有什么好用的桌面 GPG 工具 。除了 GPGSuite。
没找到其他的, 我用了这个 ` brew install gpg-suite-no-mail ` , 去掉了邮件加密模块
198 天前
回复了 857681664 创建的主题 程序员 个人博客终于迁移成功上线了
博客没有评论系统,只能评论在这里了

《 Kotlin 实现 Rust 风格的 Result 》
"可惜的是最后返回的 content 是可用类型,在后续使用的时候必须带上!!或者?:操作符,"
可以不用返回可空类型的, 可以这样写

```kotlin
sealed class KResult<T, E : Throwable> {
fun isOk(): Boolean = this is OK
fun isError(): Boolean = this is Error

fun <T, E : Throwable> KResult<T, E>.OK(block: (T) -> T): T {
return block((this as OK).data)
}

fun <T, E : Throwable> KResult<T, E>.Error(block: (E) -> Nothing) : Nothing {
this as Error
block(this.error)
}
}

class OK<T, E : Throwable>(val data: T): KResult<T, E>() {}

class Error<T, E : Throwable>(val error: E): KResult<T, E>() {}

infix fun<T, E: Throwable> KResult<T, E>.match(block: KResult<T, E>.() -> T): T {
if (this.isOk()) {
return (this as OK).data
}
throw (this as Error).error
}

fun openFile(fileName: String): KResult<String, Throwable> {
if (fileName == "error") return Error( IOException("io exception"))
return OK("content")
}

fun main() {
val result = openFile("error")
val content = result match {
OK { str ->
str
}
Error { error ->
throw error
}
}
println(content)
}
```
👍 赞,太牛了, 先收藏一个, 以后可能用得上😀
求一个码😜 Y2hlbmppYW5AZHVjay5jb20K
https://i.imgur.com/WbLXOUp.png

求个 lifetime 的 Y29tLnNvQHFxLmNvbQo=
支持
271 天前
回复了 villa2935 创建的主题 Python Python 新手
在 Python 中,可以使用 `enumerate()` 函数来同时获取迭代对象的索引和值。你可以在循环中使用 `enumerate()` 函数来获得当前元素的索引位置。

下面是一个使用 `enumerate()` 函数的示例代码:

```python
items = [0, 0, 1, 1, 2, 2]

for index, item in enumerate(items):
print(f"index: {index}, item: {item}")
```

输出结果为:

```
index: 0, item: 0
index: 1, item: 1
index: 2, item: 2
```

这样你就可以获得当前元素在集合中的位置了。
https://sindresorhus.com/velja

velja 有个 safari 扩展, 点一下就可以切换到其他浏览器打开
288 天前
回复了 LoongRiver 创建的主题 程序员 以练代学,用 Rust 实现 Lua 解释器
最近正在跟着这个课程学习,结果作者出现了 🥳 感谢分享
Y2hlbmppYW5AZHVjay5jb20K
1  2  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   910 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 36ms · UTC 19:56 · PVG 03:56 · LAX 12:56 · JFK 15:56
Developed with CodeLauncher
♥ Do have faith in what you're doing.