اشتراک‌ها
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
بازخوردهای دوره
استفاده از StructureMap به عنوان یک IoC Container
سلام؛ زیر ObjectFactoryیه خط سبز میاد و می‌نویسه :
Warning 
Structuremap.ObjectFactory is obsolete objectfactory will be removed future 4.0 release of structuremapfavor the usage of the container class for futur work
چطور می‌تونم برطرف کنم. ممنون
اشتراک‌ها
نگاهی به نگارش آزمایشی Windows 11

Now, it seems like the rumor is going to be real. Yesterday there was a Windows 11 Build leaked online from a Chinese portal, and we got to know more about that build. Here's a quick look at Windows 11 that is expected to be released later this year. 

نگاهی به نگارش آزمایشی Windows 11
اشتراک‌ها
آینده #C به نقل از طراحان آن

The future of C#
Over the last year we shipped no less than three "point releases" of C# (7.1, 7.2 and 7.3), full of small but useful language features. Mads and Dustin will race you through a tour of these, before turning to some of the big things we have in store for the future: Nullable reference types, recursive patterns, asynchronous streams and more. 

آینده #C به نقل از طراحان آن
اشتراک‌ها
شرکت در نظرسنجی رسمی Entity Framework Core
The team behind Entity Framework Core thanks you for your interest in our product. I am a Senior Program Manager for .NET data at Microsoft and work closely with the EF Core team. As part of our ongoing effort to improve the experience of working with data in .NET, we developed a short survey to learn more about how you work with data. It should only take a few minutes of your time. 
شرکت در نظرسنجی رسمی Entity Framework Core
اشتراک‌ها
پیاده سازی مفاهیم SOLID در ASP.NET Core توسط نویسنده‌ی AutoMapper

ASP.NET Core 1.0 is the ground-up rewrite of ASP.NET, MVC and Web API, bringing a new paradigm in building web applications and APIs in .NET. With this rewrite brought new techniques in building SOLID applications, and updated some existing patterns and tools.
In this session, we'll take a lap around some of the major extension points of ASP.NET Core 1.0, walking through how these features can help us build cleaner, more maintainable systems. We'll cover web APIs, traditional MVC applications, controllers, views, filters, dependency injection, tag helpers and more. With a SOLID foundation, our ASP.NET Core applications will be dead simple to build and maintain.
 

پیاده سازی مفاهیم SOLID در ASP.NET Core توسط نویسنده‌ی AutoMapper
مطالب
اصلاح daylight saving time ویندوز تا 90 سال بعد
چند سالی هست (از سال 2009) که آپدیت‌های daylight saving time ویندوز شامل حال تنظیمات رسمی ایران نمی‌شود. برای نمونه، همین یکی دو روز قبل بود که ساعت ویندوز به صورت خودکار تغییر کرد؛ درحالیکه باید در انتهای روز 30 شهریور اینکار صورت می‌گرفت.
اطلاعات daylight saving time یا بازه صرفه جویی زمانی ویندوز در دو مدخل رجیستری زیر ثبت می‌شوند:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Iran Standard Time]



تصویر سوم مرتبط است به ویندوزهای ویستا به بعد که مفهوم dynamic daylight saving time در آن‌ها معرفی شده است.
در اینجا یک نمونه اطلاعات زمانی ثبت شده مرتبط با ایران را مشاهده می‌کنید:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Iran Standard Time]
"Display"="(GMT+03:30) Tehran"
"Dlt"="Iran Daylight Time"
"Std"="Iran Standard Time"
"MapID"="-1,72"
"Index"=dword:000000a0
"TZI"=hex:2e,ff,ff,ff,00,00,00,00,c4,ff,ff,ff,00,00,09,00,04,00,03,00,17,00,3b,\
  00,3b,00,00,00,00,00,03,00,02,00,03,00,17,00,3b,00,3b,00,00,00
TZI ایی که در اینجا وجود دارد، دارای یک چنین ساختاری است:
using System.Runtime.InteropServices;

namespace TimeZoneInfo.Core
{
    [StructLayout(LayoutKind.Sequential)]
    public struct TZI
    {
        public int Bias;
        public int StandardBias;
        public int DaylightBias;
        public SystemTime StandardDate;
        public SystemTime DaylightDate;
    }
}
و SystemTime آن نیز به نحو زیر تعریف شده است:
using System;
using System.Runtime.InteropServices;

namespace TimeZoneInfo.Core
{
    [StructLayoutAttribute(LayoutKind.Sequential)]
    public struct SystemTime
    {
        public short Year;
        public short Month;
        public short DayOfWeek;
        public short Day;
        public short Hour;
        public short Minute;
        public short Second;
        public short Milliseconds;
    }
}
برای مثال اگر اطلاعات درج شده در TZI به صورت زیر باشد:
2C 01 00 00 00 00 00 00
C4 FF FF FF 00 00 0A 00
00 00 05 00 02 00 00 00
00 00 00 00 00 00 04 00
00 00 01 00 02 00 00 00
00 00 00 00
نمونه رمزگشایی شده آن به نحو ذیل خواهد بود:
(little-endian)   => (big-endian)
  2C 01 00 00     => 00 00 01 2C = 300 Bias
  00 00 00 00     => 00 00 00 00 = 0 Std Bias
  C4 FF FF FF     => FF FF FF C4 = 4294967236 Dlt Bias
( SYSTEM TIME ) StandardDate
  00 00           => 00 00 = Year
  0A 00           => 00 0A = Month
  00 00           => 00 00 = Day of Week
  05 00           => 00 05 = Day
  02 00           => 00 02 = Hour
  00 00           => 00 00 = Minutes
  00 00           => 00 00 = Seconds
  00 00           => 00 00 = Milliseconds
( SYSTEM TIME ) DaylightDate
  00 00           => 00 00 = Year
  04 00           => 00 04 = Month
  00 00           => 00 00 = Day of Week
  01 00           => 00 01 = Day
  02 00           => 00 02 = Hour
  00 00           => 00 00 = Minutes
  00 00           => 00 00 = Seconds
  00 00           => 00 00 = Milliseconds
در ساختار SystemTime متناظر با TZI، فیلد Day دارای مقدار روز در یک ماه نیست. به معنای شماره هفته است. مثلا پنج شنبه (DayOfWeek) هفته سوم (Day) ماه 9 سال 2012.
همچنین Day از یک شروع می‌شود و DayOfWeek از صفر. Year اگر صفر وارد شود به معنای زمان نسبی است و برای سال بعد نیز می‌تواند کاربرد داشته باشد (و عموما صفر تعریف شده است).
بنابراین برای تبدیل DateTime به SystemTime سازگار با TZI به فرمول زیر خواهیم رسید:
        public static SystemTime ToSystemTime(DateTime time)
        {
            var result = new SystemTime
            {
                Year = 0, // سال نسبی وارد می‌شود نه مطلق
                Month = (short)time.Month,
                DayOfWeek = (short)time.DayOfWeek,
                Hour = (short)time.Hour,
                Minute = (short)time.Minute,
                Second = (short)time.Second,
                Milliseconds = (short)time.Millisecond
            };

            int weekdayOfMonth = 1; // شماره هفته است نه شماره روز
            for (int dd = time.Day; dd > 7; dd -= 7)
                weekdayOfMonth++;

            result.Day = (short)weekdayOfMonth;

            return result;
        }
در ادامه نیاز خواهیم داشت تا ساختار TZI سفارشی و بازسازی شده خودمان را بتوانیم به آرایه‌ای از بایت‌ها تبدیل کنیم تا بتوان در همان مدخل رجیستری نوشت. اینکار را توسط متد SerializeByteArray زیر می‌توان انجام داد:
using System;
using System.Runtime.InteropServices;

namespace TimeZoneInfo.Core
{
    public static class ByteUtils
    {
        public static Byte[] SerializeByteArray<T>(T msg) where T : struct
        {
            int objsize = Marshal.SizeOf(typeof(T));
            Byte[] ret = new Byte[objsize];

            IntPtr buff = Marshal.AllocHGlobal(objsize);
            Marshal.StructureToPtr(msg, buff, true);
            Marshal.Copy(buff, ret, 0, objsize);
            Marshal.FreeHGlobal(buff);

            return ret;
        }
    }
}
و اگر اینکار را تا بیش از 90 سال بعد بر اساس تاریخ ایران انجام داده و مداخل رجیستری ویندوز را تکمیل کنیم، خروجی آن فایل reg زیر خواهد بود که به سادگی با کلیک راست و انتخاب گزینه‌ی merge به رجیستری ویندوز اضافه شده و تا چندین سال بعد، مشکل تنظیمات DST را برطرف خواهد کرد:
پس از اعمال تغییرات فوق، نیاز است یکبار ویندوز را ری استارت کنید.