Skip to content

Commit 32561bc

Browse files
author
jeffshumphreys@gmail.com
committed
New function! NearX, converting names to use X, S, and C suffixes so there aren't errors using a pattern function when looking for a string. Near copies the Lucene of context.
1 parent 098e336 commit 32561bc

25 files changed

+909
-338
lines changed

ActiveDirectory.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace MySQLCLRFunctions
1+
namespace MySQLCLRFunctions
82
{
93
public static class ActiveDirectory
104
{

Adaptors.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
using System;
2-
using System.Collections;
3-
using Microsoft.SqlServer.Server;
1+
using Microsoft.SqlServer.Server;
2+
using System;
43
using System.Data.SqlTypes;
5-
using System.Text.RegularExpressions;
6-
using System.Text;
7-
using System.Net.NetworkInformation;
8-
using System.Net;
9-
using System.Net.Sockets;
10-
using System.Linq;
11-
using System.IO;
12-
using System.Xml.Schema;
134
using System.Globalization;
145

156
namespace MySQLCLRFunctions

Compares.cs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
using System;
2-
using System.Collections;
3-
using Microsoft.SqlServer.Server;
4-
using System.Data.SqlTypes;
5-
using System.Text.RegularExpressions;
6-
using System.Text;
7-
using System.Net.NetworkInformation;
8-
using System.Net;
9-
using System.Net.Sockets;
1+
using Microsoft.SqlServer.Server;
2+
using System;
103
using System.Linq;
11-
using System.IO;
12-
using System.Xml.Schema;
134

145
namespace MySQLCLRFunctions
156
{
@@ -25,7 +16,7 @@ public static class Compares
2516
[SqlFunction(DataAccess = DataAccessKind.None, IsDeterministic = false, IsPrecise = true)]
2617
public static DateTime? Max3DateTimes(DateTime? d1, DateTime? d2, DateTime? d3)
2718
{
28-
DateTime?[] itemlist = new [] { d1, d2, d3 };
19+
DateTime?[] itemlist = new[] { d1, d2, d3 };
2920
return itemlist.Max();
3021
}
3122

Environmental.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
using System;
2-
using System.Collections;
3-
using Microsoft.SqlServer.Server;
4-
using System.Data.SqlTypes;
5-
using System.Text.RegularExpressions;
6-
using System.Text;
7-
using System.Net.NetworkInformation;
8-
using System.Net;
9-
using System.Net.Sockets;
10-
using System.Linq;
11-
using System.IO;
12-
using System.Xml.Schema;
1+
using Microsoft.SqlServer.Server;
2+
using System;
133

144
namespace MySQLCLRFunctions
155
{

FileNameExtract.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
using System;
2-
using System.Collections;
3-
using Microsoft.SqlServer.Server;
4-
using System.Data.SqlTypes;
5-
using System.Text.RegularExpressions;
6-
using System.Text;
7-
using System.Net.NetworkInformation;
8-
using System.Net;
9-
using System.Net.Sockets;
10-
using System.Linq;
1+
using Microsoft.SqlServer.Server;
112
using System.IO;
12-
using System.Xml.Schema;
13-
using System.Runtime.Remoting.Messaging;
3+
using System.Linq;
144

155
namespace MySQLCLRFunctions
166
{
@@ -42,7 +32,7 @@ public static string FileNameWithoutExtension(string fullfilepath)
4232
public static bool IsLegalFileName(string filenamewithoutext)
4333
{
4434
// http://stackoverflow.com/questions/1976007/ddg#31976060
45-
var invalidchars = new char[] {'/', '\\', '"', ':', '>', '<', '|', '?', '*'};
35+
var invalidchars = new char[] { '/', '\\', '"', ':', '>', '<', '|', '?', '*' };
4636

4737
if (filenamewithoutext.Any(c => char.IsControl(c) || invalidchars.Contains(c)))
4838
{

Files.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
using System;
2-
using System.Collections;
3-
using Microsoft.SqlServer.Server;
4-
using System.Data.SqlTypes;
5-
using System.Text.RegularExpressions;
6-
using System.Text;
7-
using System.Net.NetworkInformation;
8-
using System.Net;
9-
using System.Net.Sockets;
10-
using System.Linq;
1+
using Microsoft.SqlServer.Server;
112
using System.IO;
12-
using System.Xml.Schema;
13-
using System.Runtime.Remoting.Messaging;
143

154
namespace MySQLCLRFunctions
165
{

Humanization.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Microsoft.SqlServer.Server;
22
using System;
3-
using System.Linq;
43

54
namespace MySQLCLRFunctions
65
{
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('packages\NUnit.3.12.0\build\NUnit.props')" />
4+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
5+
<PropertyGroup>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<ProjectGuid>{6AEAE0BF-82E7-4793-8E9D-E649ABD0A807}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>MySQLCLRFunctions</RootNamespace>
12+
<AssemblyName>MySQLCLRFunctions</AssemblyName>
13+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<Deterministic>true</Deterministic>
16+
<TargetFrameworkProfile />
17+
<NuGetPackageImportStamp>
18+
</NuGetPackageImportStamp>
19+
</PropertyGroup>
20+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21+
<DebugSymbols>true</DebugSymbols>
22+
<DebugType>full</DebugType>
23+
<Optimize>false</Optimize>
24+
<OutputPath>bin\Debug\</OutputPath>
25+
<DefineConstants>DEBUG;TRACE</DefineConstants>
26+
<ErrorReport>prompt</ErrorReport>
27+
<WarningLevel>4</WarningLevel>
28+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
29+
</PropertyGroup>
30+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
31+
<DebugType>pdbonly</DebugType>
32+
<Optimize>true</Optimize>
33+
<OutputPath>bin\Release\</OutputPath>
34+
<DefineConstants>TRACE</DefineConstants>
35+
<ErrorReport>prompt</ErrorReport>
36+
<WarningLevel>4</WarningLevel>
37+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
38+
</PropertyGroup>
39+
<ItemGroup>
40+
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
41+
<HintPath>packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
42+
</Reference>
43+
<Reference Include="System" />
44+
<Reference Include="System.Core" />
45+
<Reference Include="System.Transactions" />
46+
<Reference Include="System.Xml.Linq" />
47+
<Reference Include="System.Data.DataSetExtensions" />
48+
<Reference Include="Microsoft.CSharp" />
49+
<Reference Include="System.Data" />
50+
<Reference Include="System.Net.Http" />
51+
<Reference Include="System.Xml" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<Compile Include="ActiveDirectory.cs" />
55+
<Compile Include="Adaptors.cs" />
56+
<Compile Include="Compares.cs" />
57+
<Compile Include="Environmental.cs" />
58+
<Compile Include="FileNameExtract.cs" />
59+
<Compile Include="Files.cs" />
60+
<Compile Include="Humanization.cs" />
61+
<Compile Include="NetworkCollect.cs" />
62+
<Compile Include="NetworkTest.cs" />
63+
<Compile Include="_SharedConstants.cs" />
64+
<Compile Include="StringBuildOut.cs" />
65+
<Compile Include="StringDecode.cs" />
66+
<Compile Include="StringExtract.cs" />
67+
<Compile Include="StringFormat.cs" />
68+
<Compile Include="StringMeasure.cs" />
69+
<Compile Include="StringPivot.cs" />
70+
<Compile Include="StringReduce.cs" />
71+
<Compile Include="StringTest.cs" />
72+
<Compile Include="StringTransform.cs" />
73+
<Compile Include="StringTransformStripDownCustomizations.cs" />
74+
<Compile Include="StringTransformTSQLSpecific.cs" />
75+
<Compile Include="Properties\AssemblyInfo.cs" />
76+
</ItemGroup>
77+
<ItemGroup>
78+
<None Include="packages.config" />
79+
</ItemGroup>
80+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
81+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
82+
<PropertyGroup>
83+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
84+
</PropertyGroup>
85+
<Error Condition="!Exists('packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\NUnit.3.12.0\build\NUnit.props'))" />
86+
</Target>
87+
</Project>
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<!DOCTYPE html>
2+
<!-- saved from url=(0014)about:internet -->
3+
4+
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt"><head><meta content="en-us" http-equiv="Content-Language" /><meta content="text/html; charset=utf-16" http-equiv="Content-Type" /><title _locID="NuGetUpgradeReportTitle">
5+
NuGetMigrationLog
6+
</title><style>
7+
8+
/* Body style, for the entire document */
9+
body
10+
{
11+
background: #F3F3F4;
12+
color: #1E1E1F;
13+
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
14+
font-size: 12pt;
15+
padding: 0;
16+
margin: 0;
17+
}
18+
19+
/* Header1 style, used for the main title */
20+
h1
21+
{
22+
padding: 10px 0px 10px 10px;
23+
font-size: 21pt;
24+
background-color: #E2E2E2;
25+
border-bottom: 1px #C1C1C2 solid;
26+
color: #201F20;
27+
margin: 0;
28+
font-weight: normal;
29+
}
30+
31+
/* Header2 style, used for "Overview" and other sections */
32+
h2
33+
{
34+
font-size: 18pt;
35+
font-weight: normal;
36+
padding: 15px 0 5px 0;
37+
margin: 0;
38+
}
39+
40+
/* Header3 style, used for sub-sections, such as project name */
41+
h3
42+
{
43+
font-weight: normal;
44+
font-size: 15pt;
45+
margin: 0;
46+
padding: 15px 0 5px 0;
47+
background-color: transparent;
48+
}
49+
50+
.info-text
51+
{
52+
margin: 0px 0 0.75em 0;
53+
}
54+
55+
/* Color all hyperlinks one color */
56+
a
57+
{
58+
color: #1382CE;
59+
}
60+
61+
/* Table styles */
62+
table
63+
{
64+
border-spacing: 0 0;
65+
border-collapse: collapse;
66+
font-size: 11pt;
67+
}
68+
69+
table th
70+
{
71+
background: #E7E7E8;
72+
text-align: left;
73+
text-decoration: none;
74+
font-weight: normal;
75+
padding: 3px 6px 3px 6px;
76+
}
77+
78+
table td
79+
{
80+
vertical-align: top;
81+
padding: 3px 6px 5px 5px;
82+
margin: 0px;
83+
border: 1px solid #E7E7E8;
84+
background: #F7F7F8;
85+
}
86+
87+
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
88+
.localLink
89+
{
90+
color: #1E1E1F;
91+
background: #EEEEED;
92+
text-decoration: none;
93+
}
94+
95+
.localLink:hover
96+
{
97+
color: #1382CE;
98+
background: #FFFF99;
99+
text-decoration: none;
100+
}
101+
102+
.issueCell
103+
{
104+
width: 100%;
105+
}
106+
107+
.packageIssue
108+
{
109+
margin-left: 25px;
110+
}
111+
112+
/* Padding around the content after the h1 */
113+
#content
114+
{
115+
padding: 0px 20px 20px 20px;
116+
}
117+
118+
.issues table
119+
{
120+
width: 97%;
121+
}
122+
123+
/* All Icons */
124+
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded
125+
{
126+
min-width:18px;
127+
min-height:18px;
128+
background-repeat:no-repeat;
129+
background-position:center;
130+
}
131+
132+
.IconSuccessEncoded
133+
{
134+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABcElEQVR4Xq2TsUsCURzHv15g8ZJcBWlyiYYgCIWcb9DFRRwMW5TA2c0/QEFwFkxxUQdxVlBwCYWOi6IhWgQhBLHJUCkhLr/BW8S7gvrAg+N+v8/v+x68Z8MGy+XSCyABQAXgBgHGALoASkIIDWSLeLBetdHryMjd5IxQPWT4rn1c/P7+xxp72Cs9m5SZ0Bq2vPnbPFafK2zDvmNHypdC0BPkLlQhxJsCAhQoZwdZU5mwxh720qGo8MzTxTTKZDPCx2HoVzp6lz0Q9tKhyx0kGs8Ny+TkWRKk8lCROwEduhyg9l/6lunOPSfmH3NUH6uQ0KHLAe7JYvJjevm+DAMGJHToKtigE+vwvIidxLamb8IBY9e+C5LiXREkfho3TSd06HJA13/oh6T51MTsfQbHrsMynQ5dDihFjiK8JJAU9AKIWTp76dCVN7HWHrajmUEGvyF9nkbAE6gLIS7kTUyuf2gscLoJrElZo/Mvj+nPz/kLTmfnEwP3tB0AAAAASUVORK5CYII=);
135+
}
136+
137+
.IconInfoEncoded
138+
{
139+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
140+
}
141+
142+
.IconWarningEncoded
143+
{
144+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
145+
}
146+
147+
.IconErrorEncoded
148+
{
149+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
150+
}
151+
152+
</style></head><body><h1>
153+
NuGet Migration Report - MySQLCLRFunctions</h1><div id="content"><h2 _locID="OverviewTitle">Overview</h2><div class="info-text">Migration to PackageReference was completed successfully. Please build and run your solution to verify that all packages are available.</div><div class="info-text">
154+
If you run into any problems, have feedback, questions, or concerns, please
155+
<a href="https://github.com/NuGet/Home/issues/">file an issue on the NuGet GitHub repository.</a></div><div class="info-text">
156+
Changed files and this report have been backed up here:
157+
<a href="C:\Users\humphrej2\source\repos\jeffshumphreys\MySQLCLRFunctions\MigrationBackup\3697b4fe\MySQLCLRFunctions">C:\Users\humphrej2\source\repos\jeffshumphreys\MySQLCLRFunctions\MigrationBackup\3697b4fe\MySQLCLRFunctions</a></div><div class="info-text"><a href="https://aka.ms/nuget-pc2pr-migrator-rollback">Help me rollback to packages.config</a></div><h2 _locID="PackagesTitle">Packages processed</h2><h3 _locID="IncludePackagesTitle">Top-level dependencies:</h3><div class="issues"><table><tr><th class="issueCell">Package Id</th><th>Version</th></tr><tr><td class="issueCell"><span>NUnit</span></td><td><span>
158+
v3.12.0</span></td></tr></table></div><p /><h3 _locID="IncludePackagesTitle">Transitive dependencies:</h3><div class="issues"><table><tr><th class="issueCell">Package Id</th><th>Version</th></tr><tr><td class="issueCell">
159+
No transitive dependencies found.
160+
</td><td /></tr></table></div><h2 _locID="IssuesTitle">Package compatibility issues</h2><div class="issues"><table><tr><th /><th class="issueCell" _locID="DescriptionTableHeader">Description</th></tr><tr><td class="IconInfoEncoded" /><td class="issueCell">
161+
No issues were found.
162+
</td></tr></table></div></div></body></html>

0 commit comments

Comments
 (0)