اشتراک‌ها
بازه‌ها و الگوهای بازگشتی در C# 8
  • C# 8 Adds Ranges and Recursive Patterns
  • Ranges easily define a sequence of data, replacing the Enumberable.Range()
  • Recursive Patterns brings an F#-like construct to C#
  • Recursive Patterns is an awesome feature, it giving you the flexibility to testing the data against a sequence of conditions and performing further computations based on the condition met.
  • Ranges is very useful to generate sequences of numbers in the form of a collection or a list. 
بازه‌ها و الگوهای بازگشتی در C# 8
اشتراک‌ها
نکات جالبی درباره Breakpoints

Have you ever found a bug in your code and wanted to pause code execution to inspect the problem? If you are a developer, there’s a strong chance you have experienced or will experience this issue many, many times. While the short and sweet answer to this problem is to use a breakpoint, the longer answer is that Visual Studio actually provides multiple kinds of breakpoints and methods that let you pause your code depending on the context! Based on the different scenarios you may experience while debugging, here are some of the various ways to pause your code and set or manage a breakpoint in Visual Studio 2017 

نکات جالبی درباره Breakpoints
مطالب
رفع مشکل برگشت خوردن ایمیل‌ها توسط 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
اشتراک‌ها
سری بررسی مهم‌ترین مفاهیم طراحی سیستم‌ها

system design tutorials
7 videos
This series of videos covers of the the most important concepts related to system design, with a focus on practical system design knowledge for interviews. These system design videos cover topics like vertical vs horizontal scaling, load balancers, database design and scaling, caching, back of the envelope math for estimating capacity requirements for a system, an introduction to distributed systems, and some system design interview style questions walking through a full design implementation

 

سری بررسی مهم‌ترین مفاهیم طراحی سیستم‌ها