اشتراک‌ها
npm v5.0.0 منتشر شد

npm@5 takes npm a pretty big step forward, significantly improving its performance in almost all common situations, fixing a bunch of old errors due to the architecture, and just generally making it more robust and fault-tolerant.  

npm v5.0.0 منتشر شد
اشتراک‌ها
NET 5.0 Preview 8. منتشر شد

Today, we are releasing .NET 5.0 Preview 8. The .NET 5.0 release is now “feature complete”, meaning that very nearly all features are in their final form (with the exception of bug fixes still to come). Preview 8 is, appropriately, the last preview. We plan on releasing two go-live release candidates before the final .NET 5.0 release in November. This post describes a selection of features across the .NET 5.0 release. 

NET 5.0 Preview 8. منتشر شد
اشتراک‌ها
ریلیز شد Orleans 7.0

The .NET 7 release marks an exciting milestone in many ways, but one in particular that’s exciting for ASP.NET developers building distributed apps or apps designed to be cloud native and ready for dynamic horizontal scale out is the addition of the Orleans team to the broader .NET team. Bringing Orleans and ASP.NET Core closer together has led to some exciting ideas for the future of how we blend Orleans into the ASP.NET toolchain, and coupled with the huge advances in performance throughout .NET 7 are improvements to Orleans 7 that bring over 150% improvements to some areas of the Orleans toolchain. This post will introduce you to some of the new features in Orleans 7. 

ریلیز شد Orleans 7.0
اشتراک‌ها
طراحی Entity پایه برای کلاس های Domain

How you shouldn’t implement base classes

public class Entity<T>
{

  public T Id { get; protected set; }

}

Motivation for such code it pretty clear: you have a base class that can be reused across multiple projects. For instance, if there is a web application with GUID Id columns in the database and a desktop app with integer Ids, it might seem a good idea to have the same class for both of them. In fact, this approach introduces accidental complexity because of premature generalization. 

There is no need in using a single base entity class for more than one project or bounded context. Each domain has its unique path, so let it grow independently. Just copy and paste the base entity class to a new project and specify the exact type that will be used for the Id property. 

طراحی Entity پایه برای کلاس های Domain
نظرات مطالب
شروع به کار با EF Core 1.0 - قسمت 14 - لایه بندی و تزریق وابستگی‌ها
در زمان CRUD مشکل Update وجود دارد یعنی در زمان فراخوانی 
_unitofwork.MarkAsChanged(entity);
در کنترلر MVC خطایی با این عنوان اتفاق می‌افتد 
An unhandled exception has occurred while executing the request
System.InvalidOperationException: The instance of entity type 'Country' cannot be tracked because another instance of this type with the same key is already being tracked. When adding new entities, for most key types a unique temporary key value will be created if no key is set (i.e. if the key property is assigned the default value for its type). If you are explicitly setting key values for new entities, ensure they do not collide with existing entities or temporary values generated for other new entities. When attaching existing entities, ensure that only one entity instance with a given key value is attached to the context.

مطالب
رفع مشکل برگشت خوردن ایمیل‌ها توسط Gmail
چند روزی بود که ایمیل‌های سایت رد نمی‌شدند و تمام آن‌هایی که متعلق به جی‌میل بودند، برگشت می‌خورند. در لاگ‌های سرور، اطلاعات خاصی مشاهده نشد. به همین جهت logging مخصوص SMTP Server فعال شد:

پس از یک روز، چنین سطرهایی پس از سعی‌های ارسال ایمیل به جی‌میل، قابل مشاهده بودند:
 550-5.7.1+This+message+does+not+have+authentication+information+or+fails+to+pass
پس از اندکی جستجو مشخص شد که جی‌میل، استفاده‌ی از SPF را اجباری کرده‌است و تمام ایمیل‌های میل‌سرورهایی را که این تنظیم را نداشته باشند، با پیام فوق برگشت می‌زند.


SPF چیست؟

SPF یا Sender Framework Policy، رکوردهای مخصوص DNS ای هستند که مشخص می‌کنند کدام میل سرورها، بر اساس نام دومین جاری، مجاز هستند ایمیل ارسال کنند. برای مثال اگر کلاینتی با IP1 سعی کند خودش را بجای دومین شما با IP0، معرفی کند و ایمیل ارسال کند، ایمیل‌های او برگشت خواهند خورد. در این حالت این کلاینت، پیام‌های خطایی شروع شده‌ی با عبارات زیر را دریافت خواهد کرد:
550-5.7.1 This message does not have authentication information or fails to pass
550-5.7.1 SPF Failed validation
status=bounced (host gmail-smtp-in.l.google.com said: 550-5.7.1 This message does not have authentication information or fails to pass
550-5.7.1 authentication checks. To best protect our users from spam, the 550-5.7.1 message has been blocked.
Please visit 550-5.7.1 https://support.google.com/mail/answer/81126#authentication for more 550 5.7.1 information.
اکنون چند روزی است که حتی اگر ایمیلی از میل سرور خود شما نیز ارسال شود، درصورتیکه اطلاعات SPF را تنظیم نکرده باشید، توسط جی‌میل حتی دریافت هم نخواهد شد؛ چه برسد به اینکه به قسمت SPAM هدایت شود.


چگونه باید SPF را تنظیم کرد؟

برای این منظور نیاز است به پنل تنظیمات دومین خریداری شده‌ی خود دسترسی داشته باشید و بتوانید در آنجا یک DNS Record جدید از نوع TXT را اضافه کنید؛ با این مشخصات:
Name/Host/Alias: @
Time to Live (TTL): 3600 or leave the default
Value/Answer/Destination:
v=spf1 ip4:xx.xx.xx.xx include:_spf.google.com ~all
در اینجا مقدار مشخص شده، دارای یک IP نگارش 4 است و مشخص کننده‌ی IP سروری است که مجاز است از طرف دومین شما ایمیل ارسال کند (IP سرور شما). قسمت include هم میل‌سرورهای گوگل را نیز مجاز اعلام می‌کند. پارامتر all~ به این معنا است که میل سرورها باید ایمیل‌را حتی اگر اعتبارسنجی SPF آن با شکست مواجه شد، دریافت کنند؛ اما مجاز هستند آن‌را به صورت اسپم علامتگذاری کنند. اگر این پارامتر به صورت all- معرفی شود، میل سرور دریافت کننده‌ی ایمیل، در صورت شکست اعتبارسنجی SPF، ایمیل را پذیرش و دریافت نخواهد کرد (که تبدیل به حالت پیش‌فرض جی‌میل شده‌است).


چگونه بررسی کنیم که رکورد SPF دومین ما به درستی تنظیم شده‌است؟

برای این منظور می‌توان از ابزار Check MX گوگل، استفاده کرد:
https://toolbox.googleapps.com/apps/checkmx/check
اشتراک‌ها
مقایسه نحوه طراحی Windows NT و Unix

Windows NT vs. Unix: A design comparison

NT is often touted as a "very advanced" operating system. Why is that? What made NT better than Unix, if anything? And is that still the case?

مقایسه نحوه طراحی Windows NT و Unix
اشتراک‌ها
کتاب مهندسی داده

The Data Engineering Cookbook

I get asked super often how to become a Data Engineer. That's why I decided to start this cookbook with all the topics you need to look into. 

کتاب مهندسی داده