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

AI如何辅助编程?

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

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

分享给朋友:

相关文章

创业容易吗?

创业容易吗?创建企业不一定是困难或令人生畏的。它可以从一个简单但有力的想法开始,比如小强意识到,如果洗手液能杀死真菌,尤其是拳击台上的真菌,就会更加有用。创业确实需要奉献精神、努力工作和仔细规划——这是没有办法的。虽然这本身可能并不容易,但…

WordPress建站同时面向B端和C端,有什么好的解决方案?

这个很容易实现呀,只不过需要自己开发,整体用权限管理就可以实现了,B端和C端是不同用户权限,C端能看到的菜单入口和B端不一样就行了。技术层面实现没问题的,只不过就是看你们的技术能力和投入了 ,这样的需求应该没有现成的开源插件。只能找人定制开…

有哪些网站,一旦知道,你就离不开了?

有哪些网站,一旦知道,你就离不开了?

这六个网站,一旦用过,基本上是离不开了。都是我超爱的一些网站,基本上每天都用。 1 地图生成器 第一个,我要给大家推荐的是地图生成器。可以下载到各省,各市,各县的svg格式的地图素材。 这些素材导入PPT中都是可以编辑的。 可以单独更改颜色…

用红米手机会很丢人吗?

前些日子遇到了一位快递小哥,京东的,签收 小哥年纪不算大,目测二十多岁 他的手机上全是一道道极严重的划痕,有点卡, 他开热点了,热点名就是手机型号,红米9a,我父母的同款 现在他那边操作了一会,然后又是我这边操作了一会 小哥看着我手机刷刷的…

都是前端框架,为什么用 React 的人会有优越感?

都是前端框架,为什么用 React 的人会有优越感?

上家公司一直搞react,最近第一次写个vue3项目。 老板朋友来了看了下页面说:这用vue写的吧。 我:是... 老板朋友:一看就知道是vue做的。 这tm你看一眼页面就知道用的啥框架? 这感觉就是,我一直用苹果,偶尔用了下华为打电话,有…

如何进行 Elasticsearch 调优实践?

如何进行 Elasticsearch 调优实践?

面试官心理分析这个问题是肯定要问的,说白了,就是看你有没有实际干过 es,因为啥?其实 es 性能并没有你想象中那么好的。很多时候数据量大了,特别是有几亿条数据的时候,可能你会懵逼的发现,跑个搜索怎么一下 5~10s ,坑爹了。第一次搜索的…

发表评论

访客

看不清,换一张

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