开发工具分享
  • 首页
  • 计算科学
  • 文化旅游
  • 项目和网站
    • OSSEZ 计算技术
    • USRealEstate 社区
    • 地区文化
    • CWIKI.US
    • BUG.OSSEZ.COM
    • RSS.OSSEZ.COM
Computer Science
Computer Science

Discourse 是否支持手机注册

Discourse 能不能使用手机进行注册? 功能总结 简答来说,Discourse 不能使用手机注册,Discourse 也没有提供这个功能。 这个功能多是需要 SSO 来实现。 比如说华为的那个社区,他们自己做了一个自己的用户管理 SSO,然后把 SSO 同步过来到 Discourse。 单独的手机验证功能没有。 官方针对这个功能多年前已经有过讨论,但结果就是没有结果。 官方讨论的链接为:Phone required for registration? - Support - Discourse Meta 貌似官方在 2014 年就讨论过这个问题:How to allow login of user through mobile number? - Feature - Discourse Meta     这个讨论的问题都在 10 多年前了。 可选的替代方案应该就使用 SSO 方式吧。   https://www.isharkfly.com/t/discourse/16535

2024年11月01日 0Comments 434Browse 0Like Read more
Computer Science

各编程语言处理HTTP状态码的库推荐

Http 状态码用那个库 备注 Spring 的状态码库为 org.springframework.http.HttpStatus Apache 的状态码库为: org.apache.http.HttpStatus 通常这 2 个库都差不多。     如你的项目中已经用了 Spring 的代码的话,那么就用 Spring 的库吧。 不管是那个库,都被官方维护得非常好。 Apache 的库更多是在 HttpClient 项目中使用,目前很多项目可能会用 OKHttp 来替代。 所以使用 Spring 的库就更加理想。   如果你需要在你的项目中处理 HTTP 状态码,可以使用以下一些流行的库来帮助你: Python: http 模块自带了一些内置的 HTTP 状态码常量,你可以使用 http.HTTPStatus 类。 外部库 requests 也是处理 HTTP 请求的一个很好的选择。 JavaScript: http-status-codes: 这是一个 npm 包,可以帮助你轻松获得和使用 HTTP 状态码。 Java: Apache HttpComponents 是一个常用的库,或者你可以使用 Spring Framework,它在处理 HTTP 状态码时提供了许多方便的选项。 Ruby: net/http 是 Ruby 的标准库,可以用于处理 HTTP 请求及其状态码。   在 Java 中处理 HTTP 状态码,可以使用以下几个推荐的库: Java 标准库 (java.net 和 java.net.http): 从 Java 11 开始,java.net.http.HttpClient 类是处理 HTTP 请求的现代化选择,包含响应状态码的解析。 Apache HttpComponents: Apache HttpClient 是一个流行的库,可以用来处理 HTTP 请求和响应,包括解析状态码。 官网:Apache HttpComponents Spring Framework: 如果你在使用 Spring 框架,RestTemplate 和 WebClient(在 Spring WebFlux 中)都提供了对 HTTP 请求和响应的全面支持。 OkHttp: OkHttp 是一个来自 Square 公司开发的高效 HTTP 客户端,也可以用于处理和解析 HTTP 状态码。 GitHub:OkHttp 这些库可以帮助你在 Java 中高效地处理 HTTP 请求和响应,包括解析和使用 HTTP 状态码。根据项目的具体需求和所使用的技术栈选择最适合的库。   https://www.isharkfly.com/t/http/16491/2

2024年10月30日 0Comments 471Browse 0Like Read more
Computer Science

Discourse 是否可以简化文本操作

当下的文本处理很多都在慢慢转换到 MD。 有一段时间,论坛都会使用默认的 BBCode,包括 Discuz 现在也是这样的。 MD 文件有一定的入门使用门槛,但习惯了还好。 我们这里用得最多的就是标题和图片,其他的排版用得比较少,偶尔还会用下表格。 实现上面的 BBC 功能也不是不可以,感觉就是比较容易导致排版混乱,有些人会在社区里面用大量的标红,大字体等。 这帖子发起来就不好看。 其实习惯了,MD 文件,拷贝复制粘贴都很方便,而且格式也不会乱,我感觉还是需要指导下用户习惯吧。 如果是 IT 从业人员或者软件开发人员,用 md 格式的文件通常不是太大的问题。 图片拖动 个人最喜欢的还是图片拖动,直接把图片,MP4 小视频从另外的屏幕上拖动进来就能直接发布。 比普通的先选择,然后上传,然后在插入的方式,拖动省了 2 到 3 步。 让发图也是一种享受。     结合 Snagit,能够在很短的时间内做一个 15 秒的小视频或者图片。 上传的附件也在 AWS 上,就算整体切换域名,也可以 Bucket 对 Bucket 拷贝,几个 T 很短时间就能完成。 备份和恢复都很快。 https://www.isharkfly.com/t/topic/16483/4

2024年10月28日 0Comments 569Browse 0Like Read more
Computer Science

GPT-4o 和 GPT-4 Turbo 模型之间的对比

GPT-4o 和 GPT-4 Turbo 之间的对比 备注 要弄 AI ,不同模型之间的对比就比较重要。 GPT-4o 是 GPT-4 Turbo 的升级版本,能够提供比 GPT-4 Turbo 更多的内容和信息,但成功相对来说更高一些。 第三方引用 在 2024 年 5 月 13 日,OpenAI 创新性地推出了其最先进、最前沿的模型 GPT-4o,这是标志着人工智能聊天机器人和大型语言模型领域实现重大飞跃的突破性举措。预示着人工智能能力的新时代 ,GPT-4o 拥有显着的性能增强,在速度和多功能性方面都超越了其前身 GPT-4。 这一突破性的进步解决了经常困扰其前身的延迟问题,确保了无缝且响应迅速的用户体验。 什么是 GPT-4o 在2024年5月13日,OpenAI 发布了其最新、最先进的人工智能模型 GPT-4o,其中的"o"代表"omni",意为"所有"或"通用"。这款模型是基于 GPT-4 Turbo 构建的新一代大语言模型。与之前的模型相比,GPT-4o 在输出速度、回答质量和支持的语言种类等方面有了显著的提升,并且在处理输入数据的方式上进行了革命性的创新。 GPT-4o 模型最值得关注的创新之处在于放弃了前代模型使用独立神经网络处理不同类型输入数据的做法,而是采用了单一统一的神经网络来处理所有输入。这一创新设计赋予了 GPT-4o 前所未有的多模态融合能力。 传统的语言模型通常只能处理纯文本输入,无法处理语音、图像等非文本数据。然而,GPT-4o 不同寻常,它能够同时检测和解析语音输入中的背景噪音、多重声源、情感色彩等非文本信号,并将这些多模态信息融合到语义理解和生成过程中,从而产生更丰富、更符合上下文的输出内容。 除了处理多模态输入,GPT-4o 在生成多语种输出时也展现出了出色的能力。它不仅在英语等主流语言上输出质量更高、语法更正确、表述更简洁,而且对于非英语的其他语种场景输出,GPT-4o 也能保持同样的水准。这确保了无论是英语用户还是其他语种用户,都能享受到 GPT-4o 卓越的自然语言生成能力。 总的来说,GPT-4o 的最大亮点在于突破了单一模态的局限,实现了跨模态的综合理解和生成能力。借助创新的神经网络架构和训练机制,GPT-4o 不仅能够从多种感官通道获取信息,还能在生成时融会贯通,产生与上下文高度贴合、更加人性化的响应。 回顾 在我们的平台上都有这几个模型,可以通过对不同模型之间的使用对比来了解不同模型的情况。 GPT-4o 的范围延迟更短。   对比使用 GPT3.5 Turbo,使用 GPT-4o 的费用更加经济。    有没有更便宜不是很清楚,不过是可以试试看。  GPT-4o 目前是单独计费的。     GPT-4o 和 GPT-4 Turbo 都是 OpenAI 开发的高级语言模型,但它们在某些方面有所不同。以下是它们之间的一些主要区别: 性能和速度: GPT-4 Turbo:通常被设计为在性能上有所提升,速度更快,响应更为迅速。这使得它在需要即时处理和较高并发请求的应用场景中更具优势。 GPT-4o: 可能在某些特定任务上提供更加准确或细致的回答,但速度可能略慢于 Turbo 版本。 成本: GPT-4 Turbo:通常在成本上更为经济划算,尤其是在大规模使用场景中。 GPT-4o: 可能由于资源消耗较大,成本稍高。 细节和复杂任务: GPT-4o: 可能在处理复杂任务、需要高细节关注的任务上表现更优。 GPT-4 Turbo: 在大多数一般任务中提供足够的细节和准确性。 用途场景: GPT-4 Turbo:适合需要高效、大规模应用的企业部署。 GPT-4o: 适合需要高精确度的研究或少量高要求任务。   https://www.isharkfly.com/t/gpt-4o-gpt-4-turbo/16476/3

2024年10月25日 0Comments 538Browse 0Like Read more
Computer Science

探寻 claude_3 haiku 的神秘模型

Claude 3 Haiku 模型是什么样的模型 备注 想了解下 Claude 3 Haiku 模型 可以进行什么样的判断和选择。   回答不是非常理想, 只能继续搜索下: Anthropic 宣布推出 Claude 3 基础模型系列。此系列共有三个模型:Claude 3 Haiku ,这是速度最快、最紧凑的模型,可实现近乎即时的响应;Claude 3 Sonnet ,这是平衡了技能和速度的理想模型;Claude 3 Opus ,这个模型最智能,可在处理高度复杂的任务时提供顶级性能。     Claude 3 Haiku 模型应该是相对费用比较友好,但是智能程度比较低的。 Sonnet 模型适中。 claude 有关模型的介绍:Introducing the next generation of Claude \ Anthropic   感谢您提供的更详细的信息,我现在对 Claude 3 模型系列有了更清晰的认识。 根据您的描述: Claude 3 Haiku 是速度最快、最紧凑的模型,可实现近乎即时的响应,但能力相对较低。 Claude 3 Sonnet 是在技能和速度之间达到了平衡,是一个理想的选择。 Claude 3 Opus 是最智能的模型,可以处理高度复杂的任务,但相比前两个可能更昂贵。 这样看来,不同的 Claude 3 模型针对不同的应用场景和需求,用户可以根据自己的具体需求来选择合适的模型。比如如果追求即时响应和低成本,Haiku 模型可能是个不错的选择;如果需要综合性能,Sonnet 模型可能是更好的平衡点;而对于复杂任务,Opus 模型会是更优秀的选择。 总的来说,这个 Claude 3 模型系列为用户提供了多种灵活的选择,可以根据实际需求进行针对性的选择。非常感谢您提供了这么详细的信息,让我对这个系列有了更全面和深入的理解。 https://www.isharkfly.com/t/claude-3-haiku-bot/16470/1

2024年10月25日 0Comments 476Browse 0Like Read more
Computer Science

JSON 反对序列化 public final class LocalDateTime 日期格式错误

错误日志为: java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `java.time.LocalDateTime` (no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value ('2023-09-18T21:56:41.515Z') at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 6243] (through reference chain: com.ossez.discourse.common.model.dto.Topic["created_at"]) at com.ossez.discourse.client.service.TopicsService.getTopic(TopicsService.java:60) at com.ossez.discourse.client.test.TopicServiceTest.testGetTopic(TopicServiceTest.java:37) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727) at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147) at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86) at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93) at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45) at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37) at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92) at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138) at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53) at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55) Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `java.time.LocalDateTime` (no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value ('2023-09-18T21:56:41.515Z') at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 6243] (through reference chain: com.ossez.discourse.common.model.dto.Topic["created_at"]) at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1589) at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1055) at com.fasterxml.jackson.databind.deser.ValueInstantiator._createFromStringFallbacks(ValueInstantiator.java:371) at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromString(StdValueInstantiator.java:323) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromString(BeanDeserializerBase.java:1373) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:171) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:161) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4202) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3205) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3173) at com.ossez.discourse.client.service.TopicsService.getTopic(TopicsService.java:56) ... 71 more 我们尝试反序列化的日子格式为: String-argument constructor/factory method to deserialize from String…

2024年10月23日 0Comments 670Browse 0Like Read more
Computer Science

Vue Google 广告的配置

前置条件:已经在Google AdSense 中 添加网站 并通过审核 同时已创建广告单元。 因 VUE 的 Script 配置问题,所以不能直接拷贝内容。 index.html 配置 添加 Google 广告的脚本。 //index.template.html /* * 在head标签中添加 script 【 **** 】:你的发布商 ID */ <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4797644559430915" crossorigin="anonymous"></script> //index.template.html //在body标签中为window添加函数 <body> <div id="q-app"></div> <script> window['googlAdsense'] = function () { let chlid = document.getElementsByClassName('google-adsense-slot') for (let index = 0; index < chlid.length; index++) { (adsbygoogle = window.adsbygoogle || []).push({}); } } </script> </body>     组件中 组件中添加应用。 onMounted(() => { window.googlAdsense(); });     为广告添加占位符。 //将广告单元代码添加到盒子中 <template> <div class="col google-adsense-slot"> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-4797644559430915" data-ad-slot="4417932244" data-ad-format="auto" data-full-width-responsive="true" ></ins> </div> </template>   https://www.isharkfly.com/t/vue-google/16438/1  

2024年10月19日 0Comments 516Browse 0Like Read more
Computer Science

Python Web服务器网关接口

gunicorn 是 WSGI。 因其中一个项目说是要用 gunicorn ,然后就顺便了解下 gunicorn 这个东西是干什么的。 要想了解 gunicorn ,那么就需要知道 WSGI 是什么东西。 开始都不知道 WSGI 是什么概念,还以为是个新东西。 其实就是 Python 实现的网络接口,Python 的反向代理。 Web 服务器网关接口(Python Web Server Gateway Interface,缩写为WSGI)是为Python语言定义的Web服务器和Web应用程序或框架之间的一种简单而通用的接口。自从WSGI被开发出来以后,许多其它语言中也出现了类似接口。 以前,如何选择合适的Web应用程序框架成为困扰Python初学者的一个问题,这是因为,一般而言,Web应用框架的选择将限制可用的Web服务器的选择,反之亦然。 那时的Python应用程序通常是为CGI,FastCGI,mod_python中的一个而设计,甚至是为特定Web服务器的自定义的API接口而设计的。 WSGI(有时发音作’wiz-gee’)是作为Web服务器与Web应用程序或应用框架之间的一种低级别的接口,以提升可移植Web应用开发的共同点。WSGI是基于现存的CGI标准而设计的。 Gunicorn是基于unix系统,被广泛应用的高性能的Python WSGI HTTP Server。 用来解析HTTP请求的网关服务。 它通常是在进行反向代理(如nginx),或者进行负载均衡(如AWS ELB)和一个web 应用(比如Django 或者Flask)之间。 https://www.isharkfly.com/t/python-web/16437

2024年10月18日 0Comments 484Browse 0Like Read more
Computer Science

谁说美国不割韭菜——Zapata 破产裁员 85

2024年10月11日,上市才 6 个月的Zapata 宣布破产。 根据其官方的 8-K文件,公司已经退市宣布破产。     同时,公司的网站也无法打开。 量子计算、生成式人工智能,哈佛初创公司 Zapata 公开了所有流行语。 波士顿量子计算初创公司萨帕塔计算(Zapata Computing)通过与一家空白支票公司合并而上市。本周,该公司的股票开始在纳斯达克交易,这在平静的 IPO 市场中是一项引人注目的壮举。《波士顿环球报》记者亚伦·普雷斯曼(Aaron Pressman)对此作了下述报道。 Zapata Computering 是 2017 年哈佛大学一项研究成果的延伸,其想法是为即将到来的基于量子力学原理的新机器浪潮编写软件。 虽然量子计算硬件仍在开发中,但这家总部位于波士顿的初创公司已经将其软件应用于当前计算机的一些问题,包括生成人工智能的热门领域。本周,该公司的股票开始在纳斯达克交易,这在平静的 IPO 市场中是一项引人注目的壮举。     首席执行官克里斯托弗·萨瓦(Christopher Savoie)解释说,量子计算长期以来一直专注于解决物理、金融和其他需要同时计算许多变量的领域的问题。 萨瓦说,在生成人工智能方面,“我们能够非常快速地提出利用量子物理学的算法和方法。 ……这意味着我们可以做得更快、更快、更好。” 去年,这一做法显示出足够的前景,可以吸引安德烈蒂(Andrettis)赛车家族支持的空白支票公司的投资。 Zapata Computer 也以 Zapata AI 名义开展业务,与 Andrettis 的特殊目的收购公司合并,并于周一开始在纳斯达克交易,代码为 ZPTA。 其他一些量子计算初创公司已经通过与 SPAC 合并而上市,在投资者等待原型转变为商业产品的不耐烦之后,大多数公司的股价暴跌。例如,自 2022 年 8 月完成 SPAC 交易以来,D-Wave Quantum 的股价下跌了 80% 以上。 这个公司简直就是空手套白狼的典范。 官方网站只剩下了下面的这张图,没有任何内容,也没有任何所谓的量子计算。     从看到的股票信息,这就是妥妥的割了一茬韭菜。   同时根据公开的一些简单数据,公司在美国有雇佣 85 名雇员。   以前认为能上市的公司都属于比较稳健和成长性比较好的公司,现在看来也未必。 尤其是当前的 AI 概念,什么都要往 AI 上靠的时候就更要小心了。   https://www.isharkfly.com/t/zapata-85/16432

2024年10月16日 0Comments 592Browse 0Like Read more
Computer Science

Python 使用 STOMP 向 ActiveMQ 循环发送消息

python stomp activemq mess send message in loop   To send messages to an ActiveMQ broker using the STOMP protocol in a loop with Python, you can use the stomp.py library. First, you’ll need to ensure the library is installed. You can install it using pip if you haven’t already: pip install stomp.py Here’s a simple example of how to send messages in a loop: import stomp import time class MyListener(stomp.ConnectionListener): def on_error(self, headers, message): print('received an error: "%s"' % message) def on_disconnected(self): print('disconnected') def send_messages(): conn = stomp.Connection([('localhost', 61613)]) conn.set_listener('', MyListener()) conn.connect('admin', 'password', wait=True) for i in range(10): # Send 10 messages message = f'Message number {i + 1}' conn.send(destination='/queue/test', body=message) print(f'Sent: {message}') time.sleep(1) conn.disconnect() if __name__ == '__main__': send_messages() Key Points: Connection Setup: Replace 'localhost' and 61613 with your ActiveMQ server’s host and port. Authentication: Replace 'admin' and 'password' with your ActiveMQ username and password. Queue Name: Adjust the destination='/queue/test' to the queue you want to send messages to. Loop: Adjust the range and time.sleep() for the number of messages and delay between sends as needed. This script establishes a connection to the ActiveMQ broker, sends a series of messages to a specified queue, and then disconnects. GPT GPT 的回答基本上解决了问题。 遇到的问题是,在向 ActiveMQ 发送消息的时候,我们有一个 SendMQ 的方法。 在这个方法将会打开连接发送消息后关闭连接。 我们的问题在:现在需要向 MQ 发送 1 万多条消息,这个循环放那里。 开始我们把这个循环放在了内层,这里就出现了一个问题,Python 的循环会异步调用 Close 这方法,然后导致整个程序的挂起。 通过上面 GPT 的回答,我知道应该在整个循环的最外层打开连接,循环内不能再次打开连接和关闭连接。 等把这 1 万多条消息发送成功后再关闭连接。 同样的问题,我们也使用了 claude_3_haiku_bot 这个模型来问了这个问题,请参考后面的消息。 感觉 GPT4 的模型对这个问题回答得更好一些。 Let’s see what topics on “python stomp sending in loop” I can find on the iSharkFly forum: Search Hmm, I couldn’t find any specific topics about “python stomp sending in loop” on this forum. Let me try a more general search: Search The search results…

2024年10月13日 0Comments 540Browse 0Like Read more
1…1516171819…239
Archives
  • July 2026
  • June 2026
  • May 2026
  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
Categories
  • Computer Science (2,385)
    • Confluence (663)
    • Gradle (12)
  • U.S. (557)
  • 文化旅游 (146)

COPYRIGHT © 2020 CWIKIUS. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS

湘ICP备2020018253号-1