【Hacker News搬运】Visual Studio代码旨在断裂
-
Title: Visual Studio Code is designed to fracture
Visual Studio代码旨在断裂
Text:
Url: https://ghuntley.com/fracture/
很抱歉,作为一个AI,我无法直接访问互联网来抓取或分析网页内容。但是,我可以指导你如何使用JinaReader或其他工具来抓取和总结网页内容。 以下是一个使用Python和JinaReader进行网页抓取和内容总结的基本步骤: 1. **安装JinaReader**: 首先需要安装JinaReader库,如果你还没有安装,可以使用以下命令: ```bash pip install jina
-
编写Python代码:
使用以下Python代码来抓取网页内容并使用JinaReader进行总结。from jina import Document from jina.flow import Flow # 创建一个Flow flow = Flow.load_config('flow.yml') # 设置网页URL url = "https://ghuntley.com/fracture/" # 创建一个Document对象并添加到Flow中 doc = Document(url=url) flow.push(doc) # 等待Flow完成处理 flow.run() # 获取总结结果 summary = doc.as_dict()['content']['summary'] print("Summary:", summary)
注意:上面的代码假设你已经有一个配置好的
flow.yml
文件,它定义了如何处理文档。 -
处理非中文内容:
如果网页内容不是中文,JinaReader默认可能无法直接处理。这时,你可能需要使用一个翻译API(如Google翻译API)来先将内容翻译成中文,然后再进行总结。from googletrans import Translator # 假设网页内容已经被抓取到text变量中 text = "网页的英文内容" # 创建翻译器实例 translator = Translator() # 翻译内容到中文 translated = translator.translate(text, dest='zh-cn').text # 现在用翻译后的中文内容进行总结 # ...(使用JinaReader或其他方法进行总结)
-
运行代码:
运行上面的Python脚本,它应该会抓取指定网页的内容,将其翻译成中文,并输出一个总结。
请注意,上述代码只是一个示例,实际应用中可能需要根据你的具体需求和环境进行调整。此外,确保你遵守网站的使用条款和隐私政策,不要抓取或使用未经授权的内容。
## Post by: ghuntley ### Comments: **CrimsonCape**: Here's a good comment thread from cpptools extension:<p><a href="https://github.com/microsoft/vscode-cpptools/discussions/12688">https://github.com/microsoft/vscode-cpptools/discussions/126...</a><p>Having not delved too deeply into building from source, this post suggests it's not even possible.<p>We will need some new terminology to express that a given codebase is OSS licensed and the build dependencies additionally are OSS licensed. > **CrimsonCape**: 这里;这是来自cpptools扩展的一个很好的评论线程:<p><a href=“https:/;github.com/ microsoft/-vscode cpptools//讨论(”>https:/;github.com;微软;vscode cpptools;讨论;126…</a><p>这篇文章没有深入探讨从源代码构建,因此建议:;这甚至是不可能的<p> 我们需要一些新的术语来表示给定的代码库是OSS许可的,并且构建依赖项也是OSS许可的。 **mustache_kimono**: I'm still trying to figure out what the issue is.<p>It <i>sounds like</i> MS is making a better cpptools/C++ extension mouse trap and it's impossible to build a fully OSS version because many of the MS components are closed? And when a user discovers he/she can't use their native extensions from any web interface, this is a problem for the web interface guys?<p>I have to ask -- if people want to use this freeware instead of OSS software, it might be disappointing, but is that really a problem? The problem seems to be the same as the problem one has re: not being able to use WinRAR on Linux?<p>That is -- the answer would seem to be more information.<p>Perhaps open source vendors should be more clear that their offerings are also open source <i>and</i> open ecosystem? Perhaps that would tip off devs that not every extension is, that is, the MS alternative extension is not.<p>One could even be more forceful:<p><pre><code> "Certain alternatives, like vscode-cpptools, are NOT licensed under OSI approved licenses. vscode-cpptools contains many untrusted and possibly insecure binary blob components. Developers of blah blah blah C++ extension strongly believe in an open ecosystem for VSCode extensions, but MS has also refused to allow redistribution of vscode-cpptools, if used by VSCodium or other open source builds. Developers of blah blah blah believe, whether the code is closed or open, ALL VSCode extensions should be freely redistributable for the good of the broader extension ecosystem." </code></pre> If major extension projects are aligned, they could simply add a notice like above to their description on their marketplace page? Trust me, legally, culturally, MS really, really doesn't want to deny access to its marketplace, because a few OSS projects wanted to offer a comparison of their license terms to those of MS.<p>Apple is currently dealing with a marketplace lawsuit. MS doesn't want a marketplace or another antitrust suit. > **mustache_kimono**: 我;我仍在努力找出问题所在。<p>听起来<i>MS正在开发更好的cpptools;C++扩展鼠标陷阱;因为许多MS组件都是关闭的,所以不可能构建一个完全的OSS版本吗?当用户发现他;她可以;不要在任何web界面上使用他们的原生扩展,这对web界面人员来说是个问题吗<p> 我不得不问,如果人们想使用这个免费软件而不是OSS软件,这可能会令人失望,但这真的是一个问题吗?这个问题似乎与一个问题相同:无法在Linux上使用WinRAR<p> 也就是说,答案似乎是更多的信息<p> 也许开源供应商应该更清楚,他们的产品也是开源的<i>和</i>开放生态系统?也许这会提醒开发人员,并非每个扩展都是,也就是说,MS替代扩展不是<p> 一个甚至可以更有力:<p><pre><code>";某些替代方案,如vscode cpptools,没有根据OSI批准的许可证进行许可。vscodecpptools包含许多不受信任且可能不安全的二进制blob组件。blah-blah-blah C++扩展的开发人员坚信VSCode扩展的开放生态系统,但微软也拒绝允许VSCodium或其他开源版本使用VSCode cpptools的重新分发。blah-blah-blah的开发人员认为,无论代码是封闭的还是开放的,为了更广泛的扩展生态系统的利益,所有VSCode扩展都应该可以自由再分发&“;</code></pre>如果主要的扩展项目是一致的,他们可以简单地在他们的市场页面上的描述中添加这样的通知吗?相信我,在法律上,在文化上,MS真的,真的不相信;我不想拒绝进入其市场,因为一些开源软件项目希望将其许可条款与微软的许可条款进行比较。苹果目前正在处理一场市场诉讼。MS没有;我不希望市场或另一场反垄断诉讼。 **Pannoniae**: People when a piece of software is source-available but not strictly OSS: <i>outrage</i><p>People when Microsoft pulls this trick (core repo OSS, most useful things around it are full of DRM and legal traps): <i>silence</i><p>The hypocrisy is really astounding and in a way, MS has managed to pacify even the strongest FOSS advocates by offering something which <i>looks</i> like OSS but it actually isn't. This is on par with claiming that a repo is GPL but the build API keys are not. (Yes, this also happened elsewhere, and not even in a corporate project at all!)<p>The Open Source Definition is hilariously unfit for purpose in 2024 because it allows shenanigans like this.<p>If you enjoy a rabbithole, look at how much DRM there is in Pylance (another extension that MS has locked down): <a href="https://github.com/VSCodium/vscodium/discussions/1641">https://github.com/VSCodium/vscodium/discussions/1641</a><p>The short summary is that MS uses multiple, constantly changing methods of DRM to make it impossible for people to patch out the "only official VSCode" check from the Pylance extension. This is very clearly malicious. > **Pannoniae**: 当一款软件是源代码可用的,但不是严格意义上的开源软件时,人们会感到愤怒:<i>愤怒</i><p>当微软耍这种把戏时(核心仓库开源软件,它周围最有用的东西都充满了DRM和法律陷阱),人们会:<i>silence</i><p>这种虚伪真的令人震惊,在某种程度上,微软通过提供一些看起来</i>像开源软件但实际上不是开源软件的东西,甚至安抚了最强大的开源软件倡导者;t.这等同于声称回购是GPL,但构建API密钥不是。(是的,这在其他地方也发生过,甚至在公司项目中都没有!)<p>开源定义在2024年非常不适合,因为它允许这样的恶作剧<p> 如果你喜欢rabbithole,看看Pylance(微软已经锁定的另一个扩展)中有多少DRM:<a href=“https:/;github.com/ VSCodium  vssodium! discussions!”>https:/;github.com;VSCodium™;vssodium™;讨论;1641</a><p>简而言之,MS使用多种不断变化的DRM方法,使人们无法修补“;唯一官方VSCode”;从Pylance扩展中检查。这显然是恶意的。 **dumbo-octopus**: Without proposing a model for how the 50+ full time employees who create VS Code justify their collective ~20MM annual budget, this sounds a lot like: “Ugh, they made it mildly inconvenient for my company to benefit from all their engineering work but swap out the product surface and reap the profits by undercutting their product via not needing to fund the engineering ourselves. How lame.” > **dumbo-octopus**: 没有提出一个模型来说明创建VS Code的50多名全职员工如何证明他们的集体2000万美元的年度预算是合理的,这听起来很像:“啊,他们让我的公司从他们所有的工程工作中受益有点不方便,但换掉了产品表面,通过不需要自己资助工程来削弱他们的产品来获得利润。真是太蹩脚了。” **TZubiri**: Coding in notepad or nano has been a great investment of my time.<p>I don't need to learn any of these tools or read about any drama, I just type letters into the screen and use my keyboard to move my pointer. That's it, if I need anything more complex to handle my codestring, I write code.<p>But I have never needed to run a search and replace of a variable, both notepad and nano can do that. If I need anything more complex I do it manually. Anyone that does some exercise or has had a physical job knows that doing something 26 times in a row is basic stuff of any worthwile endeavor. > **TZubiri**: 在记事本或nano上编码是我时间的一项巨大投资<p> 我不知道;我不需要学习这些工具,也不需要阅读任何戏剧,我只需要在屏幕上输入字母,然后用键盘移动指针。那;是的,如果我需要更复杂的东西来处理我的代码串,我会写代码<p> 但我从未需要搜索和替换变量,记事本和nano都可以做到这一点。如果我需要更复杂的东西,我会手动完成。任何做过运动或体力劳动的人都知道,连续26次做某事是任何有价值的努力的基本内容。
-