بازخوردهای پروژه‌ها
چند متد الحاقی SEO
سلام.
من هم چند متد الحاقی داشتم که مرتبط با SEO اند، البته حتما قابل رشد هست ...


public class SEO
{
    private const char TitleCharSeparator = '-';
    //-------------------------------------------------
    public static string GetTitle(params string[] crumbs)
    {
        var maxLenghtTitle = 60;

        var title = "";

        try
        {

            foreach (var crumb in crumbs)
            {
                title += string.Format(" {0} {1}", TitleCharSeparator, crumb);
            }
            title = title.Substring(3);
        }
        catch
        {

        }

        title = title.Substring(0, title.Length <= maxLenghtTitle ? title.Length : maxLenghtTitle).Trim(); 

        return title;
    }
    //-------------------------------------------------
    public static string GenerateMetaTag(this string pageTitle, string pageDescription)
    {
        var maxLenghtTitle = 60;
        var maxLenghtDescription = 170;

        pageTitle = pageTitle.Substring(0, pageTitle.Length <= maxLenghtTitle ? pageTitle.Length : maxLenghtTitle).Trim();
        pageDescription = pageDescription.Substring(0, pageDescription.Length <= maxLenghtDescription ? pageDescription.Length : maxLenghtDescription).Trim();


        var meta = "";

        try
        {
            meta += string.Format("<title>{0}</title>\n", pageTitle);
            meta += string.Format("<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n");
            meta += string.Format("<meta charset=\"utf-8\"/>\n");
            meta += string.Format("<meta name=\"description\" content=\"{0}\"/>\n", pageDescription);
            meta += string.Format("<meta name=\"robots\" content=\"{0}\" />\n", "follow");
            meta += string.Format("<link rel=\"shortcut icon\" href=\"{0}\"/>\n", "~/cdn/images/ui/favicon.ico");
        }
        catch
        {

        }

        return meta;
    }
    //-------------------------------------------------
    public static string GenerateSlug(this string title)
    {
        var maxLenghtSlug = 45;

        string str = title.RemoveAccent().ToLower();        
str = Regex.Replace(str, @"[^a-z0-9-\u0600-\u06FF]", "-"); str = Regex.Replace(str, @"\s+", "-").Trim(); str = Regex.Replace(str, @"-+", "-"); str = str.Substring(0, str.Length <= maxLenghtSlug ? str.Length : maxLenghtSlug).Trim();

  return str; } //------------------------------------------------- private static string RemoveAccent(this string txt) { var bytes = Encoding.GetEncoding("UTF-8").GetBytes(txt); return Encoding.UTF8.GetString(bytes); } //------------------------------------------------- }


اشتراک‌ها
نگارش نهایی SQL Server 2022 منتشر شد

Today, we announced the general availability of SQL Server 2022, the most Azure-enabled release of SQL Server yet, with continued innovation across performance, security, and availability1. This marks the latest milestone in the more than 30-year history of SQL Server. 

نگارش نهایی SQL Server 2022 منتشر شد
اشتراک‌ها
ویژگی های جدید در SQL Server 2019

Features and performance

Sql server 2019 will help us by making data integration, Management and intelligence easier and more intuitive than ever earlier.

Major Key points

  • Single virtual data layer

  • Data virtualization and Integrating Data

  • No data replication and Managing all data

  • Spark Built-In

  • Unified platform for big data analytics

  • Spark jobs

  • Train machine learning models

     
ویژگی های جدید در SQL Server 2019
اشتراک‌ها
استفاده از کش توزیع شده در asp.net core

n general terms, caching takes place where the frequently-used data is stored, so that the application can quickly access the data rather than accessing the data from the source. Caching can improve the performance and scalability of the application dramatically and can help us to remove the unnecessary requests from the external data sources for the data that changes infrequently. 

استفاده از  کش  توزیع  شده  در   asp.net core
اشتراک‌ها
چرا از آنگولار به ری اکت + ری داکس سوئیچ کردم!

 It’s a library. And therefore you can attach any javascript library of your choice as add-ons

State Management is more flexible

JSX syntax blends well together with javascript

Faster learning curve

Modern Web Development is challenging and the way we develop web apps are now different than before

You can reuse components effortlessly because they’re all just pure functions


چرا از آنگولار به ری اکت + ری داکس سوئیچ کردم!
اشتراک‌ها
ref returns و ref locals در C# 7 از کدهای unsafe سریعتر هستند

Results

Method Jit Platform Mean Scaled
ByReference LegacyJit X64 1.649 us 1.00
ByReferenceUnsafe LegacyJit X64 1.721 us 1.04
ByReference LegacyJit X86 1.666 us 1.00
ByReferenceUnsafe LegacyJit X86 1.673 us 1.00
ByReference RyuJit X64 1.684 us 1.00
ByReferenceUnsafe RyuJit X64 1.709 us 1.02

To our surprise, the safe way is faster than unsafe! 

ref returns و ref locals در C# 7 از کدهای unsafe سریعتر هستند
نظرات مطالب
بازگردانی پایگاه داده بدون فایل لاگ
این اسکریپت رو پیدا کردم، منتهی اجراش که میکنم زمان باقی مونده رو اعلام نمیکنه.

DECLARE @DBName VARCHAR(64) = 'databasename'
 
DECLARE @ErrorLog AS TABLE([LogDate] CHAR(24), [ProcessInfo] VARCHAR(64), [TEXT] VARCHAR(MAX))
 
INSERT INTO @ErrorLog
EXEC sys.xp_readerrorlog 0, 1, 'Recovery of database', @DBName
 
SELECT TOP 5
 [LogDate]
,SUBSTRING([TEXT], CHARINDEX(') is ', [TEXT]) + 4,CHARINDEX(' complete (', [TEXT]) - CHARINDEX(') is ', [TEXT]) - 4) AS PercentComplete
,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0 AS MinutesRemaining
,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0/60.0 AS HoursRemaining
,[TEXT]
 
FROM @ErrorLog ORDER BY [LogDate] DESC

 در ضمن دیتابیس روی درایو D هست و فضای چند ده گیگ خالی داره. حجم فایل ldf هم تا حدود 400 مگ هست. وقتی هم یک کوئری بخوام روی دیتابیس اجرا کنم خطای زیر رو میده:
Database 'Manager' is being recovered. Waiting until recovery is finished.