مطالب
آموزش زبان Rust - قسمت 12 - Implementation Blocks
در Rust، پیاده سازی فانکشن‌ها ( implementation block ) به ما اجازه می‌دهد تا عملکردی را برای یک type مشخص، تعریف کنیم که ایجاد روش‌ها و توابع مرتبط برای انواع داده‌های سفارشی‌مان را ممکن می‌سازد. در این مقاله، نحوه‌ی استفاده از implementation block را برای تعریف متدها و توابع مرتبط در Rust، با استفاده از ساختار Product به عنوان مثال، بررسی خواهیم کرد. 

ابتدا، بیایید یک struct محصول را با فیلدهای زیر تعریف کنیم: 
struct Product {
    name: String,
    price: f32,
    in_stock: bool,
}

پیاده سازی اجرای روش محاسبه مالیات فروش برای struct product

در ادامه بیایید تابع catalog_sales_tax را به عنوان روشی برای ساختار Product، با استفاده از یک implementation block اضافه کنیم.
impl Product {
    fn calculate_sales_tax(&self) -> f32 {
        self.price * 0.1
    }
}
در این مثال، از کلمه‌ی کلیدی Self، برای ارجاع به نمونه محصولی که این تابع با آن فراخوانی می‌شود، استفاده می‌شود؛ به عبارت دیگر وقتی از Self استفاده میکنید، یعنی دارید خود Product را صدا میزنید و به فیلدهای آن دسترسی دارید.

استفاده از متد در تابع اصلی

اکنون می‌توانیم یک نمونه محصول را ایجاد کنیم و از روش محاسبه مالیات استفاده کنیم:
fn main() {
    let book = Product {
        name: String::from("Book"),
        price: 28.85,
        in_stock: true,
    };
    
    let sales_tax = book.calculate_sales_tax();
    println!("Sales tax: {}", sales_tax);
}

انواع مختلف Self
Immutable borrow (در مواردی استفاده می‌شود که می‌خواهید به سادگی از فیلدهای خود بدون تغییر چیزی استفاده کنید):
fn calculate_sales_tax(&self) -> f32 {
    self.price * 0.1
}

Mutable borrow  (در مواردی که می‌خواهید فیلدهای خود را تغییر دهید استفاده می‌شود): 
fn set_price(&mut self, price: f32) {
    self.price = price;
}

Owned form  (مالکیت نمونه به متد منتقل شده و نمونه در پایان متد حذف می‌شود و دیگر معتبر نیست): 
fn buy(self) {
    let name: String = self.name;
    println!("{} was bought", name);
}

Associated Functions

Associated functions  از کلمه کلیدی self استفاده نمی‌کنند و با استفاده از سینتکس :: فراخوانی می‌شوند. با این حال، هنگام فراخوانی توابع مرتبط در متدهایی که از self استفاده می‌کنند، '.' بجای آن از سینتکس '::' استفاده می‌شود: 

impl Product {
    fn new(name: String, price: f32) -> Product {
        Product {
            name,
            price,
            in_stock: true,
        }
    }
}

اکنون، می‌توانیم یک نمونه محصول را با استفاده از تابع جدید مرتبط ایجاد کنیم:

fn main() {
    let book = Product::new(String::from("Book"), 30.0);
}

در این مقاله، بررسی کردیم که چگونه Implementation Blocks در Rust به ما اجازه می‌دهند تا عملکردی را برای انواع داده‌های سفارشی، مانند روش‌ها و توابع مرتبط تعریف کنیم. با درک اشکال مختلف self و نحوه‌ی استفاده از آنها، می‌توانید روش‌های قدرتمند و انعطاف پذیری را برای انواع داده‌های سفارشی خود در Rust پیاده سازی کنید.  
اشتراک‌ها
Docker ها در ویندوز سرور 2016
 Today the Docker team announced the availability of a technical preview of the Docker Engine for Windows Server 2016. This is huge for us and all software teams that work primarily on the Windows platform
یک لینک هم در مورد Dockerها در ویندوز سرور 2016 از سایت weblogs.asp.net
Visual Studio 2015 Tools for Docker - August Preview 

برای اطلاعات بیشتر در مورد Docker‌ها هم می‌توانید به ترجمه این مصاحبه مراجعه کنید  ^^^
Docker ها در ویندوز سرور 2016
اشتراک‌ها
نسخه بتا گیت هاب برای اندروید به زودی منتشر می‌شود

There’s a lot you can do on GitHub that doesn’t require a complex development environment, like sharing feedback on a design discussion or reviewing a few lines of code. We’re making these tasks easier to complete while you’re on the go, with a fully-native experience. With GitHub for mobile, you have the flexibility to move work forward and stay in touch with your team, wherever you are 

نسخه بتا گیت هاب برای اندروید به زودی منتشر می‌شود
اشتراک‌ها
شاید مایکروسافت با واتس آپ روی اپلیکیشنی از نوع UWP کار کنند

WhatsApp for Windows Phone is one of the few apps on Windows 10 Mobile today that continues to receive frequent updates from its developer. Unfortunately, the app itself is one based on Silverlight, which is what apps built for Windows Phone 8.1 used back in 2014. This means the app isn't a Universal Windows Platform app (UWP,) and as such doesn't run across all the different Windows 10 platforms and devices available today. 

شاید مایکروسافت با واتس آپ روی اپلیکیشنی از نوع UWP کار کنند
اشتراک‌ها
جزئیاتی درباره تغییرات NET Core 2.0.

It has only been about a year since .NET Core 1.0 RC came out. We are now getting close to .NET Core 2.0. We have been playing with .NET Core since the betas and feel like the quality of the 1.0 runtime was very good. Our only complaint has really been odd Visual Studio behavior. We would expect that with 2.0, the adoption of .NET Core is likely to skyrocket. 

جزئیاتی درباره تغییرات NET Core 2.0.
اشتراک‌ها
برنامه نویسی چند هسته ای در .NET

In the .NET framework 4+, there is enhanced support for parallel programming, including new class library types, Tasks, Parallel For, Parallel Linq, and concurrent collections. Check out some of these features here. 

برنامه نویسی  چند هسته ای در .NET
اشتراک‌ها
دوره 6 ساعته Blazor WebAssembly و Web API با NET 6.

Learn Blazor WebAssembly and Web API on .NET 6 by building a shopping cart application using C#. This course also provides a guide on how to integrate a payment gateway into your Blazor WebAssembly component, so that a user is able to pay for products through your application using a debit or credit card or PayPal account.

⭐️ Course Contents ⭐️
⌨️ (0:00:00) Introduction
⌨️ (0:00:51) Create the Database using EF Core Code First Database Migrations
⌨️ (0:26:05) Retrieve Product Data from Database (Web API component)
⌨️ (0:30:17) Create Classes for Data Transfer Objects (DTOs)
⌨️ (0:36:22) Create ProductRepository Class (Repository Design Pattern)
⌨️ (0:43:05) Create ProductController Class
⌨️ (0:51:08) Create DtoConversion Class (DTO Conversion Extension methods)
⌨️ (0:57:45) Display Product Data to User (Blazor WebAssembly Component)
⌨️ (1:39:59) Display Data for Specific Product to User (Web API and Blazor)
⌨️ (2:06:07) Add Product to Shopping Cart (Web API and Blazor)
⌨️ (2:52:40) Remove Product from Shopping Cart (Web API and Blazor)
⌨️ (3:14:03) Update the Quantity of Products in the Shopping Cart (Web API, Blazor, Blazor JavaScript Interoperability)
⌨️ (3:44:01) Update the Header Menu in Response to a Change to the State of the Shopping Cart (Creating Custom Events in Blazor)
⌨️ (4:04:48) Integration of PayPal Payment Gateway into Blazor Component
⌨️ (4:36:03) Dynamically Populate the Side-Bar Menu (Web API and Blazor)
⌨️ (5:05:44) Optimise Code for Performance (Web API and Blazor)
⌨️ (5:08:26) Use Include Extension Method in LINQ Query (Web API)
⌨️ (5:14:00) User Local Storage Functionality (Blazor)
⌨️ (5:35:42) Outro 

دوره 6 ساعته Blazor WebAssembly و Web API با NET 6.
اشتراک‌ها
دوره 3 ساعته NET MAUI.

.NET MAUI Course for Beginners – Create Cross-Platform Apps with C#

Learn how to use .NET MAUI for native cross-platform desktop and mobile development! You will learn the essentials of building mobile applications with .NET MAUI and C# while creating a Contacts app.

⭐️ Contents ⭐️
⌨️ (0:00:00) Introduction
⌨️ (0:03:42) What is .Net Maui - .Net Maui vs Xamarin Forms
⌨️ (0:06:52) Prepare Development Environment _ Create first project
⌨️ (0:12:29) Project Structure
⌨️ (0:20:28) Three elements of stateful .Net Maui
⌨️ (0:23:51) Page, Layout _ View, Namespaces
⌨️ (0:33:02) URL based navigation
⌨️ (0:51:10) Basics of ListView and Data Binding
⌨️ (1:05:58) Events Handling of ListView
⌨️ (1:16:54) Parameters in URL based Navigation _ Static Repository
⌨️ (1:35:35) Stacklayout for Edit Contact page
⌨️ (1:52:47) View Contact Details _ Update Contact
⌨️ (2:06:40) Observable Collection
⌨️ (2:14:58) Field Validation with .Net Maui CommunityToolkit
⌨️ (2:27:08) Reusable Control
⌨️ (2:40:37) Grid Layout and  Use reusable control
⌨️ (2:53:23) ContextActions _ MenuItems in ListView
⌨️ (3:03:44) SearchBar in .NetMaui 

دوره 3 ساعته NET MAUI.
اشتراک‌ها
بررسی imageهای مختلف NET. در Docker

.NET and .NET Core (and Windows!) have been getting better and better with Docker. I run Docker for Windows as it supports both Linux Containers and Windows Containers. They have both a Stable and Edge channel. The Edge (Beta) channel is regularly updated and, as a rule, gets better and better in the year I've been running it. 

بررسی imageهای مختلف NET. در Docker