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

AI如何辅助编程?

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

一觉醒来,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

分享给朋友:

相关文章

我觉得华为Mate60Pro明明配置不高,为什么还是有那么多人买呢?

我也好奇啊,所以闲聊时,我问了我们公司的副总,我说Mate60pro配置这么拉胯你怎么还买啊? 他一脸疑惑的看着我,配置?什么配置?我这手机信号挺好的啊? 我们总经理用的是去年华为出的折叠手机,花了一万多,我也想问问他同样的问题,但奈何一直…

中国芯片产量达1399亿颗,这意味着什么?

美国并不是没有明白人,只是特朗普不懂芯片产业的情况,冒冒失失在ZZ正确下,开启了对中国芯片的掐脖子,结果没掐死,反而让人练出了铁肺。 芯片是所有科技产业的上游,美国原本在上游呆得很舒服,靠英伟达、AMD、德州仪器、高通等这些几十年霸主地位的…

无意中发现技术主管写的代码,大家帮忙看看什么水平?

无意中发现技术主管写的代码,大家帮忙看看什么水平?

虽然很多答主用了诸如“典范级”、“心旷神怡” 的形容, 赞美这段代码, 但这里, 出于技术讨论的动机, 我说说不同看法. 栈, 如果善于利用栈来处理树结构, 那么可以写出更简洁的代码, 根本不需要 recuresiveFn 这种方法. 泛型…

有哪些让你目瞪口呆的 Bug ?

有哪些让你目瞪口呆的 Bug ?

成都有个监狱情况比较特殊,关押的基本全是重犯,而且还都是经济犯和政治犯, 他们以前都是一方大佬,在自己的一亩三分地翻手为云覆手为雨,无非是不小心中箭落马或帮老大顶锅才进监狱, 所以即使进来了,他们依然保持着体面和骄傲,依从性差,虽然不至于和…

拼多多百亿补贴买手机电脑等数码产品靠谱吗?

大家很多人都在问pdd百亿补贴购机靠谱吗? 首先声明一下,我不是pdd的人,我只是一个普普通通混迹从事pc行业的数码玩家,我只是在评论区看到很多人都在无脑推百亿补贴,特地发一条怗子来说明一下这个东西。此怡不存在偏向引导,此站仅站在我个人角度…

抖音上有一些账号搬运别人的视频,几乎一模一样,也没判搬运,他们是怎么做到的??

对于任何短视频平台来说,如何用最低的成本快速实现伪原创搬运都是需要解决的问题。 所有的短视频平台,包括抖音、快手、tiktok、视频号、小红书、B站,甚至是FB、推特、INS、YouTube,它们的查重技术都是类似的,只要你在网络环境设置得…

发表评论

访客

看不清,换一张

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