Posts

[MS] C++/WinRT implementation inheritance: Notes on winrt::implements, part 4 - devamazonaws.blogspot.com

Last time, we figured out the rules for inheriting winrt:: implements in C++/WinRT runtime class implementations : You can use winrt:: implements in your class hierarchy, as long as you use single inheritance for the winrt:: implements part. You are not allowed to derive multiply from two different winrt:: implements base classes. One case of this is a base class that is configured at construction. struct StringableInt32 : winrt::implements<StringableInt32, winrt::Windows::Foundation::IStringable> { StringableInt32(int value) : m_value(value) {} winrt::hstring ToString() { return winrt::to_hstring(m_value); } private: int m_value; }; We can use this by itself: auto o = winrt::make<StringableInt32>(42); But we can also tell the implements template that we would like to derive from it. struct Derived : winrt::implements<Derived, StringableInt32> { Derived() : StringableInt32(42) {} }; Unfortunately, this doesn't work...

[MS] 增强 Razor 生产力的新功能 - devamazonaws.blogspot.com

Image
本文翻译自 Leslie Richardson 的 New Features for Enhanced Razor Productivity! 如果您现在正在使用 Razor 构建 Web 应用,我们为您带来了一些令人兴奋的新功能,无论您使用的是 Visual Studio 还是 Visual Studio Code,您都会爱上这些新功能!现在,您可以使用名为“将元素提取到新组件”的重构功能,以及全新的基于 Roslyn 的 C# 分词器,这些功能旨在提升您在 Razor 文件中的开发效率。让我们一起来看看吧!  将元素提取到新组件   将元素提取到新组件是 Visual Studio 17.12 中提供的一项全新的重构功能,它可以自动化创建新 Razor/Blazor 组件的过程。您无需手动创建新文件并复制/粘贴代码,只需选中想要提取的代码(或标签),然后点击灯泡图标并选择 将元素提取到新组件 即可完成提取操作。该功能让创建可复用组件变得更加简单,有助于保持代码整洁,提高可维护性。  在该功能的首个版本中,提取为组件功能主要支持基础的、以 HTML 为主的代码提取场景。不过,我们计划在未来添加更多改进和支持更高级的场景 ( 例如更一致地处理涉及变量依赖、C# 代码、参数等的提取 )。   Roslyn C# 分词器   C# 分词器/词法分析器的更新显著提升了 Razor 对 C# 代码的处理能力。许多用户曾对无法在 Razor 文件中使用原始字符串文本和逐字插值字符串表示失望,而新的 Roslyn C# 词法分析器解决了这一问题!除了对这些字符串格式的支持外,词法分析器还增加了对二进制文本的支持,并改进了对 C# 预处理器指令的处理,确保它们遵循 C# 的规则。最后,新的词法分析器还将更容易支持未来的 C# 新语言特性。  这个新的词法分析器从 .NET 10开始会默认启用,但在 .NET 9 中,也可以在 Visual Studio(17.13)和 Visual Studio Code使用。如果您想立即启用 C# 分词器,请勾选 IDE 中的 为 Razor 文件使用 C# 分词器 选项,该选项位于 工具 > 选项 > 预览功能 ,并在您的 .csproj 或 d...

[MS] Visualize ROI of your GitHub Copilot Usage, How it works! - devamazonaws.blogspot.com

Image
[alert type="tip" heading="Tips"]In today's enterprise software development landscape, organizations are increasingly investing in AI-powered development tools like GitHub Copilot to boost developer productivity. However, the standard 28-day usage metrics often fall short of providing the comprehensive insights needed to truly understand ROI and adoption patterns across large organizations. The Copilot Usage Advanced Dashboard fills this critical gap by offering a powerful, enterprise-grade solution that captures and analyzes long-term usage data across multiple teams and organizations. Built with familiar tools like Elasticsearch and Grafana, this dashboard enables engineering leaders to track adoption trends, identify optimization opportunities, and quantify their Copilot investment's impact through detailed breakdowns by language, editor, and team. Beyond just tracking lines of code, the dashboard provides insights into seat utilization, activation rat...

[MS] Automating Developer Environments with Microsoft Dev Box and Teams Customizations Part 2 - devamazonaws.blogspot.com

Image
Developers today typically work on multiple projects simultaneously, with each project requiring different tools and configuration requirements. Being able to have a dedicated environment explicitly configured to that project unlocks enhanced developer productivity and reduces outside noise, allowing developers to focus just on the work they are doing. This also extends to developers who may not work in a project often, and the burden to have their environment ready at any point in time to contribute to that project can lead to an increase of cognitive load. Ideally, a developer would be able to create a new environment, do whatever work is necessary (review a Pull Request for instance) and when the environment is no longer needed, it can be deleted. This idea can be coined as an “ephemeral environment”. In this blog post, we will investigate how we can satisfy this goal with Microsoft Dev Box and the new feature “Teams Customizations” This blog post is a continuation from a previous b...

[MS] Visual Studio Code CMake Tools Extension 1.20 Release: Introducing Built-In CMake Language Services - devamazonaws.blogspot.com

Image
The February release of CMake Tools in VS Code is now available. With this release, we have some new updates to the extension to improve CMake integrations with the extension’s support. Some updates include the built-in support for CMake Language services , addressing our most highly-upvoted issues in the CMake Tools extension, and CMake presets v9 support. To view the full list of updates with this release, please look at our  CHANGELOG . This release features the following nine contributions from our open-source community. Thank you for your continued support! Adding support to configure default folder in workspace setting by @sanore Improving test output for error and skipped tests by @redstrate Adding a setting to skip project re-build before CTest by @dabsunter Ability to pass custom target to CMake: Build Target by @hippo91 Fixing issue where setting CTest suite delimiter prevented execution of all tests by hippo91 Fixing issue where GCC linker errors did not sho...

[MS] Instrumenting Apache Spark Structured Streaming jobs using OpenTelemetry - devamazonaws.blogspot.com

Image
Introduction Monitoring Apache Spark structured streaming data workloads is challenging because the data is continuously processed as it arrives. Because of this always-on nature of stream processing, it is harder to troubleshoot problems during development and production without real-time metrics, alerting and dashboards. Traces complement metrics, and since Spark doesn’t include them by default, we integrate them using OpenTelemetry. Problem statement In a traditional API enterprise job, OpenTelemetry handles the start and end tracing for simple cases. However, in a Spark streaming job that runs for an extended period, potentially days, and processes millions of messages where calls might fail, its harder to keep track of failing batches. Solution StreamingQueryListener is an excellent interface that is highly useful for instrumenting Spark jobs with OpenTelemetry. It's a call-back for operations in batches that roughly equate to API requests, making it particularly benefi...

[MS] Deploying WebJobs to Azure Container Apps - devamazonaws.blogspot.com

Image
Debjyoti Ganguly walks through the process of migrating existing WebJobs to Azure Container App Jobs, highlighting the benefits and providing practical steps to implement this migration effectively Introduction As businesses scale, the need for a robust and scalable environment for running background jobs becomes essential. Azure Container App Jobs offer a modern, scalable, and containerized solution for running background jobs, providing significant benefits over traditional Azure WebJobs. This guide will walk you through the process of migrating existing WebJobs to Azure Container App Jobs, highlighting the benefits and providing practical steps to implement this migration effectively. Benefits of Azure Container App Jobs over Azure WebJobs Scalability: Automatically scales based on demand without manual intervention. Flexibility: Supports a wide range of runtime environments and programming languages. Isolation: Each job runs in its isolated container, enhancing security and ...