Microsoft FTE.

All Posts


Bootstrap dark theme minimum style

Now Apple is forcing all apps in its app store to support dark mode. Also, most native Android apps already support the dark theme. Viewing a screen which white background when you enabled dark mode on your device will greatly harm the viewer's eyes. Like lots of websites are made by bootstrap. So how can we get a solution with minimum changes and allows the website to support automatically …

Web CSS Bootstrap Media Query Style Dark theme

Install Azure CLI on Windows 10 and use it in bash

The Azure command-line interface (CLI) is Microsoft's cross-platform command-line experience for managing Azure resources. The Azure CLI is designed to be easy to learn and get started with, but powerful enough to be a great tool for building custom automation to use Azure resources. The Azure CLI is available to install in Windows, macOS and Linux environments. It can also be run in a Docker …

bash Azure Azure CLI PowerShell

Ubuntu bash experience for Windows Terminal without Linux subsystem

Bash is the major shell client I use. On Windows 10 I really enjoy git-bash. But how to set bash to the default terminal in the new Windows terminal? Brief steps: Install a Linux style shell like git-bash. Install the Windows Terminal Make git-bash the default terminal in Windows Terminal Make the theme looks like Ubuntu style. Allow Ctrl + V to paste Allow starting WT in the directory …

bash Ubuntu Windows 10 Windows Terminal

Microsoft account integrated sign in via C#

This code example indicates how to build an app that supports Microsoft account OAuth authentication. Before coding, we gonna create an app in your Azure portal first. https://portal.azure.com The name is your app's display name. Select your app can access accounts in any organization and personal Microsoft account. As for the redirect URI, it must be your server redirect back address. For …

ASP.NET Core Azure Microsoft OAuth Login Authentication

Publish app from Azure DevOps to non-global Azure like Azure CN

如何使用Azure DevOps将编译完的应用发布到非Azure Global环境,例如Azure CN。 Publishing an app from Azure DevOps to Azure global is super easy. Simply a few clicks and you can find your azure subscription and publish it in a minute. Like this: But in some cases, our customers might be using other Azure environments, like Azure Arc, Azure for government and Azure CN. And we can't find our subscriptions easily via …

Azure App Service Azure Azure DevOps DevOps Azure CN China

Linux Cheatsheet for Windows Users

A notebook for Windows folks like me who struggle to remember Linux commands Before starting Control options Operation Command Example Execute command one by one command1; command2 Execute command1 background command1 & command2 Execute command2 if 1 success command1 && command2 Execute command2 if 1 fail command1 || command2 Reverse the …

bash Linux Ubuntu

How to write a bot for Kahla

Kahla.SDK Kahla.SDK is a library for writting bots and extends for Kahla. Tutorial - How to create a bot with Kahla.SDK This will introduce how to write a bot for Kahla. Before starting, make sure you have .NET Core SDK installed. Download .NET Core SDK here. 1. Create a new console .NET Core app Open your terminal and type the following command to create a new console app. $ mkdir …

C# .NET Core Aiursoft Kahla Bot Kahla.SDK Kahla App Console App

Creating a Model for an existing database in Entity Framework Core

Try to execute the following command under your project folder: $ dotnet ef dbcontext scaffold "Server=....." Microsoft.EntityFrameworkCore.SqlServer -o Models And fill the string Server=..... with your database connection string. Make sure that you can connect to this database successfully. And EF will try to build models from the database. Note: Once you have created the model, you …

C# Entity Framework SQL Server Database Entity Framework Core

Sync data to database with Entity-Framework Core

We already know how to add data to database. That's simple: _dbContext.MyDbSet.Add(myObject); But there may already exists some data in the database. We need to delete the obsolete data, and try to add the missing data. For example, I have some numbers: 1, 1, 2, 2, 3, 3 While in the database there is: 1, 1, 1, 5 To seed the database to the way we expected, we shall delete the first 1 and …

C# Entity Framework Database Data Sync

C#获取腾讯云直播的推流地址和观看地址

最近公司有个项目想对接腾讯云直播。腾讯云直播的推流链接是在客户端生成的,所以这段代码就别指望调用API获取了。 遗憾的是,腾讯云的网站上,只给了Java和PHP的代码示例,并没有给出C#的代码示例: 而我实在看不懂他Java的代码实例中那个txTime参数是从哪冒出来的。自己试了试各种方案,最后终于猜出来,原来是自1970年到今天的总秒数。 剩下的就是求一下MD5,拼接字符串,转一下十六进制。都是体力活,拿C#写也不算费劲。 折腾一阵后,终于搞定。 using System; using System.Security.Cryptography; using System.Text; namespace TencentCloud { public class Program { // Any value is fine. …

C# .NET Core Tencent Cloud Live Streaming China

Get an ideal flight simulator free based on X-Plane 11

Video: https://www.youtube.com/watch?v=nRMQn8rdZ-4 Or(China edition): https://www.bilibili.com/video/BV1Tg4y1z7UP Before reading this, you need to have X-Plane 11 installed. Buy X-Plane 11 here: https://www.x-plane.com/ Every time I install X-Plane 11, I gonna install many plugins to get better fly experience. And I will try to list all the plugins I use free which helps me to get …

X-Plane Flight simulation Flight Plugins Plane

Tips to get better performance for Entity Framework Core

Only get the data you need And the key reason for your slow query is it outputs too much data. Consider adding: Take(200), Skip() to take only the data you need or the current page requires. Use a pager to generate the report. This might helps a lot. Consider the following code (BAD Example) var myArticles = await _dbContext .Articles .Where(t => t.OwnerId == me.Id) . …

Entity Framework SQL Performance Database