Monthly chores: Automated repo cleanup (#41604)
This commit is contained in:
Родитель
20ff04b81f
Коммит
80284a3937
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 30 KiB |
Двоичные данные
docs/architecture/maui/media/screenshot.png
Двоичные данные
docs/architecture/maui/media/screenshot.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 1.9 MiB |
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 310 KiB |
|
@ -180,6 +180,16 @@ items:
|
|||
href: ../../core/tools/dotnet-nuget-sign.md
|
||||
- name: dotnet nuget why
|
||||
href: ../../core/tools/dotnet-nuget-why.md
|
||||
- name: dotnet nuget config
|
||||
items:
|
||||
- name: dotnet nuget config get
|
||||
href: ../../core/tools/dotnet-nuget-config-get.md
|
||||
- name: dotnet nuget config set
|
||||
href: ../../core/tools/dotnet-nuget-config-set.md
|
||||
- name: dotnet nuget config unset
|
||||
href: ../../core/tools/dotnet-nuget-config-unset.md
|
||||
- name: dotnet nuget config paths
|
||||
href: ../../core/tools/dotnet-nuget-config-paths.md
|
||||
- name: dotnet pack
|
||||
href: ../../core/tools/dotnet-pack.md
|
||||
- name: dotnet package search
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
' Visual Basic .NET Document
|
||||
Option Strict On
|
||||
|
||||
' <Snippet5>
|
||||
Imports System.Diagnostics
|
||||
Imports System.IO
|
||||
Imports System.Text.RegularExpressions
|
||||
|
||||
Module Example
|
||||
Public Sub Main()
|
||||
Dim pattern As String = "\b(\w+((\r?\n)|,?\s))*\w+[.?:;!]"
|
||||
Dim sw As Stopwatch
|
||||
Dim match As Match
|
||||
Dim ctr As Integer
|
||||
|
||||
Dim inFile As New StreamReader(".\Dreiser_TheFinancier.txt")
|
||||
Dim input As String = inFile.ReadToEnd()
|
||||
inFile.Close()
|
||||
|
||||
' Read first ten sentences with interpreted regex.
|
||||
Console.WriteLine("10 Sentences with Interpreted Regex:")
|
||||
sw = Stopwatch.StartNew()
|
||||
Dim int10 As New Regex(pattern, RegexOptions.SingleLine)
|
||||
match = int10.Match(input)
|
||||
For ctr = 0 To 9
|
||||
If match.Success Then
|
||||
' Do nothing with the match except get the next match.
|
||||
match = match.NextMatch()
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
sw.Stop()
|
||||
Console.WriteLine(" {0} matches in {1}", ctr, sw.Elapsed)
|
||||
|
||||
' Read first ten sentences with compiled regex.
|
||||
Console.WriteLine("10 Sentences with Compiled Regex:")
|
||||
sw = Stopwatch.StartNew()
|
||||
Dim comp10 As New Regex(pattern,
|
||||
RegexOptions.SingleLine Or RegexOptions.Compiled)
|
||||
match = comp10.Match(input)
|
||||
For ctr = 0 To 9
|
||||
If match.Success Then
|
||||
' Do nothing with the match except get the next match.
|
||||
match = match.NextMatch()
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
sw.Stop()
|
||||
Console.WriteLine(" {0} matches in {1}", ctr, sw.Elapsed)
|
||||
|
||||
' Read all sentences with interpreted regex.
|
||||
Console.WriteLine("All Sentences with Interpreted Regex:")
|
||||
sw = Stopwatch.StartNew()
|
||||
Dim intAll As New Regex(pattern, RegexOptions.SingleLine)
|
||||
match = intAll.Match(input)
|
||||
Dim matches As Integer = 0
|
||||
Do While match.Success
|
||||
matches += 1
|
||||
' Do nothing with the match except get the next match.
|
||||
match = match.NextMatch()
|
||||
Loop
|
||||
sw.Stop()
|
||||
Console.WriteLine(" {0:N0} matches in {1}", matches, sw.Elapsed)
|
||||
|
||||
' Read all sentences with compiled regex.
|
||||
Console.WriteLine("All Sentences with Compiled Regex:")
|
||||
sw = Stopwatch.StartNew()
|
||||
Dim compAll As New Regex(pattern,
|
||||
RegexOptions.SingleLine Or RegexOptions.Compiled)
|
||||
match = compAll.Match(input)
|
||||
matches = 0
|
||||
Do While match.Success
|
||||
matches += 1
|
||||
' Do nothing with the match except get the next match.
|
||||
match = match.NextMatch()
|
||||
Loop
|
||||
sw.Stop()
|
||||
Console.WriteLine(" {0:N0} matches in {1}", matches, sw.Elapsed)
|
||||
End Sub
|
||||
End Module
|
||||
' The example displays output like the following:
|
||||
' 10 Sentences with Interpreted Regex:
|
||||
' 10 matches in 00:00:00.0047491
|
||||
' 10 Sentences with Compiled Regex:
|
||||
' 10 matches in 00:00:00.0141872
|
||||
' All Sentences with Interpreted Regex:
|
||||
' 13,443 matches in 00:00:01.1929928
|
||||
' All Sentences with Compiled Regex:
|
||||
' 13,443 matches in 00:00:00.7635869
|
||||
'
|
||||
' >compare1
|
||||
' 10 Sentences with Interpreted Regex:
|
||||
' 10 matches in 00:00:00.0046914
|
||||
' 10 Sentences with Compiled Regex:
|
||||
' 10 matches in 00:00:00.0143727
|
||||
' All Sentences with Interpreted Regex:
|
||||
' 13,443 matches in 00:00:01.1514100
|
||||
' All Sentences with Compiled Regex:
|
||||
' 13,443 matches in 00:00:00.7432921
|
||||
' </Snippet5>
|
|
@ -1,20 +0,0 @@
|
|||
' Visual Basic .NET Document
|
||||
Option Strict On
|
||||
|
||||
' <Snippet6>
|
||||
Imports System.Reflection
|
||||
Imports System.Text.RegularExpressions
|
||||
|
||||
Module Example
|
||||
Public Sub Main()
|
||||
Dim SentencePattern As New RegexCompilationInfo("\b(\w+((\r?\n)|,?\s))*\w+[.?:;!]",
|
||||
RegexOptions.Multiline,
|
||||
"SentencePattern",
|
||||
"Utilities.RegularExpressions",
|
||||
True)
|
||||
Dim regexes() As RegexCompilationInfo = {SentencePattern}
|
||||
Dim assemName As New AssemblyName("RegexLib, Version=1.0.0.1001, Culture=neutral, PublicKeyToken=null")
|
||||
Regex.CompileToAssembly(regexes, assemName)
|
||||
End Sub
|
||||
End Module
|
||||
' </Snippet6>
|
|
@ -1,31 +0,0 @@
|
|||
' Visual Basic .NET Document
|
||||
Option Strict On
|
||||
|
||||
' <Snippet7>
|
||||
Imports System.IO
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports Utilities.RegularExpressions
|
||||
|
||||
Module Example
|
||||
Public Sub Main()
|
||||
Dim pattern As New SentencePattern()
|
||||
Dim inFile As New StreamReader(".\Dreiser_TheFinancier.txt")
|
||||
Dim input As String = inFile.ReadToEnd()
|
||||
inFile.Close()
|
||||
|
||||
Dim matches As MatchCollection = pattern.Matches(input)
|
||||
Console.WriteLine("Found {0:N0} sentences.", matches.Count)
|
||||
End Sub
|
||||
End Module
|
||||
' The example displays the following output:
|
||||
' Found 13,443 sentences.
|
||||
' </Snippet7>
|
||||
|
||||
' This code is here so that Parsnip will compile the example.
|
||||
Namespace Utilities.RegularExpressions
|
||||
Public Class SentencePattern
|
||||
Public Function Matches(input As String) As MatchCollection
|
||||
return Nothing
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
Загрузка…
Ссылка в новой задаче