commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
c670356b3ff2afe13648ed35e17163a6056f3aff
Add comment
nunit/nunit-console,nunit/nunit-console,nunit/nunit-console
src/NUnitEngine/nunit.engine/Properties/AssemblyInfo.cs
src/NUnitEngine/nunit.engine/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. #if NETSTANDARD1_3 [assembly: AssemblyTitle("NUnit .NET Standard Engine")] [assembly: AssemblyDescription("Provides a common interface for loading, exploring and running NUnit tests in .NET Core and .NET Standard")] #else [assembly: AssemblyTitle("NUnit Engine")] [assembly: AssemblyDescription("Provides a common interface for loading, exploring and running NUnit tests")] #endif [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("5796938b-03c9-4b75-8b43-89a8adc4acd0")] [assembly: InternalsVisibleTo("nunit.engine.tests, PublicKey="+ "002400000480000094000000060200000024000052534131000400000100010031eea370b1984b" + "fa6d1ea760e1ca6065cee41a1a279ca234933fe977a096222c0e14f9e5a17d5689305c6d7f1206"+ "a85a53c48ca010080799d6eeef61c98abd18767827dc05daea6b6fbd2e868410d9bee5e972a004"+ "ddd692dec8fa404ba4591e847a8cf35de21c2d3723bc8d775a66b594adeb967537729fe2a446b5"+ "48cd57a6")] //Allow NSubstitute to mock out internal types [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=002400000480000094" + "0000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602" + "f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac" + "1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924c" + "ceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. #if NETSTANDARD1_3 [assembly: AssemblyTitle("NUnit .NET Standard Engine")] [assembly: AssemblyDescription("Provides a common interface for loading, exploring and running NUnit tests in .NET Core and .NET Standard")] #else [assembly: AssemblyTitle("NUnit Engine")] [assembly: AssemblyDescription("Provides a common interface for loading, exploring and running NUnit tests")] #endif [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("5796938b-03c9-4b75-8b43-89a8adc4acd0")] [assembly: InternalsVisibleTo("nunit.engine.tests, PublicKey="+ "002400000480000094000000060200000024000052534131000400000100010031eea370b1984b" + "fa6d1ea760e1ca6065cee41a1a279ca234933fe977a096222c0e14f9e5a17d5689305c6d7f1206"+ "a85a53c48ca010080799d6eeef61c98abd18767827dc05daea6b6fbd2e868410d9bee5e972a004"+ "ddd692dec8fa404ba4591e847a8cf35de21c2d3723bc8d775a66b594adeb967537729fe2a446b5"+ "48cd57a6")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=002400000480000094" + "0000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602" + "f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac" + "1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924c" + "ceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
mit
C#
16f4afad275ec98b8636ccba06a492fa6cc12746
Update version number on each call. Build-State records the original state and is not updated during the release build cycle.
RabbitStewDio/AutoCake,RabbitStewDio/AutoCake
release.cake
release.cake
#load "src/AutoCake.Release/dependencies.cake" #load "src/AutoCake.Release/release-tasks.cake" #load "src/AutoCake.Release/git-tasks.cake" ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Attempt-Release"); GitFlow.RunBuildTarget = () => { // See release-scripts/README.md for additional configuration options // and details on the syntax of this call. var versionInfo = GitVersioningAliases.FetchVersion(); CakeRunnerAlias.RunCake(Context, new CakeSettings { Arguments = new Dictionary<string, string>() { { "targetdir", "build-artefacts/" + versionInfo.FullSemVer } } }); }; var target = Argument("target", "Default"); RunTarget(target);
#load "src/AutoCake.Release/dependencies.cake" #load "src/AutoCake.Release/release-tasks.cake" #load "src/AutoCake.Release/git-tasks.cake" ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Attempt-Release"); GitFlow.RunBuildTarget = () => { // See release-scripts/README.md for additional configuration options // and details on the syntax of this call. CakeRunnerAlias.RunCake(Context, new CakeSettings { Arguments = new Dictionary<string, string>() { { "targetdir", "build-artefacts/" + GitFlow.State.Version.FullSemVer } } }); }; var target = Argument("target", "Default"); RunTarget(target);
mit
C#
390d27c1829e492ac65499e4a1c52d8a1ba98942
Update ViewController.cs
IdentityModel/IdentityModel.OidcClient.Samples,IdentityModel/IdentityModel.OidcClient.Samples
iOSClient/iOSClient/ViewController.cs
iOSClient/iOSClient/ViewController.cs
using System; using System.Text; using IdentityModel.OidcClient; using UIKit; using Foundation; using System.Net.Http; using Newtonsoft.Json.Linq; namespace iOSClient { public partial class ViewController : UIViewController { SafariServices.SFSafariViewController safari; OidcClient _client; AuthorizeState _state; HttpClient _apiClient; public ViewController (IntPtr handle) : base (handle) { } public override void ViewDidLoad () { base.ViewDidLoad (); CallApiButton.Enabled = false; LoginButton.TouchUpInside += LoginButton_TouchUpInside; CallApiButton.TouchUpInside += CallApiButton_TouchUpInside; } async void LoginButton_TouchUpInside (object sender, EventArgs e) { var authority = "https://demo.identityserver.io"; var options = new OidcClientOptions ( authority, "native.hybrid", "secret", "openid profile email api", "io.identitymodel.native://callback"); _client = new OidcClient (options); _state = await _client.PrepareLoginAsync (); AppDelegate.CallbackHandler = HandleCallback; safari = new SafariServices.SFSafariViewController (new NSUrl (_state.StartUrl)); this.PresentViewController (safari, true, null); } async void CallApiButton_TouchUpInside (object sender, EventArgs e) { if (_apiClient == null) { return; } var result = await _apiClient.GetAsync ("identity"); var content = await result.Content.ReadAsStringAsync (); if (!result.IsSuccessStatusCode) { OutputTextView.Text = result.ReasonPhrase + "\n\n" + content; return; } OutputTextView.Text = JArray.Parse (content).ToString (); } async void HandleCallback (string url) { await safari.DismissViewControllerAsync (true); var result = await _client.ValidateResponseAsync (url, _state); var sb = new StringBuilder (128); foreach (var claim in result.Claims) { sb.AppendFormat ("{0}: {1}\n", claim.Type, claim.Value); } sb.AppendFormat ("\n{0}: {1}\n", "refresh token", result.RefreshToken); sb.AppendFormat ("\n{0}: {1}\n", "access token", result.AccessToken); OutputTextView.Text = sb.ToString (); _apiClient = new HttpClient (); _apiClient.SetBearerToken (result.AccessToken); _apiClient.BaseAddress = new Uri ("https://api.identityserver.io"); CallApiButton.Enabled = true; } public override void DidReceiveMemoryWarning () { base.DidReceiveMemoryWarning (); // Release any cached data, images, etc that aren't in use. } } }
using System; using System.Text; using IdentityModel.OidcClient; using UIKit; using Foundation; using System.Net.Http; using Newtonsoft.Json.Linq; namespace iOSClient { public partial class ViewController : UIViewController { SafariServices.SFSafariViewController safari; OidcClient _client; AuthorizeState _state; HttpClient _apiClient; public ViewController (IntPtr handle) : base (handle) { } public override void ViewDidLoad () { base.ViewDidLoad (); LoginButton.TouchUpInside += LoginButton_TouchUpInside; CallApiButton.TouchUpInside += CallApiButton_TouchUpInside; } async void LoginButton_TouchUpInside (object sender, EventArgs e) { var authority = "https://demo.identityserver.io"; var options = new OidcClientOptions ( authority, "native", "secret", "openid profile api", "io.identitymodel.native://callback"); _client = new OidcClient(options); _state = await _client.PrepareLoginAsync(); AppDelegate.CallbackHandler = HandleCallback; safari = new SafariServices.SFSafariViewController (new NSUrl (_state.StartUrl)); this.PresentViewController (safari, true, null); } async void CallApiButton_TouchUpInside (object sender, EventArgs e) { if (_apiClient == null) { return; } var result = await _apiClient.GetAsync("test"); if (!result.IsSuccessStatusCode) { OutputTextView.Text = result.ReasonPhrase; return; } var content = await result.Content.ReadAsStringAsync (); OutputTextView.Text = JArray.Parse (content).ToString (); } async void HandleCallback(string url) { await safari.DismissViewControllerAsync (true); var result = await _client.ValidateResponseAsync (url, _state); var sb = new StringBuilder (128); foreach (var claim in result.Claims) { sb.AppendFormat ("{0}: {1}\n", claim.Type, claim.Value); } sb.AppendFormat ("\n{0}: {1}\n", "refresh token", result.RefreshToken); sb.AppendFormat ("\n{0}: {1}\n", "access token", result.AccessToken); OutputTextView.Text = sb.ToString (); _apiClient = new HttpClient (); _apiClient.SetBearerToken (result.AccessToken); _apiClient.BaseAddress = new Uri ("https://demo.identityserver.io/api/"); } public override void DidReceiveMemoryWarning () { base.DidReceiveMemoryWarning (); // Release any cached data, images, etc that aren't in use. } } }
apache-2.0
C#
4359b30ae33a69bc3d2f1b4af3c77050ed5e5c6a
Add Microsoft's Nuget Package Source
ApplETS/ETSMobile-WindowsPlatforms,ApplETS/ETSMobile-WindowsPlatforms
build.cake
build.cake
////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// // Solution var rootFolder = "./Ets.Mobile"; var solutionPath = rootFolder + "/Ets.Mobile.WindowsPhone.sln"; var allProjectsBinPath = rootFolder + "/**/bin"; // Tests var testFolder = rootFolder + "/Ets.Mobile.Tests/"; var testProjects = new List<string>() { "Ets.Mobile.Client.Tests/Ets.Mobile.Client.Tests.csproj" }; var testBinPath = testFolder + "Ets.Mobile.Client.Tests/bin"; // Configurations var target = Argument("target", "Default"); var releaseConfiguration = Argument("configuration", "Release"); ////////////////////////////////////////////////////////////////////// // PREPARATION ////////////////////////////////////////////////////////////////////// // Define directories for tests. for(var ind = 0; ind < testProjects.Count; ind++) { testProjects[ind] = testFolder + testProjects[ind]; } ////////////////////////////////////////////////////////////////////// // TASKS ////////////////////////////////////////////////////////////////////// Task("Clean") .Does(() => { CleanDirectories(allProjectsBinPath); }); Task("Restore-NuGet-Packages") .IsDependentOn("Clean") .Does(() => { NuGetRestore(solutionPath, new NuGetRestoreSettings() { Source = new List<string>() { "https://api.nuget.org/v3/index.json", "https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/", "http://nuget.syncfusion.com/MzAwMTE1LDEz", "http://nuget.syncfusion.com/MzAwMTE1LDEw" } }); }); Task("Build") .IsDependentOn("Restore-NuGet-Packages") .Does(() => { // Since we use AppVeyor (with Windows Env), we'll use MSBuild MSBuild(solutionPath, settings => settings .SetConfiguration(releaseConfiguration) .SetPlatformTarget(PlatformTarget.ARM) ); // Build test projects in x86 foreach(var project in testProjects) { MSBuild(project, settings => settings .SetConfiguration(releaseConfiguration) .SetPlatformTarget(PlatformTarget.x86) .SetMSBuildPlatform(MSBuildPlatform.x86) ); } }); Task("Run-Unit-Tests") .IsDependentOn("Build") .Does(() => { XUnit2(testBinPath + "/x86/" + releaseConfiguration + "/*.Tests.dll", new XUnit2Settings { ToolPath = "./tools/xunit.runner.console/tools/xunit.console.x86.exe" }); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Run-Unit-Tests"); ////////////////////////////////////////////////////////////////////// // EXECUTION ////////////////////////////////////////////////////////////////////// RunTarget(target);
////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// // Solution var rootFolder = "./Ets.Mobile"; var solutionPath = rootFolder + "/Ets.Mobile.WindowsPhone.sln"; var allProjectsBinPath = rootFolder + "/**/bin"; // Tests var testFolder = rootFolder + "/Ets.Mobile.Tests/"; var testProjects = new List<string>() { "Ets.Mobile.Client.Tests/Ets.Mobile.Client.Tests.csproj" }; var testBinPath = testFolder + "Ets.Mobile.Client.Tests/bin"; // Configurations var target = Argument("target", "Default"); var releaseConfiguration = Argument("configuration", "Release"); ////////////////////////////////////////////////////////////////////// // PREPARATION ////////////////////////////////////////////////////////////////////// // Define directories for tests. for(var ind = 0; ind < testProjects.Count; ind++) { testProjects[ind] = testFolder + testProjects[ind]; } ////////////////////////////////////////////////////////////////////// // TASKS ////////////////////////////////////////////////////////////////////// Task("Clean") .Does(() => { CleanDirectories(allProjectsBinPath); }); Task("Restore-NuGet-Packages") .IsDependentOn("Clean") .Does(() => { NuGetRestore(solutionPath, new NuGetRestoreSettings() { Source = new List<string>() { "https://api.nuget.org/v3/index.json", "http://nuget.syncfusion.com/MzAwMTE1LDEz", "http://nuget.syncfusion.com/MzAwMTE1LDEw" } }); }); Task("Build") .IsDependentOn("Restore-NuGet-Packages") .Does(() => { // Since we use AppVeyor (with Windows Env), we'll use MSBuild MSBuild(solutionPath, settings => settings .SetConfiguration(releaseConfiguration) .SetPlatformTarget(PlatformTarget.ARM) ); // Build test projects in x86 foreach(var project in testProjects) { MSBuild(project, settings => settings .SetConfiguration(releaseConfiguration) .SetPlatformTarget(PlatformTarget.x86) .SetMSBuildPlatform(MSBuildPlatform.x86) ); } }); Task("Run-Unit-Tests") .IsDependentOn("Build") .Does(() => { XUnit2(testBinPath + "/x86/" + releaseConfiguration + "/*.Tests.dll", new XUnit2Settings { ToolPath = "./tools/xunit.runner.console/tools/xunit.console.x86.exe" }); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Run-Unit-Tests"); ////////////////////////////////////////////////////////////////////// // EXECUTION ////////////////////////////////////////////////////////////////////// RunTarget(target);
apache-2.0
C#
2fb2ecdb82e073386825fd47cd1cf894813a23ce
Tweak cake
danielwertheim/mynatsclient,danielwertheim/mynatsclient
build.cake
build.cake
#tool "nuget:?package=NUnit.ConsoleRunner" #load "./buildconfig.cake" var config = BuildConfig.Create(Context, BuildSystem); Func<string, string> projectOutDir = project => string.Format("{0}{1}.{2}", config.OutDir, project, config.SemVer); Task("Default") .IsDependentOn("InitOutDir") .IsDependentOn("NuGet-Restore") .IsDependentOn("AssemblyVersion") .IsDependentOn("Build") .IsDependentOn("UnitTests") .IsDependentOn("Copy") .IsDependentOn("NuGet-Pack"); //assinfo, nuget-pack Task("InitOutDir") .Does(() => { EnsureDirectoryExists(config.OutDir); CleanDirectory(config.OutDir); }); Task("NuGet-Restore") .Does(() => NuGetRestore(config.SolutionPath)); Task("AssemblyVersion").Does(() => { var file = config.SrcDir + "GlobalAssemblyVersion.cs"; var info = ParseAssemblyInfo(file); CreateAssemblyInfo(file, new AssemblyInfoSettings { Version = config.BuildVersion, InformationalVersion = config.SemVer }); }); Task("Build").Does(() => { MSBuild(config.SolutionPath, new MSBuildSettings { Verbosity = Verbosity.Minimal, ToolVersion = MSBuildToolVersion.VS2015, Configuration = config.BuildProfile, PlatformTarget = PlatformTarget.MSIL }.WithTarget("Rebuild")); }); Task("UnitTests").Does(() => { NUnit3(config.SrcDir + "**/*.UnitTests/bin/" + config.BuildProfile + "/*.UnitTests.dll", new NUnit3Settings { NoResults = true, NoHeader = true, TeamCity = config.IsTeamCityBuild }); }); Task("IntegrationTests").Does(() => { NUnit3(config.SrcDir + "**/*.IntegrationTests/bin/" + config.BuildProfile + "/*.IntegrationTests.dll", new NUnit3Settings { NoResults = true, NoHeader = true, TeamCity = config.IsTeamCityBuild }); }); Task("Copy").Does(() => { foreach(var project in config.Projects){ var trg = projectOutDir(project); CreateDirectory(trg); CopyFiles( string.Format("{0}{1}/bin/{2}/{1}.*", config.SrcDir, project, config.BuildProfile), trg); } }); Task("NuGet-Pack").Does(() => { foreach(var project in config.Projects){ NuGetPack(config.SrcDir + project + ".nuspec", new NuGetPackSettings { Version = config.SemVer, BasePath = projectOutDir(project), OutputDirectory = config.OutDir }); } }); RunTarget(config.Target);
#tool "nuget:?package=NUnit.ConsoleRunner" #load "./buildconfig.cake" var config = BuildConfig.Create(Context, BuildSystem); Func<string, string> projectOutDir = project => string.Format("{0}{1}.v{2}", config.OutDir, project, config.SemVer); Task("Default") .IsDependentOn("InitOutDir") .IsDependentOn("NuGet-Restore") .IsDependentOn("AssemblyVersion") .IsDependentOn("Build") .IsDependentOn("UnitTests") .IsDependentOn("Copy") .IsDependentOn("NuGet-Pack"); //assinfo, nuget-pack Task("InitOutDir") .Does(() => { EnsureDirectoryExists(config.OutDir); CleanDirectory(config.OutDir); }); Task("NuGet-Restore") .Does(() => NuGetRestore(config.SolutionPath)); Task("AssemblyVersion").Does(() => { var file = config.SrcDir + "GlobalAssemblyVersion.cs"; var info = ParseAssemblyInfo(file); CreateAssemblyInfo(file, new AssemblyInfoSettings { Version = config.BuildVersion, InformationalVersion = config.SemVer }); }); Task("Build").Does(() => { MSBuild(config.SolutionPath, new MSBuildSettings { Verbosity = Verbosity.Minimal, ToolVersion = MSBuildToolVersion.VS2015, Configuration = config.BuildProfile, PlatformTarget = PlatformTarget.MSIL }.WithTarget("Rebuild")); }); Task("UnitTests").Does(() => { NUnit3(config.SrcDir + "**/*.UnitTests/bin/" + config.BuildProfile + "/*.UnitTests.dll", new NUnit3Settings { NoResults = true, NoHeader = true, TeamCity = config.IsTeamCityBuild }); }); Task("IntegrationTests").Does(() => { NUnit3(config.SrcDir + "**/*.IntegrationTests/bin/" + config.BuildProfile + "/*.IntegrationTests.dll", new NUnit3Settings { NoResults = true, NoHeader = true, TeamCity = config.IsTeamCityBuild }); }); Task("Copy").Does(() => { foreach(var project in config.Projects){ var trg = projectOutDir(project); CreateDirectory(trg); CopyFiles( string.Format("{0}{1}/bin/{2}/{1}.*", config.SrcDir, project, config.BuildProfile), trg); } }); Task("NuGet-Pack").Does(() => { foreach(var project in config.Projects){ NuGetPack(config.SrcDir + project + ".nuspec", new NuGetPackSettings { Version = config.SemVer, BasePath = projectOutDir(project), OutputDirectory = config.OutDir }); } }); RunTarget(config.Target);
mit
C#
648d96aa91189f4d8a491810896fcecab3f43b4e
Update build.cake
davetimmins/Anywhere.ArcGIS,davetimmins/Anywhere.ArcGIS
build.cake
build.cake
using System.Text.RegularExpressions; #tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0 ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); var solution = "./Anywhere.ArcGIS.sln"; var version = "1.11.1"; var versionSuffix = Environment.GetEnvironmentVariable("VERSION_SUFFIX"); ////////////////////////////////////////////////////////////////////// // PREPARATION ////////////////////////////////////////////////////////////////////// // Define directories. var buildDir = Directory("./src/Anywhere.ArcGIS/bin") + Directory(configuration); var artifactDir = Directory("./artifacts"); var outputDir = artifactDir + Directory("output"); ////////////////////////////////////////////////////////////////////// // TASKS ////////////////////////////////////////////////////////////////////// Task("Build") .IsDependentOn("Update-Version") .Does(() => { DotNetCoreBuild( solution, new DotNetCoreBuildSettings { Configuration = configuration, ArgumentCustomization = args => args.Append($"/p:CI=true /v:n"), OutputDirectory = outputDir }); }); Task("Clean") .Does(() => { CleanDirectory(buildDir); CleanDirectory(artifactDir); }); Task("Restore") .IsDependentOn("Clean") .Does(() => { DotNetCoreRestore(solution); }); Task("Test") .IsDependentOn("Build") .Does(() => { var projects = GetFiles("./tests/**/*.csproj"); foreach(var project in projects) { DotNetCoreTool( projectPath: project.FullPath, command: "xunit", arguments: $"-configuration {configuration} -diagnostics -stoponfail" ); } }); Task("Update-Version") .IsDependentOn("Restore") .Does(() => { Information("Setting version to " + version + versionSuffix); var file = GetFiles("./src/Anywhere.ArcGIS/Anywhere.ArcGIS.csproj").First(); var project = System.IO.File.ReadAllText(file.FullPath, Encoding.UTF8); var projectVersion = new Regex(@"<Version>.+<\/Version>"); project = projectVersion.Replace(project, string.Concat("<Version>", version + versionSuffix, "</Version>")); System.IO.File.WriteAllText(file.FullPath, project, Encoding.UTF8); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Build"); ////////////////////////////////////////////////////////////////////// // EXECUTION ////////////////////////////////////////////////////////////////////// RunTarget(target);
using System.Text.RegularExpressions; #tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0 ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); var solution = "./Anywhere.ArcGIS.sln"; var version = "1.11.0"; var versionSuffix = Environment.GetEnvironmentVariable("VERSION_SUFFIX"); ////////////////////////////////////////////////////////////////////// // PREPARATION ////////////////////////////////////////////////////////////////////// // Define directories. var buildDir = Directory("./src/Anywhere.ArcGIS/bin") + Directory(configuration); var artifactDir = Directory("./artifacts"); var outputDir = artifactDir + Directory("output"); ////////////////////////////////////////////////////////////////////// // TASKS ////////////////////////////////////////////////////////////////////// Task("Build") .IsDependentOn("Update-Version") .Does(() => { DotNetCoreBuild( solution, new DotNetCoreBuildSettings { Configuration = configuration, ArgumentCustomization = args => args.Append($"/p:CI=true /v:n"), OutputDirectory = outputDir }); }); Task("Clean") .Does(() => { CleanDirectory(buildDir); CleanDirectory(artifactDir); }); Task("Restore") .IsDependentOn("Clean") .Does(() => { DotNetCoreRestore(solution); }); Task("Test") .IsDependentOn("Build") .Does(() => { var projects = GetFiles("./tests/**/*.csproj"); foreach(var project in projects) { DotNetCoreTool( projectPath: project.FullPath, command: "xunit", arguments: $"-configuration {configuration} -diagnostics -stoponfail" ); } }); Task("Update-Version") .IsDependentOn("Restore") .Does(() => { Information("Setting version to " + version + versionSuffix); var file = GetFiles("./src/Anywhere.ArcGIS/Anywhere.ArcGIS.csproj").First(); var project = System.IO.File.ReadAllText(file.FullPath, Encoding.UTF8); var projectVersion = new Regex(@"<Version>.+<\/Version>"); project = projectVersion.Replace(project, string.Concat("<Version>", version + versionSuffix, "</Version>")); System.IO.File.WriteAllText(file.FullPath, project, Encoding.UTF8); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Build"); ////////////////////////////////////////////////////////////////////// // EXECUTION ////////////////////////////////////////////////////////////////////// RunTarget(target);
mit
C#
e71f702bb8a40a4e04cf424377bd3de5acbcb2f2
Change SUCCESSFUL to SUCCEDDED in SkillStatusState
stoiveyp/Alexa.NET.Management
Alexa.NET.Management/Skills/SkillStatusState.cs
Alexa.NET.Management/Skills/SkillStatusState.cs
namespace Alexa.NET.Management.Skills { public enum SkillStatusState { IN_PROGRESS, FAILED, SUCCEEDED } }
namespace Alexa.NET.Management.Skills { public enum SkillStatusState { IN_PROGRESS, FAILED, SUCCESSFUL } }
mit
C#
f642704ff3d86f69d5012900d6f4085eac1a6707
allow documentation of if statements
toontown-archive/Krypton.LibProtocol
Krypton.LibProtocol/Src/Member/Statement/IfStatement.cs
Krypton.LibProtocol/Src/Member/Statement/IfStatement.cs
using System.Collections.Generic; using System.Collections.ObjectModel; using Krypton.LibProtocol.Member.Common; using Krypton.LibProtocol.Member.Expression; using Krypton.LibProtocol.Target; namespace Krypton.LibProtocol.Member.Statement { public class IfStatement : IExpressiveStatementContainer, IStatement, IDocumentable, ITemplateType { public string TemplateName => "if_statement"; public IStatementContainer Parent { get; } public IEnumerable<IStatement> Statements { get; } private IList<IStatement> _statements = new List<IStatement>(); public IList<IExpression> Expressions { get; } private IList<IExpression> _expressions = new List<IExpression>(); public Documentation Documentation { get; private set; } public IfStatement(IStatementContainer parent) { Parent = parent; Statements = new ReadOnlyCollection<IStatement>(_statements); Expressions = new ReadOnlyCollection<IExpression>(_expressions); } public void AddStatement(IStatement statement) { _statements.Add(statement); } public void AddExpresion(IExpression expression) { _expressions.Add(expression); } public void SetDocumentation(Documentation documentation) { Documentation = documentation; } } }
using System.Collections.Generic; using System.Collections.ObjectModel; using Krypton.LibProtocol.Member.Expression; using Krypton.LibProtocol.Target; namespace Krypton.LibProtocol.Member.Statement { public class IfStatement : IExpressiveStatementContainer, IStatement, ITemplateType { public string TemplateName => "if_statement"; public IStatementContainer Parent { get; } public IEnumerable<IStatement> Statements { get; } private IList<IStatement> _statements = new List<IStatement>(); public IList<IExpression> Expressions { get; } private IList<IExpression> _expressions = new List<IExpression>(); public IfStatement(IStatementContainer parent) { Parent = parent; Statements = new ReadOnlyCollection<IStatement>(_statements); Expressions = new ReadOnlyCollection<IExpression>(_expressions); } public void AddStatement(IStatement statement) { _statements.Add(statement); } public void AddExpresion(IExpression expression) { _expressions.Add(expression); } } }
mit
C#
b9db982c18ed4423f8f60947eba6faec780c8397
Load images in the test folder
fraxedas/photo,fraxedas/photo
src/photo.exif.unit.test/ParserTest.cs
src/photo.exif.unit.test/ParserTest.cs
using System; using System.IO; using System.Linq; using NUnit.Framework; namespace photo.exif.unit.test { public class ParserTest { public ParserTest() { _parser = new Parser(); } private readonly Parser _parser; static string[] paths = Directory.GetFiles( Environment.CurrentDirectory, "*.jpg", SearchOption.AllDirectories); [Test, TestCaseSource("paths")] public void Test_parse_path_return_some_data(string path) { var data = _parser.Parse(path); data.ToList().ForEach(Console.WriteLine); Assert.That(data, Is.Not.Null); Assert.That(data, Is.Not.Empty); } [Test, TestCaseSource("paths")] public void Test_parse_stream_return_some_data(string path) { var data = _parser.Parse(new FileStream(path,FileMode.Open)); data.ToList().ForEach(Console.WriteLine); Assert.That(data, Is.Not.Null); Assert.That(data, Is.Not.Empty); } } }
using System; using System.IO; using System.Linq; using NUnit.Framework; namespace photo.exif.unit.test { [TestFixture("Images/Canon PowerShot SX500 IS.JPG")] [TestFixture("Images/Nikon COOLPIX P510.JPG")] [TestFixture("Images/Panasonic Lumix DMC-FZ200.JPG")] [TestFixture("Images/Samsung SIII.jpg")] public class ParserTest { public ParserTest(string path) { _path = path; _parser = new Parser(); } private readonly string _path; private readonly Parser _parser; [Test] public void Test_parse_path_return_some_data() { var data = _parser.Parse(_path); data.ToList().ForEach(Console.WriteLine); Assert.That(data, Is.Not.Null); Assert.That(data, Is.Not.Empty); } [Test] public void Test_parse_stream_return_some_data() { var data = _parser.Parse(new FileStream(_path,FileMode.Open)); data.ToList().ForEach(Console.WriteLine); Assert.That(data, Is.Not.Null); Assert.That(data, Is.Not.Empty); } } }
mit
C#
c1e328feb4577a9d86c3ed70eee773635b16aac7
Drop special support for "default" target.
ejball/ArgsReading
tools/BuildTools/BuildRunner.cs
tools/BuildTools/BuildRunner.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.CompilerServices; using McMaster.Extensions.CommandLineUtils; namespace BuildTools { public static class BuildRunner { public static int Execute(string[] args, Action<BuildApp> initialize, string scriptPath = null, [CallerFilePath] string callerFilePath = null) { string scriptDirectory = Path.GetDirectoryName(scriptPath ?? callerFilePath); string buildDirectory = Path.GetFullPath(Path.Combine(scriptDirectory ?? ".", "..", "..")); Directory.SetCurrentDirectory(buildDirectory); var commandLineApp = new CommandLineApplication(); var buildApp = new BuildApp(commandLineApp); initialize(buildApp); var helpFlag = buildApp.AddFlag("-h|-?|--help", "Show build help"); var targetsArgument = commandLineApp.Argument("targets", "The targets to build", multipleValues: true); commandLineApp.OnExecute(() => { var targets = targetsArgument.Values; if (helpFlag.Value || targets.Count == 0) { commandLineApp.ShowHelp(); ShowTargets(buildApp.Targets); } else { buildApp.RunTargets(targets); } }); return commandLineApp.Execute(args); } private static void ShowTargets(IReadOnlyList<BuildTarget> targets) { Console.WriteLine("Targets:"); foreach (var target in targets) Console.WriteLine(" {0}", target.Name); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.CompilerServices; using McMaster.Extensions.CommandLineUtils; namespace BuildTools { public static class BuildRunner { public static int Execute(string[] args, Action<BuildApp> initialize, string scriptPath = null, [CallerFilePath] string callerFilePath = null) { string scriptDirectory = Path.GetDirectoryName(scriptPath ?? callerFilePath); string buildDirectory = Path.GetFullPath(Path.Combine(scriptDirectory ?? ".", "..", "..")); Directory.SetCurrentDirectory(buildDirectory); var commandLineApp = new CommandLineApplication(); var buildApp = new BuildApp(commandLineApp); initialize(buildApp); var helpFlag = buildApp.AddFlag("-h|-?|--help", "Show build help"); var targetsArgument = commandLineApp.Argument("targets", "The targets to build", multipleValues: true); commandLineApp.OnExecute(() => { var targets = targetsArgument.Values; if (helpFlag.Value || targets.Count == 0 && buildApp.Targets.All(x => x.Name != "default")) { commandLineApp.ShowHelp(); ShowTargets(buildApp.Targets); } else { buildApp.RunTargets(targets); } }); return commandLineApp.Execute(args); } private static void ShowTargets(IReadOnlyList<BuildTarget> targets) { Console.WriteLine("Targets:"); foreach (var target in targets) Console.WriteLine(" {0}", target.Name); } } }
mit
C#
61ab05efe6d3370be40c2f3627c38cb3ea1266a8
Fix grammar
HangfireIO/Hangfire.Highlighter,HangfireIO/Hangfire.Highlighter,HangfireIO/Hangfire.Highlighter
Hangfire.Highlighter/Views/Home/_Snippet.cshtml
Hangfire.Highlighter/Views/Home/_Snippet.cshtml
@model CodeSnippet <div data-snippet="@Model.Id" data-subscribe="@(Model.HighlightedCode == null)"> @if (Model.HighlightedCode == null) { <span class="text-waring"><img src="~/Content/ajax-loader.gif"> <em>Background job is being processed...</em></span> } else { @Html.Raw(Model.HighlightedCode) } </div>
@model CodeSnippet <div data-snippet="@Model.Id" data-subscribe="@(Model.HighlightedCode == null)"> @if (Model.HighlightedCode == null) { <span class="text-waring"><img src="~/Content/ajax-loader.gif"> <em>Background job is processed...</em></span> } else { @Html.Raw(Model.HighlightedCode) } </div>
mit
C#
41ea6c6c3df31b360c53a9ec3aaed04ca848e941
update version
prodot/ReCommended-Extension
Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
Sources/ReCommendedExtension/Properties/AssemblyInfo.cs
using System.Reflection; using ReCommendedExtension; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle(ZoneMarker.ExtensionName)] [assembly: AssemblyDescription(ZoneMarker.ExtensionDescription)] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("prodot GmbH")] [assembly: AssemblyProduct(ZoneMarker.ExtensionId)] [assembly: AssemblyCopyright("© 2012-2021 prodot GmbH")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("5.6.1.0")] [assembly: AssemblyFileVersion("5.6.1")]
using System.Reflection; using ReCommendedExtension; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle(ZoneMarker.ExtensionName)] [assembly: AssemblyDescription(ZoneMarker.ExtensionDescription)] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("prodot GmbH")] [assembly: AssemblyProduct(ZoneMarker.ExtensionId)] [assembly: AssemblyCopyright("© 2012-2021 prodot GmbH")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("5.6.0.0")] [assembly: AssemblyFileVersion("5.6.0")]
apache-2.0
C#
0b89f8489e9c1ffcb7cafa214efc6684082f6cc0
Remove smart grid metamodels from the unit tests
mlessmann/NMF,georghinkel/NMF,NMFCode/NMF
Transformations/Tests/CodeGenerationTests/ModelTests.cs
Transformations/Tests/CodeGenerationTests/ModelTests.cs
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using NMF.Models.Repository; using NMF.Interop.Ecore; namespace NMF.CodeGenerationTests { [TestClass] public class ModelTests { [TestMethod] public void ClassModelGeneratesSuccessfully() { GenerateAndAssertEcore("Class.ecore"); } [TestMethod] public void ArchitectureCRAModelGeneratesSuccessfully() { GenerateAndAssertEcore("architectureCRA.ecore"); } [TestMethod] public void FamiliesModelGeneratesSuccessfully() { GenerateAndAssertEcore("Families.ecore"); } [TestMethod] public void PersonsModelGeneratesSuccessfully() { GenerateAndAssertEcore("Persons.ecore"); } [TestMethod] public void RailwayModelGeneratesSuccessfully() { GenerateAndAssertEcore("railway.ecore"); } [TestMethod] public void RelationalModelGeneratesSuccessfully() { GenerateAndAssertEcore("Relational.ecore"); } private void GenerateAndAssertEcore(string modelPath) { string log; string errorLog; var package = EcoreInterop.LoadPackageFromFile(modelPath); var ns = EcoreInterop.Transform2Meta(package); var result = CodeGenerationTest.GenerateAndCompile(ns, out errorLog, out log); Assert.AreEqual(0, result, log + errorLog); } } }
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using NMF.Models.Repository; using NMF.Interop.Ecore; namespace NMF.CodeGenerationTests { [TestClass] public class ModelTests { [TestMethod] public void ClassModelGeneratesSuccessfully() { GenerateAndAssertEcore("Class.ecore"); } [TestMethod] public void ArchitectureCRAModelGeneratesSuccessfully() { GenerateAndAssertEcore("architectureCRA.ecore"); } [TestMethod] public void FamiliesModelGeneratesSuccessfully() { GenerateAndAssertEcore("Families.ecore"); } [TestMethod] public void PersonsModelGeneratesSuccessfully() { GenerateAndAssertEcore("Persons.ecore"); } [TestMethod] public void RailwayModelGeneratesSuccessfully() { GenerateAndAssertEcore("railway.ecore"); } [TestMethod] public void RelationalModelGeneratesSuccessfully() { GenerateAndAssertEcore("Relational.ecore"); } [TestMethod] public void ABBModelGeneratesSuccessfully() { GenerateAndAssertEcore("ABB.ecore"); } [TestMethod] public void Iso61850GeneratesSuccessfully() { GenerateAndAssertEcore("61850.ecore"); } [TestMethod] public void CosemModelGeneratesSuccessfully() { GenerateAndAssertEcore("COSEM.ecore"); } [TestMethod] public void SmartGridSchemaGeneratesSuccessfully() { GenerateAndAssertEcore("schema.ecore"); } private void GenerateAndAssertEcore(string modelPath) { string log; string errorLog; var package = EcoreInterop.LoadPackageFromFile(modelPath); var ns = EcoreInterop.Transform2Meta(package); var result = CodeGenerationTest.GenerateAndCompile(ns, out errorLog, out log); Assert.AreEqual(0, result, log + errorLog); } } }
apache-2.0
C#
fa702999d733136c5afd2546309a69fdcfba9e42
Fix MicrogameNumber decrease increasing number
NitorInc/NitoriWare,NitorInc/NitoriWare,plrusek/NitoriWare,Barleytree/NitoriWare,Barleytree/NitoriWare
Assets/Scripts/Animation/MicrogameNumber.cs
Assets/Scripts/Animation/MicrogameNumber.cs
using UnityEngine; using System.Collections; public class MicrogameNumber : MonoBehaviour { public static MicrogameNumber instance; public TextMesh text; void Awake() { instance = this; } public void increaseNumber() { if (text.text == "999") return; int number = int.Parse(text.text) + 1; text.text = number.ToString("D3"); } public void decreaseNumber() { if (text.text == "999") return; int number = int.Parse(text.text) - 1; text.text = number.ToString("D3"); } public int getNumber() { return int.Parse(text.text); } public void resetNumber() { text.text = "000"; } }
using UnityEngine; using System.Collections; public class MicrogameNumber : MonoBehaviour { public static MicrogameNumber instance; public TextMesh text; void Awake() { instance = this; } public void increaseNumber() { if (text.text == "999") return; int number = int.Parse(text.text) + 1; text.text = number.ToString("D3"); } public void decreaseNumber() { if (text.text == "999") return; int number = int.Parse(text.text) + 1; text.text = number.ToString("D3"); } public int getNumber() { return int.Parse(text.text); } public void resetNumber() { text.text = "000"; } }
mit
C#
43d2095c150d7edd23faafcff248edf05441f130
Fix translation for International Women's Day
tinohager/Nager.Date,tinohager/Nager.Date,tinohager/Nager.Date
Src/Nager.Date/PublicHolidays/RussiaProvider.cs
Src/Nager.Date/PublicHolidays/RussiaProvider.cs
using Nager.Date.Contract; using Nager.Date.Model; using System.Collections.Generic; using System.Linq; namespace Nager.Date.PublicHolidays { public class RussiaProvider : IPublicHolidayProvider { public IEnumerable<PublicHoliday> Get(int year) { //Russia //https://en.wikipedia.org/wiki/Public_holidays_in_Russia var countryCode = CountryCode.RU; var items = new List<PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "Новый год", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 1, 2, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 3, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 4, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 5, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 6, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 7, "Рождество Христово", "Orthodox Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 2, 23, "День защитника Отечества", "Defender of the Fatherland Day", countryCode, 1918)); items.Add(new PublicHoliday(year, 3, 8, "Международный женский день", "International Women's Day", countryCode, 1913)); items.Add(new PublicHoliday(year, 5, 1, "День труда", "Labour Day", countryCode)); items.Add(new PublicHoliday(year, 5, 9, "День Победы", "Victory Day", countryCode)); items.Add(new PublicHoliday(year, 6, 12, "День России", "Russia Day", countryCode, 2002)); items.Add(new PublicHoliday(year, 11, 4, "День народного единства", "Unity Day", countryCode, 2005)); return items.OrderBy(o => o.Date); } } }
using Nager.Date.Contract; using Nager.Date.Model; using System.Collections.Generic; using System.Linq; namespace Nager.Date.PublicHolidays { public class RussiaProvider : IPublicHolidayProvider { public IEnumerable<PublicHoliday> Get(int year) { //Russia //https://en.wikipedia.org/wiki/Public_holidays_in_Russia var countryCode = CountryCode.RU; var items = new List<PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "Новый год", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 1, 2, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 3, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 4, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 5, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 6, "Новогодние каникулы", "New Year holiday", countryCode)); items.Add(new PublicHoliday(year, 1, 7, "Рождество Христово", "Orthodox Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 2, 23, "День защитника Отечества", "Defender of the Fatherland Day", countryCode, 1918)); items.Add(new PublicHoliday(year, 3, 8, "Мiжнародны жаночы дзень", "International Women's Day", countryCode, 1913)); items.Add(new PublicHoliday(year, 5, 1, "День труда", "Labour Day", countryCode)); items.Add(new PublicHoliday(year, 5, 9, "День Победы", "Victory Day", countryCode)); items.Add(new PublicHoliday(year, 6, 12, "День России", "Russia Day", countryCode, 2002)); items.Add(new PublicHoliday(year, 11, 4, "День народного единства", "Unity Day", countryCode, 2005)); return items.OrderBy(o => o.Date); } } }
mit
C#
9bca25b26be12cd07c8367c0ff28c18229d93394
Support multiple repos on commandline.
kingsimmy/GitRepoStats,kingsimmy/GitRepoStats
GitRepoStats.CommandLine/GitRepoAnalyser.cs
GitRepoStats.CommandLine/GitRepoAnalyser.cs
using HtmlGenerator; using LibGit2Sharp; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; namespace GitRepoStats.CommandLine { public class GitRepoAnalyser { static void Main(string[] args) { List<string> argList = args.ToList(); bool htmlOutput = argList.Remove("-html"); string outFilePath = GetOutFilePath(argList); RepoStats[] repoStats = GetRepoStats(args[0]).ToArray(); string output = htmlOutput ? GenerateHtml(repoStats) : GenerateString(repoStats); if (String.IsNullOrEmpty(outFilePath)) { Console.WriteLine(output); } else { File.WriteAllText(outFilePath, output); } } private static string GetOutFilePath(List<string> args) { int outFileIndex = args.IndexOf("-outFile"); if (outFileIndex == -1) { return string.Empty; } if (outFileIndex == args.Count - 1) { Console.WriteLine("-outFile flag must be followed by a file name"); Environment.Exit(1); } string outFilePath = args[outFileIndex + 1]; args.RemoveRange(outFileIndex, 2); if (Directory.Exists(outFilePath)) { Console.WriteLine($"-outFile value {outFilePath} is a directory. Please pass a file path for -outFile"); Environment.Exit(1); } return outFilePath; } private static string GenerateHtml(params RepoStats[] allStats) { HtmlDocument document = new HtmlDocument(); Collection<HtmlElement> elements = new Collection<HtmlElement>(allStats.Select(x => x.ToHtml()).ToList()); document.Body.AddChildren(elements); return document.Serialize().Replace("\r", Environment.NewLine); } private static string GenerateString(params RepoStats[] allStats) { Func<RepoStats, string> repoStatsToString = repoStats => repoStats.ToString() + Environment.NewLine + Environment.NewLine; return new String(allStats.SelectMany(repoStatsToString).ToArray()); } private static IEnumerable<RepoStats> GetRepoStats(params string[] repoPaths) { foreach (string repoPath in repoPaths) { Repository repo = new Repository(repoPath); yield return new RepoStats(repo); } } } }
using HtmlGenerator; using LibGit2Sharp; using System; using System.Collections.Generic; using System.Linq; namespace GitRepoStats.CommandLine { public class GitRepoAnalyser { static void Main(string[] args) { List<string> argList = args.ToList(); bool htmlOutput = argList.Remove("-html"); RepoStats repoStats = GetRepoStats(args[0]); string output; if (htmlOutput) { HtmlDocument document = new HtmlDocument(); HtmlElement repoElement = repoStats.ToHtml(); document.Body.AddChild(repoElement); output = document.Serialize().Replace("\r", Environment.NewLine); } else { output = repoStats.ToString(); } Console.WriteLine(output); } private static RepoStats GetRepoStats(string repoPath) { Repository repo = new Repository(repoPath); RepoStats repoStats = new RepoStats(repo); return repoStats; } } }
mit
C#
236e8b0f2f55b8689c13915c4f037f45ec480eb9
add using for System.Linq
louthy/language-ext,StefanBertels/language-ext,StanJav/language-ext
LanguageExt.Process/ActorSys/Deserialise.cs
LanguageExt.Process/ActorSys/Deserialise.cs
using Newtonsoft.Json; using System; using System.Reflection; using LanguageExt.Trans; using static LanguageExt.Prelude; using System.Linq; namespace LanguageExt { /// <summary> /// Helper function for invoking the generic JsonConvert.DeserializeObject function /// instead of the variant that takes a Type argument. This forces the type to be /// cast away from JObject and gives the caller the best chance of getting a useful /// value. /// </summary> internal static class Deserialise { static Map<string, MethodInfo> funcs = Map.empty<string, MethodInfo>(); static MethodInfo DeserialiseFunc(Type type) { var name = type.FullName; var result = funcs.Find(name); if (result.IsSome) return result.LiftUnsafe(); var func = typeof(JsonConvert).GetTypeInfo() .GetDeclaredMethods("DeserializeObject") .Filter(m => m.IsGenericMethod) .Filter(m => m.GetParameters().Length == 2) .Filter(m => m.GetParameters().ElementAt(1).ParameterType.Equals(typeof(JsonSerializerSettings))) .Head() .MakeGenericMethod(type); // No locks because we don't really care if it's done // more than once, but we do care about locking unnecessarily. funcs = funcs.AddOrUpdate(name, func); return func; } public static object Object(string value, Type type) => DeserialiseFunc(type).Invoke(null, new object[] { value, ActorSystemConfig.Default.JsonSerializerSettings }); } }
using Newtonsoft.Json; using System; using System.Reflection; using LanguageExt.Trans; using static LanguageExt.Prelude; namespace LanguageExt { /// <summary> /// Helper function for invoking the generic JsonConvert.DeserializeObject function /// instead of the variant that takes a Type argument. This forces the type to be /// cast away from JObject and gives the caller the best chance of getting a useful /// value. /// </summary> internal static class Deserialise { static Map<string, MethodInfo> funcs = Map.empty<string, MethodInfo>(); static MethodInfo DeserialiseFunc(Type type) { var name = type.FullName; var result = funcs.Find(name); if (result.IsSome) return result.LiftUnsafe(); var func = typeof(JsonConvert).GetTypeInfo() .GetDeclaredMethods("DeserializeObject") .Filter(m => m.IsGenericMethod) .Filter(m => m.GetParameters().Length == 2) .Filter(m => m.GetParameters().ElementAt(1).ParameterType.Equals(typeof(JsonSerializerSettings))) .Head() .MakeGenericMethod(type); // No locks because we don't really care if it's done // more than once, but we do care about locking unnecessarily. funcs = funcs.AddOrUpdate(name, func); return func; } public static object Object(string value, Type type) => DeserialiseFunc(type).Invoke(null, new object[] { value, ActorSystemConfig.Default.JsonSerializerSettings }); } }
mit
C#
b7841339c1e17899bab362a0fc94982ad077ea65
update interface
Epxoxy/LiveRoku
LiveRoku.Base/downloader/ILiveDownloader.cs
LiveRoku.Base/downloader/ILiveDownloader.cs
namespace LiveRoku.Base { public delegate void DanmakuResolver(DanmakuModel danmaku); //To implements ILiveDownloader must have a default constructor as //public Constructor (IRequestModel model, string userAgent, int requestTimeout); public interface ILiveDownloader : IDownloader{ LowList<ILiveDataResolver> LiveDataResolvers { get; } LowList<IStatusBinder> StatusBinders { get; } LowList<DanmakuResolver> DanmakuResolvers { get; } LowList<ILogger> Loggers { get; } RoomInfo fetchRoomInfo(bool refresh); object getExtra(string key); void setExtra(string key, object value); } }
namespace LiveRoku.Base { public delegate void DanmakuResolver(DanmakuModel danmaku); //To implements ILiveDownloader must have a default constructor as //public Constructor (IRequestModel model, string userAgent, int requestTimeout); public interface ILiveDownloader : IDownloader{ LowList<ILiveDataResolver> LiveDataResolvers { get; } LowList<IStatusBinder> StatusBinders { get; } LowList<DanmakuResolver> DanmakuResolvers { get; } LowList<ILogger> Loggers { get; } RoomInfo fetchRoomInfo(bool refresh); object getExtra(string key); } }
mit
C#
a3f685419fe2330782272ccf2720b27750390346
Remove IntervalType from IntervalReachedEventArgs.
jcheng31/IntervalTimer
IntervalReachedEventArgs.cs
IntervalReachedEventArgs.cs
using System; using Microsoft.SPOT; namespace IntervalTimer { public class IntervalReachedEventArgs : EventArgs { public String Message { get; set; } public IntervalReachedEventArgs(String message) { Message = message; } } }
using System; using Microsoft.SPOT; namespace IntervalTimer { public enum IntervalType { Short, Long }; public class IntervalReachedEventArgs : EventArgs { public IntervalType Type { get; set; } public String Message { get; set; } public IntervalReachedEventArgs(IntervalType type, String message) { Type = type; Message = message; } } }
mit
C#
5d940ded09d91d1e1d217b173fa598ed5196985e
Fix incorrect usage of nullable in `ControlItemMention`
peppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,ppy/osu,ppy/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu
osu.Game/Overlays/Chat/ChannelControl/ControlItemMention.cs
osu.Game/Overlays/Chat/ChannelControl/ControlItemMention.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osuTK; namespace osu.Game.Overlays.Chat.ChannelControl { public class ControlItemMention : CircularContainer { public readonly BindableInt Mentions = new BindableInt(); private OsuSpriteText countText = null!; [BackgroundDependencyLoader] private void load(OsuColour osuColour, OverlayColourProvider colourProvider) { Masking = true; Size = new Vector2(20, 12); Alpha = 0f; Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = osuColour.Orange1, }, countText = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.Torus.With(size: 11, weight: FontWeight.Bold), Margin = new MarginPadding { Bottom = 1 }, Colour = colourProvider.Background5, }, }; } protected override void LoadComplete() { base.LoadComplete(); Mentions.BindValueChanged(change => { int mentionCount = change.NewValue; countText.Text = mentionCount > 99 ? "99+" : mentionCount.ToString(); if (mentionCount > 0) Show(); else Hide(); }, true); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osuTK; namespace osu.Game.Overlays.Chat.ChannelControl { public class ControlItemMention : CircularContainer { public readonly BindableInt Mentions = new BindableInt(); private OsuSpriteText? countText; [BackgroundDependencyLoader] private void load(OsuColour osuColour, OverlayColourProvider colourProvider) { Masking = true; Size = new Vector2(20, 12); Alpha = 0f; Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = osuColour.Orange1, }, countText = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.Torus.With(size: 11, weight: FontWeight.Bold), Margin = new MarginPadding { Bottom = 1 }, Colour = colourProvider.Background5, }, }; } protected override void LoadComplete() { base.LoadComplete(); Mentions.BindValueChanged(change => { int mentionCount = change.NewValue; countText!.Text = mentionCount > 99 ? "99+" : mentionCount.ToString(); if (mentionCount > 0) Show(); else Hide(); }, true); } } }
mit
C#
c55ec690506a2afa58297f62986a2bc4f09371bc
Set the SonarTfsAnnotate.exe version to 2.1.1
SonarCommunity/sonar-scm-tfvc,SonarCommunity/sonar-scm-tfvc
SonarTfsAnnotate/Properties/AssemblyInfo.cs
SonarTfsAnnotate/Properties/AssemblyInfo.cs
/* * SonarQube :: SCM :: TFVC :: Plugin * Copyright (c) SonarSource SA and Microsoft Corporation. All rights reserved. * * Licensed under the MIT License. See License.txt in the project root for license information. */ using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SonarTfsAnnotate")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("SonarSource")] [assembly: AssemblyProduct("SonarTfsAnnotate")] [assembly: AssemblyCopyright("Copyright © SonarSource 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ef935e23-3dbf-401d-a5c3-62b3ec660a46")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.1.1.0")] [assembly: AssemblyFileVersion("2.1.1.0")]
/* * SonarQube :: SCM :: TFVC :: Plugin * Copyright (c) SonarSource SA and Microsoft Corporation. All rights reserved. * * Licensed under the MIT License. See License.txt in the project root for license information. */ using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("SonarTfsAnnotate")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("SonarSource")] [assembly: AssemblyProduct("SonarTfsAnnotate")] [assembly: AssemblyCopyright("Copyright © SonarSource 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ef935e23-3dbf-401d-a5c3-62b3ec660a46")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")]
mit
C#
a4de7bdeb7fe51cca5828e9f70c88fe3577c680a
Call base Handle if Decoratee not handled
Miruken-DotNet/Miruken
Source/Miruken/Callback/HandlerDecorator.cs
Source/Miruken/Callback/HandlerDecorator.cs
namespace Miruken.Callback { using System; public abstract class HandlerDecorator : Handler, IDecorator { protected HandlerDecorator(IHandler decoratee) { if (decoratee == null) throw new ArgumentNullException(nameof(decoratee)); Decoratee = decoratee; } public IHandler Decoratee { get; } object IDecorator.Decoratee => Decoratee; protected override bool HandleCallback( object callback, ref bool greedy, IHandler composer) { return Decoratee.Handle(callback, ref greedy, composer) || base.HandleCallback(callback, ref greedy, composer); } } }
namespace Miruken.Callback { using System; public abstract class HandlerDecorator : Handler, IDecorator { protected HandlerDecorator(IHandler decoratee) { if (decoratee == null) throw new ArgumentNullException(nameof(decoratee)); Decoratee = decoratee; } public IHandler Decoratee { get; } object IDecorator.Decoratee => Decoratee; protected override bool HandleCallback( object callback, ref bool greedy, IHandler composer) { return Decoratee.Handle(callback, ref greedy, composer); } } }
mit
C#
695964de7a49cbb176a66801b285f8d96dfbbeb1
Update assembly information and add file header.
oliverzick/ImmutableUndoRedo
src/ImmutableUndoRedo.Test/Properties/AssemblyInfo.cs
src/ImmutableUndoRedo.Test/Properties/AssemblyInfo.cs
#region Copyright and license // <copyright file="AssemblyInfo.cs" company="Oliver Zick"> // Copyright (c) 2015 Oliver Zick. All rights reserved. // </copyright> // <author>Oliver Zick</author> // <license> // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </license> #endregion using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("ImmutableUndoRedo Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ImmutableUndoRedo Tests")] [assembly: AssemblyCopyright("Copyright © 2015 Oliver Zick. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("c6350e77-4af6-488a-bcd4-918ccf5f8d7f")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Allgemeine Informationen über eine Assembly werden über folgende // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die einer Assembly zugeordnet sind. [assembly: AssemblyTitle("ImmutableUndoRedo.Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ImmutableUndoRedo.Test")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Wenn ComVisible auf "false" festgelegt wird, sind die Typen innerhalb dieser Assembly // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. [assembly: ComVisible(false)] // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird [assembly: Guid("c6350e77-4af6-488a-bcd4-918ccf5f8d7f")] // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: // // Hauptversion // Nebenversion // Buildnummer // Revision // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // durch Einsatz von '*', wie in nachfolgendem Beispiel: // [Assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
apache-2.0
C#
6c5dfff0e72a8b29f7f90a340eea435f7c4e661b
Update Program.cs
ickecode/GitTest1
ConsoleApp1/ConsoleApp1/Program.cs
ConsoleApp1/ConsoleApp1/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { Console.WriteLine("Hello, World!"); Console.ReadKey(); //Comment added in GitHub //Another comment added in GitHub } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { Console.WriteLine("Hello, World!"); Console.ReadKey(); //Comment added in GitHub } } }
mit
C#
3c4a1cb08ceb507a3a25abdb1da864b6f98760f8
Remove unnecessary annotations
yb199478/catlib,CatLib/Framework
CatLib.VS/CatLib/FileSystem/File.cs
CatLib.VS/CatLib/FileSystem/File.cs
/* * This file is part of the CatLib package. * * (c) Yu Bin <support@catlib.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * Document: http://catlib.io/ */ using CatLib.API.FileSystem; namespace CatLib.FileSystem { /// <summary> /// 文件 /// </summary> public class File : Handler, IFile { /// <summary> /// 文件 /// </summary> /// <param name="fileSystem">文件系统</param> /// <param name="path">文件路径</param> public File(FileSystem fileSystem, string path) : base(fileSystem, path) { } /// <summary> /// 写入数据 /// 如果数据已经存在则覆盖 /// </summary> /// <param name="contents">写入数据</param> public void Write(byte[] contents) { FileSystem.Write(Path, contents); } /// <summary> /// 读取文件 /// </summary> /// <returns>读取的数据</returns> public byte[] Read() { return FileSystem.Read(Path); } } }
/* * This file is part of the CatLib package. * * (c) Yu Bin <support@catlib.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * Document: http://catlib.io/ */ using CatLib.API.FileSystem; namespace CatLib.FileSystem { /// <summary> /// 文件 /// </summary> public class File : Handler, IFile { /// <summary> /// 文件 /// </summary> /// <param name="fileSystem">文件系统</param> /// <param name="path">文件路径</param> public File(FileSystem fileSystem, string path) : base(fileSystem, path) { } /// <summary> /// 写入数据 /// 如果数据已经存在则覆盖 /// </summary> /// <param name="contents">写入数据</param> public void Write(byte[] contents) { FileSystem.Write(Path, contents); } /// <summary> /// 读取文件 /// </summary> /// <param name="path">路径</param> /// <returns>读取的数据</returns> public byte[] Read() { return FileSystem.Read(Path); } } }
unknown
C#
2e17e08b70534710b950beddebd4ff60b669524a
Fix display window construction.
eylvisaker/AgateLib
Tests/Core/TgzProvider/TgzProviderTester.cs
Tests/Core/TgzProvider/TgzProviderTester.cs
using System; using System.Collections.Generic; using System.Linq; using AgateLib; using AgateLib.DisplayLib; using AgateLib.Geometry; using AgateLib.Utility; namespace TgzProviderTester { class TgzProviderTester { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { new TgzProviderTester().Run(); } private void Run() { var tgz = new TgzFileProvider("archives/dogs.tar.gz"); // These two lines are used by AgateLib tests to locate // driver plugins and images. AgateFileProvider.Assemblies.AddPath("../Drivers"); AgateFileProvider.Images.Add(tgz); using (AgateSetup setup = new AgateSetup()) { setup.AskUser = true; setup.Initialize(true, false, false); if (setup.WasCanceled) return; DisplayWindow wind = DisplayWindow.CreateWindowed( "TgzFileProvider Tester", 800, 600, false); Surface surf = new Surface("dogs.png"); Surface surf2 = new Surface("bigpaddle.png"); PixelBuffer pix = surf.ReadPixels(); while (wind.IsClosed == false) { Display.BeginFrame(); Display.Clear(Color.Blue); surf.Draw(); surf2.Draw(10, 490); Display.EndFrame(); Core.KeepAlive(); } } } } }
using System; using System.Collections.Generic; using System.Linq; using AgateLib; using AgateLib.DisplayLib; using AgateLib.Geometry; using AgateLib.Utility; namespace TgzProviderTester { class TgzProviderTester { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { new TgzProviderTester().Run(); } private void Run() { var tgz = new TgzFileProvider("archives/dogs.tar.gz"); // These two lines are used by AgateLib tests to locate // driver plugins and images. AgateFileProvider.Assemblies.AddPath("../Drivers"); AgateFileProvider.Images.Add(tgz); using (AgateSetup setup = new AgateSetup()) { setup.AskUser = true; setup.Initialize(true, false, false); if (setup.WasCanceled) return; DisplayWindow wind = DisplayWindow.CreateWindowed( "TgzFileProvider Tester", 800, 600, null, false); Surface surf = new Surface("dogs.png"); Surface surf2 = new Surface("bigpaddle.png"); PixelBuffer pix = surf.ReadPixels(); while (wind.IsClosed == false) { Display.BeginFrame(); Display.Clear(Color.Blue); surf.Draw(); surf2.Draw(10, 490); Display.EndFrame(); Core.KeepAlive(); } } } } }
mit
C#
5d199e9b51f49f7260aea574201b0b0879ccb67c
Change slack error message text.
LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform
src/CompetitionPlatform/Exceptions/GlobalExceptionFilter.cs
src/CompetitionPlatform/Exceptions/GlobalExceptionFilter.cs
using System; using AzureStorage.Queue; using Common.Log; using CompetitionPlatform.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; namespace CompetitionPlatform.Exceptions { public class GlobalExceptionFilter : IExceptionFilter, IDisposable { private readonly ILog _log; private readonly IAzureQueue<SlackMessage> _slackMessageQueue; public GlobalExceptionFilter(ILog log, string slackNotificationsConnString) { _log = log; if (!string.IsNullOrEmpty(slackNotificationsConnString)) { _slackMessageQueue = new AzureQueue<SlackMessage>(slackNotificationsConnString, "slack-notifications"); } else { _slackMessageQueue = new QueueInMemory<SlackMessage>(); } } public void OnException(ExceptionContext context) { var controller = context.RouteData.Values["controller"]; var action = context.RouteData.Values["action"]; _log.WriteError("Exception", "LykkeStreams", $"Controller: {controller}, action: {action}", context.Exception).Wait(); var message = new SlackMessage { Type = "Errors", //Errors, Info Sender = "Lykke Streams", Message = "Occured in: " + controller + "Controller, " + action + " - " + context.Exception.GetType() }; _slackMessageQueue.PutMessageAsync(message).Wait(); } public void Dispose() { } } }
using System; using AzureStorage.Queue; using Common.Log; using CompetitionPlatform.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; namespace CompetitionPlatform.Exceptions { public class GlobalExceptionFilter : IExceptionFilter, IDisposable { private readonly ILog _log; private readonly IAzureQueue<SlackMessage> _slackMessageQueue; public GlobalExceptionFilter(ILog log, string slackNotificationsConnString) { _log = log; if (!string.IsNullOrEmpty(slackNotificationsConnString)) { _slackMessageQueue = new AzureQueue<SlackMessage>(slackNotificationsConnString, "slack-notifications"); } _slackMessageQueue = new QueueInMemory<SlackMessage>(); } public void OnException(ExceptionContext context) { var controller = context.RouteData.Values["controller"]; var action = context.RouteData.Values["action"]; _log.WriteError("Exception", "LykkeStreams", $"Controller: {controller}, action: {action}", context.Exception).Wait(); var message = new SlackMessage { Type = "Errors", //Errors, Info Sender = "Lykke Streams", Message = "Message occured in: " + controller + ", " + action + " - " + context.Exception }; _slackMessageQueue.PutMessageAsync(message).Wait(); } public void Dispose() { } } }
mit
C#
376cfe880e64ec5c90aeac96c0f1045e83d708e0
Bump version to 1.4.2
CodeAnimal/PreMailer.Net,CarterTsai/PreMailer.Net,tobio/PreMailer.Net,milkshakesoftware/PreMailer.Net,kendallb/PreMailer.Net,rohk/PreMailer.Net
PreMailer.Net/GlobalAssemblyInfo.cs
PreMailer.Net/GlobalAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: AssemblyProduct("PreMailer.Net")] [assembly: AssemblyCompany("Milkshake Software")] [assembly: AssemblyCopyright("Copyright © Milkshake Software 2015")] [assembly: AssemblyVersion("1.4.2.0")] [assembly: AssemblyFileVersion("1.4.2.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: AssemblyProduct("PreMailer.Net")] [assembly: AssemblyCompany("Milkshake Software")] [assembly: AssemblyCopyright("Copyright © Milkshake Software 2015")] [assembly: AssemblyVersion("1.4.1.0")] [assembly: AssemblyFileVersion("1.4.1.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
mit
C#
d68381d38445f5ebd0893b45312e88c64bdfc7b2
Update PBU-Main-Future.cs
win120a/ACClassRoomUtil,win120a/ACClassRoomUtil
ProcessBlockUtil/PBU-Main-Future.cs
ProcessBlockUtil/PBU-Main-Future.cs
/* THIS IS ONLY TO EASY CHANGE, NOT THE PROJECT CODE AT NOW. (I will use in the future.) Copyright (C) 2011-2014 AC Inc. (Andy Cheung) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System; using System.IO; using System.Diagnostics; using System.ServiceProcess; using System.Threading; using System.Collections; namespace ACProcessBlockUtil { class Run:ServiceBase { SteamReader sr; ArrayList<String> al; String[] list; public static void kill() { while (true) { Process[] ieProcArray = Process.GetProcessesByName("iexplore"); //Console.WriteLine(ieProcArray.Length); if (ieProcArray.Length == 0) { continue; } foreach(Process p in ieProcArray){ p.Kill(); } Thread.Sleep(2000); } } public static void Main(String[] a) { String userProfile = Environment.GetEnvironmentVariable("UserProfile"); String systemRoot = Environment.GetEnvironmentVariable("SystemRoot"); if(File.Exists(userProfile + "\\ACRules.txt")){ ar = new ArrayList<String>(); sr = new SteamReader(userProfile + "\\ACRules.txt"); while(true){ String tempLine = sr.ReadLine(); if(tempLine == null){ break; } else{ ar.Add(tempLine); } } list = ar.ToArray(); } else{ list = {"iexplore", "360se", "chrome", "firefox", "safari"} } ServiceBase.Run(new Run()); } protected override void OnStart(String[] a){ Thread t = new Thread(new ThreadStart(kill)); t.IsBackground = true; t.Start(); } } }
/* THIS IS ONLY TO EASY CHANGE, NOT THE PROJECT CODE AT NOW. (I will use in the future.) Copyright (C) 2011-2014 AC Inc. (Andy Cheung) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System; using System.IO; using System.Diagnostics; using System.ServiceProcess; using System.Threading; using System.Collections; using System.Text; namespace ACProcessBlockUtil { class Run:ServiceBase { SteamReader sr; ArrayList<String> al; String[] list; public static void kill() { while (true) { Process[] ieProcArray = Process.GetProcessesByName("iexplore"); //Console.WriteLine(ieProcArray.Length); if (ieProcArray.Length == 0) { continue; } foreach(Process p in ieProcArray){ p.Kill(); } Thread.Sleep(2000); } } public static void Main(String[] a) { String userProfile = Environment.GetEnvironmentVariable("UserProfile"); String systemRoot = Environment.GetEnvironmentVariable("SystemRoot"); if(File.Exists(userProfile + "\\ACRules.txt")){ ar = new ArrayList<String>(); sr = new SteamReader(userProfile + "\\ACRules.txt", new ASCIIEncoding()); while(true){ String tempLine = sr.ReadLine(); if(tempLine == null){ break; } else{ ar.Add(tempLine); } } list = ar.ToArray(); } else{ list = {"iexplore", "360se", "chrome", "firefox", "safari"} } ServiceBase.Run(new Run()); } protected override void OnStart(String[] a){ Thread t = new Thread(new ThreadStart(kill)); t.IsBackground = true; t.Start(); } } }
apache-2.0
C#
0dcb2b252226efe8fcf034ba6c346ca30a56ff6d
Remove unused code.
mrward/monodevelop-dnx-addin
src/MonoDevelop.Dnx/MonoDevelop.Dnx/AspNetProjectLocator.cs
src/MonoDevelop.Dnx/MonoDevelop.Dnx/AspNetProjectLocator.cs
// // AspNetProjectLocator.cs // // Author: // Matt Ward <ward.matt@gmail.com> // // Copyright (c) 2015 Matthew Ward // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // using Microsoft.CodeAnalysis; using MonoDevelop.Ide; using MonoDevelop.Projects; using OmniSharp.Dnx; namespace MonoDevelop.Dnx { public class AspNetProjectLocator { readonly DnxContext context; Solution solution; FrameworkProject frameworkProject; public AspNetProjectLocator (DnxContext context) { this.context = context; } public DnxProject FindProject (ProjectId projectId) { if (Init (projectId)) return solution.FindProjectByProjectJsonFileName (frameworkProject.Project.Path); return null; } bool Init (ProjectId projectId) { solution = IdeApp.ProjectOperations.CurrentSelectedSolution; if (solution == null) { return false; } return context.WorkspaceMapping.TryGetValue (projectId, out frameworkProject); } } }
// // AspNetProjectLocator.cs // // Author: // Matt Ward <ward.matt@gmail.com> // // Copyright (c) 2015 Matthew Ward // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // using Microsoft.CodeAnalysis; using MonoDevelop.Ide; using MonoDevelop.Projects; using OmniSharp.Dnx; namespace MonoDevelop.Dnx { public class AspNetProjectLocator { readonly DnxContext context; Solution solution; FrameworkProject frameworkProject; public AspNetProjectLocator (DnxContext context) { this.context = context; } public DnxProject FindProject (ProjectId projectId) { if (Init (projectId)) return solution.FindProjectByProjectJsonFileName (frameworkProject.Project.Path); return null; } bool Init (ProjectId projectId) { solution = IdeApp.ProjectOperations.CurrentSelectedSolution; if (solution == null) { return false; } return context.WorkspaceMapping.TryGetValue (projectId, out frameworkProject); } public DnxProject FindProjectForCurrentFramework (ProjectId projectId) { if (!Init (projectId)) return null; DnxProject project = solution.FindProjectByProjectJsonFileName (frameworkProject.Project.Path); if (project.IsCurrentFramework (frameworkProject.Framework, frameworkProject.Project.ProjectsByFramework.Keys)) { return project; } return null; } } }
mit
C#
bcbfeb65e9922a2e35c5e982b7a276b65707d33c
Fix an incorrect type
Aux/NTwitch,Aux/NTwitch
src/NTwitch.Rest/Entities/Follows/RestChannelFollow.cs
src/NTwitch.Rest/Entities/Follows/RestChannelFollow.cs
using Newtonsoft.Json; namespace NTwitch.Rest { public class RestChannelFollow : RestFollow { [JsonProperty("channel")] public RestChannel Channel { get; private set; } public RestChannelFollow(BaseRestClient client) : base(client) { } public static new RestChannelFollow Create(BaseRestClient client, string json) { var follow = new RestChannelFollow(client); JsonConvert.PopulateObject(json, follow); return follow; } } }
using Newtonsoft.Json; namespace NTwitch.Rest { public class RestChannelFollow : RestFollow { [JsonProperty("channel")] public RestChannel Channel { get; private set; } public RestChannelFollow(BaseRestClient client) : base(client) { } public static new RestChannelFollow Create(TwitchRestClient client, string json) { var follow = new RestChannelFollow(client); JsonConvert.PopulateObject(json, follow); return follow; } } }
mit
C#
be9e6824572eda11a2b246443b42e77362b01cef
Update minor version
provisiondata/Provision.AspNet.StructureMap
src/Provision.AspNet.StructureMap/Properties/AssemblyInfo.cs
src/Provision.AspNet.StructureMap/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Provision.AspNet.StructureMap")] [assembly: AssemblyDescription("StructureMap integration for ASP.NET MVC and WebAPI")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Provision Data Systems Inc.")] [assembly: AssemblyProduct("Provision.AspNet.StructureMap")] [assembly: AssemblyCopyright("Copyright © 2016 Provision Data Systems Inc.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("EN-us")] [assembly: ComVisible(false)] [assembly: Guid("ff8e04d9-346b-499e-b365-c057481cd94e")] [assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Provision.AspNet.StructureMap")] [assembly: AssemblyDescription("StructureMap integration for ASP.NET MVC and WebAPI")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Provision Data Systems Inc.")] [assembly: AssemblyProduct("Provision.AspNet.StructureMap")] [assembly: AssemblyCopyright("Copyright © 2016 Provision Data Systems Inc.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("EN-us")] [assembly: ComVisible(false)] [assembly: Guid("ff8e04d9-346b-499e-b365-c057481cd94e")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
b3465c182179e16404d8ca3c40a268a8448d357d
Change HelenaZ force
bunashibu/kikan
Assets/Scripts/Skill/Helena/HelenaZ.cs
Assets/Scripts/Skill/Helena/HelenaZ.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; using UniRx; using UniRx.Triggers; namespace Bunashibu.Kikan { [RequireComponent(typeof(SkillSynchronizer))] public class HelenaZ : Skill { void Awake() { _synchronizer = GetComponent<SkillSynchronizer>(); _hitRistrictor = new HitRistrictor(_hitInfo); MonoUtility.Instance.StoppableDelaySec(_existTime, "HelenaZFalse" + GetInstanceID().ToString(), () => { if (gameObject == null) return; gameObject.SetActive(false); // NOTE: See SMB-DestroySkillSelf MonoUtility.Instance.StoppableDelaySec(5.0f, "HelenaZDestroy" + GetInstanceID().ToString(), () => { if (gameObject == null) return; Destroy(gameObject); }); }); this.UpdateAsObservable() .Where(_ => _skillUserObj != null) .Take(1) .Subscribe(_ => { var skillUser = _skillUserObj.GetComponent<Player>(); Vector2 direction = (skillUser.Renderers[0].flipX) ? Vector2.left : Vector2.right; _synchronizer.SyncForce(skillUser.PhotonView.viewID, _force, direction, false); }); } void OnTriggerStay2D(Collider2D collider) { if (PhotonNetwork.isMasterClient) { var target = collider.gameObject.GetComponent<IPhoton>(); if (target == null) return; if (TeamChecker.IsSameTeam(collider.gameObject, _skillUserObj)) return; if (_hitRistrictor.ShouldRistrict(collider.gameObject)) return; DamageCalculator.Calculate(_skillUserObj, _attackInfo); _synchronizer.SyncAttack(_skillUserViewID, target.PhotonView.viewID, DamageCalculator.Damage, DamageCalculator.IsCritical, HitEffectType.Helena); } } [SerializeField] private AttackInfo _attackInfo; [SerializeField] private HitInfo _hitInfo; private SkillSynchronizer _synchronizer; private HitRistrictor _hitRistrictor; private float _existTime = 5.0f; private float _force = 15.0f; } }
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Bunashibu.Kikan { [RequireComponent(typeof(SkillSynchronizer))] public class HelenaZ : Skill { void Awake() { _synchronizer = GetComponent<SkillSynchronizer>(); _hitRistrictor = new HitRistrictor(_hitInfo); MonoUtility.Instance.StoppableDelaySec(_existTime, "HelenaZFalse" + GetInstanceID().ToString(), () => { if (gameObject == null) return; gameObject.SetActive(false); // NOTE: See SMB-DestroySkillSelf MonoUtility.Instance.StoppableDelaySec(5.0f, "HelenaZDestroy" + GetInstanceID().ToString(), () => { if (gameObject == null) return; Destroy(gameObject); }); }); } void OnTriggerStay2D(Collider2D collider) { if (PhotonNetwork.isMasterClient) { var target = collider.gameObject.GetComponent<IPhoton>(); if (target == null) return; if (TeamChecker.IsSameTeam(collider.gameObject, _skillUserObj)) return; if (_hitRistrictor.ShouldRistrict(collider.gameObject)) return; DamageCalculator.Calculate(_skillUserObj, _attackInfo); _synchronizer.SyncAttack(_skillUserViewID, target.PhotonView.viewID, DamageCalculator.Damage, DamageCalculator.IsCritical, HitEffectType.Helena); } } [SerializeField] private AttackInfo _attackInfo; [SerializeField] private HitInfo _hitInfo; private SkillSynchronizer _synchronizer; private HitRistrictor _hitRistrictor; private float _existTime = 5.0f; } }
mit
C#
cef646bf586a3f82e7feb9565e0cb33060a0e4bd
fix exception message
NServiceBusSqlPersistence/NServiceBus.SqlPersistence
src/Guard.cs
src/Guard.cs
 using System; using System.Collections; static class Guard { public static void AgainstNull(string argumentName, object value) { if (value == null) { throw new ArgumentNullException(argumentName); } } public static void AgainstNullAndEmpty(string argumentName, string value) { if (string.IsNullOrWhiteSpace(value)) { throw new ArgumentNullException(argumentName); } } public static void AgainstSqlDelimiters(string argumentName, string value) { if (value.Contains("]") || value.Contains("[") || value.Contains("`")) { throw new ArgumentException($"The argument '{value}' has a tableSuffix that contains a ']', '[' or '`'. Names automatically quoted."); } } public static void AgainstEmpty(string argumentName, string value) { if (value !=null && string.IsNullOrWhiteSpace(value)) { throw new ArgumentNullException(argumentName); } } public static void AgainstNullAndEmpty(string argumentName, ICollection value) { if (value == null) { throw new ArgumentNullException(argumentName); } if (value.Count == 0) { throw new ArgumentOutOfRangeException(argumentName); } } public static void AgainstNegativeAndZero(string argumentName, int value) { if (value <= 0) { throw new ArgumentOutOfRangeException(argumentName); } } public static void AgainstNegative(string argumentName, int value) { if (value < 0) { throw new ArgumentOutOfRangeException(argumentName); } } public static void AgainstNegativeAndZero(string argumentName, TimeSpan value) { if (value <= TimeSpan.Zero) { throw new ArgumentOutOfRangeException(argumentName); } } public static void AgainstNegative(string argumentName, TimeSpan value) { if (value < TimeSpan.Zero) { throw new ArgumentOutOfRangeException(argumentName); } } }
 using System; using System.Collections; static class Guard { public static void AgainstNull(string argumentName, object value) { if (value == null) { throw new ArgumentNullException(argumentName); } } public static void AgainstNullAndEmpty(string argumentName, string value) { if (string.IsNullOrWhiteSpace(value)) { throw new ArgumentNullException(argumentName); } } public static void AgainstSqlDelimiters(string argumentName, string value) { if (value.Contains("]")) { throw new ArgumentException($"The argument '{value}' contians a ']' SQL Delimiters which is not supported. Delimiters are automatically added and are not required in configuration.", argumentName); } if (value.Contains("[")) { throw new ArgumentException($"The argument '{value}' contians a ']' SQL Delimiters which is not supported. Delimiters are automatically added and are not required in configuration.", argumentName); } if (value.Contains("`")) { throw new ArgumentException($"The argument '{value}' contians a '`' SQL Delimiters which is not supported. Delimiters are automatically added and are not required in configuration.", argumentName); } } public static void AgainstEmpty(string argumentName, string value) { if (value !=null && string.IsNullOrWhiteSpace(value)) { throw new ArgumentNullException(argumentName); } } public static void AgainstNullAndEmpty(string argumentName, ICollection value) { if (value == null) { throw new ArgumentNullException(argumentName); } if (value.Count == 0) { throw new ArgumentOutOfRangeException(argumentName); } } public static void AgainstNegativeAndZero(string argumentName, int value) { if (value <= 0) { throw new ArgumentOutOfRangeException(argumentName); } } public static void AgainstNegative(string argumentName, int value) { if (value < 0) { throw new ArgumentOutOfRangeException(argumentName); } } public static void AgainstNegativeAndZero(string argumentName, TimeSpan value) { if (value <= TimeSpan.Zero) { throw new ArgumentOutOfRangeException(argumentName); } } public static void AgainstNegative(string argumentName, TimeSpan value) { if (value < TimeSpan.Zero) { throw new ArgumentOutOfRangeException(argumentName); } } }
mit
C#
c5972e1912a61013c9f0bd36287abd7e83aab8fb
Update CameraEventsListener.android.cs
Redth/ZXing.Net.Mobile
ZXing.Net.Mobile/Android/CameraAccess/CameraEventsListener.android.cs
ZXing.Net.Mobile/Android/CameraAccess/CameraEventsListener.android.cs
using System; using Android.Hardware; using ApxLabs.FastAndroidCamera; namespace ZXing.Mobile.CameraAccess { public class CameraEventsListener : Java.Lang.Object, INonMarshalingPreviewCallback, Camera.IAutoFocusCallback { public event EventHandler<FastJavaByteArray> OnPreviewFrameReady; public void OnPreviewFrame(IntPtr data, Camera camera) { if (data != null && data != IntPtr.Zero) { using (var fastArray = new FastJavaByteArray(data)) { OnPreviewFrameReady?.Invoke(this, fastArray); camera.AddCallbackBuffer(fastArray); } } } public void OnAutoFocus(bool success, Camera camera) { Android.Util.Log.Debug(MobileBarcodeScanner.TAG, "AutoFocus {0}", success ? "Succeeded" : "Failed"); } } }
using System; using Android.Hardware; using ApxLabs.FastAndroidCamera; namespace ZXing.Mobile.CameraAccess { public class CameraEventsListener : Java.Lang.Object, INonMarshalingPreviewCallback, Camera.IAutoFocusCallback { public event EventHandler<FastJavaByteArray> OnPreviewFrameReady; public void OnPreviewFrame(IntPtr data, Camera camera) { using (var fastArray = new FastJavaByteArray(data)) { OnPreviewFrameReady?.Invoke(this, fastArray); camera.AddCallbackBuffer(fastArray); } } public void OnAutoFocus(bool success, Camera camera) { Android.Util.Log.Debug(MobileBarcodeScanner.TAG, "AutoFocus {0}", success ? "Succeeded" : "Failed"); } } }
apache-2.0
C#
f9c6200b279a9a58e3d63a78bec8209dc52d9c5a
Fix some documentation issues.
nohros/must,nohros/must,nohros/must
src/base/common/data/transferobjects/IDataTransferObject.cs
src/base/common/data/transferobjects/IDataTransferObject.cs
using System; using System.Collections.Generic; using System.Text; namespace Nohros.Data.TransferObjects { /// <summary> /// Represents an class that can be serialized using the json format. Classes /// that implement this interface is usually used to transfer json encoded /// data from the data access layer to another layer (usually a web /// front-end). /// </summary> public interface IDataTransferObject { /// <summary> /// Gets a json-compliant string of characters that represents the /// underlying class and is formatted like a json array element. /// </summary> /// <example> /// The example uses the AsJsonArray to serialize the MyDataTransferObject /// to a string that represents an json array. /// <code> /// class MyDataTransferObject : IDataTransferObject { /// string first_name_, las_name; /// /// public MyDataTransferObject(string first_name, string last_name) { /// first_name_ = first_name; /// last_name_ = last_name; /// } /// /// public string AsJsonArray() { /// return "['" + first_name + "','" + last_name + "']" /// } /// } /// </code> /// </example> /// <returns> /// A json compliant string of characters formatted like a json array /// element. /// </returns> string AsJsonArray(); /// <summary> /// Gets a json-compliant string of characters that represents the /// underlying class and is formatted like a json object. /// </summary> /// <example> /// The example uses the AsJsonObject method to serialize the /// MyDataTransferObject to a string that represents an json object. /// <code> /// class MyDataTransferObject : IDataTransferObject { /// string first_name_, las_name; /// /// public MyDataTransferObject(string first_name, string last_name) { /// first_name_ = first_name; /// last_name_ = last_name; /// } /// /// public string AsJsonObject() { /// return "{\"first_name\":\"" + first_name + "\",\"last_name\":\"" + last_name + "\"}"; /// } /// } /// </code> /// </example> /// <returns> /// A json compliant string of characters formatted like a json object. /// </returns> string AsJsonObject(); } }
using System; using System.Collections.Generic; using System.Text; namespace Nohros.Data.TransferObjects { /// <summary> /// Represents an class that can be serialized using the json format. Classes /// that implement this interface is usually used to transfer json encoded /// data from the data access layer to another layer (usually a web /// front-end). /// </summary> public interface IDataTransferObject { /// <summary> /// Gets a json-compliant string of characters that represents the /// underlying class and is formatted like a json array element. /// </summary> /// <example> /// <code> /// [ToJsElement(), "somedata", ...] /// </code> /// </example> /// <returns> /// A json compliant string of characters formatted like a json array /// element. /// </returns> /// <remarks> /// The returned string will be scaped with quotation marks. /// </remarks> string AsJsonArray(); /// <summary> /// Gets a json compliant string of characters that represents the /// underlying class and is formmated like a json object. /// </summary> /// <example> /// <code> /// { "name": "nohros systems", "surname": "nohros" } /// </code> /// </example> /// <returns> /// A json compliant string of characters formatted like a json object. /// </returns> /// <remarks> /// The strings inside the object will be escaped with quotation marks. /// </remarks> string AsJsonObject(); } }
mit
C#
d5cca8386e6ccd42d62faa61e61a50f76ebe3da4
Add possible IOExceptino
dotnet/roslyn,dotnet/roslyn,dotnet/roslyn
src/Workspaces/Core/Portable/Shared/Utilities/IOUtilities.cs
src/Workspaces/Core/Portable/Shared/Utilities/IOUtilities.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.IO; using System.Security; using System.Threading.Tasks; namespace Microsoft.CodeAnalysis.Shared.Utilities { internal static class IOUtilities { public static void PerformIO(Action action) { PerformIO<object>(() => { action(); return null; }); } public static T PerformIO<T>(Func<T> function, T defaultValue = default) { try { return function(); } catch (Exception e) when (IsNormalIOException(e)) { } return defaultValue; } public static async Task<T> PerformIOAsync<T>(Func<Task<T>> function, T defaultValue = default) { try { return await function().ConfigureAwait(false); } catch (Exception e) when (IsNormalIOException(e)) { } return defaultValue; } public static bool IsNormalIOException(Exception e) { return e is IOException or SecurityException or ArgumentException or UnauthorizedAccessException or NotSupportedException or InvalidOperationException or InvalidDataException; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using System.IO; using System.Security; using System.Threading.Tasks; namespace Microsoft.CodeAnalysis.Shared.Utilities { internal static class IOUtilities { public static void PerformIO(Action action) { PerformIO<object>(() => { action(); return null; }); } public static T PerformIO<T>(Func<T> function, T defaultValue = default) { try { return function(); } catch (Exception e) when (IsNormalIOException(e)) { } return defaultValue; } public static async Task<T> PerformIOAsync<T>(Func<Task<T>> function, T defaultValue = default) { try { return await function().ConfigureAwait(false); } catch (Exception e) when (IsNormalIOException(e)) { } return defaultValue; } public static bool IsNormalIOException(Exception e) { return e is IOException or SecurityException or ArgumentException or UnauthorizedAccessException or NotSupportedException or InvalidOperationException; } } }
mit
C#
81b0b4670501e7c53e54a539abed33e6c3a5de6c
Update IInputRaster.cs
LANDIS-II-Foundation/Landis-Spatial-Modeling-Library
src/api/IInputRaster.cs
src/api/IInputRaster.cs
// Copyright 2004-2006 University of Wisconsin // All rights reserved. // // Contributors: // James Domingo, UW-Madison, Forest Landscape Ecology Lab // James Domingo, Green Code LLC namespace Landis.SpatialModeling { /// <summary> /// An input raster file from which pixel data are read. Pixels are read /// in row-major order, from the upper-left corner to the lower-right /// corner. /// </summary> public interface IInputRaster<TPixel> : IRaster where TPixel : Pixel, new() { /// <summary> /// The single-pixel buffer for reading pixels to the raster. /// </summary> TPixel BufferPixel { get; } //--------------------------------------------------------------------- /// <summary> /// Reads the next pixel from the raster into the buffer pixel. /// </summary> /// <exception cref="System.IO.EndOfStreamException"> /// There are no more pixels left to read. /// </exception> /// <exception cref="System.IO.IOException"> /// An error occurred reading the pixel data from the raster. /// </exception> /// <exception cref="System.InvalidOperationException"> /// This method was called too many times (more than the number of /// pixels in the raster). /// </exception> void ReadBufferPixel(); } }
// Copyright 2004-2006 University of Wisconsin // All rights reserved. // // The copyright holders license this file under the New (3-clause) BSD // License (the "License"). You may not use this file except in // compliance with the License. A copy of the License is available at // // http://www.opensource.org/licenses/BSD-3-Clause // // and is included in the NOTICE.txt file distributed with this work. // // Contributors: // James Domingo, UW-Madison, Forest Landscape Ecology Lab // James Domingo, Green Code LLC namespace Landis.SpatialModeling { /// <summary> /// An input raster file from which pixel data are read. Pixels are read /// in row-major order, from the upper-left corner to the lower-right /// corner. /// </summary> public interface IInputRaster<TPixel> : IRaster where TPixel : Pixel, new() { /// <summary> /// The single-pixel buffer for reading pixels to the raster. /// </summary> TPixel BufferPixel { get; } //--------------------------------------------------------------------- /// <summary> /// Reads the next pixel from the raster into the buffer pixel. /// </summary> /// <exception cref="System.IO.EndOfStreamException"> /// There are no more pixels left to read. /// </exception> /// <exception cref="System.IO.IOException"> /// An error occurred reading the pixel data from the raster. /// </exception> /// <exception cref="System.InvalidOperationException"> /// This method was called too many times (more than the number of /// pixels in the raster). /// </exception> void ReadBufferPixel(); } }
apache-2.0
C#
3c5a3124e8fc5b98a11ba83c583e1fa36ddf8cab
Update FileSystemRootPathProvider.cs
danbarua/Nancy,guodf/Nancy,rudygt/Nancy,asbjornu/Nancy,blairconrad/Nancy,tareq-s/Nancy,cgourlay/Nancy,damianh/Nancy,ayoung/Nancy,wtilton/Nancy,adamhathcock/Nancy,JoeStead/Nancy,phillip-haydon/Nancy,cgourlay/Nancy,grumpydev/Nancy,thecodejunkie/Nancy,Worthaboutapig/Nancy,tsdl2013/Nancy,xt0rted/Nancy,kekekeks/Nancy,EliotJones/NancyTest,tparnell8/Nancy,horsdal/Nancy,ccellar/Nancy,albertjan/Nancy,grumpydev/Nancy,daniellor/Nancy,JoeStead/Nancy,MetSystem/Nancy,sloncho/Nancy,jmptrader/Nancy,Crisfole/Nancy,sadiqhirani/Nancy,charleypeng/Nancy,dbabox/Nancy,jonathanfoster/Nancy,ccellar/Nancy,kekekeks/Nancy,dbolkensteyn/Nancy,jongleur1983/Nancy,AIexandr/Nancy,daniellor/Nancy,malikdiarra/Nancy,Crisfole/Nancy,felipeleusin/Nancy,jeff-pang/Nancy,joebuschmann/Nancy,guodf/Nancy,Novakov/Nancy,jongleur1983/Nancy,anton-gogolev/Nancy,anton-gogolev/Nancy,VQComms/Nancy,Crisfole/Nancy,asbjornu/Nancy,charleypeng/Nancy,JoeStead/Nancy,jchannon/Nancy,sloncho/Nancy,AcklenAvenue/Nancy,jmptrader/Nancy,sroylance/Nancy,malikdiarra/Nancy,sroylance/Nancy,Novakov/Nancy,joebuschmann/Nancy,wtilton/Nancy,dbabox/Nancy,albertjan/Nancy,AcklenAvenue/Nancy,SaveTrees/Nancy,nicklv/Nancy,dbolkensteyn/Nancy,felipeleusin/Nancy,lijunle/Nancy,AlexPuiu/Nancy,AcklenAvenue/Nancy,VQComms/Nancy,adamhathcock/Nancy,MetSystem/Nancy,jonathanfoster/Nancy,dbolkensteyn/Nancy,damianh/Nancy,malikdiarra/Nancy,ccellar/Nancy,tsdl2013/Nancy,felipeleusin/Nancy,duszekmestre/Nancy,VQComms/Nancy,sadiqhirani/Nancy,wtilton/Nancy,albertjan/Nancy,SaveTrees/Nancy,anton-gogolev/Nancy,AIexandr/Nancy,lijunle/Nancy,jonathanfoster/Nancy,nicklv/Nancy,vladlopes/Nancy,AIexandr/Nancy,jmptrader/Nancy,murador/Nancy,vladlopes/Nancy,daniellor/Nancy,duszekmestre/Nancy,phillip-haydon/Nancy,rudygt/Nancy,MetSystem/Nancy,thecodejunkie/Nancy,tparnell8/Nancy,phillip-haydon/Nancy,albertjan/Nancy,EliotJones/NancyTest,rudygt/Nancy,SaveTrees/Nancy,sadiqhirani/Nancy,cgourlay/Nancy,dbolkensteyn/Nancy,NancyFx/Nancy,NancyFx/Nancy,kekekeks/Nancy,jonathanfoster/Nancy,AIexandr/Nancy,damianh/Nancy,danbarua/Nancy,AlexPuiu/Nancy,lijunle/Nancy,hitesh97/Nancy,rudygt/Nancy,jongleur1983/Nancy,xt0rted/Nancy,AcklenAvenue/Nancy,charleypeng/Nancy,horsdal/Nancy,JoeStead/Nancy,duszekmestre/Nancy,nicklv/Nancy,fly19890211/Nancy,davidallyoung/Nancy,tparnell8/Nancy,Worthaboutapig/Nancy,khellang/Nancy,guodf/Nancy,xt0rted/Nancy,EliotJones/NancyTest,tsdl2013/Nancy,jongleur1983/Nancy,tareq-s/Nancy,AlexPuiu/Nancy,EIrwin/Nancy,duszekmestre/Nancy,sroylance/Nancy,tsdl2013/Nancy,sadiqhirani/Nancy,vladlopes/Nancy,Worthaboutapig/Nancy,nicklv/Nancy,tparnell8/Nancy,joebuschmann/Nancy,ayoung/Nancy,davidallyoung/Nancy,adamhathcock/Nancy,felipeleusin/Nancy,davidallyoung/Nancy,khellang/Nancy,joebuschmann/Nancy,AIexandr/Nancy,ayoung/Nancy,EliotJones/NancyTest,tareq-s/Nancy,grumpydev/Nancy,charleypeng/Nancy,VQComms/Nancy,adamhathcock/Nancy,vladlopes/Nancy,lijunle/Nancy,jmptrader/Nancy,asbjornu/Nancy,horsdal/Nancy,murador/Nancy,asbjornu/Nancy,jchannon/Nancy,sloncho/Nancy,ccellar/Nancy,fly19890211/Nancy,horsdal/Nancy,EIrwin/Nancy,khellang/Nancy,guodf/Nancy,phillip-haydon/Nancy,EIrwin/Nancy,NancyFx/Nancy,dbabox/Nancy,hitesh97/Nancy,hitesh97/Nancy,jeff-pang/Nancy,jeff-pang/Nancy,wtilton/Nancy,malikdiarra/Nancy,charleypeng/Nancy,grumpydev/Nancy,khellang/Nancy,sroylance/Nancy,murador/Nancy,thecodejunkie/Nancy,dbabox/Nancy,fly19890211/Nancy,sloncho/Nancy,SaveTrees/Nancy,danbarua/Nancy,Novakov/Nancy,cgourlay/Nancy,thecodejunkie/Nancy,jchannon/Nancy,fly19890211/Nancy,jchannon/Nancy,jeff-pang/Nancy,anton-gogolev/Nancy,VQComms/Nancy,AlexPuiu/Nancy,davidallyoung/Nancy,MetSystem/Nancy,blairconrad/Nancy,jchannon/Nancy,asbjornu/Nancy,davidallyoung/Nancy,daniellor/Nancy,xt0rted/Nancy,blairconrad/Nancy,ayoung/Nancy,tareq-s/Nancy,Worthaboutapig/Nancy,blairconrad/Nancy,hitesh97/Nancy,Novakov/Nancy,murador/Nancy,danbarua/Nancy,EIrwin/Nancy,NancyFx/Nancy
src/Nancy.Hosting.Self/FileSystemRootPathProvider.cs
src/Nancy.Hosting.Self/FileSystemRootPathProvider.cs
namespace Nancy.Hosting.Self { using System; using System.IO; using System.Reflection; public class FileSystemRootPathProvider : IRootPathProvider { public string GetRootPath() { var assembly = Assembly.GetEntryAssembly(); return assembly != null ? Path.GetDirectoryName(assembly.Location) : Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); } } }
using System; using System.IO; using System.Reflection; namespace Nancy.Hosting.Self { public class FileSystemRootPathProvider : IRootPathProvider { public string GetRootPath() { var assembly = Assembly.GetEntryAssembly(); return assembly != null ? Path.GetDirectoryName(assembly.Location) : Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); } } }
mit
C#
9e92339e4fbb042ae6d4de98348a63208c768e1c
Remove unused field.
blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon
Compiler/ParseTree/FieldDeclaration.cs
Compiler/ParseTree/FieldDeclaration.cs
using System; using System.Collections.Generic; namespace Crayon.ParseTree { internal class FieldDeclaration : Executable { public Token NameToken { get; set; } public Expression DefaultValue { get; set; } public bool IsStaticField { get; private set; } public int MemberID { get; set; } public int StaticMemberID { get; set; } public FieldDeclaration(Token fieldToken, Token nameToken, ClassDefinition owner, bool isStatic) : base(fieldToken, owner) { this.NameToken = nameToken; this.DefaultValue = new NullConstant(fieldToken, owner); this.IsStaticField = isStatic; this.MemberID = -1; } internal override IList<Executable> Resolve(Parser parser) { this.DefaultValue = this.DefaultValue.Resolve(parser); return Listify(this); } internal override Executable ResolveNames(Parser parser, Dictionary<string, Executable> lookup, string[] imports) { parser.CurrentCodeContainer = this; this.DefaultValue = this.DefaultValue.ResolveNames(parser, lookup, imports); parser.CurrentCodeContainer = null; return this; } internal override void GetAllVariablesReferenced(HashSet<Variable> vars) { } internal override void PerformLocalIdAllocation(VariableIdAllocator varIds, VariableIdAllocPhase phase) { // Throws if it finds any variable. this.DefaultValue.PerformLocalIdAllocation(varIds, phase); } } }
using System; using System.Collections.Generic; namespace Crayon.ParseTree { internal class FieldDeclaration : Executable { public Token NameToken { get; set; } public Expression DefaultValue { get; set; } public bool IsStaticField { get; private set; } public int MemberID { get; set; } public int StaticMemberID { get; set; } public FieldDeclaration(Token fieldToken, Token nameToken, ClassDefinition owner, bool isStatic) : base(fieldToken, owner) { this.NameToken = nameToken; this.DefaultValue = new NullConstant(fieldToken, owner); this.IsStaticField = isStatic; this.MemberID = -1; } internal override IList<Executable> Resolve(Parser parser) { this.DefaultValue = this.DefaultValue.Resolve(parser); return Listify(this); } internal override Executable ResolveNames(Parser parser, Dictionary<string, Executable> lookup, string[] imports) { parser.CurrentCodeContainer = this; this.DefaultValue = this.DefaultValue.ResolveNames(parser, lookup, imports); parser.CurrentCodeContainer = null; return this; } internal override void GetAllVariablesReferenced(HashSet<Variable> vars) { } private static readonly VariableIdAllocator EMPTY_ID_ALLOC = new VariableIdAllocator(); internal override void PerformLocalIdAllocation(VariableIdAllocator varIds, VariableIdAllocPhase phase) { // Throws if it finds any variable. this.DefaultValue.PerformLocalIdAllocation(varIds, phase); } } }
mit
C#
f93b2ce2fe26accb3c36f6bfa1c0fcd40282067c
fix null reference errors while converting reg date
mdavid626/artemis
src/Artemis.Web/App_Start/AutoMapperConfig.cs
src/Artemis.Web/App_Start/AutoMapperConfig.cs
using Artemis.Common; using Artemis.Web.Models; using AutoMapper; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Artemis.Web { public static class AutoMapperConfig { public static IMapper Create() { var config = new MapperConfiguration(cfg => { cfg.CreateMap<CarAdvert, CarAdvertViewModel>() .ForMember(d => d.New, opt => opt.MapFrom(src => src.IsNew)) .ForMember(d => d.Fuel, opt => opt.MapFrom(src => src.Fuel.ToString().ToLower())) .ForMember(d => d.FirstRegistration, opt => opt.MapFrom(src => src.FirstRegistration.HasValue ? src.FirstRegistration.Value.Date : (DateTime?)null)); cfg.CreateMap<CarAdvertViewModel, CarAdvert>() .ForMember(d => d.IsNew, opt => opt.MapFrom(src => src.New)) .ForMember(d => d.Fuel, opt => opt.MapFrom(src => Enum.Parse(typeof(FuelType), src.Fuel, true))) .ForMember(d => d.FirstRegistration, opt => opt.MapFrom(src => src.FirstRegistration.HasValue ? src.FirstRegistration.Value.Date : (DateTime?)null)); }); return config.CreateMapper(); } } }
using Artemis.Common; using Artemis.Web.Models; using AutoMapper; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Artemis.Web { public static class AutoMapperConfig { public static IMapper Create() { var config = new MapperConfiguration(cfg => { cfg.CreateMap<CarAdvert, CarAdvertViewModel>() .ForMember(d => d.New, opt => opt.MapFrom(src => src.IsNew)) .ForMember(d => d.Fuel, opt => opt.MapFrom(src => src.Fuel.ToString().ToLower())) .ForMember(d => d.FirstRegistration, opt => opt.MapFrom(src => src.FirstRegistration.Value.Date)); cfg.CreateMap<CarAdvertViewModel, CarAdvert>() .ForMember(d => d.IsNew, opt => opt.MapFrom(src => src.New)) .ForMember(d => d.Fuel, opt => opt.MapFrom(src => Enum.Parse(typeof(FuelType), src.Fuel, true))) .ForMember(d => d.FirstRegistration, opt => opt.MapFrom(src => src.FirstRegistration.Value.Date)); }); return config.CreateMapper(); } } }
mit
C#
628f12b4424ad6f50177a21d1a2b257b8cb9e805
fix attr on name of event
LagoVista/DeviceAdmin
src/LagoVista.IoT.DeviceAdmin/Models/Event.cs
src/LagoVista.IoT.DeviceAdmin/Models/Event.cs
using LagoVista.Core.Attributes; using LagoVista.Core.Interfaces; using LagoVista.IoT.DeviceAdmin.Resources; using System; namespace LagoVista.IoT.DeviceAdmin.Models { [EntityDescription(DeviceAdminDomain.StateMachines, DeviceLibraryResources.Names.StateMachineEvent_Title, Resources.DeviceLibraryResources.Names.StateMachineEvent_UserHelp,Resources.DeviceLibraryResources.Names.StateMachineEvent_Description, EntityDescriptionAttribute.EntityTypes.SimpleModel, typeof(DeviceLibraryResources))] public class Event : IKeyedEntity, INamedEntity { [FormField(LabelResource: Resources.DeviceLibraryResources.Names.Common_Key, HelpResource: Resources.DeviceLibraryResources.Names.Common_Key_Help, FieldType: FieldTypes.Key, RegExValidationMessageResource: Resources.DeviceLibraryResources.Names.Common_Key_Validation, ResourceType: typeof(DeviceLibraryResources), IsRequired: true)] public String Key { get; set; } [FormField(LabelResource: Resources.DeviceLibraryResources.Names.Common_Name, ResourceType: typeof(DeviceLibraryResources), IsRequired: true)] public String Name { get; set; } [FormField(LabelResource: Resources.DeviceLibraryResources.Names.Common_Description, FieldType: FieldTypes.MultiLineText, ResourceType: typeof(DeviceLibraryResources))] public String Description { get; set; } } }
using LagoVista.Core.Attributes; using LagoVista.Core.Interfaces; using LagoVista.IoT.DeviceAdmin.Resources; using System; namespace LagoVista.IoT.DeviceAdmin.Models { [EntityDescription(DeviceAdminDomain.StateMachines, DeviceLibraryResources.Names.StateMachineEvent_Title, Resources.DeviceLibraryResources.Names.StateMachineEvent_UserHelp,Resources.DeviceLibraryResources.Names.StateMachineEvent_Description, EntityDescriptionAttribute.EntityTypes.SimpleModel, typeof(DeviceLibraryResources))] public class Event : IKeyedEntity, INamedEntity { [FormField(LabelResource: Resources.DeviceLibraryResources.Names.Common_Key, HelpResource: Resources.DeviceLibraryResources.Names.Common_Key_Help, FieldType: FieldTypes.Key, RegExValidationMessageResource: Resources.DeviceLibraryResources.Names.Common_Key_Validation, ResourceType: typeof(DeviceLibraryResources), IsRequired: true)] public String Key { get; set; } [FormField(LabelResource: Resources.DeviceLibraryResources.Names.Common_Name, ResourceType: typeof(DeviceLibraryResources), IsRequired: true, IsUserEditable: false)] public String Name { get; set; } [FormField(LabelResource: Resources.DeviceLibraryResources.Names.Common_Description, FieldType: FieldTypes.MultiLineText, ResourceType: typeof(DeviceLibraryResources))] public String Description { get; set; } } }
mit
C#
0389c3ecca3bb254caffec97ddbf9cceeecf28c1
make json came case in eventhub trace
aliostad/PerfIt,aliostad/PerfIt
src/PerfIt.Tracers.EventHub/EventHubTracer.cs
src/PerfIt.Tracers.EventHub/EventHubTracer.cs
using Microsoft.Azure.EventHubs; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using Psyfon; using System; using System.Collections.Generic; using System.Text; namespace PerfIt.Tracers.EventHub { /// <summary> /// A tracer that pushes instrumentation events to EventHub /// </summary> public class EventHubTracer : ITwoStageTracer { private readonly IEventDispatcher _dispatcher; /// <summary> /// .ctor /// </summary> /// <param name="dispatcher">an event dispatcher</param> public EventHubTracer(IEventDispatcher dispatcher) { _dispatcher = dispatcher; } public void Dispose() { // DO NOT DISPOSE dispather BECAUSE YOU DID NOT CREATE IT!!!! } public void Finish(object token, long timeTakenMilli, string correlationId = null, InstrumentationContext extraContext = null) { var info = (IInstrumentationInfo) token; var so = JsonConvert.SerializeObject(new TraceEvent() { CategoryName = info.CategoryName, InstanceName = info.InstanceName, CorrelationId = correlationId, Text1 = extraContext?.Text1, Text2 = extraContext?.Text2, Numeric = extraContext?.Numeric ?? 0, Decimal = extraContext?.Decimal ?? 0, TimeTakenMilli = timeTakenMilli }, new JsonSerializerSettings() { ContractResolver = new CamelCasePropertyNamesContractResolver() }); _dispatcher.Add(new EventData(Encoding.UTF8.GetBytes(so))); } public object Start(IInstrumentationInfo info) { return info; } } }
using Microsoft.Azure.EventHubs; using Newtonsoft.Json; using Psyfon; using System; using System.Collections.Generic; using System.Text; namespace PerfIt.Tracers.EventHub { /// <summary> /// A tracer that pushes instrumentation events to EventHub /// </summary> public class EventHubTracer : ITwoStageTracer { private readonly IEventDispatcher _dispatcher; /// <summary> /// .ctor /// </summary> /// <param name="dispatcher">an event dispatcher</param> public EventHubTracer(IEventDispatcher dispatcher) { _dispatcher = dispatcher; } public void Dispose() { // DO NOT DISPOSE dispather BECAUSE YOU DID NOT CREATE IT!!!! } public void Finish(object token, long timeTakenMilli, string correlationId = null, InstrumentationContext extraContext = null) { var info = (IInstrumentationInfo) token; var so = JsonConvert.SerializeObject(new TraceEvent() { CategoryName = info.CategoryName, InstanceName = info.InstanceName, CorrelationId = correlationId, Text1 = extraContext?.Text1, Text2 = extraContext?.Text2, Numeric = extraContext?.Numeric ?? 0, Decimal = extraContext?.Decimal ?? 0, TimeTakenMilli = timeTakenMilli }); _dispatcher.Add(new EventData(Encoding.UTF8.GetBytes(so))); } public object Start(IInstrumentationInfo info) { return info; } } }
mit
C#
43e6efc960dc4dd55b989bf7cbcf1653221500cb
Update _VacancySmallPreview.cshtml
dncuug/dot-net.in.ua,dncuug/dot-net.in.ua,dncuug/dot-net.in.ua
src/WebSite/Views/Shared/_VacancySmallPreview.cshtml
src/WebSite/Views/Shared/_VacancySmallPreview.cshtml
@model Core.ViewModels.VacancyViewModel @{ var cssClass = ""; if (Model.Hot) {cssClass = "hot"; } if (Model.Fresh) {cssClass = "fresh"; } } <div class="vacancy-small-preview @cssClass"> <h4>@Model.Title</h4> <div> <span class="label category-label label-default">@Model.Category.Name</span> @if (Model.Hot){ <span class="label label-warning">This week</span> } @if (Model.Fresh){ <span class="label label-danger">Hot!</span> } </div> <br /> <span> @Model.Description </span> <br /><br /> <div class="text-right"> <a class="btn btn-default" href="@Model.ShareUrl">View details...&nbsp;<i class="glyphicon glyphicon-eur"></i></a> </div> </div>
@model Core.ViewModels.VacancyViewModel @{ var cssClass = ""; if (Model.Hot) {cssClass = "hot"; } if (Model.Fresh) {cssClass = "fresh"; } } <div class="vacancy-small-preview @cssClass"> <h4>@Model.Title</h4> <div> <span class="label category-label label-default">@Model.Category.Name</span> @if (Model.Hot){ <span class="label label-warning">This week</span> } @if (Model.Fresh){ <span class="label label-danger">Today</span> } </div> <br /> <span> @Model.Description </span> <br /><br /> <div class="text-right"> <a class="btn btn-default" href="@Model.ShareUrl">View details...&nbsp;<i class="glyphicon glyphicon-eur"></i></a> </div> </div>
mit
C#
34ace2553e5b8db36be5dd0447bac569eeb2d843
Revert "Refactor the menu's max height to be a property"
NeoAdonis/osu,peppy/osu-new,peppy/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,smoogipooo/osu,peppy/osu,ppy/osu,ppy/osu,NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,UselessToucan/osu
osu.Game/Overlays/Settings/SettingsEnumDropdown.cs
osu.Game/Overlays/Settings/SettingsEnumDropdown.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { public class SettingsEnumDropdown<T> : SettingsDropdown<T> where T : struct, Enum { protected override OsuDropdown<T> CreateDropdown() => new DropdownControl(); protected new class DropdownControl : OsuEnumDropdown<T> { public DropdownControl() { Margin = new MarginPadding { Top = 5 }; RelativeSizeAxes = Axes.X; } protected override DropdownMenu CreateMenu() => base.CreateMenu().With(m => m.MaxHeight = 200); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { public class SettingsEnumDropdown<T> : SettingsDropdown<T> where T : struct, Enum { protected override OsuDropdown<T> CreateDropdown() => new DropdownControl(); protected new class DropdownControl : OsuEnumDropdown<T> { protected virtual int MenuMaxHeight => 200; public DropdownControl() { Margin = new MarginPadding { Top = 5 }; RelativeSizeAxes = Axes.X; } protected override DropdownMenu CreateMenu() => base.CreateMenu().With(m => m.MaxHeight = MenuMaxHeight); } } }
mit
C#
e43d91ad5d82cc338802f312411a24abe411f3bc
Fix another case of incorrect null checking in editor verification processing
NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,peppy/osu,smoogipoo/osu,smoogipoo/osu,peppy/osu,ppy/osu,NeoAdonis/osu,ppy/osu,smoogipooo/osu,ppy/osu
osu.Game/Rulesets/Edit/Checks/CheckFilePresence.cs
osu.Game/Rulesets/Edit/Checks/CheckFilePresence.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Game.Beatmaps; using osu.Game.Rulesets.Edit.Checks.Components; namespace osu.Game.Rulesets.Edit.Checks { public abstract class CheckFilePresence : ICheck { protected abstract CheckCategory Category { get; } protected abstract string TypeOfFile { get; } protected abstract string GetFilename(IBeatmap beatmap); public CheckMetadata Metadata => new CheckMetadata(Category, $"Missing {TypeOfFile}"); public IEnumerable<IssueTemplate> PossibleTemplates => new IssueTemplate[] { new IssueTemplateNoneSet(this), new IssueTemplateDoesNotExist(this) }; public IEnumerable<Issue> Run(BeatmapVerifierContext context) { string filename = GetFilename(context.Beatmap); if (string.IsNullOrEmpty(filename)) { yield return new IssueTemplateNoneSet(this).Create(TypeOfFile); yield break; } // If the file is set, also make sure it still exists. string storagePath = context.Beatmap.BeatmapInfo.BeatmapSet.GetPathForFile(filename); if (storagePath != null) yield break; yield return new IssueTemplateDoesNotExist(this).Create(TypeOfFile, filename); } public class IssueTemplateNoneSet : IssueTemplate { public IssueTemplateNoneSet(ICheck check) : base(check, IssueType.Problem, "No {0} has been set.") { } public Issue Create(string typeOfFile) => new Issue(this, typeOfFile); } public class IssueTemplateDoesNotExist : IssueTemplate { public IssueTemplateDoesNotExist(ICheck check) : base(check, IssueType.Problem, "The {0} file \"{1}\" does not exist.") { } public Issue Create(string typeOfFile, string filename) => new Issue(this, typeOfFile, filename); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Game.Beatmaps; using osu.Game.Rulesets.Edit.Checks.Components; namespace osu.Game.Rulesets.Edit.Checks { public abstract class CheckFilePresence : ICheck { protected abstract CheckCategory Category { get; } protected abstract string TypeOfFile { get; } protected abstract string GetFilename(IBeatmap beatmap); public CheckMetadata Metadata => new CheckMetadata(Category, $"Missing {TypeOfFile}"); public IEnumerable<IssueTemplate> PossibleTemplates => new IssueTemplate[] { new IssueTemplateNoneSet(this), new IssueTemplateDoesNotExist(this) }; public IEnumerable<Issue> Run(BeatmapVerifierContext context) { string filename = GetFilename(context.Beatmap); if (filename == null) { yield return new IssueTemplateNoneSet(this).Create(TypeOfFile); yield break; } // If the file is set, also make sure it still exists. string storagePath = context.Beatmap.BeatmapInfo.BeatmapSet.GetPathForFile(filename); if (storagePath != null) yield break; yield return new IssueTemplateDoesNotExist(this).Create(TypeOfFile, filename); } public class IssueTemplateNoneSet : IssueTemplate { public IssueTemplateNoneSet(ICheck check) : base(check, IssueType.Problem, "No {0} has been set.") { } public Issue Create(string typeOfFile) => new Issue(this, typeOfFile); } public class IssueTemplateDoesNotExist : IssueTemplate { public IssueTemplateDoesNotExist(ICheck check) : base(check, IssueType.Problem, "The {0} file \"{1}\" does not exist.") { } public Issue Create(string typeOfFile, string filename) => new Issue(this, typeOfFile, filename); } } }
mit
C#
4212b44f40c1d7fca50dd24f5456c82391526cb5
Fix cannot load firebase analytics type.
Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x
src/unity/Runtime/Services/Internal/FirebaseAnalyticsImpl.cs
src/unity/Runtime/Services/Internal/FirebaseAnalyticsImpl.cs
using System; using System.Reflection; namespace EE.Internal { internal class FirebaseAnalyticsImpl : IFirebaseAnalyticsImpl { private readonly MethodInfo _methodSetCurrentScreen; public FirebaseAnalyticsImpl() { var type = Type.GetType("Firebase.Analytics.FirebaseAnalytics, Firebase.Analytics"); if (type == null) { throw new ArgumentException("Cannot find FirebaseAnalytics"); } _methodSetCurrentScreen = type.GetMethod("SetCurrentScreen", new[] {typeof(string), typeof(string)}); } public void SetCurrentScreen(string screenName, string screenClass) { _methodSetCurrentScreen.Invoke(null, new object[] {screenName, screenClass}); } } }
using System; using System.Reflection; namespace EE.Internal { internal class FirebaseAnalyticsImpl : IFirebaseAnalyticsImpl { private readonly MethodInfo _methodSetCurrentScreen; public FirebaseAnalyticsImpl() { var type = Type.GetType("Firebase.Analytics.FirebaseAnalytics, Firebase.Crashlytics"); if (type == null) { throw new ArgumentException("Cannot find FirebaseAnalytics"); } _methodSetCurrentScreen = type.GetMethod("SetCurrentScreen", new[] {typeof(string), typeof(string)}); } public void SetCurrentScreen(string screenName, string screenClass) { _methodSetCurrentScreen.Invoke(null, new object[] {screenName, screenClass}); } } }
mit
C#
22570be8ac5d1c37bc0f3056d6cf8f2560d402f3
remove price form _GalleryPartial
ramzzzay/GalleryMVC_With_Auth,ramzzzay/GalleryMVC_With_Auth,ramzzzay/GalleryMVC_With_Auth
GalleryMVC_With_Auth/Views/Shared/_GalleryPartial.cshtml
GalleryMVC_With_Auth/Views/Shared/_GalleryPartial.cshtml
@using GalleryMVC_With_Auth.Domain.Entities <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls"> <div class="slides"></div> <h3 class="title"></h3> <a class="prev">‹</a> <a class="next">›</a> <a class="close">×</a> <a class="play-pause"></a> <ol class="indicator"></ol> </div> <div class="grid"> <div id="links"> @foreach (Picture picture in Model) { <figure class="effect-milo"> <img class="lazy" data-original="@picture.TmbPath" alt="@picture.Description"/> <figcaption> <h2> <span>@picture.Description</span></h2> <p style="color: red">Автор - @picture.Name.</p> <p style="color: red">Тэг - @picture.Tag.Name</p> @*<p style="color: red">Цена - @picture.Price бел.руб.</p>*@ <a class="pic" id="links" href="@picture.Path" title="@picture.Name"></a> </figcaption> </figure> <button type="button" class="btn btn-danger" onclick="location.href = '@Url.Action("Comments", "Images", new {@picture.Id})'">Комментарии</button> @*<a style="margin: 10px" href="@Url.Action("Comments", "Images", new {@picture.Id})" onclick="location.href = '@Url.Action("Comments", "Images", new {@picture.Id})'">Комментарии</a>*@ @*@Html.ActionLink("comments", "Comments", "Images", new {picture.Id}, new {@class = "comment", onclick= "window.open(url)" })*@ } </div> </div> <script> $(function() { $("img.lazy").lazyload({ effect: "fadeIn" }); }); </script>
@using GalleryMVC_With_Auth.Domain.Entities <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls"> <div class="slides"></div> <h3 class="title"></h3> <a class="prev">‹</a> <a class="next">›</a> <a class="close">×</a> <a class="play-pause"></a> <ol class="indicator"></ol> </div> <div class="grid"> <div id="links"> @foreach (Picture picture in Model) { <figure class="effect-milo"> <img class="lazy" data-original="@picture.TmbPath" alt="@picture.Description"/> <figcaption> <h2> <span>@picture.Description</span></h2> <p style="color: red">Автор - @picture.Name.</p> <p style="color: red">Тэг - @picture.Tag.Name</p> <p style="color: red">Цена - @picture.Price бел.руб.</p> <a class="pic" id="links" href="@picture.Path" title="@picture.Name"></a> </figcaption> </figure> <button type="button" class="btn btn-danger" onclick="location.href = '@Url.Action("Comments", "Images", new {@picture.Id})'">Комментарии</button> @*<a style="margin: 10px" href="@Url.Action("Comments", "Images", new {@picture.Id})" onclick="location.href = '@Url.Action("Comments", "Images", new {@picture.Id})'">Комментарии</a>*@ @*@Html.ActionLink("comments", "Comments", "Images", new {picture.Id}, new {@class = "comment", onclick= "window.open(url)" })*@ } </div> </div> <script> $(function() { $("img.lazy").lazyload({ effect: "fadeIn" }); }); </script>
apache-2.0
C#
b0d180b5a94a96cffad99c2a9d95a83d7424091c
Fix R# nag.
JohanLarsson/Gu.Wpf.ValidationScope
Gu.Wpf.ValidationScope.Ui.Tests/Helpers/DumpAppDomain.cs
Gu.Wpf.ValidationScope.Ui.Tests/Helpers/DumpAppDomain.cs
namespace Gu.Wpf.ValidationScope.Ui.Tests { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using NUnit.Framework; [Explicit("Script")] public class DumpAppDomain { [Test] public void DumpNotExcludedAssemblies() { var excludedAssemblies = ExcludedAssemblies(); var notExcluded = AppDomain.CurrentDomain.GetAssemblies() .Where(a => !excludedAssemblies.Contains(a.GetName().Name)) .Select(a => a.GetName().Name) .OrderBy(x => x) .ToList(); foreach (var assemblyName in notExcluded) { Console.WriteLine($"\"{assemblyName}\","); } } [Test] public void DumpExcludedAssembliesSorted() { var excludedAssemblies = ExcludedAssemblies() .OrderBy(x => x) .ToArray(); foreach (var name in excludedAssemblies) { Console.WriteLine($"\"{name}\","); } } private static HashSet<string> ExcludedAssemblies() { // ReSharper disable once PossibleNullReferenceException var hashSet = (HashSet<string>)typeof(InputTypeCollectionConverter).GetNestedType("CompatibleTypeCache", BindingFlags.Static | BindingFlags.NonPublic) .GetField("ExcludedAssemblies", BindingFlags.Static | BindingFlags.NonPublic) .GetValue(null); return new HashSet<string>(hashSet); } } }
namespace Gu.Wpf.ValidationScope.Ui.Tests { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using NUnit.Framework; [Explicit("Script")] public class DumpAppDomain { [Test] public void DumpNotExcludedAssemblies() { var excludedAssemblies = ExcludedAssemblies(); var notExcluded = AppDomain.CurrentDomain.GetAssemblies() .Where(a => !excludedAssemblies.Contains(a.GetName().Name)) .Select(a => a.GetName().Name) .OrderBy(x => x) .ToList(); foreach (var assemblyName in notExcluded) { Console.WriteLine($"\"{assemblyName}\","); } } [Test] public void DumpExcludedAssembliesSorted() { var excludedAssemblies = ExcludedAssemblies() .OrderBy(x => x) .ToArray(); foreach (var name in excludedAssemblies) { Console.WriteLine($"\"{name}\","); } } private static HashSet<string> ExcludedAssemblies() { var hashSet = (HashSet<string>)typeof(InputTypeCollectionConverter).GetNestedType("CompatibleTypeCache", BindingFlags.Static | BindingFlags.NonPublic) .GetField("ExcludedAssemblies", BindingFlags.Static | BindingFlags.NonPublic) .GetValue(null); return new HashSet<string>(hashSet); } } }
mit
C#
469450075c66a9f96690abcb19d21d7be268138b
Update Program.cs
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
Battery-Commander.Web/Program.cs
Battery-Commander.Web/Program.cs
namespace BatteryCommander.Web { using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Serilog; using Serilog.Core; public class Program { public static LoggingLevelSwitch LogLevel { get; } = new LoggingLevelSwitch(Serilog.Events.LogEventLevel.Information); public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } private static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder .UseSentry(dsn: "https://78e464f7456f49a98e500e78b0bb4b13@o255975.ingest.sentry.io/1447369") .UseStartup<Startup>(); }) .ConfigureLogging((context, builder) => { Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext() .Enrich.WithProperty("Application", context.HostingEnvironment.ApplicationName) .Enrich.WithProperty("Environment", context.HostingEnvironment.EnvironmentName) .Enrich.WithProperty("Version", $"{typeof(Startup).Assembly.GetName().Version}") .WriteTo.Seq(serverUrl: "https://logs.redleg.app", apiKey: context.Configuration.GetValue<string>("Seq:ApiKey"), compact: true, controlLevelSwitch: LogLevel) .MinimumLevel.ControlledBy(LogLevel) .CreateLogger(); builder.AddSerilog(); }); } }
namespace BatteryCommander.Web { using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Serilog; using Serilog.Core; public class Program { public static LoggingLevelSwitch LogLevel { get; } = new LoggingLevelSwitch(Serilog.Events.LogEventLevel.Information); public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } private static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder .UseSentry(dsn: "https://78e464f7456f49a98e500e78b0bb4b13@o255975.ingest.sentry.io/1447369") .UseStartup<Startup>(); }) .ConfigureLogging((context, builder) => { Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext() .Enrich.WithProperty("Application", context.HostingEnvironment.ApplicationName) .Enrich.WithProperty("Environment", context.HostingEnvironment.EnvironmentName) .Enrich.WithProperty("Version", $"{typeof(Startup).Assembly.GetName().Version}") .WriteTo.Seq(serverUrl: "http://redlegdev-logs.eastus.azurecontainer.io", apiKey: context.Configuration.GetValue<string>("Seq:ApiKey"), compact: true, controlLevelSwitch: LogLevel) .MinimumLevel.ControlledBy(LogLevel) .CreateLogger(); builder.AddSerilog(); }); } }
mit
C#
205661e6ce1ad40ae4b82a510da1a325006934e2
Remove CommandImporter mock
renehernandez/NetConsole.Core,renehernandez/NetConsole.Core
src/tests/NetConsole.Core.Tests/CommandImporterTest.cs
src/tests/NetConsole.Core.Tests/CommandImporterTest.cs
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using NetConsole.Core.Managers; using NUnit.Framework; using Rhino.Mocks; namespace NetConsole.Core.Tests { [TestFixture] public class CommandImporterTest { private CommandImporter _importer; [SetUp] public void SetUp() { _importer = new CommandImporter(); _importer.ImportAllCommands(); } [Test] public void Test_GetOutputFromString() { var output = _importer.GetOutputFromString("echo:echoed unique trial"); Assert.AreEqual(1, output.Length); Assert.AreEqual(0, output[0].Status); Assert.AreEqual("unique trial", output[0].Output); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using NetConsole.Core.Managers; using NUnit.Framework; using Rhino.Mocks; namespace NetConsole.Core.Tests { [TestFixture] public class CommandImporterTest { private CommandImporter _importer; [SetUp] public void SetUp() { _importer = MockRepository.GenerateMock<CommandImporter>(); _importer.ImportAllCommands(); } [Test] public void Test_GetOutputFromString() { var output = _importer.GetOutputFromString("echo:echoed unique trial"); Assert.AreEqual(1, output.Length); Assert.AreEqual(0, output[0].Status); Assert.AreEqual("unique trial", output[0].Output); } } }
mit
C#
679b7bfca5106756c80c55b17f1e6f12298f30fe
Remove noise
ceddlyburge/canoe-polo-league-organiser-backend
CanoePoloLeagueOrganiser/Team.cs
CanoePoloLeagueOrganiser/Team.cs
using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; using System.Text; namespace CanoePoloLeagueOrganiser { public class Team { public string Name { get; } public Team(string name) => Name = name; public override bool Equals(object obj) { if (obj is Team) return (obj as Team).Name.Equals(Name, StringComparison.CurrentCultureIgnoreCase); return false; } public override int GetHashCode() => Name.GetHashCode(); } }
using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; using System.Text; namespace CanoePoloLeagueOrganiser { public class Team { public string Name { get; } public Team(string name) { Name = name; } public override bool Equals(object obj) { if (obj is Team) return (obj as Team).Name.Equals(Name, StringComparison.CurrentCultureIgnoreCase); return false; } public override int GetHashCode() { return Name.GetHashCode(); } } }
mit
C#
48209b37a2f09f40cfbba024087a767244ee42e0
Add LiveNodePacket.DisableAcknowledgement
Jay-Jay-D/LeanSTP,jameschch/Lean,jameschch/Lean,QuantConnect/Lean,jameschch/Lean,Jay-Jay-D/LeanSTP,redmeros/Lean,redmeros/Lean,AlexCatarino/Lean,AlexCatarino/Lean,jameschch/Lean,kaffeebrauer/Lean,kaffeebrauer/Lean,QuantConnect/Lean,AnshulYADAV007/Lean,AlexCatarino/Lean,AnshulYADAV007/Lean,redmeros/Lean,kaffeebrauer/Lean,Jay-Jay-D/LeanSTP,JKarathiya/Lean,QuantConnect/Lean,JKarathiya/Lean,Jay-Jay-D/LeanSTP,StefanoRaggi/Lean,AnshulYADAV007/Lean,AnshulYADAV007/Lean,StefanoRaggi/Lean,StefanoRaggi/Lean,JKarathiya/Lean,AlexCatarino/Lean,kaffeebrauer/Lean,AnshulYADAV007/Lean,jameschch/Lean,redmeros/Lean,JKarathiya/Lean,StefanoRaggi/Lean,kaffeebrauer/Lean,StefanoRaggi/Lean,Jay-Jay-D/LeanSTP,QuantConnect/Lean
Common/Packets/LiveNodePacket.cs
Common/Packets/LiveNodePacket.cs
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using System.Collections.Generic; using Newtonsoft.Json; namespace QuantConnect.Packets { /// <summary> /// Live job task packet: container for any live specific job variables /// </summary> public class LiveNodePacket : AlgorithmNodePacket { /// <summary> /// Deploy Id for this live algorithm. /// </summary> [JsonProperty(PropertyName = "sDeployID")] public string DeployId = ""; /// <summary> /// String name of the brokerage we're trading with /// </summary> [JsonProperty(PropertyName = "sBrokerage")] public string Brokerage = ""; /// <summary> /// String-String Dictionary of Brokerage Data for this Live Job /// </summary> [JsonProperty(PropertyName = "aBrokerageData")] public Dictionary<string, string> BrokerageData = new Dictionary<string, string>(); /// <summary> /// String name of the DataQueueHandler we're running with /// </summary> [JsonProperty(PropertyName = "sDataQueueHandler")] public string DataQueueHandler = ""; /// <summary> /// Gets flag indicating whether or not the message should be acknowledged and removed from the queue /// </summary> [JsonProperty(PropertyName = "DisableAcknowledgement")] public bool DisableAcknowledgement; /// <summary> /// Default constructor for JSON of the Live Task Packet /// </summary> public LiveNodePacket() : base(PacketType.LiveNode) { Controls = new Controls { MinuteLimit = 100, SecondLimit = 50, TickLimit = 25, RamAllocation = 512 }; } } }
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using System.Collections.Generic; using Newtonsoft.Json; namespace QuantConnect.Packets { /// <summary> /// Live job task packet: container for any live specific job variables /// </summary> public class LiveNodePacket : AlgorithmNodePacket { /// <summary> /// Deploy Id for this live algorithm. /// </summary> [JsonProperty(PropertyName = "sDeployID")] public string DeployId = ""; /// <summary> /// String name of the brokerage we're trading with /// </summary> [JsonProperty(PropertyName = "sBrokerage")] public string Brokerage = ""; /// <summary> /// String-String Dictionary of Brokerage Data for this Live Job /// </summary> [JsonProperty(PropertyName = "aBrokerageData")] public Dictionary<string, string> BrokerageData = new Dictionary<string, string>(); /// <summary> /// String name of the DataQueueHandler we're running with /// </summary> [JsonProperty(PropertyName = "sDataQueueHandler")] public string DataQueueHandler = ""; /// <summary> /// Default constructor for JSON of the Live Task Packet /// </summary> public LiveNodePacket() : base(PacketType.LiveNode) { Controls = new Controls { MinuteLimit = 100, SecondLimit = 50, TickLimit = 25, RamAllocation = 512 }; } } // End Work Packet: } // End of Namespace:
apache-2.0
C#
1650f8517bfef174f8637d8f74d575648e534b94
Add AsyncActionDispatcher
jorik041/maccore,cwensley/maccore,mono/maccore
src/Foundation/NSAction.cs
src/Foundation/NSAction.cs
// // Copyright 2009-2010, Novell, Inc. // Copyright 2012 Xamarin Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using MonoMac.ObjCRuntime; namespace MonoMac.Foundation { public delegate void NSAction (); // Use this for synchronous operations [Register ("__MonoMac_NSActionDispatcher")] internal class NSActionDispatcher : NSObject { public static Selector Selector = new Selector ("apply"); NSAction action; public NSActionDispatcher (NSAction action) { this.action = action; } [Export ("apply")] [Preserve (Conditional = true)] public void Apply () { action (); } } // Use this for asynchronous operations [Register ("__MonoMac_NSAsyncActionDispatcher")] internal class NSAsyncActionDispatcher : NSObject { GCHandle gch; NSAction action; public NSActionDispatcher (NSAction action) { this.action = action; gch = GCHandle.Alloc (this); } [Export ("apply")] [Preserve (Conditional = true)] public void Apply () { action (); gch.Free (); } } }
// // Copyright 2009-2010, Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using MonoMac.ObjCRuntime; namespace MonoMac.Foundation { public delegate void NSAction (); [Register ("__MonoMac_NSActionDispatcher")] internal class NSActionDispatcher : NSObject { public static Selector Selector = new Selector ("apply"); NSAction action; public NSActionDispatcher (NSAction action) { this.action = action; } [Export ("apply")] [Preserve (Conditional = true)] public void Apply () { action (); } } }
apache-2.0
C#
38899ea4dba68dcc4e0d0ddbf242756c26700265
add manage link to key index page to edit keys
IdentityModel/AuthorizationServer,s093294/Thinktecture.AuthorizationServer,IdentityModel/AuthorizationServer,s093294/Thinktecture.AuthorizationServer,yfann/AuthorizationServer,yfann/AuthorizationServer
source/WebHost/Areas/Admin/Views/Key/Index.cshtml
source/WebHost/Areas/Admin/Views/Key/Index.cshtml
@{ ViewBag.Title = "Keys"; } <h2>Keys</h2> <ul class="nav nav-pills"> <li>@Html.ActionLink("New Symmetric Key", "SymmetricKey")</li> </ul> <table class="table table-striped hide table-condensed" data-bind="css: { hide: !keys().length }"> <thead> <tr> <th></th> <th>Name</th> <th>Type</th> <th>Applications</th> </tr> </thead> <tbody data-bind="foreach: keys"> <tr> <td> <a class="btn btn-primary" data-href="@Url.Action("SymmetricKey")" data-bind="attr: { href: $element.dataset.href + '#' + $data.id() }">Manage</a> <button class="btn" data-bind="click: function (data, evt) { $parent.deleteKey(data) }, enable: applicationCount() == 0">Delete</button> </td> <td data-bind="text:name"></td> <td data-bind="text:type"></td> <td data-bind="text: applicationCount"></td> </tr> </tbody> </table> <p data-bind="css: { hide: keys().length }" class="alert alert-warning hide"> No Keys Found </p> @section scripts{ <script src="~/Areas/Admin/Scripts/Keys.js"></script> }
@{ ViewBag.Title = "Keys"; } <h2>Keys</h2> <ul class="nav nav-pills"> <li>@Html.ActionLink("New Symmetric Key", "SymmetricKey")</li> </ul> <table class="table table-striped hide table-condensed" data-bind="css: { hide: !keys().length }"> <thead> <tr> <th></th> <th>Name</th> <th>Type</th> <th>Applications</th> </tr> </thead> <tbody data-bind="foreach: keys"> <tr> <td><button class="btn" data-bind="click: function (data, evt) { $parent.deleteKey(data) }, enable: applicationCount() == 0">Delete</button></td> <td data-bind="text:name"></td> <td data-bind="text:type"></td> <td data-bind="text: applicationCount"></td> </tr> </tbody> </table> <p data-bind="css: { hide: keys().length }" class="alert alert-warning hide"> No Keys Found </p> @section scripts{ <script src="~/Areas/Admin/Scripts/Keys.js"></script> }
bsd-3-clause
C#
8a35bae81624fedf89fbbaf628ed54ed26188f2b
Simplify code (and slightly improve performance)
chromium/vs-chromium,chromium/vs-chromium,chromium/vs-chromium,chromium/vs-chromium
src/Server/FileSystem/Builder/ProjectPathChanges.cs
src/Server/FileSystem/Builder/ProjectPathChanges.cs
using System; using System.Collections.Generic; using System.Linq; using VsChromium.Core.Collections; using VsChromium.Core.Files; using VsChromium.Core.Linq; using VsChromium.Core.Utility; namespace VsChromium.Server.FileSystem.Builder { /// <summary> /// Map from RelativePath to PathChangeKind for a given project root path. /// Note: This class is thread safe /// </summary> public class ProjectPathChanges { private readonly FullPath _projectPath; private readonly Dictionary<RelativePath, PathChangeKind> _map; private readonly Lazy<Dictionary<RelativePath, List<RelativePath>>> _createdChildren; private readonly Lazy<Dictionary<RelativePath, List<RelativePath>> >_deletedChildren; public ProjectPathChanges(FullPath projectPath, IList<PathChangeEntry> entries) { _projectPath = projectPath; _map = entries .Where(x => x.BasePath.Equals(_projectPath)) .Select(x => KeyValuePair.Create(x.RelativePath, x.ChangeKind)) .ToDictionary(x => x.Key, x => x.Value); _createdChildren = new Lazy<Dictionary<RelativePath, List<RelativePath>>>(() => _map .Where(x => x.Value == PathChangeKind.Created) .GroupBy(x => x.Key.Parent) .ToDictionary(g => g.Key, g => g.Select(x => x.Key).ToList())); _deletedChildren = new Lazy<Dictionary<RelativePath, List<RelativePath>>>(() => _map .Where(x => x.Value == PathChangeKind.Deleted) .GroupBy(x => x.Key.Parent) .ToDictionary(g => g.Key, g => g.Select(x => x.Key).ToList())); } public PathChangeKind GetPathChangeKind(RelativePath path) { PathChangeKind result; if (!_map.TryGetValue(path, out result)) { result = PathChangeKind.None; } return result; } public bool IsDeleted(RelativePath path) { return GetPathChangeKind(path) == PathChangeKind.Deleted; } public bool IsCreated(RelativePath path) { return GetPathChangeKind(path) == PathChangeKind.Created; } public bool IsChanged(RelativePath path) { return GetPathChangeKind(path) == PathChangeKind.Changed; } public IList<RelativePath> GetCreatedEntries(RelativePath parentPath) { return _createdChildren.Value.GetValue(parentPath) ?? ArrayUtilities.EmptyList<RelativePath>.Instance; } public IList<RelativePath> GetDeletedEntries(RelativePath parentPath) { return _deletedChildren.Value.GetValue(parentPath) ?? ArrayUtilities.EmptyList<RelativePath>.Instance; } } }
using System; using System.Collections.Generic; using System.Linq; using VsChromium.Core.Collections; using VsChromium.Core.Files; using VsChromium.Core.Linq; using VsChromium.Core.Utility; namespace VsChromium.Server.FileSystem.Builder { /// <summary> /// Map from RelativePath to PathChangeKind for a given project root path. /// Note: This class is thread safe /// </summary> public class ProjectPathChanges { private readonly FullPath _projectPath; private readonly Dictionary<RelativePath, PathChangeKind> _map; private readonly Lazy<Dictionary<RelativePath, List<RelativePath>>> _createdChildren; private readonly Lazy<Dictionary<RelativePath, List<RelativePath>> >_deletedChildren; public ProjectPathChanges(FullPath projectPath, IList<PathChangeEntry> entries) { _projectPath = projectPath; _map = entries .Where(x => PathHelpers.IsPrefix(x.Path.Value, _projectPath.Value)) .Select(x => { var relPath = PathHelpers.SplitPrefix(x.Path.Value, _projectPath.Value).Suffix; return KeyValuePair.Create(new RelativePath(relPath), x.ChangeKind); }) .ToDictionary(x => x.Key, x => x.Value); _createdChildren = new Lazy<Dictionary<RelativePath, List<RelativePath>>>(() => _map .Where(x => x.Value == PathChangeKind.Created) .GroupBy(x => x.Key.Parent) .ToDictionary(g => g.Key, g => g.Select(x => x.Key).ToList())); _deletedChildren = new Lazy<Dictionary<RelativePath, List<RelativePath>>>(() => _map .Where(x => x.Value == PathChangeKind.Deleted) .GroupBy(x => x.Key.Parent) .ToDictionary(g => g.Key, g => g.Select(x => x.Key).ToList())); } public PathChangeKind GetPathChangeKind(RelativePath path) { PathChangeKind result; if (!_map.TryGetValue(path, out result)) { result = PathChangeKind.None; } return result; } public bool IsDeleted(RelativePath path) { return GetPathChangeKind(path) == PathChangeKind.Deleted; } public bool IsCreated(RelativePath path) { return GetPathChangeKind(path) == PathChangeKind.Created; } public bool IsChanged(RelativePath path) { return GetPathChangeKind(path) == PathChangeKind.Changed; } public IList<RelativePath> GetCreatedEntries(RelativePath parentPath) { return _createdChildren.Value.GetValue(parentPath) ?? ArrayUtilities.EmptyList<RelativePath>.Instance; } public IList<RelativePath> GetDeletedEntries(RelativePath parentPath) { return _deletedChildren.Value.GetValue(parentPath) ?? ArrayUtilities.EmptyList<RelativePath>.Instance; } } }
bsd-3-clause
C#
ea25c12fac50520c12649995c731aab4724a622e
Use nameof
carbon/Amazon
src/Amazon.CloudFront/Models/InvalidationBatch.cs
src/Amazon.CloudFront/Models/InvalidationBatch.cs
using System; using System.Collections.Generic; using System.Xml.Linq; namespace Amazon.CloudFront { public sealed class InvalidationBatch { public InvalidationBatch(IList<string> paths) { if (paths is null) throw new ArgumentNullException(nameof(paths)); if (paths.Count == 0) throw new ArgumentException("May not be empty", nameof(paths)); Paths = paths; } public IList<string> Paths { get; } public string CallerReference { get; set; } public XElement ToXml() { var root = new XElement("InvalidationBatch"); foreach (var path in Paths) { root.Add(new XElement("Path", path)); } root.Add(new XElement("CallerReference", CallerReference)); return root; } } } /* <InvalidationBatch> <Path>/image1.jpg</Path> <Path>/image2.jpg</Path> <Path>/videos/movie.flv</Path> <Path>/sound%20track.mp3</Path> <CallerReference>my-batch</CallerReference> </InvalidationBatch> */
using System; using System.Collections.Generic; using System.Xml.Linq; namespace Amazon.CloudFront { public sealed class InvalidationBatch { public InvalidationBatch(IList<string> paths) { if (paths is null) throw new ArgumentNullException(nameof(paths)); if (paths.Count == 0) throw new ArgumentException("May not be empty", "paths"); Paths = paths; } public IList<string> Paths { get; } public string CallerReference { get; set; } public XElement ToXml() { var root = new XElement("InvalidationBatch"); foreach (var path in Paths) { root.Add(new XElement("Path", path)); } root.Add(new XElement("CallerReference", CallerReference)); return root; } } } /* <InvalidationBatch> <Path>/image1.jpg</Path> <Path>/image2.jpg</Path> <Path>/videos/movie.flv</Path> <Path>/sound%20track.mp3</Path> <CallerReference>my-batch</CallerReference> </InvalidationBatch> */
mit
C#
feaba98fc30059e605b15bc901fed81643466040
add of line number
Appleseed/base,Appleseed/base
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class SolrResponseItem { public string id { get; set; } public string item_type { get; set; } public string address_1 { get; set; } public string city { get; set; } public string state { get; set; } public string classification { get; set; } public string country { get; set; } public string postal_code { get; set; } public string product_description { get; set; } public string product_quantity { get; set; } public string product_type { get; set; } public string code_info { get; set; } public string reason_for_recall { get; set; } public DateTime recall_initiation_date { get; set; } public string recall_number { get; set; } public string recalling_firm { get; set; } public string voluntary_mandated { get; set; } public DateTime report_date { get; set; } public string status { get; set; } public DateTime date_last_indexed { get; set; } //ICitations public string act_cfr { get; set; } public string program_area { get; set; } public string description_short { get; set; } public string description_long { get; set; } public DateTime end_date { get; set; } //IClassification public string district_decision { get; set; } public string district { get; set; } public DateTime inspection_end_date { get; set; } public string center { get; set; } public string project_area { get; set; } public string legal_name { get; set; } //IRefusal public string fei_number { get; set; } public string product_code { get; set; } public string product_code_description { get; set; } public DateTime refusal_date { get; set; } public string entry_number { get; set; } public string rfrnc_doc_id { get; set; } public string line_number { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class SolrResponseItem { public string id { get; set; } public string item_type { get; set; } public string address_1 { get; set; } public string city { get; set; } public string state { get; set; } public string classification { get; set; } public string country { get; set; } public string postal_code { get; set; } public string product_description { get; set; } public string product_quantity { get; set; } public string product_type { get; set; } public string code_info { get; set; } public string reason_for_recall { get; set; } public DateTime recall_initiation_date { get; set; } public string recall_number { get; set; } public string recalling_firm { get; set; } public string voluntary_mandated { get; set; } public DateTime report_date { get; set; } public string status { get; set; } public DateTime date_last_indexed { get; set; } //ICitations public string act_cfr { get; set; } public string program_area { get; set; } public string description_short { get; set; } public string description_long { get; set; } public DateTime end_date { get; set; } //IClassification public string district_decision { get; set; } public string district { get; set; } public DateTime inspection_end_date { get; set; } public string center { get; set; } public string project_area { get; set; } public string legal_name { get; set; } //IRefusal public string fei_number { get; set; } public string product_code { get; set; } public string product_code_description { get; set; } public DateTime refusal_date { get; set; } public string entry_number { get; set; } public string rfrnc_doc_id { get; set; } } }
apache-2.0
C#
bd48694074e3bbb2164de68d909b3c26a14377b1
Make method private
roman-yagodin/R7.News,roman-yagodin/R7.News,roman-yagodin/R7.News
R7.News/Controls/ActionButtons.ascx.cs
R7.News/Controls/ActionButtons.ascx.cs
using System.Collections.Generic; using System.Linq; using System.Web.UI; using System.Web.UI.WebControls; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; using DotNetNuke.UI.Modules; using R7.Dnn.Extensions.ViewModels; using R7.News.Components; using R7.News.Controls.Models; using R7.News.Controls.ViewModels; using R7.Dnn.Extensions.Controls; namespace R7.News.Controls { public class ActionButtons: UserControl { #region Controls protected ListView listActionButtons; #endregion #region Public properties public IList<NewsEntryAction> Actions { get; set; } #endregion ViewModelContext viewModelContext; protected ViewModelContext DnnContext { get { return viewModelContext ?? (viewModelContext = new ViewModelContext (this, this.FindParentOfType<IModuleControl> ())); } } public override void DataBind () { if (Actions != null && Actions.Count > 0) { listActionButtons.DataSource = Actions.Select (a => new NewsEntryActionViewModel (a, DnnContext)); } base.DataBind (); } protected void linkActionButton_Command (object sender, CommandEventArgs e) { // Cannot use DnnContext here? var actionHandler = new ActionHandler (); var action = JsonExtensionsWeb.FromJson<NewsEntryAction> ((string) e.CommandArgument); actionHandler.ExecuteAction (action, PortalSettings.Current.PortalId, PortalSettings.Current.ActiveTab.TabID, GetSuperUserId ()); } int GetSuperUserId () { var superUsers = UserController.GetUsers (false, true, -1); return ((UserInfo) superUsers [0]).UserID; } } }
using System.Collections.Generic; using System.Linq; using System.Web.UI; using System.Web.UI.WebControls; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; using DotNetNuke.UI.Modules; using R7.Dnn.Extensions.ViewModels; using R7.News.Components; using R7.News.Controls.Models; using R7.News.Controls.ViewModels; using R7.Dnn.Extensions.Controls; namespace R7.News.Controls { public class ActionButtons: UserControl { #region Controls protected ListView listActionButtons; #endregion #region Public properties public IList<NewsEntryAction> Actions { get; set; } #endregion ViewModelContext viewModelContext; protected ViewModelContext DnnContext { get { return viewModelContext ?? (viewModelContext = new ViewModelContext (this, this.FindParentOfType<IModuleControl> ())); } } public override void DataBind () { if (Actions != null && Actions.Count > 0) { listActionButtons.DataSource = Actions.Select (a => new NewsEntryActionViewModel (a, DnnContext)); } base.DataBind (); } protected void linkActionButton_Command (object sender, CommandEventArgs e) { // Cannot use DnnContext here? var actionHandler = new ActionHandler (); var action = JsonExtensionsWeb.FromJson<NewsEntryAction> ((string) e.CommandArgument); actionHandler.ExecuteAction (action, PortalSettings.Current.PortalId, PortalSettings.Current.ActiveTab.TabID, GetSuperUserId ()); } protected int GetSuperUserId () { var superUsers = UserController.GetUsers (false, true, -1); return ((UserInfo) superUsers [0]).UserID; } } }
agpl-3.0
C#
fdf8998e46e08f017afdc53b884940470371dfb1
Add AssembyResolver test
Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver
test/AsmResolver.DotNet.Tests/AssemblyResolverTest.cs
test/AsmResolver.DotNet.Tests/AssemblyResolverTest.cs
using System.IO; using AsmResolver.DotNet.Signatures; using AsmResolver.DotNet.TestCases.NestedClasses; using Xunit; namespace AsmResolver.DotNet.Tests { public class AssemblyResolverTest { private readonly SignatureComparer _comparer = new SignatureComparer(); [Fact] public void ResolveCorLib() { var assemblyName = typeof(object).Assembly.GetName(); var assemblyRef = new AssemblyReference( assemblyName.Name, assemblyName.Version, false, assemblyName.GetPublicKeyToken()); var resolver = new NetCoreAssemblyResolver(); var assemblyDef = resolver.Resolve(assemblyRef); Assert.NotNull(assemblyDef); Assert.Equal(assemblyName.Name, assemblyDef.Name); } [Fact] public void ResolveLocalLibrary() { var resolver = new NetCoreAssemblyResolver(); resolver.SearchDirectories.Add(Path.GetDirectoryName(typeof(AssemblyResolverTest).Assembly.Location)); var assemblyDef = AssemblyDefinition.FromFile(typeof(TopLevelClass1).Assembly.Location); var assemblyRef = new AssemblyReference(assemblyDef); Assert.Equal(assemblyDef, resolver.Resolve(assemblyRef), _comparer); resolver.ClearCache(); resolver.AddToCache(assemblyRef, assemblyDef); Assert.Equal(assemblyDef, resolver.Resolve(assemblyRef)); resolver.RemoveFromCache(assemblyRef); Assert.NotEqual(assemblyDef, resolver.Resolve(assemblyRef)); } } }
using System.IO; using AsmResolver.DotNet.Signatures; using AsmResolver.DotNet.TestCases.NestedClasses; using Xunit; namespace AsmResolver.DotNet.Tests { public class AssemblyResolverTest { private readonly SignatureComparer _comparer = new SignatureComparer(); [Fact] public void ResolveCorLib() { var assemblyName = typeof(object).Assembly.GetName(); var assemblyRef = new AssemblyReference( assemblyName.Name, assemblyName.Version, false, assemblyName.GetPublicKeyToken()); var resolver = new NetCoreAssemblyResolver(); var assemblyDef = resolver.Resolve(assemblyRef); Assert.NotNull(assemblyDef); Assert.Equal(assemblyName.Name, assemblyDef.Name); } [Fact] public void ResolveLocalLibrary() { var resolver = new NetCoreAssemblyResolver(); resolver.SearchDirectories.Add(Path.GetDirectoryName(typeof(AssemblyResolverTest).Assembly.Location)); var assemblyDef = AssemblyDefinition.FromFile(typeof(TopLevelClass1).Assembly.Location); var assemblyRef = new AssemblyReference(assemblyDef); Assert.Equal(assemblyDef, resolver.Resolve(assemblyRef), _comparer); } } }
mit
C#
0ec72a7b8c2f09bbdc3bc73f7fa1e4267d2c7edc
Fix formatting.
int19h/PTVS,int19h/PTVS,huguesv/PTVS,huguesv/PTVS,Microsoft/PTVS,DEVSENSE/PTVS,huguesv/PTVS,DEVSENSE/PTVS,int19h/PTVS,DEVSENSE/PTVS,int19h/PTVS,zooba/PTVS,zooba/PTVS,DEVSENSE/PTVS,DEVSENSE/PTVS,int19h/PTVS,Microsoft/PTVS,DEVSENSE/PTVS,Microsoft/PTVS,Microsoft/PTVS,Microsoft/PTVS,int19h/PTVS,huguesv/PTVS,zooba/PTVS,huguesv/PTVS,Microsoft/PTVS,zooba/PTVS,zooba/PTVS,huguesv/PTVS,zooba/PTVS
Python/Product/Cookiecutter/Telemetry/DictionaryExtension.cs
Python/Product/Cookiecutter/Telemetry/DictionaryExtension.cs
// Python Tools for Visual Studio // Copyright(c) Microsoft Corporation // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the License); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS // OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY // IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. using System.Collections.Generic; using System.Reflection; namespace Microsoft.CookiecutterTools.Telemetry { internal static class DictionaryExtension { public static IDictionary<string, object> FromAnonymousObject(object data) { IDictionary<string, object> dict; if (data != null) { dict = data as IDictionary<string, object>; if (dict == null) { var attr = BindingFlags.Public | BindingFlags.Instance; dict = new Dictionary<string, object>(); foreach (var property in data.GetType().GetProperties(attr)) { if (property.CanRead) { dict.Add(property.Name, property.GetValue(data, null)); } } } } else { dict = new Dictionary<string, object>(); } return dict; } } }
// Python Tools for Visual Studio // Copyright(c) Microsoft Corporation // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the License); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS // OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY // IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. using System.Collections.Generic; using System.Reflection; namespace Microsoft.CookiecutterTools.Telemetry { internal static class DictionaryExtension { public static IDictionary<string, object> FromAnonymousObject(object data) { IDictionary<string, object> dict; if (data != null) { dict = data as IDictionary<string, object>; if (dict == null) { var attr = BindingFlags.Public | BindingFlags.Instance; dict = new Dictionary<string, object>(); foreach (var property in data.GetType().GetProperties(attr)) { if (property.CanRead) { dict.Add(property.Name, property.GetValue(data, null)); } } } } else { dict = new Dictionary<string, object>(); } return dict; } } }
apache-2.0
C#
f81b0c01ec686e43fb3da44c0758d1b4536e5284
Add sqlite migrate on startup
mglodack/RedCard.API,mglodack/RedCard.API
src/RedCard.API/Program.cs
src/RedCard.API/Program.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Builder; using RedCard.API.Contexts; using Microsoft.EntityFrameworkCore; namespace RedCard.API { public class Program { public static void Main(string[] args) { using (var context = new ApplicationDbContext()) { context.Database.Migrate(); } var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup<Startup>() .Build(); host.Run(); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Builder; namespace RedCard.API { public class Program { public static void Main(string[] args) { var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup<Startup>() .Build(); host.Run(); } } }
mit
C#
9e9f6e0c9357c19014a87662cfa7525fbd09f413
Fix error if Content-Length has already been set
xabikos/aspnet-webpack
src/Webpack/WebpackMiddleware.cs
src/Webpack/WebpackMiddleware.cs
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.Extensions.Logging; using System.IO; using System.Threading.Tasks; namespace Webpack { public class WebpackMiddleware { RequestDelegate _next; private readonly ILogger _logger; WebPackMiddlewareOptions _options; public WebpackMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, WebPackMiddlewareOptions options) { _next = next; _logger = loggerFactory.CreateLogger<WebpackMiddleware>(); _options = options; } public async Task Invoke(HttpContext context) { var buffer = new MemoryStream(); var stream = context.Response.Body; context.Response.Body = buffer; await _next(context); buffer.Seek(0, SeekOrigin.Begin); var isHtml = context.Response.ContentType?.ToLower().Contains("text/html"); if (context.Response.StatusCode == 200 && isHtml.GetValueOrDefault()) { using (var reader = new StreamReader(buffer)) { var response = await reader.ReadToEndAsync(); if (response.Contains("</body>")) { _logger.LogInformation("A full html page is returned so the necessary script for webpack will be injected"); var scriptTag = string.Empty; if (_options.EnableHotLoading) { scriptTag = $"<script src=\"http://{_options.Host}:{_options.Port}/{_options.OutputFileName}\"></script>"; response = response.Replace("</body>", $"{scriptTag}</body>"); } else { scriptTag = $"<script src=\"{_options.OutputFileName}\"></script>"; response = response.Replace("</body>", $"{scriptTag}</body>"); } _logger.LogInformation($"Inject script {scriptTag} as a last element in the body "); } using (var memStream = new MemoryStream()) using (var writer = new StreamWriter(memStream)) { writer.Write(response); writer.Flush(); memStream.Seek(0, SeekOrigin.Begin); context.Response.Headers["Content-Length"] = memStream.Length.ToString(); await memStream.CopyToAsync(stream); } } } else { await buffer.CopyToAsync(stream); } } } }
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.Extensions.Logging; using System.IO; using System.Threading.Tasks; namespace Webpack { public class WebpackMiddleware { RequestDelegate _next; private readonly ILogger _logger; WebPackMiddlewareOptions _options; public WebpackMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, WebPackMiddlewareOptions options) { _next = next; _logger = loggerFactory.CreateLogger<WebpackMiddleware>(); _options = options; } public async Task Invoke(HttpContext context) { var buffer = new MemoryStream(); var stream = context.Response.Body; context.Response.Body = buffer; await _next(context); buffer.Seek(0, SeekOrigin.Begin); var isHtml = context.Response.ContentType?.ToLower().Contains("text/html"); if (context.Response.StatusCode == 200 && isHtml.GetValueOrDefault()) { using (var reader = new StreamReader(buffer)) { var response = await reader.ReadToEndAsync(); if (response.Contains("</body>")) { _logger.LogInformation("A full html page is returned so the necessary script for webpack will be injected"); var scriptTag = string.Empty; if (_options.EnableHotLoading) { scriptTag = $"<script src=\"http://{_options.Host}:{_options.Port}/{_options.OutputFileName}\"></script>"; response = response.Replace("</body>", $"{scriptTag}</body>"); } else { scriptTag = $"<script src=\"{_options.OutputFileName}\"></script>"; response = response.Replace("</body>", $"{scriptTag}</body>"); } _logger.LogInformation($"Inject script {scriptTag} as a last element in the body "); } using (var memStream = new MemoryStream()) using (var writer = new StreamWriter(memStream)) { writer.Write(response); writer.Flush(); memStream.Seek(0, SeekOrigin.Begin); context.Response.Headers.Add("Content-Length", memStream.Length.ToString()); await memStream.CopyToAsync(stream); } } } else { await buffer.CopyToAsync(stream); } } } }
mit
C#
6662724f2b8e37518b76b4616d39b107da88053a
check if Dns.GetHostAddressesAsync got a ip "::1" then convert to 127.0.0.1
gboucher90/thrift-netcore,gboucher90/thrift-netcore
src/thrift-netcore/Transport/TcpClientExtensions.cs
src/thrift-netcore/Transport/TcpClientExtensions.cs
using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; namespace Thrift.Transport { public static class TcpClientExtensions { public static async Task ClientConnectAsync(this TcpClient tcpClient, string host, int port) { #if NETSTANDARD1_4 || NETSTANDARD1_5 IPAddress ip; if (IPAddress.TryParse(host, out ip)) // if host is ip, parse it and connect { await tcpClient.ConnectAsync(ip, port); } else { IPAddress[] addresses = await Dns.GetHostAddressesAsync(host);// not ip, resolve it and get IP(s) if (addresses.Length > 0) { int rand = (int)(DateTime.Now.Ticks % addresses.Length); // if dns port to multiple IPs, random an ip to connect IPAddress address = addresses[rand]; if (address.ToString() == "::1") address = IPAddress.Parse("127.0.0.1"); await tcpClient.ConnectAsync(address, port); } else throw new TTransportException(TTransportException.ExceptionType.NotOpen, $"Can't resolve host({host})"); } #else await client.ConnectAsync(host, port); #endif } } }
using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; namespace Thrift.Transport { public static class TcpClientExtensions { public static async Task ClientConnectAsync(this TcpClient tcpClient, string host, int port) { #if NETSTANDARD1_4 || NETSTANDARD1_5 IPAddress ip; if (IPAddress.TryParse(host, out ip)) // if host is ip, parse it and connect { await tcpClient.ConnectAsync(ip, port); } else { IPAddress[] address = await Dns.GetHostAddressesAsync(host);// not ip, resolve it and get IP(s) if (address.Length > 0) { int rand = (int)(DateTime.Now.Ticks % address.Length); // if dns port to multiple IPs, random an ip to connect await tcpClient.ConnectAsync(address[rand], port); } else throw new TTransportException(TTransportException.ExceptionType.NotOpen, $"Can't resolve host({host})"); } #else await client.ConnectAsync(host, port); #endif } } }
apache-2.0
C#
6a971d3e42403c8e7f48ffe5c2b240c89f34e1b4
add Timer in PomodoroService
zindlsn/RosaroterTiger
RosaroterPanterWPF/RosaroterPanterWPF/PomodoroService.cs
RosaroterPanterWPF/RosaroterPanterWPF/PomodoroService.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Timers; namespace RosaroterPanterWPF { public class PomodoroService { private Timer Timer; public PomodoroService() { } public void StartTask(DataService.Task task) { } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RosaroterPanterWPF.Services { public class PomodoroService { public void startTask(Task task) { } } }
mit
C#
b6076d50c10411868bee820e338753a0dbdd4878
Use wss for lobby, not ws
Chess-Variants-Training/Chess-Variants-Training,Chess-Variants-Training/Chess-Variants-Training,Chess-Variants-Training/Chess-Variants-Training
src/ChessVariantsTraining/Views/Variant960/Lobby.cshtml
src/ChessVariantsTraining/Views/Variant960/Lobby.cshtml
@section Title{Variant960 Lobby} @section AddToHead { <link rel="stylesheet" type="text/css" href="@Url.Content("~/styles/variant960/lobby.css")"> <script type="text/javascript">window.wsUrl = "@Url.Action("LobbySocket", "Socket", null, "wss")";</script> <script src="@Url.Content("~/scripts/variant960/lobby.js")" type="text/javascript"></script> } <h1>Play Variant960 games</h1> <div> <div id="seek-table"> <div class="header"> <div class="seek-player"><strong>Player</strong></div> <div class="seek-time"><strong>Time</strong></div> <div class="seek-variant"><strong>Variant</strong></div> </div> </div> <div id="creation"> <h2>Create a game</h2> <p>Initial time:</p> <input type="range" min="0" max="33" value="6" id="time-range"> <p id="initial-time"></p> <hr> <p>Increment:</p> <input type="range" min="0" max="30" value="2" id="inc-range"> <p id="increment"></p> <hr> <p> Variant: <select id="variant-selector"> <option value="Antichess">Antichess 960</option> <option value="Atomic">Atomic 960</option> <option value="Horde">Horde 960</option> <option value="KingOfTheHill">King of the Hill 960</option> <option value="RacingKings">Racing Kings 1440</option> <option value="ThreeCheck">Three-Check 960</option> </select> </p> <p> Board: <select id="symmetry-selector"> <option value="symmetrical">Symmetrical</option> <option value="asymetrical">Asymmetrical</option> </select> </p> <hr> <button id="create-game">Create game</button> </div> </div>
@section Title{Variant960 Lobby} @section AddToHead { <link rel="stylesheet" type="text/css" href="@Url.Content("~/styles/variant960/lobby.css")"> <script type="text/javascript">window.wsUrl = "@Url.Action("LobbySocket", "Socket", null, "ws")";</script> <script src="@Url.Content("~/scripts/variant960/lobby.js")" type="text/javascript"></script> } <h1>Play Variant960 games</h1> <div> <div id="seek-table"> <div class="header"> <div class="seek-player"><strong>Player</strong></div> <div class="seek-time"><strong>Time</strong></div> <div class="seek-variant"><strong>Variant</strong></div> </div> </div> <div id="creation"> <h2>Create a game</h2> <p>Initial time:</p> <input type="range" min="0" max="33" value="6" id="time-range"> <p id="initial-time"></p> <hr> <p>Increment:</p> <input type="range" min="0" max="30" value="2" id="inc-range"> <p id="increment"></p> <hr> <p> Variant: <select id="variant-selector"> <option value="Antichess">Antichess 960</option> <option value="Atomic">Atomic 960</option> <option value="Horde">Horde 960</option> <option value="KingOfTheHill">King of the Hill 960</option> <option value="RacingKings">Racing Kings 1440</option> <option value="ThreeCheck">Three-Check 960</option> </select> </p> <p> Board: <select id="symmetry-selector"> <option value="symmetrical">Symmetrical</option> <option value="asymetrical">Asymmetrical</option> </select> </p> <hr> <button id="create-game">Create game</button> </div> </div>
agpl-3.0
C#
4913e83a32ef54d35acabd51936e979709892494
Set correct min and max values
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Fluent/ViewModels/TestLineChartViewModel.cs
WalletWasabi.Fluent/ViewModels/TestLineChartViewModel.cs
using System.Collections.Generic; namespace WalletWasabi.Fluent.ViewModels { public class TestLineChartViewModel { public double XAxisCurrentValue { get; set; } = 36; public double XAxisMinValue { get; set; } = 1; public double XAxisMaxValue { get; set; } = 1008; public List<string> XAxisLabels => new List<string>() { "1w", "3d", "1d", "12h", "6h", "3h", "1h", "30m", "20m", "fastest" }; public List<double> XAxisValues => new List<double>() { 1008, 432, 144, 72, 36, 18, 6, 3, 2, 1, }; public List<double> YAxisValues => new List<double>() { 4, 4, 7, 22, 57, 97, 102, 123, 123, 185 }; } }
using System.Collections.Generic; namespace WalletWasabi.Fluent.ViewModels { public class TestLineChartViewModel { public double XAxisCurrentValue { get; set; } = 36; public double XAxisMinValue { get; set; } = 2; public double XAxisMaxValue { get; set; } = 864; public List<string> XAxisLabels => new List<string>() { "1w", "3d", "1d", "12h", "6h", "3h", "1h", "30m", "20m", "fastest" }; public List<double> XAxisValues => new List<double>() { 1008, 432, 144, 72, 36, 18, 6, 3, 2, 1, }; public List<double> YAxisValues => new List<double>() { 4, 4, 7, 22, 57, 97, 102, 123, 123, 185 }; } }
mit
C#
875c31c2eca4a05c07d3c0ff89cda272fa9e9762
fix tests
sachatrauwaen/OpenApp,sachatrauwaen/OpenApp,sachatrauwaen/OpenApp,sachatrauwaen/OpenApp,sachatrauwaen/OpenApp,sachatrauwaen/OpenApp
test/Satrabel.OpenApp.Tests/JobManagerTestModule.cs
test/Satrabel.OpenApp.Tests/JobManagerTestModule.cs
using System; using Abp.AutoMapper; using Abp.Dependency; using Abp.Modules; using Abp.Configuration.Startup; using Abp.Net.Mail; using Abp.TestBase; using Abp.Zero.Configuration; using Abp.Zero.EntityFrameworkCore; using Satrabel.OpenApp.EntityFramework; using Satrabel.OpenApp.Tests.DependencyInjection; using Castle.MicroKernel.Registration; using NSubstitute; using Satrabel.OpenApp.Web.Startup; using Satrabel.Starter.Web.Startup; using Satrabel.Starter.EntityFramework; using Abp.Reflection.Extensions; using Abp.AspNetCore; namespace Satrabel.OpenApp.Tests { [DependsOn( typeof(OpenAppApplicationModule), typeof(EntityFrameworkModule), typeof(AbpTestBaseModule) )] public class JobManagerTestModule : AbpModule { public JobManagerTestModule(EntityFrameworkModule abpProjectNameEntityFrameworkModule) { abpProjectNameEntityFrameworkModule.SkipDbContextRegistration = true; } public override void PreInitialize() { Configuration.UnitOfWork.Timeout = TimeSpan.FromMinutes(30); Configuration.UnitOfWork.IsTransactional = false; //Disable static mapper usage since it breaks unit tests (see https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2052) Configuration.Modules.AbpAutoMapper().UseStaticMapper = false; Configuration.BackgroundJobs.IsJobExecutionEnabled = false; //StarterLocalizationConfigurer.Configure(Configuration.Localization); //Use database for language management Configuration.Modules.Zero().LanguageManagement.EnableDbLocalization(); RegisterFakeService<AbpZeroDbMigrator<AppDbContext>>(); Configuration.ReplaceService<IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient); } public override void Initialize() { ServiceCollectionRegistrar.Register(IocManager); } private void RegisterFakeService<TService>() where TService : class { IocManager.IocContainer.Register( Component.For<TService>() .UsingFactoryMethod(() => Substitute.For<TService>()) .LifestyleSingleton() ); } } }
using System; using Abp.AutoMapper; using Abp.Dependency; using Abp.Modules; using Abp.Configuration.Startup; using Abp.Net.Mail; using Abp.TestBase; using Abp.Zero.Configuration; using Abp.Zero.EntityFrameworkCore; using Satrabel.OpenApp.EntityFramework; using Satrabel.OpenApp.Tests.DependencyInjection; using Castle.MicroKernel.Registration; using NSubstitute; using Satrabel.OpenApp.Web.Startup; using Satrabel.Starter.Web.Startup; using Satrabel.Starter.EntityFramework; using Satrabel.OpenApp.Web.Localization; using Abp.Reflection.Extensions; using Abp.AspNetCore; namespace Satrabel.OpenApp.Tests { [DependsOn( typeof(OpenAppApplicationModule), typeof(EntityFrameworkModule), typeof(AbpTestBaseModule) )] public class JobManagerTestModule : AbpModule { public JobManagerTestModule(EntityFrameworkModule abpProjectNameEntityFrameworkModule) { abpProjectNameEntityFrameworkModule.SkipDbContextRegistration = true; } public override void PreInitialize() { Configuration.UnitOfWork.Timeout = TimeSpan.FromMinutes(30); Configuration.UnitOfWork.IsTransactional = false; //Disable static mapper usage since it breaks unit tests (see https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2052) Configuration.Modules.AbpAutoMapper().UseStaticMapper = false; Configuration.BackgroundJobs.IsJobExecutionEnabled = false; //StarterLocalizationConfigurer.Configure(Configuration.Localization); //Use database for language management Configuration.Modules.Zero().LanguageManagement.EnableDbLocalization(); RegisterFakeService<AbpZeroDbMigrator<AppDbContext>>(); Configuration.ReplaceService<IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient); } public override void Initialize() { ServiceCollectionRegistrar.Register(IocManager); } private void RegisterFakeService<TService>() where TService : class { IocManager.IocContainer.Register( Component.For<TService>() .UsingFactoryMethod(() => Substitute.For<TService>()) .LifestyleSingleton() ); } } }
mit
C#
fcbbf5703f4bef0560d753b44439ff6fbec1d6f1
Fix LocalConfiguration values from being space sensitive
adam-mccoy/elasticsearch-net,elastic/elasticsearch-net,jonyadamit/elasticsearch-net,RossLieberman/NEST,RossLieberman/NEST,UdiBen/elasticsearch-net,cstlaurent/elasticsearch-net,cstlaurent/elasticsearch-net,cstlaurent/elasticsearch-net,adam-mccoy/elasticsearch-net,TheFireCookie/elasticsearch-net,azubanov/elasticsearch-net,KodrAus/elasticsearch-net,azubanov/elasticsearch-net,CSGOpenSource/elasticsearch-net,jonyadamit/elasticsearch-net,TheFireCookie/elasticsearch-net,CSGOpenSource/elasticsearch-net,jonyadamit/elasticsearch-net,elastic/elasticsearch-net,RossLieberman/NEST,KodrAus/elasticsearch-net,UdiBen/elasticsearch-net,KodrAus/elasticsearch-net,azubanov/elasticsearch-net,CSGOpenSource/elasticsearch-net,TheFireCookie/elasticsearch-net,adam-mccoy/elasticsearch-net,UdiBen/elasticsearch-net
src/Tests/Framework/Configuration/LocalConfiguration.cs
src/Tests/Framework/Configuration/LocalConfiguration.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tests.Framework.Configuration { public class LocalConfiguration { public bool IntegrationOverride { get; private set; } = false; public string ManualOverrideVersion { get; private set; } = "2.0.0-rc1"; public LocalConfiguration(string configurationFile) { if (!File.Exists(configurationFile)) return; var config = File.ReadAllLines(configurationFile) .ToDictionary(l => ConfigName(l), l => ConfigValue(l)); this.IntegrationOverride = bool.Parse(config["integration_override"]); this.ManualOverrideVersion = config["override_version"]; } private string ConfigName(string configLine) => Parse(configLine, 0); private string ConfigValue(string configLine) => Parse(configLine, 1); private string Parse(string configLine, int index) => configLine.Split(':')[index].Trim(' '); } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tests.Framework.Configuration { public class LocalConfiguration { public bool IntegrationOverride { get; private set; } = false; public string ManualOverrideVersion { get; private set; } = "2.0.0-rc1"; public LocalConfiguration(string configurationFile) { if (!File.Exists(configurationFile)) return; var config = File.ReadAllLines(configurationFile) .ToDictionary(l => l.Split(':')[0], l => l.Split(':')[1]); this.IntegrationOverride = bool.Parse(config["integration_override"]); this.ManualOverrideVersion = config["override_version"]; } } }
apache-2.0
C#
47cb516a93c3e5c24a20ffac630c6f384b3fa67f
Reorder methods
appharbor/appharbor-cli
src/AppHarbor/AppHarborClient.cs
src/AppHarbor/AppHarborClient.cs
using System; using System.Collections.Generic; using AppHarbor.Model; namespace AppHarbor { public class AppHarborClient : IAppHarborClient { private readonly AuthInfo _authInfo; public AppHarborClient(string AccessToken) { _authInfo = new AuthInfo { AccessToken = AccessToken }; } public CreateResult<string> CreateApplication(string name, string regionIdentifier = null) { var appHarborApi = GetAppHarborApi(); return appHarborApi.CreateApplication(name, regionIdentifier); } public IEnumerable<Application> GetApplications() { var appHarborApi = GetAppHarborApi(); return appHarborApi.GetApplications(); } public User GetUser() { var appHarborApi = GetAppHarborApi(); return appHarborApi.GetUser(); } private AppHarborApi GetAppHarborApi() { try { return new AppHarborApi(_authInfo); } catch (ArgumentNullException) { throw new CommandException("You're not logged in. Log in with \"appharbor login\""); } } } }
using System; using System.Collections.Generic; using AppHarbor.Model; namespace AppHarbor { public class AppHarborClient : IAppHarborClient { private readonly AuthInfo _authInfo; public AppHarborClient(string AccessToken) { _authInfo = new AuthInfo { AccessToken = AccessToken }; } public CreateResult<string> CreateApplication(string name, string regionIdentifier = null) { var appHarborApi = GetAppHarborApi(); return appHarborApi.CreateApplication(name, regionIdentifier); } public IEnumerable<Application> GetApplications() { var appHarborApi = GetAppHarborApi(); return appHarborApi.GetApplications(); } private AppHarborApi GetAppHarborApi() { try { return new AppHarborApi(_authInfo); } catch (ArgumentNullException) { throw new CommandException("You're not logged in. Log in with \"appharbor login\""); } } public User GetUser() { var appHarborApi = GetAppHarborApi(); return appHarborApi.GetUser(); } } }
mit
C#
6744ff5ac87c0dae9755d28a7529ed6e09d91fc8
Update version 1.3.73
agileharbor/shipStationAccess
src/Global/GlobalAssemblyInfo.cs
src/Global/GlobalAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "ShipStationAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "ShipStation webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "1.3.73.0" ) ]
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "ShipStationAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "ShipStation webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "1.3.72.0" ) ]
bsd-3-clause
C#
57b4eeb19a04ce1d2af64a637d06082b545435a2
fix message
PKRoma/Fody,distantcam/Fody,huoxudong125/Fody,furesoft/Fody,Fody/Fody,GeertvanHorrik/Fody,ichengzi/Fody,ColinDabritzViewpoint/Fody,jasonholloway/Fody
Fody/InstanceLinker/WeaversConfiguredInstanceLinker.cs
Fody/InstanceLinker/WeaversConfiguredInstanceLinker.cs
using MethodTimer; public partial class Processor { [Time] public void ConfigureWhenWeaversFound() { foreach (var weaverConfig in Weavers) { ProcessConfig(weaverConfig); } } public void ProcessConfig(WeaverEntry weaverConfig) { //support for diff names weavers when "In solution weaving" var weaverProjectContains = WeaverProjectContainsType(weaverConfig.AssemblyName); if (weaverProjectContains) { weaverConfig.AssemblyPath = WeaverAssemblyPath; weaverConfig.TypeName = weaverConfig.AssemblyName; return; } var assemblyPath = FindAssemblyPath(weaverConfig.AssemblyName); if (assemblyPath == null) { var message = string.Format( @"Could not find a weaver named '{0}'. If you have nuget package restore turned on you probably need to do a build to download the weavers. Alternatively you may have added a weaver to your 'FodyWeavers.xml' and forgot to add the appropriate nuget package. Perhaps you need to run 'Install-Package {0}.Fody'. This url may provide more information http://nuget.org/packages/{0}.Fody/ .", weaverConfig.AssemblyName); throw new WeavingException(message); } weaverConfig.AssemblyPath = assemblyPath; weaverConfig.TypeName = "ModuleWeaver"; } }
using MethodTimer; public partial class Processor { [Time] public void ConfigureWhenWeaversFound() { foreach (var weaverConfig in Weavers) { ProcessConfig(weaverConfig); } } public void ProcessConfig(WeaverEntry weaverConfig) { //support for diff names weavers when "In solution weaving" var weaverProjectContains = WeaverProjectContainsType(weaverConfig.AssemblyName); if (weaverProjectContains) { weaverConfig.AssemblyPath = WeaverAssemblyPath; weaverConfig.TypeName = weaverConfig.AssemblyName; return; } var assemblyPath = FindAssemblyPath(weaverConfig.AssemblyName); if (assemblyPath == null) { var message = string.Format( @"Could not find a weaver named '{0}'. If you have nuget package restore turned on you probably need to do a build to download the weavers. Alternatively you may have added a weaver to your 'FodyWeavers.xml' and forgot to add the appropriate nuget package. Perhaps you need to run 'Install-Package {0}.Fody'. This url may provide more information http://nuget.org/packages/{0}.Fody/", weaverConfig.AssemblyName); throw new WeavingException(message); } weaverConfig.AssemblyPath = assemblyPath; weaverConfig.TypeName = "ModuleWeaver"; } }
mit
C#
b5e820c6a84b51d38af12d09e9dbb491d17b19e5
Update Demo
sunkaixuan/SqlSugar
Src/Asp.Net/OracleTest/Config.cs
Src/Asp.Net/OracleTest/Config.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OrmTest { public class Config { public static string ConnectionString = "Data Source=localhost/orcl;User ID=system;Password=jhl856615011;"; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OrmTest { public class Config { public static string ConnectionString = "Data Source=localhost/orcl;User ID=system;Password=jhl85661501;"; } }
apache-2.0
C#
f93487922d5cb49056151b668e4e79043361a09c
Update assembly info
Epinova/Epinova.QuickExport,Epinova/Epinova.QuickExport
src/Epinova.QuickExport/Properties/AssemblyInfo.cs
src/Epinova.QuickExport/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Epinova.QuickExport")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Epinova AS")] [assembly: AssemblyProduct("Epinova.QuickExport")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b0281478-54e9-479d-936e-832efc0cbfe8")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Epinova.QuickExport")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Epinova.QuickExport")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b0281478-54e9-479d-936e-832efc0cbfe8")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
b4063c8d9cbadb09a6294ca4f53b65b9a6586b55
Fix incorrect doc comments.
github/VisualStudio,github/VisualStudio,github/VisualStudio
src/GitHub.Exports.Reactive/Services/IGitClient.cs
src/GitHub.Exports.Reactive/Services/IGitClient.cs
using System; using System.Reactive; using LibGit2Sharp; namespace GitHub.Services { public interface IGitClient { /// <summary> /// Pushes the specified branch to the remote. /// </summary> /// <param name="repository">The repository to pull</param> /// <param name="remoteName">The name of the remote</param> /// <param name="branchName">the branch to pull</param> /// <returns></returns> IObservable<Unit> Push(IRepository repository, string branchName, string remoteName); /// <summary> /// Fetches the remote. /// </summary> /// <param name="repository">The repository to pull</param> /// <param name="remoteName">The name of the remote</param> /// <returns></returns> IObservable<Unit> Fetch(IRepository repository, string remoteName); /// <summary> /// Sets the specified remote to the specified URL. /// </summary> /// <param name="repository">The repository to set</param> /// <param name="remoteName">The name of the remote</param> /// <param name="url">The URL to set as the remote</param> /// <returns></returns> IObservable<Unit> SetRemote(IRepository repository, string remoteName, Uri url); /// <summary> /// Sets the remote branch that the local branch tracks /// </summary> /// <param name="repository">The repository to set</param> /// <param name="branchName">The name of the local remote</param> /// <param name="remoteName">The name of the remote branch</param> /// <returns></returns> IObservable<Unit> SetTrackingBranch(IRepository repository, string branchName, string remoteName); IObservable<Remote> GetHttpRemote(IRepository repo, string remote); } }
using System; using System.Reactive; using LibGit2Sharp; namespace GitHub.Services { public interface IGitClient { /// <summary> /// Pushes the specified branch to the remote. /// </summary> /// <param name="repository">The repository to pull</param> /// <param name="remoteName">The name of the remote</param> /// <param name="branchName">the branch to pull</param> /// <returns></returns> IObservable<Unit> Push(IRepository repository, string branchName, string remoteName); /// <summary> /// Fetches the remote. /// </summary> /// <param name="repository">The repository to pull</param> /// <param name="remoteName">The name of the remote</param> /// <returns></returns> IObservable<Unit> Fetch(IRepository repository, string remoteName); /// <summary> /// Sets the specified remote to the specified URL. /// </summary> /// <param name="repository">The repository to set</param> /// <param name="remoteName">The name of the remote</param> /// <param name="url">The URL to set as the remote</param> /// <returns></returns> IObservable<Unit> SetRemote(IRepository repository, string remoteName, Uri url); /// <summary> /// Sets the remote branch that the local branch tracks /// </summary> /// <param name="repository">The repository to set</param> /// <param name="branchName">The name of the remote</param> /// <param name="remoteName">The name of the branch (local and remote)</param> /// <returns></returns> IObservable<Unit> SetTrackingBranch(IRepository repository, string branchName, string remoteName); IObservable<Remote> GetHttpRemote(IRepository repo, string remote); } }
mit
C#
72cda724643082bd3b6b0f27fb5e5e37be62016b
Reorganize Assembler.cs
aivel/AlmostPDP11,aivel/AlmostPDP11
AlmostPDP11/VM/Assembler/Assembler.cs
AlmostPDP11/VM/Assembler/Assembler.cs
using System; using System.Collections.Generic; using System.Collections.ObjectModel; namespace VM.Assembler { public class Assembler { public static IEnumerable<ushort> Assambly(IEnumerable<String> program, int baseAddress) { return new ushort[] {}; } } }
using System; using System.Collections.Generic; namespace VM.Assembler { public class Assembler { public Assembler(IEnumerable<String> program, int baseAddress) { this.program = program; BASEADDRESS = baseAddress; } public int BASEADDRESS { get; set; } public IEnumerable<String> program { get; set; } public IEnumerable<ushort> assambled { get; set; } public void assamble() { } } }
mit
C#
1884e35ceffeefd123d7aea2e0d5f458436e2cf3
Revert "fixed compile error"
CombatCube/HoloAtelier
Assets/Scripts/RemoteHead.cs
Assets/Scripts/RemoteHead.cs
using UnityEngine; using System.Collections; public class RemoteHead : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnSelect() { Debug.Log("Remote Head tapped!"); if (RemoteHeadManager.Instance.activeHead != gameObject) { RemoteHeadManager.Instance.activeHead = gameObject; ToolManager.Instance.SetActiveTool(gameObject); } else { RemoteHeadManager.Instance.activeHead = null; ToolManager.Instance.SetActiveTool(null); } } }
using UnityEngine; using System.Collections; public class RemoteHead : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnSelect() { Debug.Log("Remote Head tapped!"); //if (RemoteHeadManager.Instance.activeHead != gameObject) //{ // RemoteHeadManager.Instance.activeHead = gameObject; // ToolManager.Instance.SetActiveTool(gameObject); //} //else //{ // RemoteHeadManager.Instance.activeHead = null; // ToolManager.Instance.SetActiveTool(null); //} } }
mit
C#
4016695162a14ae5969c91c8a0b7ebe052ec09e8
fix MC test for 'prefetch' in 3DNow.s.cs
AmesianX/capstone,code4bones/capstone,xia0pin9/capstone,AmesianX/capstone,pombredanne/capstone,zneak/capstone,fvrmatteo/capstone,pranith/capstone,techvoltage/capstone,dynm/capstone,nplanel/capstone,zuloloxi/capstone,capturePointer/capstone,pranith/capstone,zuloloxi/capstone,sigma-random/capstone,zneak/capstone,bSr43/capstone,techvoltage/capstone,code4bones/capstone,bughoho/capstone,krytarowski/capstone,bigendiansmalls/capstone,dynm/capstone,pombredanne/capstone,xia0pin9/capstone,krytarowski/capstone,07151129/capstone,capturePointer/capstone,zneak/capstone,dynm/capstone,techvoltage/capstone,capturePointer/capstone,code4bones/capstone,zneak/capstone,code4bones/capstone,nplanel/capstone,bSr43/capstone,bSr43/capstone,nplanel/capstone,pyq881120/capstone,pombredanne/capstone,8l/capstone,pranith/capstone,xia0pin9/capstone,pombredanne/capstone,fvrmatteo/capstone,dynm/capstone,bSr43/capstone,bigendiansmalls/capstone,nplanel/capstone,bigendiansmalls/capstone,zneak/capstone,techvoltage/capstone,AmesianX/capstone,zuloloxi/capstone,bigendiansmalls/capstone,angelabier1/capstone,bigendiansmalls/capstone,capturePointer/capstone,sigma-random/capstone,krytarowski/capstone,8l/capstone,capturePointer/capstone,krytarowski/capstone,angelabier1/capstone,pranith/capstone,sephiroth99/capstone,zneak/capstone,sephiroth99/capstone,pyq881120/capstone,pyq881120/capstone,dynm/capstone,pombredanne/capstone,pyq881120/capstone,bughoho/capstone,dynm/capstone,07151129/capstone,techvoltage/capstone,07151129/capstone,NeilBryant/capstone,bughoho/capstone,techvoltage/capstone,pombredanne/capstone,bSr43/capstone,nplanel/capstone,NeilBryant/capstone,bSr43/capstone,pranith/capstone,pranith/capstone,bigendiansmalls/capstone,zneak/capstone,fvrmatteo/capstone,07151129/capstone,sigma-random/capstone,fvrmatteo/capstone,pyq881120/capstone,NeilBryant/capstone,nplanel/capstone,angelabier1/capstone,sephiroth99/capstone,sigma-random/capstone,pranith/capstone,8l/capstone,pyq881120/capstone,07151129/capstone,krytarowski/capstone,techvoltage/capstone,bowlofstew/capstone,zuloloxi/capstone,NeilBryant/capstone,code4bones/capstone,8l/capstone,NeilBryant/capstone,sigma-random/capstone,NeilBryant/capstone,bigendiansmalls/capstone,xia0pin9/capstone,angelabier1/capstone,zuloloxi/capstone,bowlofstew/capstone,krytarowski/capstone,pyq881120/capstone,AmesianX/capstone,07151129/capstone,NeilBryant/capstone,bughoho/capstone,krytarowski/capstone,sephiroth99/capstone,fvrmatteo/capstone,8l/capstone,bughoho/capstone,xia0pin9/capstone,angelabier1/capstone,sigma-random/capstone,sephiroth99/capstone,angelabier1/capstone,nplanel/capstone,code4bones/capstone,8l/capstone,pombredanne/capstone,sigma-random/capstone,sephiroth99/capstone,angelabier1/capstone,AmesianX/capstone,bowlofstew/capstone,zuloloxi/capstone,bowlofstew/capstone,capturePointer/capstone,bowlofstew/capstone,bughoho/capstone,8l/capstone,bowlofstew/capstone,07151129/capstone,sephiroth99/capstone,code4bones/capstone,xia0pin9/capstone,bSr43/capstone,fvrmatteo/capstone,zuloloxi/capstone,fvrmatteo/capstone,capturePointer/capstone,AmesianX/capstone,bughoho/capstone,AmesianX/capstone,bowlofstew/capstone,dynm/capstone,xia0pin9/capstone
suite/MC/X86/3DNow.s.cs
suite/MC/X86/3DNow.s.cs
# CS_ARCH_X86, CS_MODE_32, CS_OPT_SYNTAX_ATT 0x0f,0x0f,0xca,0xbf = pavgusb %mm2, %mm1 0x67,0x0f,0x0f,0x5c,0x16,0x09,0xbf = pavgusb 9(%esi,%edx), %mm3 0x0f,0x0f,0xca,0x1d = pf2id %mm2, %mm1 0x67,0x0f,0x0f,0x5c,0x16,0x09,0x1d = pf2id 9(%esi,%edx), %mm3 0x0f,0x0f,0xca,0xae = pfacc %mm2, %mm1 0x0f,0x0f,0xca,0x9e = pfadd %mm2, %mm1 0x0f,0x0f,0xca,0xb0 = pfcmpeq %mm2, %mm1 0x0f,0x0f,0xca,0x90 = pfcmpge %mm2, %mm1 0x0f,0x0f,0xca,0xa0 = pfcmpgt %mm2, %mm1 0x0f,0x0f,0xca,0xa4 = pfmax %mm2, %mm1 0x0f,0x0f,0xca,0x94 = pfmin %mm2, %mm1 0x0f,0x0f,0xca,0xb4 = pfmul %mm2, %mm1 0x0f,0x0f,0xca,0x96 = pfrcp %mm2, %mm1 0x0f,0x0f,0xca,0xa6 = pfrcpit1 %mm2, %mm1 0x0f,0x0f,0xca,0xb6 = pfrcpit2 %mm2, %mm1 0x0f,0x0f,0xca,0xa7 = pfrsqit1 %mm2, %mm1 0x0f,0x0f,0xca,0x97 = pfrsqrt %mm2, %mm1 0x0f,0x0f,0xca,0x9a = pfsub %mm2, %mm1 0x0f,0x0f,0xca,0xaa = pfsubr %mm2, %mm1 0x0f,0x0f,0xca,0x0d = pi2fd %mm2, %mm1 0x0f,0x0f,0xca,0xb7 = pmulhrw %mm2, %mm1 0x0f,0x0e = femms 0x0f,0x0d,0x00 = prefetch (%eax) 0x0f,0x0f,0xca,0x1c = pf2iw %mm2, %mm1 0x0f,0x0f,0xca,0x0c = pi2fw %mm2, %mm1 0x0f,0x0f,0xca,0x8a = pfnacc %mm2, %mm1 0x0f,0x0f,0xca,0x8e = pfpnacc %mm2, %mm1 0x0f,0x0f,0xca,0xbb = pswapd %mm2, %mm1
# CS_ARCH_X86, CS_MODE_32, CS_OPT_SYNTAX_ATT 0x0f,0x0f,0xca,0xbf = pavgusb %mm2, %mm1 0x67,0x0f,0x0f,0x5c,0x16,0x09,0xbf = pavgusb 9(%esi,%edx), %mm3 0x0f,0x0f,0xca,0x1d = pf2id %mm2, %mm1 0x67,0x0f,0x0f,0x5c,0x16,0x09,0x1d = pf2id 9(%esi,%edx), %mm3 0x0f,0x0f,0xca,0xae = pfacc %mm2, %mm1 0x0f,0x0f,0xca,0x9e = pfadd %mm2, %mm1 0x0f,0x0f,0xca,0xb0 = pfcmpeq %mm2, %mm1 0x0f,0x0f,0xca,0x90 = pfcmpge %mm2, %mm1 0x0f,0x0f,0xca,0xa0 = pfcmpgt %mm2, %mm1 0x0f,0x0f,0xca,0xa4 = pfmax %mm2, %mm1 0x0f,0x0f,0xca,0x94 = pfmin %mm2, %mm1 0x0f,0x0f,0xca,0xb4 = pfmul %mm2, %mm1 0x0f,0x0f,0xca,0x96 = pfrcp %mm2, %mm1 0x0f,0x0f,0xca,0xa6 = pfrcpit1 %mm2, %mm1 0x0f,0x0f,0xca,0xb6 = pfrcpit2 %mm2, %mm1 0x0f,0x0f,0xca,0xa7 = pfrsqit1 %mm2, %mm1 0x0f,0x0f,0xca,0x97 = pfrsqrt %mm2, %mm1 0x0f,0x0f,0xca,0x9a = pfsub %mm2, %mm1 0x0f,0x0f,0xca,0xaa = pfsubr %mm2, %mm1 0x0f,0x0f,0xca,0x0d = pi2fd %mm2, %mm1 0x0f,0x0f,0xca,0xb7 = pmulhrw %mm2, %mm1 0x0f,0x0e = femms 0x0f,0x0d,0x00 = // CHECK: prefetchw (%rax) # encoding: [0x0f,0x0d,0x08] 0x0f,0x0f,0xca,0x1c = pf2iw %mm2, %mm1 0x0f,0x0f,0xca,0x0c = pi2fw %mm2, %mm1 0x0f,0x0f,0xca,0x8a = pfnacc %mm2, %mm1 0x0f,0x0f,0xca,0x8e = pfpnacc %mm2, %mm1 0x0f,0x0f,0xca,0xbb = pswapd %mm2, %mm1
bsd-3-clause
C#
6570a8fefad8eb0164aef8c70d6e7cd53173432f
fix the internals visible to
DHGMS-Solutions/gripewithroslyn
src/Dhgms.GripeWithRoslyn.Analyzer/Properties/AssemblyInfo.cs
src/Dhgms.GripeWithRoslyn.Analyzer/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyDescription("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: [assembly:InternalsVisibleTo("Dhgms.GripeWithRoslyn.UnitTests")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyDescription("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: [assembly:InternalsVisibleTo("Dhgms.GripeWithRoslyn.Analyzer.UnitTests")]
mit
C#
3e93a708a68e70c725f19094a31a71d195051cd9
make sure matrix aggs is added to solution on master, fix upgrade api tests on master as well
adam-mccoy/elasticsearch-net,CSGOpenSource/elasticsearch-net,adam-mccoy/elasticsearch-net,elastic/elasticsearch-net,CSGOpenSource/elasticsearch-net,elastic/elasticsearch-net,adam-mccoy/elasticsearch-net,CSGOpenSource/elasticsearch-net
src/Tests/Indices/StatusManagement/Upgrade/UpgradeApiTests.cs
src/Tests/Indices/StatusManagement/Upgrade/UpgradeApiTests.cs
using System; using Elasticsearch.Net; using Nest; using Tests.Framework; using Tests.Framework.Integration; using Tests.Framework.MockData; using Xunit; using static Nest.Infer; namespace Tests.Indices.StatusManagement.Upgrade { public class UpgradeApiTests : ApiIntegrationAgainstNewIndexTestBase <IntrusiveOperationCluster, IUpgradeResponse, IUpgradeRequest, UpgradeDescriptor, UpgradeRequest> { public UpgradeApiTests(IntrusiveOperationCluster cluster, EndpointUsage usage) : base(cluster, usage) { } protected override LazyResponses ClientUsage() => Calls( fluent: (client, f) => client.Upgrade(CallIsolatedValue, f), fluentAsync: (client, f) => client.UpgradeAsync(CallIsolatedValue, f), request: (client, r) => client.Upgrade(r), requestAsync: (client, r) => client.UpgradeAsync(r) ); protected override bool ExpectIsValid => true; protected override int ExpectStatusCode => 200; protected override HttpMethod HttpMethod => HttpMethod.POST; protected override string UrlPath => $"/{CallIsolatedValue}/_upgrade?allow_no_indices=true"; protected override Func<UpgradeDescriptor, IUpgradeRequest> Fluent => d => d.AllowNoIndices(); protected override UpgradeRequest Initializer => new UpgradeRequest(CallIsolatedValue) { AllowNoIndices = true }; } }
using System; using Elasticsearch.Net; using Nest; using Tests.Framework; using Tests.Framework.Integration; using Tests.Framework.MockData; using Xunit; using static Nest.Infer; namespace Tests.Indices.StatusManagement.Upgrade { public class UpgradeApiTests : ApiIntegrationAgainstNewIndexTestBase <IntrusiveOperationCluster, IUpgradeResponse, IUpgradeRequest, UpgradeDescriptor, UpgradeRequest> { public UpgradeApiTests(IntrusiveOperationCluster cluster, EndpointUsage usage) : base(cluster, usage) { } protected override LazyResponses ClientUsage() => Calls( fluent: (client, f) => client.Upgrade(CallIsolatedValue, f), fluentAsync: (client, f) => client.UpgradeAsync(CallIsolatedValue, f), request: (client, r) => client.Upgrade(r), requestAsync: (client, r) => client.UpgradeAsync(r) ); protected override bool ExpectIsValid => true; protected override int ExpectStatusCode => 200; protected override HttpMethod HttpMethod => HttpMethod.POST; protected override string UrlPath => $"/{CallIsolatedValue}/_upgrade?allow_no_indices=true"; protected override Func<UpgradeDescriptor, IUpgradeRequest> Fluent => d => d.AllowNoIndices(); protected override UpgradeRequest Initializer => new UpgradeRequest(CallIsolatedValue) { AllowNoIndices = true }; protected override UpgradeRequest Initializer => new UpgradeRequest(CallIsolatedValue); } }
apache-2.0
C#
35fdc55d52e3b7b1c88758365c884344e3a2176d
Fix merge conflict resolution
sharwell/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,weltkante/roslyn,jasonmalinowski/roslyn,jmarolf/roslyn,gafter/roslyn,AmadeusW/roslyn,eriawan/roslyn,weltkante/roslyn,stephentoub/roslyn,CyrusNajmabadi/roslyn,davkean/roslyn,mgoertz-msft/roslyn,KevinRansom/roslyn,jmarolf/roslyn,shyamnamboodiripad/roslyn,davkean/roslyn,brettfo/roslyn,KirillOsenkov/roslyn,diryboy/roslyn,dotnet/roslyn,weltkante/roslyn,shyamnamboodiripad/roslyn,aelij/roslyn,panopticoncentral/roslyn,jasonmalinowski/roslyn,jmarolf/roslyn,diryboy/roslyn,gafter/roslyn,KevinRansom/roslyn,wvdd007/roslyn,mavasani/roslyn,physhi/roslyn,sharwell/roslyn,AlekseyTs/roslyn,aelij/roslyn,panopticoncentral/roslyn,AmadeusW/roslyn,tmat/roslyn,bartdesmet/roslyn,genlu/roslyn,KirillOsenkov/roslyn,ErikSchierboom/roslyn,wvdd007/roslyn,jasonmalinowski/roslyn,heejaechang/roslyn,tmat/roslyn,ErikSchierboom/roslyn,brettfo/roslyn,dotnet/roslyn,sharwell/roslyn,eriawan/roslyn,heejaechang/roslyn,KirillOsenkov/roslyn,brettfo/roslyn,stephentoub/roslyn,KevinRansom/roslyn,gafter/roslyn,panopticoncentral/roslyn,wvdd007/roslyn,tannergooding/roslyn,ErikSchierboom/roslyn,genlu/roslyn,stephentoub/roslyn,diryboy/roslyn,bartdesmet/roslyn,AmadeusW/roslyn,AlekseyTs/roslyn,dotnet/roslyn,physhi/roslyn,heejaechang/roslyn,tmat/roslyn,davkean/roslyn,mavasani/roslyn,mavasani/roslyn,aelij/roslyn,tannergooding/roslyn,genlu/roslyn,bartdesmet/roslyn,physhi/roslyn,mgoertz-msft/roslyn,CyrusNajmabadi/roslyn,shyamnamboodiripad/roslyn,eriawan/roslyn,tannergooding/roslyn,mgoertz-msft/roslyn
src/VisualStudio/LiveShare/Test/RunCodeActionsHandlerTests.cs
src/VisualStudio/LiveShare/Test/RunCodeActionsHandlerTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.LanguageServer.CustomProtocol; using Microsoft.VisualStudio.LanguageServer.Protocol; using Newtonsoft.Json.Linq; using Roslyn.Test.Utilities; using Xunit; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests { public class RunCodeActionsHandlerTests : AbstractLiveShareRequestHandlerTests { [WpfFact] public async Task TestRunCodeActionsAsync() { var markup = @"class A { void M() { {|caret:|}int i = 1; } }"; var (solution, ranges) = CreateTestSolution(markup); var codeActionLocation = ranges["caret"].First(); var results = await TestHandleAsync<LSP.ExecuteCommandParams, object>(solution, CreateExecuteCommandParams(codeActionLocation, CSharpAnalyzersResources.Use_implicit_type), Methods.WorkspaceExecuteCommandName); Assert.True((bool)results); } private static LSP.ExecuteCommandParams CreateExecuteCommandParams(LSP.Location location, string title) => new LSP.ExecuteCommandParams() { Command = "_liveshare.remotecommand.Roslyn", Arguments = new object[] { JObject.FromObject(new LSP.Command() { CommandIdentifier = "Roslyn.RunCodeAction", Arguments = new RunCodeActionParams[] { CreateRunCodeActionParams(title, location) }, Title = title }) } }; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.LanguageServer.CustomProtocol; using Microsoft.VisualStudio.LanguageServer.Protocol; using Newtonsoft.Json.Linq; using Roslyn.Test.Utilities; using Xunit; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; namespace Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests { public class RunCodeActionsHandlerTests : AbstractLiveShareRequestHandlerTests { [WpfFact] public async Task TestRunCodeActionsAsync() { var markup = @"class A { void M() { {|caret:|}int i = 1; } }"; var (solution, ranges) = CreateTestSolution(markup); var codeActionLocation = ranges["caret"].First var results = await TestHandleAsync<LSP.ExecuteCommandParams, object>(solution, CreateExecuteCommandParams(codeActionLocation, CSharpAnalyzersResources.Use_implicit_type), Methods.WorkspaceExecuteCommandName); Assert.True((bool)results); } private static LSP.ExecuteCommandParams CreateExecuteCommandParams(LSP.Location location, string title) => new LSP.ExecuteCommandParams() { Command = "_liveshare.remotecommand.Roslyn", Arguments = new object[] { JObject.FromObject(new LSP.Command() { CommandIdentifier = "Roslyn.RunCodeAction", Arguments = new RunCodeActionParams[] { CreateRunCodeActionParams(title, location) }, Title = title }) } }; } }
mit
C#
b45d121c24f040d6c5b8cfa67d2745ea8692e802
Fix puller empty statement
space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14
Content.Shared/Pulling/Systems/SharedPullerSystem.cs
Content.Shared/Pulling/Systems/SharedPullerSystem.cs
using Content.Shared.Alert; using Content.Shared.Hands; using Content.Shared.Physics.Pull; using Content.Shared.Pulling.Components; using JetBrains.Annotations; using Robust.Shared.GameObjects; namespace Content.Shared.Pulling.Systems { [UsedImplicitly] public sealed class SharedPullerSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent<SharedPullerComponent, PullStartedMessage>(PullerHandlePullStarted); SubscribeLocalEvent<SharedPullerComponent, PullStoppedMessage>(PullerHandlePullStopped); SubscribeLocalEvent<SharedPullerComponent, VirtualItemDeletedEvent>(OnVirtualItemDeleted); } private void OnVirtualItemDeleted(EntityUid uid, SharedPullerComponent component, VirtualItemDeletedEvent args) { if (component.Pulling == null) return; if (component.Pulling == EntityManager.GetEntity(args.BlockingEntity)) { if (ComponentManager.TryGetComponent<SharedPullableComponent>(args.BlockingEntity, out var comp)) { comp.TryStopPull(EntityManager.GetEntity(uid)); } } } private static void PullerHandlePullStarted( EntityUid uid, SharedPullerComponent component, PullStartedMessage args) { if (args.Puller.Owner.Uid != uid) return; if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts)) alerts.ShowAlert(AlertType.Pulling); } private static void PullerHandlePullStopped( EntityUid uid, SharedPullerComponent component, PullStoppedMessage args) { if (args.Puller.Owner.Uid != uid) return; if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts)) alerts.ClearAlert(AlertType.Pulling); } } }
using Content.Shared.Alert; using Content.Shared.Hands; using Content.Shared.Physics.Pull; using Content.Shared.Pulling.Components; using JetBrains.Annotations; using Robust.Shared.GameObjects; namespace Content.Shared.Pulling.Systems { [UsedImplicitly] public sealed class SharedPullerSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent<SharedPullerComponent, PullStartedMessage>(PullerHandlePullStarted); SubscribeLocalEvent<SharedPullerComponent, PullStoppedMessage>(PullerHandlePullStopped); SubscribeLocalEvent<SharedPullerComponent, VirtualItemDeletedEvent>(OnVirtualItemDeleted); } private void OnVirtualItemDeleted(EntityUid uid, SharedPullerComponent component, VirtualItemDeletedEvent args) { if (component.Pulling == null) return; if (component.Pulling == EntityManager.GetEntity(args.BlockingEntity)); { if (ComponentManager.TryGetComponent<SharedPullableComponent>(args.BlockingEntity, out var comp)) { comp.TryStopPull(EntityManager.GetEntity(uid)); } } } private static void PullerHandlePullStarted( EntityUid uid, SharedPullerComponent component, PullStartedMessage args) { if (args.Puller.Owner.Uid != uid) return; if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts)) alerts.ShowAlert(AlertType.Pulling); } private static void PullerHandlePullStopped( EntityUid uid, SharedPullerComponent component, PullStoppedMessage args) { if (args.Puller.Owner.Uid != uid) return; if (component.Owner.TryGetComponent(out SharedAlertsComponent? alerts)) alerts.ClearAlert(AlertType.Pulling); } } }
mit
C#
a70a23981472e089b8eb82306bc918316778fb60
Update docs for license status
SerialKeyManager/SKGL-Extension-for-dot-NET,artemlos/SKGL-Extension-for-dot-NET
Cryptolens.Licensing/LicenseRelated/LicenseStatus.cs
Cryptolens.Licensing/LicenseRelated/LicenseStatus.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using SKM.V3.Methods; namespace SKM.V3 { /// <summary> /// This field is obtained when you either call <see cref="Key.Activate(string, Models.ActivateModel)"/> /// or <see cref="Key.GetKey(string, Models.KeyInfoModel)"/> with the Metadata parameter set to true. /// </summary> public class LicenseStatus { /// <summary> /// Using 'feature definitions on the product page', this will be true if all conditions /// were satisfied. /// </summary> public bool IsValid { get; set; } /// <summary> /// If <see cref="IsValid"/> is false, this field will contain the reason. /// </summary> public InvalidityReason ReasonForInvalidity { get; set; } /// <summary> /// Using 'feature definitions', this will be true if this license key is a trial license. /// </summary> public bool Trial { get; set; } /// <summary> /// Using 'feature definitions', this will be true if this license key is time limited. /// </summary> public bool TimeLimited { get; set; } /// <summary> /// The number of days left of a license key, if it's time-limited. /// </summary> public int TimeLeft { get; set; } public override bool Equals(object obj) { LicenseStatus ls = obj as LicenseStatus; if (ls == null) return false; return ls.IsValid == IsValid && ls.ReasonForInvalidity == ReasonForInvalidity && ls.TimeLeft == TimeLeft && ls.TimeLimited == TimeLimited && ls.Trial == Trial; } } public enum InvalidityReason { None = 0, Expired = 1, Blocked = 2 } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using SKM.V3.Methods; namespace SKM.V3 { /// <summary> /// This field is obtained when you either call <see cref="Key.Activate(string, Models.ActivateModel)"/> /// or <see cref="Key.GetKey(string, Models.KeyInfoModel)"/> with the Metadata parameter set to true. /// </summary> /// <remarks>Please note that all the data in this object is not signed by the server. It means that you should /// not cache this locally on the client machine. Also, please note that until there is support in the Web API to get /// a signed copy of this object, you should use this object on systems where you have full control (eg. not on end /// user systems). /// </remarks> public class LicenseStatus { /// <summary> /// Using 'feature definitions on the product page', this will be true if all conditions /// were satisfied. /// </summary> public bool IsValid { get; set; } /// <summary> /// If <see cref="IsValid"/> is false, this field will contain the reason. /// </summary> public InvalidityReason ReasonForInvalidity { get; set; } /// <summary> /// Using 'feature definitions', this will be true if this license key is a trial license. /// </summary> public bool Trial { get; set; } /// <summary> /// Using 'feature definitions', this will be true if this license key is time limited. /// </summary> public bool TimeLimited { get; set; } /// <summary> /// The number of days left of a license key, if it's time-limited. /// </summary> public int TimeLeft { get; set; } public override bool Equals(object obj) { LicenseStatus ls = obj as LicenseStatus; if (ls == null) return false; return ls.IsValid == IsValid && ls.ReasonForInvalidity == ReasonForInvalidity && ls.TimeLeft == TimeLeft && ls.TimeLimited == TimeLimited && ls.Trial == Trial; } } public enum InvalidityReason { None = 0, Expired = 1, Blocked = 2 } }
bsd-3-clause
C#
64d3b91c9e1ba911c7977c8109f0f6681b1a6a58
Clean standalone-test
splunk/splunk-library-dotnetlogging
standalone-test/Program.cs
standalone-test/Program.cs
using Splunk.Logging; using System; namespace standalone_test { /// <summary> /// Playground for Splunk logging .NET library. /// </summary> class Program { static void Main(string[] args) { } } }
using Splunk.Logging; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Net; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Microsoft.Practices.EnterpriseLibrary.SemanticLogging; using System.Diagnostics.Tracing; namespace standalone_test { // Write 10 events to a TCP input on port 10000. class Program { static void Main(string[] args) { System.Net.ServicePointManager.ServerCertificateValidationCallback += delegate(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) { return true; }; var traceSource = new TraceSource("UnitTestLogger"); traceSource.Listeners.Remove("Default"); traceSource.Switch.Level = SourceLevels.All; traceSource.Listeners.Add( new TcpTraceListener(IPAddress.Loopback, 10000, new ExponentialBackoffTcpReconnectionPolicy())); for (int i = 0; i < 10; i++) traceSource.TraceEvent(TraceEventType.Information, 100, string.Format("Boris {0}", i)); } } }
apache-2.0
C#
605822a364e3a5b47f8c898950859d1e158c5b95
Add AddChild shortcut for IPermissionService
MarinAtanasov/AppBrix,MarinAtanasov/AppBrix.NetCore
Modules/AppBrix.Permissions/PermissionsExtensions.cs
Modules/AppBrix.Permissions/PermissionsExtensions.cs
// Copyright (c) MarinAtanasov. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the project root for license information. // using AppBrix.Permissions; using System; using System.Collections.Generic; using System.Linq; namespace AppBrix { /// <summary> /// Extension methods for easier manipulation of AppBrix permissions. /// </summary> public static class PermissionsExtensions { /// <summary> /// Gets the currently loaded permissions service. /// </summary> /// <param name="app">The current application.</param> /// <returns>The permissions service.</returns> public static IPermissionsService GetPermissionsService(this IApp app) { return (IPermissionsService)app.Get(typeof(IPermissionsService)); } /// <summary> /// Adds a child role to the specified role. /// Must not create circular dependency. /// </summary> /// <param name="service">The permission service.</param> /// <param name="role">The parent role.</param> /// <param name="child">The child role.</param> public static void AddChild(this IPermissionsService service, string role, string child) { service.AddParent(child, role); } internal static void AddValue(this Dictionary<string, HashSet<string>> dictionary, string key, string value) { if (!dictionary.TryGetValue(key, out var values)) { values = new HashSet<string>(); dictionary.Add(key, values); } values.Add(value); } internal static void RemoveValue(this Dictionary<string, HashSet<string>> dictionary, string key, string value) { if (dictionary.TryGetValue(key, out var values)) { if (values.Remove(value) && values.Count == 0) { dictionary.Remove(key); } } } internal static IReadOnlyCollection<string> GetOrEmpty(this Dictionary<string, HashSet<string>> dictionary, string key) { return dictionary.TryGetValue(key, out var values) ? (IReadOnlyCollection<string>)values : Array.Empty<string>(); } } }
// Copyright (c) MarinAtanasov. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the project root for license information. // using AppBrix.Permissions; using System; using System.Collections.Generic; using System.Linq; namespace AppBrix { /// <summary> /// Extension methods for easier manipulation of AppBrix permissions. /// </summary> public static class PermissionsExtensions { /// <summary> /// Gets the currently loaded permissions service. /// </summary> /// <param name="app">The current application.</param> /// <returns>The permissions service.</returns> public static IPermissionsService GetPermissionsService(this IApp app) { return (IPermissionsService)app.Get(typeof(IPermissionsService)); } internal static void AddValue(this Dictionary<string, HashSet<string>> dictionary, string key, string value) { if (!dictionary.TryGetValue(key, out var values)) { values = new HashSet<string>(); dictionary.Add(key, values); } values.Add(value); } internal static void RemoveValue(this Dictionary<string, HashSet<string>> dictionary, string key, string value) { if (dictionary.TryGetValue(key, out var values)) { if (values.Remove(value) && values.Count == 0) { dictionary.Remove(key); } } } internal static IReadOnlyCollection<string> GetOrEmpty(this Dictionary<string, HashSet<string>> dictionary, string key) { return dictionary.TryGetValue(key, out var values) ? (IReadOnlyCollection<string>)values : Array.Empty<string>(); } } }
mit
C#
cb1a4584ea0ddf8952eff74fb919a314f169cd82
bump version
hpcsc/Sharpenter.BootstrapperLoader
Sharpenter.BootstrapperLoader/Properties/AssemblyInfo.cs
Sharpenter.BootstrapperLoader/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Sharpenter.BootstrapperLoader")] [assembly: AssemblyDescription("A simple library to load and execute bootstrapper classes in referenced dlls by convention")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("David Nguyen")] [assembly: AssemblyProduct("Sharpenter.BootstrapperLoader")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6bdcaa00-1538-49df-8c00-e393969d119f")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.2.1.0")] [assembly: AssemblyFileVersion("1.2.1.0")] [assembly: InternalsVisibleTo("Sharpenter.BootstrapperLoader.Tests")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Sharpenter.BootstrapperLoader")] [assembly: AssemblyDescription("A simple library to load and execute bootstrapper classes in referenced dlls by convention")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("David Nguyen")] [assembly: AssemblyProduct("Sharpenter.BootstrapperLoader")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6bdcaa00-1538-49df-8c00-e393969d119f")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: InternalsVisibleTo("Sharpenter.BootstrapperLoader.Tests")]
mit
C#
8531853aa2093613ee27e7542aef267bb1bf7d94
Use ConcurrentDictionary instead of Dictionary to allow lock-free async access
FetzenRndy/Creative,FetzenRndy/Creative,FetzenRndy/Creative,FetzenRndy/Creative,FetzenRndy/Creative
Creative/StatoBot/StatoBot.Analytics/Statistics.cs
Creative/StatoBot/StatoBot.Analytics/Statistics.cs
using System; using System.Text; using System.Collections.Concurrent; namespace StatoBot.Analytics { public class Statistics : ConcurrentDictionary<string, decimal> { private readonly Encoding encoder; public Statistics() { encoder = Encoding.GetEncoding( "UTF-8", new EncoderReplacementFallback(string.Empty), new DecoderExceptionFallback() ); } public void Increment(string key) { key = SanitizeKey(key); if (!ContainsKey(key)) { TryAdd(key, 1); } else { TryGetValue(key, out var count); TryRemove(key, out decimal _); TryAdd(key, count + 1); } } private string SanitizeKey(string key) { return encoder.GetString(encoder.GetBytes(key)); } } }
using System; using System.Collections.Generic; using System.Text; namespace StatoBot.Analytics { public class Statistics : Dictionary<string, decimal> { private readonly Encoding encoder; private readonly object mutationLock; public Statistics() { encoder = Encoding.GetEncoding( "UTF-8", new EncoderReplacementFallback(string.Empty), new DecoderExceptionFallback() ); mutationLock = new object(); } public void Increment(string key) { key = SanitizeKey(key); lock (mutationLock) { if(!ContainsKey(key)) { Add(key, 1); } else { TryGetValue(key, out var count); Remove(key); Add(key, count + 1); } } } private string SanitizeKey(string key) { return encoder.GetString(encoder.GetBytes(key)); } } }
mit
C#
a27ca640651486367ca5f0ebaf6c9f089c5ba569
Fix incorrect comment
martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode
tests/AdventOfCode.Tests/Puzzles/Y2017/Day11Tests.cs
tests/AdventOfCode.Tests/Puzzles/Y2017/Day11Tests.cs
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.AdventOfCode.Puzzles.Y2017 { using Xunit; /// <summary> /// A class containing tests for the <see cref="Day11"/> class. This class cannot be inherited. /// </summary> public static class Day11Tests { [Theory] [InlineData("ne,ne,ne", 3)] [InlineData("ne,ne,sw,sw", 0)] [InlineData("ne,ne,s,s", 2)] [InlineData("se,sw,se,sw,sw", 3)] public static void Y2017_Day11_FindMinimumSteps_Returns_Correct_Solution(string path, int expected) { // Act (int actual, int _) = Day11.FindStepRange(path); // Assert Assert.Equal(expected, actual); } [Fact] public static void Y2017_Day11_Solve_Returns_Correct_Solution() { // Act var puzzle = PuzzleTestHelpers.SolvePuzzle<Day11>(); // Assert Assert.Equal(796, puzzle.MinimumSteps); Assert.Equal(1585, puzzle.MaximumDistance); } } }
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.AdventOfCode.Puzzles.Y2017 { using Xunit; /// <summary> /// A class containing tests for the <see cref="Day11"/> class. This class cannot be inherited. /// </summary> public static class Day11Tests { [Theory] [InlineData("ne,ne,ne", 3)] [InlineData("ne,ne,sw,sw", 0)] [InlineData("ne,ne,s,s", 2)] [InlineData("se,sw,se,sw,sw", 3)] public static void Y2017_Day11_FindMinimumSteps_Returns_Correct_Solution(string path, int expected) { // Arrange (int actual, int _) = Day11.FindStepRange(path); // Assert Assert.Equal(expected, actual); } [Fact] public static void Y2017_Day11_Solve_Returns_Correct_Solution() { // Act var puzzle = PuzzleTestHelpers.SolvePuzzle<Day11>(); // Assert Assert.Equal(796, puzzle.MinimumSteps); Assert.Equal(1585, puzzle.MaximumDistance); } } }
apache-2.0
C#
0ade34f964857faff036d59de3d48c5241fcc3e8
Use PuzzleTest base class
martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode
tests/AdventOfCode.Tests/Puzzles/Y2018/Day01Tests.cs
tests/AdventOfCode.Tests/Puzzles/Y2018/Day01Tests.cs
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.AdventOfCode.Puzzles.Y2018 { using Xunit; using Xunit.Abstractions; /// <summary> /// A class containing tests for the <see cref="Day01"/> class. This class cannot be inherited. /// </summary> public sealed class Day01Tests : PuzzleTest { /// <summary> /// Initializes a new instance of the <see cref="Day01Tests"/> class. /// </summary> /// <param name="outputHelper">The <see cref="ITestOutputHelper"/> to use.</param> public Day01Tests(ITestOutputHelper outputHelper) : base(outputHelper) { } [Theory] [InlineData(new[] { "+1", "-2", "+3", "+1" }, 3)] [InlineData(new[] { "+1", "+1", "+1" }, 3)] [InlineData(new[] { "+1", "+1", "-2" }, 0)] [InlineData(new[] { "-1", "-2", "-3" }, -6)] public static void Y2018_Day01_CalculateFrequency_Returns_Correct_Solution( string[] sequence, int expected) { // Act int actual = Day01.CalculateFrequency(sequence); // Assert Assert.Equal(expected, actual); } [Theory] [InlineData(new[] { "+1", "-2", "+3", "+1", "+1", "-2" }, 2)] [InlineData(new[] { "+1", "-1" }, 0)] [InlineData(new[] { "+3", "+3", "+4", "-2", "-4" }, 10)] [InlineData(new[] { "-6", "+3", "+8", "+5", "-6" }, 5)] [InlineData(new[] { "+7", "+7", "-2", "-7", "-4" }, 14)] public static void Y2018_Day01_CalculateFrequencyWithRepetition_Returns_Correct_Solution( string[] sequence, int expected) { // Act int actual = Day01.CalculateFrequencyWithRepetition(sequence).firstRepeat; // Assert Assert.Equal(expected, actual); } [Fact] public void Y2018_Day01_Solve_Returns_Correct_Solution() { // Act var puzzle = SolvePuzzle<Day01>(); // Assert Assert.Equal(543, puzzle.Frequency); Assert.Equal(621, puzzle.FirstRepeatedFrequency); } } }
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.AdventOfCode.Puzzles.Y2018 { using Xunit; /// <summary> /// A class containing tests for the <see cref="Day01"/> class. This class cannot be inherited. /// </summary> public static class Day01Tests { [Theory] [InlineData(new[] { "+1", "-2", "+3", "+1" }, 3)] [InlineData(new[] { "+1", "+1", "+1" }, 3)] [InlineData(new[] { "+1", "+1", "-2" }, 0)] [InlineData(new[] { "-1", "-2", "-3" }, -6)] public static void Y2018_Day01_CalculateFrequency_Returns_Correct_Solution( string[] sequence, int expected) { // Act int actual = Day01.CalculateFrequency(sequence); // Assert Assert.Equal(expected, actual); } [Theory] [InlineData(new[] { "+1", "-2", "+3", "+1", "+1", "-2" }, 2)] [InlineData(new[] { "+1", "-1" }, 0)] [InlineData(new[] { "+3", "+3", "+4", "-2", "-4" }, 10)] [InlineData(new[] { "-6", "+3", "+8", "+5", "-6" }, 5)] [InlineData(new[] { "+7", "+7", "-2", "-7", "-4" }, 14)] public static void Y2018_Day01_CalculateFrequencyWithRepetition_Returns_Correct_Solution( string[] sequence, int expected) { // Act int actual = Day01.CalculateFrequencyWithRepetition(sequence).firstRepeat; // Assert Assert.Equal(expected, actual); } [Fact] public static void Y2018_Day01_Solve_Returns_Correct_Solution() { // Act var puzzle = PuzzleTestHelpers.SolvePuzzle<Day01>(); // Assert Assert.Equal(543, puzzle.Frequency); Assert.Equal(621, puzzle.FirstRepeatedFrequency); } } }
apache-2.0
C#
c743be578ea820c73bf9fb42a05d3f22af993f94
Make builds a top level menu item
jaredpar/jenkins,jaredpar/jenkins,jaredpar/jenkins
Dashboard/Views/Shared/_Layout.cshtml
Dashboard/Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Roslyn Dashboard", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink(linkText: "Jobs", actionName: "Jobs", controllerName: "Jenkins")</li> <li>@Html.ActionLink(linkText: "Views", actionName: "Views", controllerName: "Jenkins")</li> <li>@Html.ActionLink(linkText: "Builds", actionName: "Index", controllerName: "Builds")</li> <li>@Html.ActionLink(linkText: "Queue", actionName: "Queue", controllerName: "Jenkins")</li> <li>@Html.ActionLink(linkText: "Waiting", actionName: "Waiting", controllerName: "Jenkins")</li> </ul> </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Roslyn Dashboard", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink(linkText: "Jobs", actionName: "Jobs", controllerName: "Jenkins")</li> <li>@Html.ActionLink(linkText: "Views", actionName: "Views", controllerName: "Jenkins")</li> <li>@Html.ActionLink(linkText: "Queue", actionName: "Queue", controllerName: "Jenkins")</li> <li>@Html.ActionLink(linkText: "Waiting", actionName: "Waiting", controllerName: "Jenkins")</li> </ul> </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
apache-2.0
C#
55a89556b53feeb6fcaa15ae48305994e690f2e0
Update IntrospectionExtensions.cs (#8029)
sagood/coreclr,cmckinsey/coreclr,botaberg/coreclr,mmitche/coreclr,qiudesong/coreclr,JonHanna/coreclr,YongseopKim/coreclr,dpodder/coreclr,rartemev/coreclr,qiudesong/coreclr,pgavlin/coreclr,krytarowski/coreclr,gkhanna79/coreclr,botaberg/coreclr,yizhang82/coreclr,JosephTremoulet/coreclr,cydhaselton/coreclr,YongseopKim/coreclr,James-Ko/coreclr,cshung/coreclr,wateret/coreclr,rartemev/coreclr,poizan42/coreclr,hseok-oh/coreclr,krk/coreclr,hseok-oh/coreclr,wateret/coreclr,JosephTremoulet/coreclr,mskvortsov/coreclr,russellhadley/coreclr,rartemev/coreclr,poizan42/coreclr,sjsinju/coreclr,pgavlin/coreclr,jamesqo/coreclr,tijoytom/coreclr,kyulee1/coreclr,ragmani/coreclr,krytarowski/coreclr,krk/coreclr,neurospeech/coreclr,krytarowski/coreclr,tijoytom/coreclr,James-Ko/coreclr,neurospeech/coreclr,mskvortsov/coreclr,dpodder/coreclr,parjong/coreclr,sagood/coreclr,neurospeech/coreclr,yizhang82/coreclr,mmitche/coreclr,yeaicc/coreclr,ruben-ayrapetyan/coreclr,dpodder/coreclr,neurospeech/coreclr,qiudesong/coreclr,cydhaselton/coreclr,alexperovich/coreclr,sagood/coreclr,rartemev/coreclr,wtgodbe/coreclr,gkhanna79/coreclr,kyulee1/coreclr,mmitche/coreclr,krytarowski/coreclr,hseok-oh/coreclr,krk/coreclr,James-Ko/coreclr,tijoytom/coreclr,wtgodbe/coreclr,mmitche/coreclr,mskvortsov/coreclr,JonHanna/coreclr,poizan42/coreclr,ruben-ayrapetyan/coreclr,botaberg/coreclr,alexperovich/coreclr,wtgodbe/coreclr,rartemev/coreclr,JosephTremoulet/coreclr,mmitche/coreclr,jamesqo/coreclr,krytarowski/coreclr,pgavlin/coreclr,JosephTremoulet/coreclr,gkhanna79/coreclr,russellhadley/coreclr,wateret/coreclr,qiudesong/coreclr,poizan42/coreclr,yeaicc/coreclr,neurospeech/coreclr,yizhang82/coreclr,gkhanna79/coreclr,yeaicc/coreclr,AlexGhiondea/coreclr,hseok-oh/coreclr,wateret/coreclr,JosephTremoulet/coreclr,ruben-ayrapetyan/coreclr,hseok-oh/coreclr,YongseopKim/coreclr,botaberg/coreclr,russellhadley/coreclr,cydhaselton/coreclr,YongseopKim/coreclr,cydhaselton/coreclr,jamesqo/coreclr,gkhanna79/coreclr,sjsinju/coreclr,ragmani/coreclr,neurospeech/coreclr,botaberg/coreclr,cshung/coreclr,poizan42/coreclr,JonHanna/coreclr,wateret/coreclr,cydhaselton/coreclr,pgavlin/coreclr,sjsinju/coreclr,cmckinsey/coreclr,ruben-ayrapetyan/coreclr,kyulee1/coreclr,wtgodbe/coreclr,krk/coreclr,JonHanna/coreclr,AlexGhiondea/coreclr,poizan42/coreclr,pgavlin/coreclr,cmckinsey/coreclr,dpodder/coreclr,AlexGhiondea/coreclr,alexperovich/coreclr,alexperovich/coreclr,yizhang82/coreclr,sagood/coreclr,cmckinsey/coreclr,sjsinju/coreclr,mskvortsov/coreclr,rartemev/coreclr,dpodder/coreclr,cshung/coreclr,jamesqo/coreclr,dpodder/coreclr,parjong/coreclr,James-Ko/coreclr,mskvortsov/coreclr,YongseopKim/coreclr,ragmani/coreclr,qiudesong/coreclr,krytarowski/coreclr,gkhanna79/coreclr,James-Ko/coreclr,cmckinsey/coreclr,cmckinsey/coreclr,parjong/coreclr,JonHanna/coreclr,parjong/coreclr,yizhang82/coreclr,hseok-oh/coreclr,AlexGhiondea/coreclr,sjsinju/coreclr,cshung/coreclr,ragmani/coreclr,kyulee1/coreclr,mskvortsov/coreclr,sagood/coreclr,YongseopKim/coreclr,AlexGhiondea/coreclr,yeaicc/coreclr,sagood/coreclr,ragmani/coreclr,kyulee1/coreclr,JosephTremoulet/coreclr,parjong/coreclr,jamesqo/coreclr,wtgodbe/coreclr,yeaicc/coreclr,kyulee1/coreclr,mmitche/coreclr,yeaicc/coreclr,ruben-ayrapetyan/coreclr,cydhaselton/coreclr,pgavlin/coreclr,JonHanna/coreclr,jamesqo/coreclr,yizhang82/coreclr,krk/coreclr,alexperovich/coreclr,tijoytom/coreclr,wtgodbe/coreclr,James-Ko/coreclr,tijoytom/coreclr,sjsinju/coreclr,ruben-ayrapetyan/coreclr,cshung/coreclr,russellhadley/coreclr,yeaicc/coreclr,parjong/coreclr,tijoytom/coreclr,cmckinsey/coreclr,qiudesong/coreclr,wateret/coreclr,krk/coreclr,AlexGhiondea/coreclr,russellhadley/coreclr,alexperovich/coreclr,russellhadley/coreclr,cshung/coreclr,ragmani/coreclr,botaberg/coreclr
src/mscorlib/src/System/Reflection/IntrospectionExtensions.cs
src/mscorlib/src/System/Reflection/IntrospectionExtensions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. /*============================================================================= ** ** ** ** ** ** Purpose: Get the underlying TypeInfo from a Type ** ** =============================================================================*/ namespace System.Reflection { public static class IntrospectionExtensions { public static TypeInfo GetTypeInfo(this Type type) { if (type == null) throw new ArgumentNullException(nameof(type)); var rcType=(IReflectableType)type; return rcType.GetTypeInfo(); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. /*============================================================================= ** ** ** ** ** ** Purpose: go from type to type info ** ** =============================================================================*/ namespace System.Reflection { using System.Reflection; public static class IntrospectionExtensions { public static TypeInfo GetTypeInfo(this Type type){ if(type == null){ throw new ArgumentNullException(nameof(type)); } var rcType=(IReflectableType)type; if(rcType==null){ return null; }else{ return rcType.GetTypeInfo(); } } } }
mit
C#
11288677e0121fd885269088b2df4c4bd3f1a61f
Revert "Fix The GlowWindow in the taskmanager"
chuuddo/MahApps.Metro,jumulr/MahApps.Metro,Jack109/MahApps.Metro,MahApps/MahApps.Metro,Evangelink/MahApps.Metro,pfattisc/MahApps.Metro,xxMUROxx/MahApps.Metro,psinl/MahApps.Metro,Danghor/MahApps.Metro,ye4241/MahApps.Metro,p76984275/MahApps.Metro,batzen/MahApps.Metro
MahApps.Metro/Behaviours/GlowWindowBehavior.cs
MahApps.Metro/Behaviours/GlowWindowBehavior.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Interactivity; using MahApps.Metro.Controls; namespace MahApps.Metro.Behaviours { public class GlowWindowBehavior : Behavior<Window> { private GlowWindow left, right, top, bottom; protected override void OnAttached() { base.OnAttached(); this.AssociatedObject.Loaded += (sender, e) => { left = new GlowWindow(this.AssociatedObject, GlowDirection.Left); right = new GlowWindow(this.AssociatedObject, GlowDirection.Right); top = new GlowWindow(this.AssociatedObject, GlowDirection.Top); bottom = new GlowWindow(this.AssociatedObject, GlowDirection.Bottom); Show(); left.Update(); right.Update(); top.Update(); bottom.Update(); }; this.AssociatedObject.Closed += (sender, args) => { if (left != null) left.Close(); if (right != null) right.Close(); if (top != null) top.Close(); if (bottom != null) bottom.Close(); }; } public void Hide() { left.Hide(); right.Hide(); bottom.Hide(); top.Hide(); } public void Show() { left.Show(); right.Show(); top.Show(); bottom.Show(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Interactivity; using MahApps.Metro.Controls; namespace MahApps.Metro.Behaviours { public class GlowWindowBehavior : Behavior<Window> { private GlowWindow left, right, top, bottom; protected override void OnAttached() { base.OnAttached(); this.AssociatedObject.Loaded += (sender, e) => { left = new GlowWindow(this.AssociatedObject, GlowDirection.Left); right = new GlowWindow(this.AssociatedObject, GlowDirection.Right); top = new GlowWindow(this.AssociatedObject, GlowDirection.Top); bottom = new GlowWindow(this.AssociatedObject, GlowDirection.Bottom); left.Owner = (MetroWindow)sender; right.Owner = (MetroWindow)sender; top.Owner = (MetroWindow)sender; bottom.Owner = (MetroWindow)sender; Show(); left.Update(); right.Update(); top.Update(); bottom.Update(); }; this.AssociatedObject.Closed += (sender, args) => { if (left != null) left.Close(); if (right != null) right.Close(); if (top != null) top.Close(); if (bottom != null) bottom.Close(); }; } public void Hide() { left.Hide(); right.Hide(); bottom.Hide(); top.Hide(); } public void Show() { left.Show(); right.Show(); top.Show(); bottom.Show(); } } }
mit
C#
fb9cb6ba05da0396e4f967560ae7d9b7ca3d560a
add asembly info
csyntax/MyDynamicXmlBuilder
MyDynamicXmlBuilder/Properties/AssemblyInfo.cs
MyDynamicXmlBuilder/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("MyDynamicXmlBuilder")] [assembly: AssemblyDescription("Dynamic XML construction API for .NET")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MyDynamicXmlBuilder")] [assembly: AssemblyCopyright("Copyright © 2015 Ivan Ivanov")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("0fa45b9b-12df-4a8b-a5e9-5d355e70627a")] [assembly: AssemblyVersion("2.0.0")] [assembly: AssemblyFileVersion("2.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; /* Todo Add AssemblyDescription */ [assembly: AssemblyTitle("MyDynamicXmlBuilder")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MyDynamicXmlBuilder")] [assembly: AssemblyCopyright("Copyright © 2015 Ivan Ivanov")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("0fa45b9b-12df-4a8b-a5e9-5d355e70627a")] [assembly: AssemblyVersion("2.0.0")] [assembly: AssemblyFileVersion("2.0.0")]
mit
C#
a8b7904b00ee933a62724adbb9f89d30b0024e33
Fix logger category of FileStreamResultExecutor
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
src/Microsoft.AspNetCore.Mvc.Core/Internal/FileStreamResultExecutor.cs
src/Microsoft.AspNetCore.Mvc.Core/Internal/FileStreamResultExecutor.cs
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Internal { public class FileStreamResultExecutor : FileResultExecutorBase { public FileStreamResultExecutor(ILoggerFactory loggerFactory) : base(CreateLogger<FileStreamResultExecutor>(loggerFactory)) { } public virtual Task ExecuteAsync(ActionContext context, FileStreamResult result) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (result == null) { throw new ArgumentNullException(nameof(result)); } long? fileLength = null; if (result.FileStream.CanSeek) { fileLength = result.FileStream.Length; } var (range, rangeLength, serveBody) = SetHeadersAndLog( context, result, fileLength, result.LastModified, result.EntityTag); if (!serveBody) { return Task.CompletedTask; } return WriteFileAsync(context, result, range, rangeLength); } protected virtual Task WriteFileAsync(ActionContext context, FileStreamResult result, RangeItemHeaderValue range, long rangeLength) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (result == null) { throw new ArgumentNullException(nameof(result)); } if (range != null && rangeLength == 0) { return Task.CompletedTask; } return WriteFileAsync(context.HttpContext, result.FileStream, range, rangeLength); } } }
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Internal { public class FileStreamResultExecutor : FileResultExecutorBase { public FileStreamResultExecutor(ILoggerFactory loggerFactory) : base(CreateLogger<VirtualFileResultExecutor>(loggerFactory)) { } public virtual Task ExecuteAsync(ActionContext context, FileStreamResult result) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (result == null) { throw new ArgumentNullException(nameof(result)); } long? fileLength = null; if (result.FileStream.CanSeek) { fileLength = result.FileStream.Length; } var (range, rangeLength, serveBody) = SetHeadersAndLog( context, result, fileLength, result.LastModified, result.EntityTag); if (!serveBody) { return Task.CompletedTask; } return WriteFileAsync(context, result, range, rangeLength); } protected virtual Task WriteFileAsync(ActionContext context, FileStreamResult result, RangeItemHeaderValue range, long rangeLength) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (result == null) { throw new ArgumentNullException(nameof(result)); } if (range != null && rangeLength == 0) { return Task.CompletedTask; } return WriteFileAsync(context.HttpContext, result.FileStream, range, rangeLength); } } }
apache-2.0
C#
49ab5d74ed1e41481a361d5a68ecde1505b31445
use invariant culture for svg parsing
prime31/Nez,prime31/Nez,ericmbernier/Nez,prime31/Nez
Nez.Portable/Graphics/SVG/Shapes/SvgPolygon.cs
Nez.Portable/Graphics/SVG/Shapes/SvgPolygon.cs
using System.Xml.Serialization; using Microsoft.Xna.Framework; namespace Nez.Svg { public class SvgPolygon : SvgElement { [XmlAttribute( "cx" )] public float centerX; [XmlAttribute( "cy" )] public float centerY; [XmlAttribute( "sides" )] public int sides; [XmlAttribute( "points" )] public string pointsAttribute { get { return null; } set { parsePoints( value ); } } public Vector2[] points; void parsePoints( string str ) { var format = System.Globalization.CultureInfo.InvariantCulture.NumberFormat; var pairs = str.Split( new char[] { ' ' }, System.StringSplitOptions.RemoveEmptyEntries ); points = new Vector2[pairs.Length]; for( var i = 0; i < pairs.Length; i++ ) { var parts = pairs[i].Split( new char[] { ',' }, System.StringSplitOptions.RemoveEmptyEntries ); points[i] = new Vector2( float.Parse( parts[0], format ), float.Parse( parts[1], format ) ); } } public Vector2[] getTransformedPoints() { var pts = new Vector2[points.Length]; var mat = getCombinedMatrix(); Vector2Ext.transform( points, ref mat, pts ); return pts; } /// <summary> /// gets the points relative to the center. SVG by default uses absolute positions for points. /// </summary> /// <returns>The relative points.</returns> public Vector2[] getRelativePoints() { var pts = new Vector2[points.Length]; var center = new Vector2( centerX, centerY ); for( var i = 0; i < points.Length; i++ ) pts[i] = points[i] - center; return pts; } } }
using System.Xml.Serialization; using Microsoft.Xna.Framework; namespace Nez.Svg { public class SvgPolygon : SvgElement { [XmlAttribute( "cx" )] public float centerX; [XmlAttribute( "cy" )] public float centerY; [XmlAttribute( "sides" )] public int sides; [XmlAttribute( "points" )] public string pointsAttribute { get { return null; } set { parsePoints( value ); } } public Vector2[] points; void parsePoints( string str ) { var pairs = str.Split( new char[] { ' ' }, System.StringSplitOptions.RemoveEmptyEntries ); points = new Vector2[pairs.Length]; for( var i = 0; i < pairs.Length; i++ ) { var parts = pairs[i].Split( new char[] { ',' }, System.StringSplitOptions.RemoveEmptyEntries ); points[i] = new Vector2( float.Parse( parts[0] ), float.Parse( parts[1] ) ); } } public Vector2[] getTransformedPoints() { var pts = new Vector2[points.Length]; var mat = getCombinedMatrix(); Vector2Ext.transform( points, ref mat, pts ); return pts; } /// <summary> /// gets the points relative to the center. SVG by default uses absolute positions for points. /// </summary> /// <returns>The relative points.</returns> public Vector2[] getRelativePoints() { var pts = new Vector2[points.Length]; var center = new Vector2( centerX, centerY ); for( var i = 0; i < points.Length; i++ ) pts[i] = points[i] - center; return pts; } } }
mit
C#
9e4fcf59b881225b441554f5f573d232a9c288ba
Build and publish XSerializer release candidate package
RockFramework/Rock.Encryption
Rock.Encryption.XSerializer/Properties/AssemblyInfo.cs
Rock.Encryption.XSerializer/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Rock.Encryption.XSerializer")] [assembly: AssemblyDescription("Extension to Rock.Encryption - allows properties marked with the [Encrypt] attribute to be encrypted during an XSerializer serialization operation.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Quicken Loans")] [assembly: AssemblyProduct("Rock.Encryption.XSerializer")] [assembly: AssemblyCopyright("Copyright © Quicken Loans 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9e66b304-79a0-4eed-a5f3-adaf0e27844b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.0")] [assembly: AssemblyInformationalVersion("0.9.0-rc3")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Rock.Encryption.XSerializer")] [assembly: AssemblyDescription("Extension to Rock.Encryption - allows properties marked with the [Encrypt] attribute to be encrypted during an XSerializer serialization operation.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Quicken Loans")] [assembly: AssemblyProduct("Rock.Encryption.XSerializer")] [assembly: AssemblyCopyright("Copyright © Quicken Loans 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9e66b304-79a0-4eed-a5f3-adaf0e27844b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.9.0.0")] [assembly: AssemblyFileVersion("0.9.0")] [assembly: AssemblyInformationalVersion("0.9.0-rc2")]
mit
C#
bfea0a7b8fc7d219fd2d2e11300c22ea663ef4b9
Update tests/System.Web.Compatibility.Tests/System.Web.Compatibility.Tests.cs
tarekgh/corefxlab,dotnet/corefxlab,tarekgh/corefxlab,dotnet/corefxlab
tests/System.Web.Compatibility.Tests/System.Web.Compatibility.Tests.cs
tests/System.Web.Compatibility.Tests/System.Web.Compatibility.Tests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Web; using System.Web.Hosting; using Xunit; namespace System.Web.Compatibility.Tests { public class SystemWebCompatTests { [Fact] public void HttpContextCurrentDoesNotThrow() { Assert.Null(HttpContext.Current); } [Fact] public void HostingEnvironmentIsHostedDoesNotThrow() { Assert.False(HostingEnvironment.IsHosted); } [Fact] public void HostingEnvironmentSiteNameDoesNotThrow() { Assert.Null(HostingEnvironment.SiteName); } [Fact] public void HttpUtilityStillWorks() { Type httpUtilityType = Type.GetType("System.Web.HttpUtility, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); Assert.NotNull(httpUtilityType); Assert.Equal(httpUtilityType, typeof(HttpUtility)); Assert.Equal("hello+world", HttpUtility.UrlEncode("hello world")); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Web; using System.Web.Hosting; using Xunit; namespace System.Web.Compatibility.Tests { public class SystemWebCompatTests { [Fact] public void HttpContextCurrentDoesNotThrow() { Assert.Null(HttpContext.Current); } [Fact] public void HostingEnvironmentIsHostedDoesNotThrow() { Assert.False(HostingEnvironment.IsHosted); } [Fact] public void HostingEnvironmentSiteNameDoesNotThrow() { Assert.Null(HttpContext.Current); } [Fact] public void HttpUtilityStillWorks() { Type httpUtilityType = Type.GetType("System.Web.HttpUtility, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"); Assert.NotNull(httpUtilityType); Assert.Equal(httpUtilityType, typeof(HttpUtility)); Assert.Equal("hello+world", HttpUtility.UrlEncode("hello world")); } } }
mit
C#
6e5c3c6853243158836ec99e0a90928c1a9e6a3e
generalize AutomaticInstanceOf to work with non-singleton lifetimes
StephenClearyApps/DotNetApis,StephenClearyApps/DotNetApis,StephenClearyApps/DotNetApis,StephenClearyApps/DotNetApis
service/DotNetApis.SimpleInjector/AutomaticInstanceOf.cs
service/DotNetApis.SimpleInjector/AutomaticInstanceOf.cs
using System; using System.Linq; using System.Linq.Expressions; using SimpleInjector; using SimpleInjector.Advanced; namespace DotNetApis.SimpleInjector { public sealed class AutomaticInstanceOf : IDependencyInjectionBehavior { private readonly IDependencyInjectionBehavior _decorated; private readonly Container _container; public AutomaticInstanceOf(Container container, IDependencyInjectionBehavior decorated) { _container = container; _decorated = decorated; } public InstanceProducer GetInstanceProducer(InjectionConsumerInfo consumer, bool throwOnFailure) { var instanceOfType = InstanceOfType(consumer); var producer = TryGetRegistration(instanceOfType); if (producer == null) return _decorated.GetInstanceProducer(consumer, throwOnFailure); var registration = producer.Lifestyle.CreateRegistration(consumer.Target.TargetType, () => { var instanceOf = _container.GetInstance(instanceOfType); return instanceOfType.GetProperty("Value").GetValue(instanceOf); }, _container); return new InstanceProducer(consumer.Target.TargetType, registration); } public void Verify(InjectionConsumerInfo consumer) { if (TryGetRegistration(InstanceOfType(consumer)) == null) _decorated.Verify(consumer); } private static Type InstanceOfType(InjectionConsumerInfo consumer) => typeof(InstanceOf<>.For<>).MakeGenericType(consumer.Target.TargetType, consumer.Target.Member.DeclaringType); private InstanceProducer TryGetRegistration(Type instanceOfType) => _container.GetCurrentRegistrations().FirstOrDefault(r => r.ServiceType == instanceOfType); } public static class AutomaticInstanceOfExtensions { public static void UseAutomaticInstanceOf(this Container container) { container.Options.DependencyInjectionBehavior = new AutomaticInstanceOf(container, container.Options.DependencyInjectionBehavior); } } }
using System.Linq; using System.Linq.Expressions; using SimpleInjector; using SimpleInjector.Advanced; namespace DotNetApis.SimpleInjector { public sealed class AutomaticInstanceOf : IDependencyInjectionBehavior { private readonly IDependencyInjectionBehavior _decorated; private readonly Container _container; public AutomaticInstanceOf(Container container, IDependencyInjectionBehavior decorated) { _container = container; _decorated = decorated; } public InstanceProducer GetInstanceProducer(InjectionConsumerInfo consumer, bool throwOnFailure) { var producer = TryGetRegistration(consumer); if (producer == null) return _decorated.GetInstanceProducer(consumer, throwOnFailure); var instance = producer.ServiceType.GetProperty("Value").GetValue(producer.GetInstance()); return InstanceProducer.FromExpression(consumer.Target.TargetType, Expression.Constant(instance), _container); } public void Verify(InjectionConsumerInfo consumer) { if (TryGetRegistration(consumer) == null) _decorated.Verify(consumer); } private InstanceProducer TryGetRegistration(InjectionConsumerInfo consumer) { var instanceOfType = typeof(InstanceOf<>.For<>).MakeGenericType(consumer.Target.TargetType, consumer.Target.Member.DeclaringType); return _container.GetCurrentRegistrations().FirstOrDefault(r => r.ServiceType == instanceOfType); } } public static class AutomaticInstanceOfExtensions { public static void UseAutomaticInstanceOf(this Container container) { container.Options.DependencyInjectionBehavior = new AutomaticInstanceOf(container, container.Options.DependencyInjectionBehavior); } } }
mit
C#
6ad910377b64a8407701fdd2713b58288974df92
Correct compile error in tests
NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework
Spa/NakedObjects.Spa.Selenium.Test/tests/TestConfig.cs
Spa/NakedObjects.Spa.Selenium.Test/tests/TestConfig.cs
 namespace NakedObjects.Selenium { public static class TestConfig { //public const string BaseUrl = "http://localhost:49998/"; public const string BaseUrl = "http://nakedobjectstest.azurewebsites.net/"; } }
 namespace NakedObjects.Web.UnitTests.Selenium { public static class TestConfig { //public const string BaseUrl = "http://localhost:49998/"; public const string BaseUrl = "http://nakedobjectstest.azurewebsites.net/"; } }
apache-2.0
C#
af0b79f8de882759f1299872b8f0a6373d0c412b
fix converter
Foglio1024/Tera-custom-cooldowns,Foglio1024/Tera-custom-cooldowns
TCC.Core/Converters/BoolToVisibleCollapsedConverter.cs
TCC.Core/Converters/BoolToVisibleCollapsedConverter.cs
using System; using System.Globalization; using System.Windows; using System.Windows.Data; namespace TCC.Converters { public class BoolToVisibleCollapsedConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var inv = false; if (parameter != null) { if (bool.Parse(parameter.ToString())) { inv = true; } } if (!(value is bool)) return Visibility.Visible; var val = (bool) value; if (inv) val = !val; return val ? Visibility.Visible : Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }
using System; using System.Globalization; using System.Windows; using System.Windows.Data; namespace TCC.Converters { public class BoolToVisibleCollapsedConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var inv = false; if (parameter != null) { if (bool.Parse(parameter.ToString())) { inv = true; } } var val = (bool) value; if (inv) val = !val; return val ? Visibility.Visible : Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }
mit
C#