- Fixed an issue that caused Xamarin.Android projects using the Xamarin.Android.Arch.Work.Runtime NuGet package to fail with "class file for com.google.common.util.concurrent.ListenableFuture not found".
- Fixed Link assemblies causes app crashes if you have an EditText in VS2019 Preview 2
- Fixed error 'Some or all identity references could not be translated' when opening extension manager; fixed failure to persist some IDE settings.
- Fixed Parallel Stacks shows nonsense number of threads
- Fixed After repair, build cmake folder fails with D8050, compile using tasks.vs.json fails with "cl" is not recognized
- Fixed No longer able to group by trait in Test Explorer with VS 2019 Preview
- Fixed Some c++ code analysis warnings are not localized
- Fixed Service Fabric Project not loading
- Now correctly reports $(MSBuildVersion) as 16.2.x, instead of the erroneous 16.200.19.
- Fixed issue causing a random crash after closing GoToAll/Symbol UI.
- Fixed crash during Visual Studio sign-in.
- Fixed an issue where forms previewer on Android frequently stops responding and needs a restart.
- Added iOS Designer Xcode 10.3 support.
fn main() { println!("The sum of 2 and 3 is {}", sum(2, 3)); } fn sum(a: i32, b: i32) -> i32 { a + b }
توابع در Rust با استفاده از کلمهی کلیدی fn و به دنبال آن نام تابع، پارامترها و نوع بازگشت (در صورت وجود) اعلام میشوند. در اینجا دستور کلی برای اعلان یک تابع در Rust آمدهاست:
fn function_name(parameter1: type1, parameter2: type2) -> return_type { // بدنه تابع // استفاده از مقادیر یارگشتی در صورت لزوم }
Function Parameters
توابع در Rust میتوانند صفر یا چند پارامتر را داشته باشند. پارامترها در امضای تابع، داخل پرانتز قرار گرفته و با کاما از هم جدا میشوند. در اینجا یک مثال، از یک تابع، با دو پارامتر آورده شدهاست:
fn greet(name: &str, age: i32) { println!("Hello, {}! You are {} years old.", name, age); }
Function Return Values
توابع در Rust میتوانند با استفاده از کلمهی کلیدی return و سپس مقدار بازگشتی، مقداری را برگردانند. یک مثال:
fn square(x: i32) -> i32 { return x * x; }
با این حال، Rust یک سینتکس مختصر را نیز برای برگرداندن مقادیر، از توابع دارد که در آن میتوانید کلمهی کلیدی return را حذف کنید و به سادگی مقداری را که باید در انتهای بدنهی تابع برگردانده شود، مشخص کنید. در اینجا همان مثال، با استفاده از سینتکس کوتاه آمدهاست:
fn square(x: i32) -> i32 { x * x }
Rust همچنین از توابعی با مقادیر بازگشتی چندگانه پشتیبانی میکند که به آنها 'tuples' نیز میگویند. یک مثال:
fn swap(a: i32, b: i32) -> (i32, i32) { (b, a) }
برای استفاده از مقادیر بازگشتی یک تابع tuple، میتوانید tuple را destructure کنید یا از عملگر '.' برای دسترسی به عناصر آن استفاده کنید. در این مثال هر دو روش وجود دارند:
let (b, a) = swap(1, 2); println!("a is {} and b is {}", a, b); let tuple = swap(1, 2); println!("a is {} and b is {}", tuple.1, tuple.0);
آیا SPA همان قسمت Front-end است؟
It is common when working on a web application, comprised of a server-side Web API, running on a framework like ASP.NET or NestJS, and a client-side Single Page Application (SPA), running on a framework like Angular, to refer to the server-side as "the back-end" and to the client-side as "the front-end". I've been a culprit of this until recently.
اگر سخنان بزرگان برنامه نویسی را مطالعه کرده باشید، یکی از موارد این بود:
" هیچگاه از gets و sprintf استفاده نکنید، در غیر اینصورت شیاطین به زودی به سراغ شما خواهند آمد! (FreeBSD Secure Programming Guidelines) "
به عبارت دیگر استفاده از توابع کتابخانههای استاندارد زبان C ، بدون ملاحظات لازم (یا همان برنامه نویسی کلاسیک به زبان C )، منشاء بسیاری از حملات Buffer overrun است، زیرا اکثر این توابع اندازهی بافر یا رشتهی ورودی را بررسی نمیکنند.
برای رفع این مشکلات که هنوز که هنوز است قربانی میگیرد! ، The Safe C Library پدید آمده است. این کتابخانه بر اساس استاندارد ISO TR24731 تهیه گردیده و در آن یک سری توابع مکمل، جهت بالا بردن امنیت برنامههای تهیه شده به زبان C مطابق استاندارد ISO/IEC 9899:1999 معرفی شده است.
برای مثال مطابق استاندارد ISO/IEC JTC1 SC22 WG14 N1172 ، تابع نا امن memcpy با تابع امن زیر باید جایگزین شود:
errno_t memcpy_s(void *dest, rsize_t dmax, const void *src, rsize_t smax)
مستندات آنرا در فایل safe_lib_html.tar پس از دریافت کتابخانه میتوانید مشاهده نمائید.
همچنین اخیرا به عنوان مکمل این مجموعه، یک کتابخانهی ریاضی امن نیز تهیه شده است.
پ.ن.
شبیه به همین مورد در اینترفیس پلاگینهای IDA-Pro در نگارشهای اخیر آن اعمال شده است و برنامه نویس را وادار میکند که از نمونههای معادل امن در آن محیط استفاده کند.
//pro.h
// We forbid using dangerous functions in IDA Pro
#ifndef USE_DANGEROUS_FUNCTIONS
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x560 || __BORLANDC__ >= 0x580) // for BCB5 (YH)
#include <stdio.h>
#endif
#undef strcpy
#define strcpy dont_use_strcpy // use qstrncpy
#define stpcpy dont_use_stpcpy // use qstpncpy
#define strncpy dont_use_strncpy // use qstrncpy
#define strcat dont_use_strcat // use qstrncat
#define strncat dont_use_strncat // use qstrncat
#define gets dont_use_gets // use fgets
#define sprintf dont_use_sprintf // use qsnprintf
#define snprintf dont_use_snprintf // use qsnprintf
#define wsprintfA dont_use_wsprintf // use qsnprintf
#endif
Not many are familiar with this awesome feature of dotnet core. Aspnet
team is actively maintaining a project named JavascriptServices
; Along with other packages, it includes the NodeServices
package. Using this package, one can easily create an instance of node
and execute JavaScript code (function) in the backend. If you think of it right now, you can see that it actually opens up a wide variety of development opportunities. By opportunities, I mean; the ASP.NET core project is trying hard to make its package eco-system (NuGet) rich but while doing it, why not get advantages of other package eco-system as well, right? When I talk about other than nuget package manager, the first name that comes to my mind is Npm
(node package manager). Npm
is the largest package manager out there on this very day and its growing rapidly. By using NodeServices
package, we can now use (not all of the npm
packages but) most of the npm
packages in our backend development. So, let me show you how to configure NodeServices
in your aspnet core project and use it to execute JavaScript code on the backend.
مقایسهای بین Mapperly و AutoMapper
Security is one of the most important aspects of any application – and when we talk about security, particularly in ASP.NET applications, it is not limited to development. A secure app involves multiple layers of security in the configuration, framework, web server, database server, and more. In this post, we’ll take a look at the top nine tips for writing secure applications in ASP.NET.
WPF allows you to build modern desktop applications for Windows, and part of building an application is debugging code and optimizing performance. In Alessandro Del Sole’s WPF Debugging and Performance Succinctly, you will learn how to debug a WPF application by leveraging all the powerful tools in Visual Studio, including the most recent additions that allow you to investigate the behavior of the UI at runtime. Also, you will learn how to analyze and improve an application’s performance in order to provide your customers with the best possible experience and thereby make them happy.
- Debugging WPF Applications
- Stepping Through Code
- Working with Debug Windows
- Debugger Visualizers and Trace Listeners
- XAML Debugging
- Analyzing the UI Performances
- Analyzing the Application Performances