Posts in category “Tips”

Multiline matches with ripgrep (rg)

You can simply click the title of this blog to check the reference.

The key is the dotall modifier (?s). It helped out me today! by the way, my final match expression is

rg --pcre2 -U '(?s)\.Initialise\([^,]+,\s*([^,]+),\s*\1(?:,true|false)?\);'

rg is a so fast and so powerful tool in my daily use, I love it!

Reference

[Solution]Microsoft.AspNetCore.Http was marked deprecated

Remove those deprecated NuGet packages, use the ASP.NET Core shared framework instead

With the release of .NET Core 3.0, many ASP.NET Core assemblies are no longer published to NuGet as packages. Instead, the assemblies are included in the Microsoft.AspNetCore.App shared framework, which is installed with the .NET Core SDK and runtime installers. For a list of packages no longer being published, see Remove obsolete package references.

As of .NET Core 3.0, projects using the Microsoft.NET.Sdk.Web MSBuild SDK implicitly reference the shared framework. Projects using the Microsoft.NET.Sdk or Microsoft.NET.Sdk.Razor SDK must reference ASP.NET Core to use ASP.NET Core APIs in the shared framework.

To reference ASP.NET Core, add the following element to your project file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
  </ItemGroup>

</Project>

Reference

How to remote desktop fullscreen RDP with just SOME of your multiple monitors

solution

Basically, you need to change or add the following options. The first three lines you can simply copy, but the fourth line, you should change to your own values.

screen mode id:i:2
use multimon:i:1
span monitors:i:1
selectedmonitors:s:3,4

explanation:

  • screen mode id:i:2 -- i means integer: 2 means fullscreen mode

  • use multimon:i:1 -- the remote desktop session will use multiple montiors

  • span monitors:i:1 -- allow to use part of the monitors for remote desktop session

  • selectedmonitors:s:3,4 -- specify what monitors you want to use: the value 3,4 could be different from yours. run mstsc /l (l here is L in lowercase) to check your own monitor ids.

Reference

[GitHub] Viewing all of your issues and pull requests

2010年我学英文时读到的一个据说能让你婚姻幸福的小故事

Reverrend Chalfant tells of a couple who were celebrating their golden wedding anniversary. The husband was asked what the secret was to his successful marriage. As the elderly are wont to do, the old gentleman answered with a story.

His wife, Sarah, was the only girl he ever dated. He grew up in an orphanage and worked hard for everything he had. He never had time to date until Sarah swept him off his feet. Before he knew it she had managed to get him to ask her to marry him.

After they had said their vows on their wedding day, Sarah's father took the new groom aside and handed him a small gift. He said: "Within this gift is all you really need to know to have a happy marriage." The nervous young man fumbled with the paper and ribbon until he got the package unwrapped. Within the box lay a large gold watch. With great care he picked it up. Upon close examination he saw etched across the face of the watch a prudent reminder he would see whenever he checked the time of day... words that, if heeded, held the secret to a successful marriage. They were, "Say something nice to Sarah."

Reverrend Chalfant 讲了一个有关一对正在庆祝金婚纪念日的老夫妇的故事。有人问这位丈夫他婚姻成功的秘诀是什么,和老人们一贯的做法一样,这位老绅士讲了一个故事。

他的妻子,Sarah,是他的初恋。他在一个孤儿院长大, 不论做什么事情都非常努力。在被 Sarah 迷住之前,他从来没有约会过。其实 Sarah 早就创造过求婚的机会给他。

婚礼那天,夫妻双方宣誓之后,Sarah 的爸爸把新郎叫到一边,给了他一个小礼物。他说:“你想知道的幸福婚姻密诀,就在这个礼物里”。紧张的年轻人笨手笨脚的打开了盒子,盒里装着一块大金表。他小心翼翼的拿起这块表, 仔细端详, 金表的表面上蚀刻着一句箴言, 他每次看时间的时候都能看到, 只要遵守它, 它就是成功婚姻的密诀。这句话是:“说 Sarah 爱听的话”。