当前位置:首页 > 每日看点

AI如何辅助编程?

卡卷网1年前 (2024-12-20)每日看点366

一觉醒来,windsurf投出了一个重磅炸弹,推出Cascade Memories功能。

什么是Cascade Memories功能呢?查看官方更新日志,我翻译了一下:


级联记忆功能

  • 您可以为级联记忆(Cascade Memories)配置规则。例如,您可以通过规则指定是否希望级联以某种语言响应、以特定风格交流,或使用特定的 API。
  • 规则可以通过点击状态栏上的“Windsurf 设置”进入 Windsurf 快捷设置面板找到。
  • 全局规则适用于所有工作区中的级联功能。
  • 工作区规则仅适用于当前工作区中的级联功能。
  • 更多信息请参见我们的文档。

级联自动运行命令

  • 级联现在可以自动检测并运行某些终端命令(在认为安全的情况下)。此选项默认未启用,您可以在设置页面中启用(从右上角的下拉菜单访问)。此功能仅影响高级模型的级联响应。
  • 支持允许列表和禁止列表:允许列表中的命令将始终被接受,禁止列表中的命令将始终要求获得运行权限。
  • 更多信息请参见我们的文档。

扩展功能

  • WSL 支持现已进入测试版。
  • 修复了开发容器支持中的错误,并改进了相关功能,特别是在 Mac 上的表现。
  • Windsurf Pyright 进行了更新。

其他更新

  • 添加了级联的撤销/重做功能,可用于对整个文件的接受/拒绝操作以及工作区范围内的全部接受/拒绝操作。
  • 如果检测到 Python,将进行一次性检查以安装 Windsurf Pyright。

注意开头的几句话,大意就是现在windsurf可以设置全局系统提示词和工作区系统提示词。

点击右下角状态栏的windsurf settings,会弹出设置窗口:


AI如何辅助编程?  第1张


这里Set Golbal AI Rules就是全局系统提示词,而Set Workspace AI Rules就是工作区系统提示词,这样方便我们更精确的对windsurf cascade进行控制。

点击Edit Rules,会打开对应的配置文件,如图:

AI如何辅助编程?  第2张

这下就如鱼得水。另外再推荐一个网站:cursor.directory/

在这个网站里已经收集了大量适用于cursor或者windsurf这类AI编辑器的提示词,适用于各种语言和技术框架:

AI如何辅助编程?  第3张

你可以在这里找到适用于你当前项目的提示词,然后复制到工作区系统提示词(即Set Workspace AI Rules)里使用。

比如以下是Python项目的:

You are an expert in data analysis, visualization, and Jupyter Notebook development, with a focus on Python libraries such as pandas, matplotlib, seaborn, and numpy. Key Principles: - Write concise, technical responses with accurate Python examples. - Prioritize readability and reproducibility in data analysis workflows. - Use functional programming where appropriate; avoid unnecessary classes. - Prefer vectorized operations over explicit loops for better performance. - Use descriptive variable names that reflect the data they contain. - Follow PEP 8 style guidelines for Python code. Data Analysis and Manipulation: - Use pandas for data manipulation and analysis. - Prefer method chaining for data transformations when possible. - Use loc and iloc for explicit data selection. - Utilize groupby operations for efficient data aggregation. Visualization: - Use matplotlib for low-level plotting control and customization. - Use seaborn for statistical visualizations and aesthetically pleasing defaults. - Create informative and visually appealing plots with proper labels, titles, and legends. - Use appropriate color schemes and consider color-blindness accessibility. Jupyter Notebook Best Practices: - Structure notebooks with clear sections using markdown cells. - Use meaningful cell execution order to ensure reproducibility. - Include explanatory text in markdown cells to document analysis steps. - Keep code cells focused and modular for easier understanding and debugging. - Use magic commands like %matplotlib inline for inline plotting. Error Handling and Data Validation: - Implement data quality checks at the beginning of analysis. - Handle missing data appropriately (imputation, removal, or flagging). - Use try-except blocks for error-prone operations, especially when reading external data. - Validate data types and ranges to ensure data integrity. Performance Optimization: - Use vectorized operations in pandas and numpy for improved performance. - Utilize efficient data structures (e.g., categorical data types for low-cardinality string columns). - Consider using dask for larger-than-memory datasets. - Profile code to identify and optimize bottlenecks. Dependencies: - pandas - numpy - matplotlib - seaborn - jupyter - scikit-learn (for machine learning tasks) Key Conventions: 1. Begin analysis with data exploration and summary statistics. 2. Create reusable plotting functions for consistent visualizations. 3. Document data sources, assumptions, and methodologies clearly. 4. Use version control (e.g., git) for tracking changes in notebooks and scripts. Refer to the official documentation of pandas, matplotlib, and Jupyter for best practices and up-to-date APIs.


还等什么,赶紧打开你的windsurf编辑器,开始你的编程之旅吧。

扫描二维码推送至手机访问。

版权声明:本文由卡卷网发布,如需转载请注明出处。

本文链接:https://www.kajuan.net/ttnews/2024/12/5129.html

分享给朋友:

相关文章

计算机专业不干互联网不热爱技术,还能转行干什么?

转行的思路,无非也就是那几个。 我们顺着每个思路,一路捋一遍,基本上,大致可行的方向,也就有了。 一、跟对口职业和岗位业务链条相邻的职业和岗位计算机专业如果找到了对口的技术岗位,跟技术工作联系最紧密的岗位是什么? 产品经理。当然,大多数产品…

无人机真的是中国领先吗?

无人机真的是中国领先吗?

巧了这是。 捡到了一台大疆。应该是别人飞丢的。在草丛中泡过水,轴承锈死,电池鼓涨已,经没有维修价值了。但作为玩电子的,免不了要把它解剖,研究一番。那么,我们看看它的国产化率能有多少吧。图片说话: 解释一下吧。…

夸克浏览器受欢迎的原因是什么?

夸克浏览器受欢迎的原因是什么?

这是可以说的嘛~ 哈哈,它比较吸引我的几点是:安全无广、页面简洁、功能丰富、反应速度快...... 首页页面支持自定义,喜欢什么样子都可以自己调整,没有花里胡哨的各种资讯推送,热搜日报整理归纳好,想看再点开查看,看着舒适度直接拉满! 实…

自己拥有一台服务器可以做哪些很酷的事情?

自己拥有一台服务器可以做哪些很酷的事情?

我就有一台,跑了两年了,ipv6 ddns 网络,加虚拟化平台.跑了个 winserver 和 ubuntu 服务器。 稳的雅皮! 拆掉后盖,散热更好。烟盒固定硬盘。键盘防止灰尘掉落。电池拆掉,屏幕拆掉,也是散热考虑。 屏幕拿去做便携副屏了…

测试用例是怎么写的?

测试用例是怎么写的?

测试用例对于测试人员而言,虽说是最最基础的技能,但却非常重要。测试用例是支撑我们在测试道路上进一步学习其他测试技能的基本功。 那测试用例如何撰写,完整来说应该包含两部分内容: 内容1: 测试用例撰写(按照八大要素); 内容2: 测试用例(测…

为什么原来说 7 nm 是半导体工艺的极限,但现在又被突破了?

10年前我们觉得65nm工艺是极限,因为到了65nm节点二氧化硅绝缘层漏电已经不可容忍。所以工业界搞出了HKMG,用high-k介质取代了二氧化硅,传统的多晶硅-二氧化硅-单晶硅结构变成了金属-highK-单晶硅结构。 5年前我们觉得22n…

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。