اشتراک‌ها
Aurelia-Toolbelt مجموعه کامپوننتی بر اساس Bootstrap 4 برای Aurelia

Aurelia is one of the best frameworks that we have ever seen in terms of software design, hence, we decided to write a bunch of tools for its developers to pave the way for further usage.

aurelia-toolbelt is that, in which we tried to gather the best libraries in Javascript world together in aurelia fashion. Writing custom-elements, value-converters, and so on. We tried not to invent the wheel, so most of the work is a wrapper, or bridge( am not sure whether the way that we coded can be called bridge or not), around other libraries.

  • Its is utterly important for us to provide a link as a reference to the libraries used, or inspired from, so that other developers can visit their product and decide on their own to use which, besides it's one way that we can respect the time and effort of those programmers.

  • All libraries used in aurelia-toolbelt are open-source and free of charge; most of which are  MIT , however we will provide definition whenever it differs. 

GitHub aurelia-toolbelt

NPM aurelia-toolbelt

Twitter aureliatoolbelt

Aurelia-Toolbelt مجموعه کامپوننتی بر اساس Bootstrap 4 برای Aurelia
اشتراک‌ها
Visual Studio 2019 version 16.6.3 منتشر شد
Visual Studio 2019 version 16.6.3 منتشر شد
اشتراک‌ها
مروری بر ویژگی Auto Properry در سی شارپ 6

With the release of Visual Studio 2015 came the (final) release of the Roslyn C# compiler and C# 6. This latest version of C#’s feature list seems to be…less than exciting, but it’s important to keep in mind that before Roslyn, none of these new features would have ever made it into a release. It was simply too hard to add a feature in C#, so higher impact/value features made it in while minor annoyances/enhancements would be deferred, indefinitely 

مروری بر ویژگی Auto Properry در سی شارپ 6
اشتراک‌ها
نگاهی دیگر به زبان #C

C# runs great on Mac, Linux, Android, and iOS (oh, and Windows); is targeted by your favorite editor; rests on a rock solid, time-tested industrial grade platform; and is open source. You want to because C# is an industry leader in language innovation, is your best option for native cross-platform mobile apps, and is toolable beyond compare.  

نگاهی دیگر به زبان #C
مطالب
PowerShell 7.x - قسمت سوم - آشنایی با Redirection
در PowerShell به صورت پیش‌فرض، خروجی، PowerShell Host یا همان کنسول است. PowerShell از چندین استریم پشتیبانی میکند:
  • Success
  • Error
  • Warning
  • Verbose
  • Debug
  • Information 
برای هر کدام از استریم‌های فوق یک آی‌دی اختصاص داده شده‌است که به ترتیب از 1 تا ۶ میباشد. همچنین برای هرکدام یک cmdlet مجزا وجود دارد:
cmdlet  Name   Id
 Write-Output  Success  1
 Write-Error  Error  2
 Write-Warning  Warning  3
 Write-Verbose  Verbose  4
 Write-Debug  Debug  5
 Write-Information  Information  6

به جز دو مورد اول، بقیه cmdletها خروجی را به صورت پیش‌فرض درون کنسول نمایش نمیدهند. به عنوان مثال اسکریپت زیر را در نظر بگیرید:

Write-Output 'Output'                          
Write-Error 'This is an error'                 
Write-Warning 'This is a warning'              

Write-Verbose 'This is verbose'                
Write-Debug 'This is Debug'                    
Write-Information 'This is information'

با اجرای اسکریپت فوق خروجی زیر را خواهیم داشت:

Output
Write-Error: This is an error
WARNING: This is a warning

همانطور که مشاهده میکنید سه cmdlet فوق، خروجی را درون کنسول نمایش نداده‌اند. این رفتار توسط مفهومی تحت عنوان Action Preference قابل تنظیم است که در واقع یک Enum است با مقدار زیر:

  6  Break
رخداد به صورت عادی مدیریت شده و برنامه ادامه پیدا میکند  2  Continue
به طور کلی از رخداد صرفنظر خواهد شد؛ بدون اینکه چیزی در استریم نمایش داده شود 4  Ignore
سوال پرسیده خواهد شد که برنامه را ادامه دهد یا متوقف کند  3  Inquire
به طور کلی از رخداد صرفنظر خواهد شد    
0  SilentlyContinue
 دستور را متوقف خواهد کرد  Stop
 دستور به نوعی معلق خواهد شد 5  Suspend

بنابراین با تغییر Action Preference برای هر کدام از cmdletها میتوانیم رفتار اسکریپت قبلی را تغییر دهیم:

Write-Output 'Output'                          
Write-Error 'This is an error'                 
Write-Warning 'This is a warning'              

$VerbosePreference = 'Continue'
Write-Verbose 'This is verbose'

$DebugPreference = 'Continue'
Write-Debug 'This is Debug'  

$InformationPreference = 'Continue'
Write-Information 'This is information'

اکنون اگر اسکریپت فوق را اجرا کنید، سه خروجی آخر را نیز مشاهده خواهید کرد:

Output
Write-Error: This is an error
WARNING: This is a warning
VERBOSE: This is verbose
DEBUG: This is Debug
This is information

هر کدام از استریم‌های فوق قابل redirect شدن نیز هستند؛ برای اینکار میتوانیم از redirect operatorهایی که در PowerShell پشتیبانی میشود استفاده کنیم:

>
>>
>&1

به عنوان مثال میتوانیم تمام خطاها یا هشدارهای درون یک اسکریپت را به یک فایل منتقل کنیم:

./script.ps1 2>&1 > .\logs.txt

یا میتوانیم تمام Success streamها را به یک فایل هدایت کنیم:

.\script.ps1 > script.log

ارسال تمام Success, Warning, Errorها به یک فایل:

&{
   Write-Warning "hello"
   Write-Error "hello"
   Write-Output "hi"
} 3>&1 2>&1 > C:\Temp\redirection.log

ارسال تمام استریم‌ها به یک فایل:

.\script.ps1 *> script.log

همچنین میتوانیم استریمی را به اصطلاح suppress کنیم که در خروجی نمایش داده نشود:

./script.ps1 1> $null 2> $null

./script.ps1 *> $null

از تکنیک فوق برای drop کردن خروجی‌هایی که نمیخواهیم نمایش داده شوند، استفاده میشود. در کد فوق دو Idهای ۱ و ۲ را به متغیر ویژه‌ی null هدایت کرده‌ایم؛ همچنین میتوانستیم از یک رشته‌ی خالی نیز بجای null استفاده کنیم. در خط بعدی از * استفاده کرده‌ایم که به معنای تمامی استریم‌های موجود است؛ با اینکار چیزی در خروجی نمایش داده نخواهد شد. یک روش دیگر برای drop کردن، استفاده از دستور Out-Null است:

Get-ChildItem | Out-Null

لازم به ذکر است که این cmdlet تا قبل از نسخه ۶ خیلی کند بود؛ زیرا همانند دیگر cmdletهای درون pipeline میبایست یک ورودی (InputObject) را دریافت کند که باعث میشد هزینه‌ی پردازشی بالایی داشته باشد. اما در نسخه ۶ به بعد این مشکل رفع شده‌است و پارزر به محض رسیدن به این keyword به صورت کلی خروجی را discard میکند بدون اینکه Out-Null را فراخوانی کند؛ در واقع این cmdlet یک hint برای پارزر است. روش دیگر برای drop کردن خروجی، انتساب نتیجه یک دستور به متغییر null است:

New-Item -Type Directory -Path $path | Out-Null

$null = New-Item -Type Directory -Path $path

همچنین میتوانیم خروجی یک دستور را به void تبدیل کنیم؛ که نتیجه مشابه با تکنیک‌های فوق دارد:

[void](New-Item -Name test -ItemType Directory)

یک نکته در مورد Out-Null

در loopهای بزرگ ممکن است Out-Null حتی در PowerShell 7.x هم کند عمل کند:

PS > Measure-Command { for($i=0; $i -lt 1mb; $i++) { $i | Out-Null } } | Select-Object TotalSeconds

TotalSeconds
------------
   4.3056315


PS > Measure-Command { for($i=0; $i -lt 1mb; $i++) { $null = $i } } | Select-Object TotalSeconds

TotalSeconds
------------
   1.1210884

PS > Measure-Command { for($i=0; $i -lt 1mb; $i++) { [void]$i } } | Select-Object TotalSeconds

TotalSeconds
------------
    1.130507

PS > Measure-Command { for($i=0; $i -lt 1mb; $i++) { $i > $null } } | Select-Object TotalSeconds

TotalSeconds
------------
   1.3832427
اشتراک‌ها
بررسی ویژگی‌های JavaScript ES2021

Some of the features for ES2021 include:

  • String.prototype.replaceAll
  • Promise.any
  • Logical Operators and Assignment Expressions
  • Numeric Separators
  • Intl.ListFormat
  • dateStyle and timeStyle options for Intl.DateTimeFormat 
بررسی ویژگی‌های JavaScript ES2021
اشتراک‌ها
کتابخانه jQuery.mmenu
The best jQuery plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.
کتابخانه jQuery.mmenu