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

AI如何辅助编程?

卡卷网2年前 (2024-12-20)每日看点428

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

分享给朋友:

相关文章

200+ 工具,这个网站堪称最强

200+ 工具,这个网站堪称最强

作为一个乱七八糟什么都懂一点的电脑小白,日常经常被别人增加些临时任务,比如PDF转Word,提取视频里的音频,图片加个边框。之前,电脑里安装了不少这类的软件,虽然能满足要求,但装的多了,总感觉电脑卡卡的。最近发现了一个超强的在线工具网站,首…

自媒体如何快速起步?

自媒体如何快速起步?

有两种经验,可供参考。 第一种是:现象级的爆火、爆款,这种情况捞到钱,实现财务自由的人并不多,但确实存在。只不过非要说清楚为什么这个账号可以火、可以短时间内赚到普通人一辈子赚不到的钱,他们自己也不一定能说清楚,因为赶上了风口(内外部情况)。…

你为什么讨厌抖音?

我就被抖音毁了。 现在被我媳妇从抖音里拯救出来了。 我为什么会这样说? 我媳妇硕士在读,我文化程度相对就比较低了。 大多数人看抖音其实就是为了一图一乐呵 刚开始我也是这样的,我是2017年在朋友的推荐下注册了抖音,刚开始那时候对抖音不太上瘾…

报名的网课分期付款怎么退?

你在你分期付款的订单下面有客服电话,直接打电话描述一下你的问题,你可以告诉他你是被恶意绑定的,在不了解有退学条件这一说的情况下报的课程,可能遇到消费者诈骗了,不承认有退学金,说是霸王条款,诈骗消费者,你若分期了先把自动续费关了,别让自己个人…

天涯神帖,第一神帖是什么?

天涯神帖,第一神帖是什么?

一些个人觉得比较经典的天涯神贴(更新进去了): 话说1999年那会儿,中国的互联网还是个小婴儿,BAT三巨头都还在穿开裆裤呢,天涯社区就已经悄然诞生了。 时光飞逝,到了2007年,这小小社区竟然已经吸引了超过20…

为什么现在 AI 已经没啥热度了?

从改名叫大模型那一刻,懂行的就已经放弃了,剩下资本和无知网友还有点后劲 所谓大模型,本质就是一个更大、更快数据库的传声筒。更大更快本身确实很厉害,但依然只是传声筒,和AI根本不沾边 数据库之外仍然一无所知,甚至数据库之内的输出逻辑还要依赖大…

发表评论

访客

看不清,换一张

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