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
6bf6bac507211efd4f49a828418d40c26602fc8d
remove unused using.
Mahifernando/GaugesNet
GaugesNet/Entity/ApiClients.cs
GaugesNet/Entity/ApiClients.cs
// ------------------------------------------------------------------------------ // | // Copyright 2012 Mahi Fernando. | // | // 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 GaugesNet.Entity { public class ApiClients { [JsonProperty("client")] public Client Client { get; set; } [JsonProperty("clients")] public Clients Clients { get; set; } } public class Client { [JsonProperty("created_at")] public string CreatedAt { get; set; } [JsonProperty("urls")] public Urls Urls { get; set; } [JsonProperty("description")] public string Description { get; set; } [JsonProperty("key")] public string Key { get; set; } } public class Clients : List<Client> { } }
using System.Collections.Generic; using Newtonsoft.Json; namespace GaugesNet.Entity { public class ApiClients { [JsonProperty("client")] public Client Client { get; set; } [JsonProperty("clients")] public Clients Clients { get; set; } } public class Client { [JsonProperty("created_at")] public string CreatedAt { get; set; } [JsonProperty("urls")] public Urls Urls { get; set; } [JsonProperty("description")] public string Description { get; set; } [JsonProperty("key")] public string Key { get; set; } } public class Clients : List<Client> { } }
apache-2.0
C#
a3160f3b6e00de54f5d3aafab1a0e3fd7688f6ca
Use .NET 6.
FacilityApi/Facility
tools/Build/Build.cs
tools/Build/Build.cs
using Faithlife.Build; using static Faithlife.Build.BuildUtility; using static Faithlife.Build.DotNetRunner; return BuildRunner.Execute(args, build => { var codegen = "fsdgenfsd"; var gitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""); var dotNetBuildSettings = new DotNetBuildSettings { NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"), DocsSettings = new DotNetDocsSettings { GitLogin = gitLogin, GitAuthor = new GitAuthorInfo("FacilityApiBot", "facilityapi@gmail.com"), SourceCodeUrl = "https://github.com/FacilityApi/Facility/tree/master/src", ProjectHasDocs = name => !name.StartsWith("fsdgen", StringComparison.Ordinal), }, PackageSettings = new DotNetPackageSettings { GitLogin = gitLogin, PushTagOnPublish = x => $"nuget.{x.Version}", }, }; build.AddDotNetTargets(dotNetBuildSettings); build.Target("codegen") .DependsOn("build") .Describe("Generates code from the FSD") .Does(() => CodeGen(verify: false)); build.Target("verify-codegen") .DependsOn("build") .Describe("Ensures the generated code is up-to-date") .Does(() => CodeGen(verify: true)); build.Target("test") .DependsOn("verify-codegen"); void CodeGen(bool verify) { var configuration = dotNetBuildSettings.GetConfiguration(); var toolPath = FindFiles($"src/{codegen}/bin/{configuration}/net6.0/{codegen}.dll").FirstOrDefault() ?? throw new BuildException($"Missing {codegen}.dll."); var verifyOption = verify ? "--verify" : null; RunDotNet(toolPath, "example/ExampleApi.fsd", "example/output", "--newline", "lf", verifyOption); RunDotNet(toolPath, "example/ExampleApi.fsd.md", "example/output", "--newline", "lf", "--verify"); RunDotNet(toolPath, "example/ExampleApi.fsd", "example/output/ExampleApi-nowidgets.fsd", "--excludeTag", "widgets", "--newline", "lf", verifyOption); RunDotNet(toolPath, "example/ExampleApi.fsd.md", "example/output/ExampleApi-nowidgets.fsd", "--excludeTag", "widgets", "--newline", "lf", "--verify"); } });
using Faithlife.Build; using static Faithlife.Build.BuildUtility; using static Faithlife.Build.DotNetRunner; return BuildRunner.Execute(args, build => { var codegen = "fsdgenfsd"; var gitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""); var dotNetBuildSettings = new DotNetBuildSettings { NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"), DocsSettings = new DotNetDocsSettings { GitLogin = gitLogin, GitAuthor = new GitAuthorInfo("FacilityApiBot", "facilityapi@gmail.com"), SourceCodeUrl = "https://github.com/FacilityApi/Facility/tree/master/src", ProjectHasDocs = name => !name.StartsWith("fsdgen", StringComparison.Ordinal), }, PackageSettings = new DotNetPackageSettings { GitLogin = gitLogin, PushTagOnPublish = x => $"nuget.{x.Version}", }, }; build.AddDotNetTargets(dotNetBuildSettings); build.Target("codegen") .DependsOn("build") .Describe("Generates code from the FSD") .Does(() => CodeGen(verify: false)); build.Target("verify-codegen") .DependsOn("build") .Describe("Ensures the generated code is up-to-date") .Does(() => CodeGen(verify: true)); build.Target("test") .DependsOn("verify-codegen"); void CodeGen(bool verify) { var configuration = dotNetBuildSettings.GetConfiguration(); var toolPath = FindFiles($"src/{codegen}/bin/{configuration}/net5.0/{codegen}.dll").FirstOrDefault() ?? throw new BuildException($"Missing {codegen}.dll."); var verifyOption = verify ? "--verify" : null; RunDotNet(toolPath, "example/ExampleApi.fsd", "example/output", "--newline", "lf", verifyOption); RunDotNet(toolPath, "example/ExampleApi.fsd.md", "example/output", "--newline", "lf", "--verify"); RunDotNet(toolPath, "example/ExampleApi.fsd", "example/output/ExampleApi-nowidgets.fsd", "--excludeTag", "widgets", "--newline", "lf", verifyOption); RunDotNet(toolPath, "example/ExampleApi.fsd.md", "example/output/ExampleApi-nowidgets.fsd", "--excludeTag", "widgets", "--newline", "lf", "--verify"); } });
mit
C#
331c7cf67bbc48e950c4539872b08f00c62f0d7c
Fix ex to torex
nopara73/DotNetTor
src/DotNetTor/SocksPort/Net/NetworkHandler.cs
src/DotNetTor/SocksPort/Net/NetworkHandler.cs
using System; using System.Net.Http; using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; namespace DotNetTor.SocksPort.Net { /// <summary>Gets a connected socket for the provided request.</summary> /// <param name="request">The HTTP request message.</param> /// <returns>The connected socket.</returns> public delegate Socket GetSocket(HttpRequestMessage request); /// <summary>Asynchronously gets a connected socket for the provided request.</summary> /// <param name="request">The HTTP request message.</param> /// <returns>The task resulting in the connected socket.</returns> public delegate Task<Socket> GetSocketAsync(HttpRequestMessage request); public class NetworkHandler : HttpMessageHandler { private readonly GetSocketAsync _getSocketAsync; private readonly HttpSocketClient _httpSocketClient; public NetworkHandler() { _httpSocketClient = new HttpSocketClient(); } public NetworkHandler(Socket socket) : this() { _getSocketAsync = r => Task.FromResult(socket); } public NetworkHandler(GetSocket getSocket) : this() { _getSocketAsync = r => Task.FromResult(getSocket?.Invoke(r)); } public NetworkHandler(GetSocketAsync getSocketAsync) : this() { _getSocketAsync = getSocketAsync; } protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { Socket socket; if (_getSocketAsync != null) { socket = await _getSocketAsync(request).ConfigureAwait(false); } else { throw new TorException("Socket cannot be found"); //socket = await Tcp.ConnectToServerAsync(request.RequestUri.DnsSafeHost, request.RequestUri.Port).ConfigureAwait(false); } var stream = await _httpSocketClient.GetStreamAsync(socket, request).ConfigureAwait(false); await _httpSocketClient.SendRequestAsync(stream, request).ConfigureAwait(false); return await _httpSocketClient.ReceiveResponseAsync(stream, request).ConfigureAwait(false); } } }
using System; using System.Net.Http; using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; namespace DotNetTor.SocksPort.Net { /// <summary>Gets a connected socket for the provided request.</summary> /// <param name="request">The HTTP request message.</param> /// <returns>The connected socket.</returns> public delegate Socket GetSocket(HttpRequestMessage request); /// <summary>Asynchronously gets a connected socket for the provided request.</summary> /// <param name="request">The HTTP request message.</param> /// <returns>The task resulting in the connected socket.</returns> public delegate Task<Socket> GetSocketAsync(HttpRequestMessage request); public class NetworkHandler : HttpMessageHandler { private readonly GetSocketAsync _getSocketAsync; private readonly HttpSocketClient _httpSocketClient; public NetworkHandler() { _httpSocketClient = new HttpSocketClient(); } public NetworkHandler(Socket socket) : this() { _getSocketAsync = r => Task.FromResult(socket); } public NetworkHandler(GetSocket getSocket) : this() { _getSocketAsync = r => Task.FromResult(getSocket?.Invoke(r)); } public NetworkHandler(GetSocketAsync getSocketAsync) : this() { _getSocketAsync = getSocketAsync; } protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { Socket socket; if (_getSocketAsync != null) { socket = await _getSocketAsync(request).ConfigureAwait(false); } else { throw new Exception("Socket cannot be found"); //socket = await Tcp.ConnectToServerAsync(request.RequestUri.DnsSafeHost, request.RequestUri.Port).ConfigureAwait(false); } var stream = await _httpSocketClient.GetStreamAsync(socket, request).ConfigureAwait(false); await _httpSocketClient.SendRequestAsync(stream, request).ConfigureAwait(false); return await _httpSocketClient.ReceiveResponseAsync(stream, request).ConfigureAwait(false); } } }
mit
C#
cf16faa17ec1d2be4a5eb539a39f48c1959b64f9
Fix test
LordMike/TMDbLib
TMDbLibTests/UtilityTests/CustomDatetimeFormatConverterTest.cs
TMDbLibTests/UtilityTests/CustomDatetimeFormatConverterTest.cs
using System; using Newtonsoft.Json; using TMDbLib.Objects.Authentication; using TMDbLib.Utilities.Converters; using TMDbLibTests.Helpers; using TMDbLibTests.JsonHelpers; using Xunit; namespace TMDbLibTests.UtilityTests { public class CustomDatetimeFormatConverterTest : TestBase { [Fact] public void CustomDatetimeFormatConverter_Data() { JsonSerializerSettings settings = new JsonSerializerSettings(); settings.Converters.Add(new CustomDatetimeFormatConverter()); Token original = new Token(); original.ExpiresAt = DateTime.UtcNow.Date; original.ExpiresAt = original.ExpiresAt.AddMilliseconds(-original.ExpiresAt.Millisecond); string json = JsonConvert.SerializeObject(original); Token result = JsonConvert.DeserializeObject<Token>(json, settings); Assert.Equal(original.ExpiresAt, result.ExpiresAt); } /// <summary> /// Tests the CustomDatetimeFormatConverter /// </summary> [Fact] public void TestCustomDatetimeFormatConverter() { Token token = Config.Client.AuthenticationRequestAutenticationTokenAsync().Sync(); DateTime low = DateTime.UtcNow.AddHours(-2); DateTime high = DateTime.UtcNow.AddHours(2); Assert.InRange(token.ExpiresAt, low, high); } } }
using System; using Newtonsoft.Json; using TMDbLib.Objects.Authentication; using TMDbLib.Utilities.Converters; using TMDbLibTests.Helpers; using TMDbLibTests.JsonHelpers; using Xunit; namespace TMDbLibTests.UtilityTests { public class CustomDatetimeFormatConverterTest : TestBase { [Fact] public void CustomDatetimeFormatConverter_Data() { JsonSerializerSettings settings = new JsonSerializerSettings(); settings.Converters.Add(new CustomDatetimeFormatConverter()); DateTime original = DateTime.UtcNow; string json = JsonConvert.SerializeObject(original); DateTime result = JsonConvert.DeserializeObject<DateTime>(json, settings); Assert.Equal(original, result); } /// <summary> /// Tests the CustomDatetimeFormatConverter /// </summary> [Fact] public void TestCustomDatetimeFormatConverter() { Token token = Config.Client.AuthenticationRequestAutenticationTokenAsync().Sync(); DateTime low = DateTime.UtcNow.AddHours(-2); DateTime high = DateTime.UtcNow.AddHours(2); Assert.InRange(token.ExpiresAt, low, high); } } }
mit
C#
4027c4c883f6b52967de00ecec9b9e10a59d977d
remove syntax errors on unmodified rows
SeriousM/Typewriter,coolkev/Typewriter,frhagn/Typewriter
Typewriter/TemplateEditor/Controllers/SyntaxErrorController.cs
Typewriter/TemplateEditor/Controllers/SyntaxErrorController.cs
using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Linq; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Tagging; using Microsoft.VisualStudio.Utilities; namespace Typewriter.TemplateEditor.Controllers { [Export(typeof(ITaggerProvider))] [ContentType(Constants.ContentType), TagType(typeof(ErrorTag))] internal class SyntaxErrorControllerProvider : ITaggerProvider { public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag { return buffer.Properties.GetOrCreateSingletonProperty(() => new SyntaxErrorController(buffer) as ITagger<T>); } } internal class SyntaxErrorController : ITagger<ErrorTag> { private readonly ITextBuffer buffer; internal SyntaxErrorController(ITextBuffer buffer) { this.buffer = buffer; this.buffer.PostChanged += BufferOnPostChanged; } private void BufferOnPostChanged(object sender, EventArgs eventArgs) { var tagsChanged = TagsChanged; if (tagsChanged != null) { var span = new Span(0, buffer.CurrentSnapshot.Length); var snapshotSpan = new SnapshotSpan(buffer.CurrentSnapshot, span); tagsChanged(this, new SnapshotSpanEventArgs(snapshotSpan)); } } public IEnumerable<ITagSpan<ErrorTag>> GetTags(NormalizedSnapshotSpanCollection spans) { return spans.SelectMany(s => Editor.Instance.GetSyntaxErrorTags(buffer, s)); } public event EventHandler<SnapshotSpanEventArgs> TagsChanged; } }
using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Linq; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Tagging; using Microsoft.VisualStudio.Utilities; namespace Typewriter.TemplateEditor.Controllers { [Export(typeof(ITaggerProvider))] [ContentType(Constants.ContentType), TagType(typeof(ErrorTag))] internal class SyntaxErrorControllerProvider : ITaggerProvider { public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag { return buffer.Properties.GetOrCreateSingletonProperty(() => new SyntaxErrorController(buffer) as ITagger<T>); } } internal class SyntaxErrorController : ITagger<ErrorTag> { private readonly ITextBuffer buffer; internal SyntaxErrorController(ITextBuffer buffer) { this.buffer = buffer; // ReSharper disable once UnusedVariable (used to suppress build warning) var temp = TagsChanged; } public IEnumerable<ITagSpan<ErrorTag>> GetTags(NormalizedSnapshotSpanCollection spans) { return spans.SelectMany(s => Editor.Instance.GetSyntaxErrorTags(buffer, s)); } public event EventHandler<SnapshotSpanEventArgs> TagsChanged; } }
apache-2.0
C#
c69711db8bb2ad8557ce23b7a2f3cb6c00d41494
Update Program.cs
pfrendo/orleans.dojo
PF.Dojo.Console/Program.cs
PF.Dojo.Console/Program.cs
using System; using System.Threading; using System.Threading.Tasks; using Orleans; using Orleans.Runtime; using Orleans.Runtime.Configuration; using PF.Dojo.User.Interfaces; namespace PF.Dojo.Console { internal class Program { private static int Main(string[] args) { System.Console.WriteLine("Initializing Console Client..."); var config = ClientConfiguration.LocalhostSilo(); try { InitializeWithRetries(config, 5); } catch (Exception ex) { System.Console.WriteLine($"Orleans client initialization failed failed due to {ex}"); System.Console.ReadLine(); return 1; } DoClientWork().Wait(); System.Console.WriteLine("Press Enter to terminate..."); System.Console.ReadLine(); return 0; } private static async Task DoClientWork() { var user = GrainClient.GrainFactory.GetGrain<IUserGrain>(Guid.NewGuid()); var userDetails = new UserDetails(); System.Console.WriteLine("Please provide a username!"); userDetails.Username = System.Console.ReadLine(); System.Console.WriteLine("Please provide a first name!"); userDetails.FirstName = System.Console.ReadLine(); System.Console.WriteLine("Please provide a last name!"); userDetails.LastName = System.Console.ReadLine(); await user.RegisterUser(userDetails); } private static void InitializeWithRetries(ClientConfiguration config, int initializeAttemptsBeforeFailing) { var attempt = 0; while (true) try { GrainClient.Initialize(config); System.Console.WriteLine("Client successfully connect to silo host"); break; } catch (SiloUnavailableException) { attempt++; System.Console.WriteLine( $"Attempt {attempt} of {initializeAttemptsBeforeFailing} failed to initialize the Orleans client."); if (attempt > initializeAttemptsBeforeFailing) throw; Thread.Sleep(TimeSpan.FromSeconds(2)); } } } }
using System; using System.Threading; using System.Threading.Tasks; using Orleans; using Orleans.Runtime; using Orleans.Runtime.Configuration; using PF.Dojo.User.Interfaces; namespace PF.Dojo.Console { internal class Program { private static int Main(string[] args) { System.Console.WriteLine("Initializing Console Client..."); var config = ClientConfiguration.LocalhostSilo(); try { InitializeWithRetries(config, 5); } catch (Exception ex) { System.Console.WriteLine($"Orleans client initialization failed failed due to {ex}"); System.Console.ReadLine(); return 1; } DoClientWork().Wait(); System.Console.WriteLine("Press Enter to terminate..."); System.Console.ReadLine(); return 0; } private static async Task DoClientWork() { var user = GrainClient.GrainFactory.GetGrain<IUserGrain>(new Guid()); var userDetails = new UserDetails(); System.Console.WriteLine("Please provide a username!"); userDetails.Username = System.Console.ReadLine(); System.Console.WriteLine("Please provide a first name!"); userDetails.FirstName = System.Console.ReadLine(); System.Console.WriteLine("Please provide a last name!"); userDetails.LastName = System.Console.ReadLine(); await user.RegisterUser(userDetails); } private static void InitializeWithRetries(ClientConfiguration config, int initializeAttemptsBeforeFailing) { var attempt = 0; while (true) try { GrainClient.Initialize(config); System.Console.WriteLine("Client successfully connect to silo host"); break; } catch (SiloUnavailableException) { attempt++; System.Console.WriteLine( $"Attempt {attempt} of {initializeAttemptsBeforeFailing} failed to initialize the Orleans client."); if (attempt > initializeAttemptsBeforeFailing) throw; Thread.Sleep(TimeSpan.FromSeconds(2)); } } } }
mit
C#
760cbcdcb658915abb190530bf089612d2d9ff36
Bump to 2.4.0
dreadnought-friends/support-tool,iltar/support-tool
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; // 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("Dreadnought Community Support Tool")] [assembly: AssemblyDescription("This community made tool gathers information which the Dreadnought Customer Support might ask of you to assist with issues or bug reports.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("support-tool")] [assembly: AssemblyCopyright("Copyright Anyone © 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)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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.4.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; // 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("Dreadnought Community Support Tool")] [assembly: AssemblyDescription("This community made tool gathers information which the Dreadnought Customer Support might ask of you to assist with issues or bug reports.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("support-tool")] [assembly: AssemblyCopyright("Copyright Anyone © 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)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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.3.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
056483d5f8b515c8cfbb2855cefacfa0f58eec54
Refactor a code
kawatan/Milk
Megalopolis/ActivationFunctions/Sigmoid.cs
Megalopolis/ActivationFunctions/Sigmoid.cs
using System; namespace Megalopolis { namespace ActivationFunctions { public class Sigmoid : IActivationFunction { public double Function(double x) { return 1.0 / (1.0 + Math.Exp(-x)); } public double Derivative(double x) { // f(x) * (1 - f(x)) return x * (1.0 - x); } } } }
using System; namespace Megalopolis { namespace ActivationFunctions { public class Sigmoid : IActivationFunction { public double Function(double x) { return 1.0 / (1.0 + Math.Exp(-x)); } public double Derivative(double x) { return x * (1.0 - x); } } } }
apache-2.0
C#
6f4ea944d949892761ac32e3019c078ac72d4fe2
fix build
NServiceBusSqlPersistence/NServiceBus.SqlPersistence
src/ScriptBuilderTask.Tests/InnerTaskTests.cs
src/ScriptBuilderTask.Tests/InnerTaskTests.cs
using System; using System.IO; using System.Linq; using NUnit.Framework; using ObjectApproval; [TestFixture] class InnerTaskTests { [Test] public void IntegrationTest() { var testDirectory = TestContext.CurrentContext.TestDirectory; var temp = Path.Combine(testDirectory, "InnerTaskTemp"); DirectoryExtensions.Delete(temp); var assemblyPath = Path.Combine(testDirectory, "ScriptBuilderTask.Tests.Target.dll"); var intermediatePath = Path.Combine(temp, "IntermediatePath"); var promotePath = Path.Combine(temp, "PromotePath"); Directory.CreateDirectory(temp); Directory.CreateDirectory(intermediatePath); Action<string, string> logError = (error, s1) => { throw new Exception(error); }; var innerTask = new InnerTask(assemblyPath, intermediatePath, "TheProjectDir", promotePath, logError); innerTask.Execute(); var files = Directory.EnumerateFiles(temp, "*.*", SearchOption.AllDirectories).Select(s => s.Replace(temp, "temp")).ToList(); ObjectApprover.VerifyWithJson(files); } }
using System; using System.IO; using System.Linq; using NUnit.Framework; using ObjectApproval; [TestFixture] class InnerTaskTests { [Test] public void IntegrationTest() { var testDirectory = TestContext.CurrentContext.TestDirectory; var temp = Path.Combine(testDirectory, "InnerTaskTemp"); DirectoryExtentions.Delete(temp); var assemblyPath = Path.Combine(testDirectory, "ScriptBuilderTask.Tests.Target.dll"); var intermediatePath = Path.Combine(temp, "IntermediatePath"); var promotePath = Path.Combine(temp, "PromotePath"); Directory.CreateDirectory(temp); Directory.CreateDirectory(intermediatePath); Action<string, string> logError = (error, s1) => { throw new Exception(error); }; var innerTask = new InnerTask(assemblyPath, intermediatePath, "TheProjectDir", promotePath, logError); innerTask.Execute(); var files = Directory.EnumerateFiles(temp, "*.*", SearchOption.AllDirectories).Select(s => s.Replace(temp, "temp")).ToList(); ObjectApprover.VerifyWithJson(files); } }
mit
C#
07969ddad706ebe8edd04ad712412831045b1614
Refactor CopyIconsToGizmosFolder()
bartlomiejwolk/AnimationPathAnimator
PathAnimatorComponent/Editor/GizmoIcons.cs
PathAnimatorComponent/Editor/GizmoIcons.cs
using System.IO; using UnityEditor; using UnityEngine; namespace ATP.SimplePathAnimator.PathAnimatorComponent { public sealed class GizmoIcons { private PathAnimatorSettings Settings { get; set; } public GizmoIcons(PathAnimatorSettings settings) { Settings = settings; } public void CopyIconsToGizmosFolder() { // Path to Unity Gizmos folder. var gizmosDir = Application.dataPath + "/Gizmos"; // Path to ATP folder inside Gizmos. // Create Asset/Gizmos folder if not exists. if (!Directory.Exists(gizmosDir + "ATP")) { Directory.CreateDirectory(gizmosDir + "ATP"); } // Check if settings asset has icons specified. if (Settings.GizmoIcons == null) return; // For each icon.. foreach (var icon in Settings.GizmoIcons) { // Get icon path. var iconPath = AssetDatabase.GetAssetPath(icon); // Copy icon to Gizmos folder. AssetDatabase.CopyAsset(iconPath, gizmosDir + "/ATP"); } } } }
using System.IO; using UnityEditor; using UnityEngine; namespace ATP.SimplePathAnimator.PathAnimatorComponent { public sealed class GizmoIcons { private PathAnimatorSettings Settings { get; set; } public GizmoIcons(PathAnimatorSettings settings) { Settings = settings; } public void CopyIconsToGizmosFolder() { // Path to Unity Gizmos folder. var gizmosDir = Application.dataPath + "/Gizmos/"; // Create Asset/Gizmos folder if not exists. if (!Directory.Exists(gizmosDir)) { Directory.CreateDirectory(gizmosDir); } // Check if settings asset has icons specified. if (Settings.GizmoIcons == null) return; // For each icon.. foreach (var icon in Settings.GizmoIcons) { // Get icon path. var iconPath = AssetDatabase.GetAssetPath(icon); // Copy icon to Gizmos folder. AssetDatabase.CopyAsset(iconPath, gizmosDir); } } } }
mit
C#
4a475911666b538689b382e28d95564010b93858
Build script now creates individual zip file packages to align with the NuGet packages and semantic versioning.
jango2015/Autofac.Extras.DynamicProxy,autofac/Autofac.Extras.DynamicProxy
Properties/VersionAssemblyInfo.cs
Properties/VersionAssemblyInfo.cs
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18033 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-02-28 02:03")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18033 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-02-22 14:39")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
mit
C#
938c682f2574705b263bae05080d769a979245d1
add an overload to avoid nesting
vkhorikov/CSharpFunctionalExtensions
CSharpFunctionalExtensions/Result/Extensions/MapAsyncRight.cs
CSharpFunctionalExtensions/Result/Extensions/MapAsyncRight.cs
using System; using System.Threading.Tasks; namespace CSharpFunctionalExtensions { public static partial class AsyncResultExtensionsRightOperand { /// <summary> /// Creates a new result from the return value of a given function. If the calling Result is a failure, a new failure result is returned instead. /// </summary> public static async Task<Result<K, E>> Map<T, K, E>(this Result<T, E> result, Func<T, Task<K>> func) { if (result.IsFailure) return Result.Failure<K, E>(result.Error); K value = await func(result.Value).DefaultAwait(); return Result.Success<K, E>(value); } /// <summary> /// Creates a new result from the return value of a given function. If the calling Result is a failure, a new failure result is returned instead. /// </summary> public static async Task<Result<K>> Map<T, K>(this Result<T> result, Func<T, Task<K>> func) { if (result.IsFailure) return Result.Failure<K>(result.Error); K value = await func(result.Value).DefaultAwait(); return Result.Success(value); } /// <summary> /// Creates a new result from the return value of a given function. If the calling Result is a failure, a new failure result is returned instead. /// </summary> public static async Task<Result<K>> Map<T, K>(this Result<T> result, Func<T, Task<Result<K>>> func) { if (result.IsFailure) return Result.Failure<K>(result.Error); Result<K> value = await func(result.Value).DefaultAwait(); return value; } /// <summary> /// Creates a new result from the return value of a given function. If the calling Result is a failure, a new failure result is returned instead. /// </summary> public static async Task<Result<K>> Map<K>(this Result result, Func<Task<K>> func) { if (result.IsFailure) return Result.Failure<K>(result.Error); K value = await func().DefaultAwait(); return Result.Success(value); } } }
using System; using System.Threading.Tasks; namespace CSharpFunctionalExtensions { public static partial class AsyncResultExtensionsRightOperand { /// <summary> /// Creates a new result from the return value of a given function. If the calling Result is a failure, a new failure result is returned instead. /// </summary> public static async Task<Result<K, E>> Map<T, K, E>(this Result<T, E> result, Func<T, Task<K>> func) { if (result.IsFailure) return Result.Failure<K, E>(result.Error); K value = await func(result.Value).DefaultAwait(); return Result.Success<K, E>(value); } /// <summary> /// Creates a new result from the return value of a given function. If the calling Result is a failure, a new failure result is returned instead. /// </summary> public static async Task<Result<K>> Map<T, K>(this Result<T> result, Func<T, Task<K>> func) { if (result.IsFailure) return Result.Failure<K>(result.Error); K value = await func(result.Value).DefaultAwait(); return Result.Success(value); } /// <summary> /// Creates a new result from the return value of a given function. If the calling Result is a failure, a new failure result is returned instead. /// </summary> public static async Task<Result<K>> Map<K>(this Result result, Func<Task<K>> func) { if (result.IsFailure) return Result.Failure<K>(result.Error); K value = await func().DefaultAwait(); return Result.Success(value); } } }
mit
C#
3c1f8370f8bafa96eb4aa2ff9d33f217bb7e35ae
return as soon as a match is found
whoa-algebraic/game-off-2016,virtuoushub/game-off-2016,virtuoushub/game-off-2016,whoa-algebraic/game-off-2016,whoa-algebraic/game-off-2016,virtuoushub/game-off-2016
Assets/Scripts/RoomNavigationManager.cs
Assets/Scripts/RoomNavigationManager.cs
using UnityEngine; using System.Collections; public class RoomNavigationManager : MonoBehaviour { public GameObject PlayerGameObject; public GameObject[] RoomPrefabs; private GameObject activeRoomPrefab; void Awake() { activeRoomPrefab = Instantiate(RoomPrefabs[0]); activeRoomPrefab.GetComponent<RoomDetails>().Doors[0].GetComponent<DoorDetails>().SetConnectedDoor(1, 1); } // Change room prefab public void ChangeRoom(int connectedRoomId, int connectedDoorId) { // remove current room prefab from scene Destroy(activeRoomPrefab); // spawn connectedRoom and save reference activeRoomPrefab = Instantiate(GetRoomPrefabById(connectedRoomId)); // place player near connected door // find position of connected door Vector3 connectedDoorPosition = GetDoorPosition(connectedDoorId); // determin if player should be on the left or right side of the door's location bool spawnCharacterOnLeftOfDoor = isDoorOnRight(connectedDoorPosition); // position player slightly off of door's location float characterOffsetX = 2f; if (spawnCharacterOnLeftOfDoor) { characterOffsetX *= -1; } PlayerGameObject.transform.localPosition = new Vector3(connectedDoorPosition.x + characterOffsetX, connectedDoorPosition.y, 0); } // assumes that a valid ID is provided, if not bad things will happen // TODO how can this be done safer, or throw an error if no room is found with the given ID? GameObject GetRoomPrefabById(int id) { // loop through all the room prefabs foreach(GameObject room in RoomPrefabs) { if(room.GetComponent<RoomDetails>().Id == id) { return room; } } return new GameObject(); } // assumes that a valid ID is provided, if not bad things will happen // TODO how can this be done safer, or throw an error if no room is found with the given ID? // TODO perhaps change roomDetail's Door array into an array of DoorDetails rather than GameObjects Vector3 GetDoorPosition(int doorId) { Vector3 doorPosition = Vector3.zero; foreach(GameObject door in activeRoomPrefab.GetComponent<RoomDetails>().Doors) { if(door.GetComponent<DoorDetails>().Id == doorId) { doorPosition = door.transform.position; } } return doorPosition; } bool isDoorOnRight(Vector3 doorPosition) { if(doorPosition.x > 0) { return true; } return false; } }
using UnityEngine; using System.Collections; public class RoomNavigationManager : MonoBehaviour { public GameObject PlayerGameObject; public GameObject[] RoomPrefabs; private GameObject activeRoomPrefab; void Awake() { activeRoomPrefab = Instantiate(RoomPrefabs[0]); activeRoomPrefab.GetComponent<RoomDetails>().Doors[0].GetComponent<DoorDetails>().SetConnectedDoor(1, 1); } // Change room prefab public void ChangeRoom(int connectedRoomId, int connectedDoorId) { // remove current room prefab from scene Destroy(activeRoomPrefab); // spawn connectedRoom and save reference activeRoomPrefab = Instantiate(GetRoomPrefabById(connectedRoomId)); // place player near connected door // find position of connected door Vector3 connectedDoorPosition = GetDoorPosition(connectedDoorId); // determin if player should be on the left or right side of the door's location bool spawnCharacterOnLeftOfDoor = isDoorOnRight(connectedDoorPosition); // position player slightly off of door's location float characterOffsetX = 2f; if (spawnCharacterOnLeftOfDoor) { characterOffsetX *= -1; } PlayerGameObject.transform.localPosition = new Vector3(connectedDoorPosition.x + characterOffsetX, connectedDoorPosition.y, 0); } // assumes that a valid ID is provided, if not bad things will happen // TODO how can this be done safer, or throw an error if no room is found with the given ID? GameObject GetRoomPrefabById(int id) { GameObject roomPrefab = new GameObject(); // loop through all the room prefabs foreach(GameObject room in RoomPrefabs) { if(room.GetComponent<RoomDetails>().Id == id) { roomPrefab = room; } } return roomPrefab; } // assumes that a valid ID is provided, if not bad things will happen // TODO how can this be done safer, or throw an error if no room is found with the given ID? // TODO perhaps change roomDetail's Door array into an array of DoorDetails rather than GameObjects Vector3 GetDoorPosition(int doorId) { Vector3 doorPosition = Vector3.zero; foreach(GameObject door in activeRoomPrefab.GetComponent<RoomDetails>().Doors) { if(door.GetComponent<DoorDetails>().Id == doorId) { doorPosition = door.transform.position; } } return doorPosition; } bool isDoorOnRight(Vector3 doorPosition) { if(doorPosition.x > 0) { return true; } return false; } }
mit
C#
151e52ccd1b309ee21718a8358b70a78f149edeb
fix InboxDirective: shutdown is no longer equal to combination of Pause + StayInQueue
louthy/echo-process,louthy/echo-process
Echo.Process/Strategy/InboxDirective.cs
Echo.Process/Strategy/InboxDirective.cs
using System; namespace Echo { [Flags] public enum InboxDirective { Default = 0, PushToFrontOfQueue = 1, Pause = 2, Shutdown = 4 } }
using System; namespace Echo { [Flags] public enum InboxDirective { Default = 0, PushToFrontOfQueue = 1, Pause = 2, Shutdown = 3 } }
mit
C#
6019e3d6c98b6a9471096b595a3dbe7b85c1221c
fix completion bug.
hecomi/uREPL
Assets/uREPL/Scripts/GuiParts/CompletionItem.cs
Assets/uREPL/Scripts/GuiParts/CompletionItem.cs
using UnityEngine; using UnityEngine.UI; using System.Collections.Generic; using System.Linq; namespace uREPL { public class CompletionItem : MonoBehaviour { public Text markText; public Text completionText; public Image colorIndicator; public Color32 hasDescriptionColor = new Color32(200, 30, 70, 255); public Color32 markColor = Color.gray; public Color32 hitTextColor = Color.white; public Color32 bgColor = Color.black; public Color32 highlightedBgColor = new Color32(30, 30, 30, 200); public string description = ""; public bool hasDescription { get { return !string.IsNullOrEmpty(description); } } private string completion_; public string completion { get { return completion_; } } private Image image_; void Awake() { image_ = GetComponent<Image>(); } void Update() { if (hasDescription) { colorIndicator.color = hasDescriptionColor; } } public void SetHighlight(bool isHighlighted) { image_.color = isHighlighted ? highlightedBgColor : bgColor; } public void SetCompletion(string code, string prefix) { completion_ = code; var hitTextColorHex = hitTextColor.r.ToString("X2") + hitTextColor.g.ToString("X2") + hitTextColor.b.ToString("X2") + hitTextColor.a.ToString("X2"); completionText.text = string.Format( "<b><color=#{2}>{0}</color></b>{1}", prefix, completion_, hitTextColorHex.ToString()); } public void SetMark(string mark, Color32 color) { markText.text = mark; markText.color = color; } } }
using UnityEngine; using UnityEngine.UI; using System.Collections.Generic; using System.Linq; namespace uREPL { public class CompletionItem : MonoBehaviour { public Text markText; public Text completionText; public Image colorIndicator; public Color32 hasDescriptionColor = new Color32(200, 30, 70, 255); public Color32 markColor = Color.gray; public Color32 hitTextColor = Color.white; public Color32 bgColor = Color.black; public Color32 highlightedBgColor = new Color32(30, 30, 30, 200); public string description = ""; public bool hasDescription { get { return !string.IsNullOrEmpty(description); } } private string completion_; public string completion { get { return completion_; } } private Image image_; void Awake() { image_ = GetComponent<Image>(); } void Update() { if (hasDescription) { colorIndicator.color = hasDescriptionColor; } } public void SetHighlight(bool isHighlighted) { image_.color = isHighlighted ? highlightedBgColor : bgColor; } public void SetCompletion(string code, string prefix) { completion_ = string.IsNullOrEmpty(prefix) ? code : code.Substring(prefix.Length); var hitTextColorHex = hitTextColor.r.ToString("X2") + hitTextColor.g.ToString("X2") + hitTextColor.b.ToString("X2") + hitTextColor.a.ToString("X2"); completionText.text = string.Format( "<b><color=#{2}>{0}</color></b>{1}", prefix, completion_, hitTextColorHex.ToString()); } public void SetMark(string mark, Color32 color) { markText.text = mark; markText.color = color; } } }
mit
C#
659f52e89bcdcb92de1ebba90548b713c399dc1b
Implement random walk for 3D
sakapon/Samples-2016,sakapon/Samples-2016
MathSample/RandomWalkConsole/Program.cs
MathSample/RandomWalkConsole/Program.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using static System.Console; using static System.Math; namespace RandomWalkConsole { class Program { const int Trials = 1 * 1000; const int MaxSteps = 100 * 1000 * 1000; const int MaxDistance = 10 * 1000; static void Main(string[] args) { var returned = Enumerable.Range(0, Trials) .Select(_ => Walk(Directions2)) .Aggregate(0, (u, t) => u + (t.HasValue ? 1 : 0)); WriteLine($"Returned Rate: {(double)returned / Trials}"); } static readonly Random random = new Random(); static readonly Int32Vector3[] Directions2 = new[] { Int32Vector3.XBasis, Int32Vector3.YBasis, -Int32Vector3.XBasis, -Int32Vector3.YBasis }; static readonly Int32Vector3[] Directions3 = new[] { Int32Vector3.XBasis, Int32Vector3.YBasis, Int32Vector3.ZBasis, -Int32Vector3.XBasis, -Int32Vector3.YBasis, -Int32Vector3.ZBasis }; static int? Walk(Int32Vector3[] directions) { var current = Int32Vector3.Zero; for (var i = 1; i <= MaxSteps; i++) { current += directions[random.Next(0, directions.Length)]; if (current == Int32Vector3.Zero) { WriteLine($"{i:N0}"); return i; } else if (Abs(current.X) >= MaxDistance || Abs(current.Y) >= MaxDistance || Abs(current.Z) >= MaxDistance) { WriteLine(current); return null; } } WriteLine(current); return null; } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; namespace RandomWalkConsole { class Program { static void Main(string[] args) { var unfinished = Enumerable.Range(0, 1000) .Select(_ => Walk2()) .Aggregate(0, (u, t) => u + (t.HasValue ? 0 : 1)); Console.WriteLine(unfinished); } static readonly Random random = new Random(); static readonly Int32Vector3[] Directions2 = new[] { Int32Vector3.XBasis, Int32Vector3.YBasis, -Int32Vector3.XBasis, -Int32Vector3.YBasis }; static int? Walk2() { var current = Int32Vector3.Zero; for (var i = 1; i <= 1000000; i++) { current += Directions2[random.Next(0, Directions2.Length)]; if (current == Int32Vector3.Zero) return i; } Console.WriteLine(current); return null; } } }
mit
C#
c315c8690b723a0dc7040ade60ccd5d414977276
Fix incorrect hit object type.
DrabWeb/osu,peppy/osu-new,ZLima12/osu,smoogipoo/osu,peppy/osu,2yangk23/osu,peppy/osu,tacchinotacchi/osu,smoogipoo/osu,UselessToucan/osu,EVAST9919/osu,EVAST9919/osu,2yangk23/osu,DrabWeb/osu,johnneijzen/osu,DrabWeb/osu,nyaamara/osu,osu-RP/osu-RP,Nabile-Rahmani/osu,ppy/osu,UselessToucan/osu,naoey/osu,ppy/osu,smoogipooo/osu,Damnae/osu,ZLima12/osu,RedNesto/osu,NeoAdonis/osu,Drezi126/osu,peppy/osu,naoey/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,UselessToucan/osu,johnneijzen/osu,Frontear/osuKyzer,naoey/osu
osu.Game/Modes/Objects/Types/LegacyHitObjectType.cs
osu.Game/Modes/Objects/Types/LegacyHitObjectType.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; namespace osu.Game.Modes.Objects.Types { [Flags] public enum HitObjectType { Circle = 1 << 0, Slider = 1 << 1, NewCombo = 1 << 2, Spinner = 1 << 3, ColourHax = 112, Hold = 1 << 7 } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; namespace osu.Game.Modes.Objects.Types { [Flags] public enum HitObjectType { Circle = 1 << 0, Slider = 1 << 1, NewCombo = 1 << 2, Spinner = 1 << 3, ColourHax = 122, Hold = 1 << 7, SliderTick = 1 << 8, } }
mit
C#
8360cbc9c5472dad1ed10397e8711fbcf230c2b2
Fix drop failure
larsbrubaker/MatterControl,mmoening/MatterControl,larsbrubaker/MatterControl,larsbrubaker/MatterControl,unlimitedbacon/MatterControl,jlewin/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,mmoening/MatterControl,unlimitedbacon/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,mmoening/MatterControl,jlewin/MatterControl,jlewin/MatterControl
MatterControlLib/Library/OnDemandLibraryItem.cs
MatterControlLib/Library/OnDemandLibraryItem.cs
/* Copyright (c) 2018, John Lewin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ using System; using System.IO; using System.Threading.Tasks; using MatterHackers.DataConverters3D; using MatterHackers.Localizations; namespace MatterHackers.MatterControl.Library { public class OnDemandLibraryItem : ILibraryAssetStream { public OnDemandLibraryItem(string name) { this.Name = name ?? "Unknown".Localize(); // TODO: Fix cheat this quick hack which in the short term naively allows IsContentFileType to return true and drag/drop to succeed this.ContentType = "mcx"; } public string ID => Guid.NewGuid().ToString(); public string Name { get; set; } public string FileName => $"{this.Name}.{this.ContentType}"; public bool IsProtected => false; public bool IsVisible => true; public DateTime DateCreated { get; } = DateTime.Now; public DateTime DateModified { get; } = DateTime.Now; public string ContentType { get; set; } public string Category => "General"; public string AssetPath { get; set; } public long FileSize => -1; public bool LocalContentExists => false; public async Task<StreamAndLength> GetStream(Action<double, string> progress) { return new StreamAndLength() { Stream = await ToStream() }; } public Func<Task<IObject3D>> Object3DProvider { get; set; } private async Task<MemoryStream> ToStream() { // Serialize to in memory stream var memoryStream = new MemoryStream(); var object3D = await this.Object3DProvider(); object3D.SaveTo(memoryStream); // Reset to start of content memoryStream.Position = 0; return memoryStream; } } }
/* Copyright (c) 2018, John Lewin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ using System; using System.IO; using System.Threading.Tasks; using MatterHackers.DataConverters3D; using MatterHackers.Localizations; namespace MatterHackers.MatterControl.Library { public class OnDemandLibraryItem : ILibraryAssetStream { public OnDemandLibraryItem(string name) { this.Name = name ?? "Unknown".Localize(); } public string ID => Guid.NewGuid().ToString(); public string Name { get; set; } public string FileName => $"{this.Name}.{this.ContentType}"; public bool IsProtected => false; public bool IsVisible => true; public DateTime DateCreated { get; } = DateTime.Now; public DateTime DateModified { get; } = DateTime.Now; public string ContentType { get; set; } public string Category => "General"; public string AssetPath { get; set; } public long FileSize => -1; public bool LocalContentExists => false; public async Task<StreamAndLength> GetStream(Action<double, string> progress) { return new StreamAndLength() { Stream = await ToStream() }; } public Func<Task<IObject3D>> Object3DProvider { get; set; } private async Task<MemoryStream> ToStream() { // Serialize to in memory stream var memoryStream = new MemoryStream(); var object3D = await this.Object3DProvider(); object3D.SaveTo(memoryStream); // Reset to start of content memoryStream.Position = 0; return memoryStream; } } }
bsd-2-clause
C#
4e1a9ece359a931d7a26d02467005ad74b2287f5
Remove debugging code
Haraguroicha/CefSharp,illfang/CefSharp,zhangjingpu/CefSharp,yoder/CefSharp,haozhouxu/CefSharp,haozhouxu/CefSharp,battewr/CefSharp,Livit/CefSharp,Livit/CefSharp,gregmartinhtc/CefSharp,AJDev77/CefSharp,battewr/CefSharp,rover886/CefSharp,AJDev77/CefSharp,dga711/CefSharp,Haraguroicha/CefSharp,Haraguroicha/CefSharp,Octopus-ITSM/CefSharp,ruisebastiao/CefSharp,jamespearce2006/CefSharp,battewr/CefSharp,Octopus-ITSM/CefSharp,joshvera/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,battewr/CefSharp,AJDev77/CefSharp,rlmcneary2/CefSharp,haozhouxu/CefSharp,VioletLife/CefSharp,yoder/CefSharp,NumbersInternational/CefSharp,jamespearce2006/CefSharp,rover886/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,jamespearce2006/CefSharp,windygu/CefSharp,Livit/CefSharp,yoder/CefSharp,zhangjingpu/CefSharp,VioletLife/CefSharp,wangzheng888520/CefSharp,rover886/CefSharp,Haraguroicha/CefSharp,joshvera/CefSharp,windygu/CefSharp,wangzheng888520/CefSharp,rlmcneary2/CefSharp,gregmartinhtc/CefSharp,dga711/CefSharp,twxstar/CefSharp,gregmartinhtc/CefSharp,rlmcneary2/CefSharp,wangzheng888520/CefSharp,ITGlobal/CefSharp,NumbersInternational/CefSharp,joshvera/CefSharp,haozhouxu/CefSharp,NumbersInternational/CefSharp,AJDev77/CefSharp,twxstar/CefSharp,twxstar/CefSharp,windygu/CefSharp,zhangjingpu/CefSharp,rover886/CefSharp,rover886/CefSharp,yoder/CefSharp,illfang/CefSharp,ruisebastiao/CefSharp,illfang/CefSharp,Octopus-ITSM/CefSharp,NumbersInternational/CefSharp,ITGlobal/CefSharp,dga711/CefSharp,zhangjingpu/CefSharp,gregmartinhtc/CefSharp,rlmcneary2/CefSharp,dga711/CefSharp,joshvera/CefSharp,ruisebastiao/CefSharp,ITGlobal/CefSharp,illfang/CefSharp,Octopus-ITSM/CefSharp,Livit/CefSharp,windygu/CefSharp
CefSharp.BrowserSubprocess/Program.cs
CefSharp.BrowserSubprocess/Program.cs
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using CefSharp.Internals; namespace CefSharp.BrowserSubprocess { public class Program { public static int Main(string[] args) { Kernel32.OutputDebugString("BrowserSubprocess starting up with command line: " + String.Join("\n", args)); //MessageBox.Show("Please attach debugger now", null, MessageBoxButtons.OK, MessageBoxIcon.Information); int result; using (var subprocess = Create(args)) { result = subprocess.Run(); } Kernel32.OutputDebugString("BrowserSubprocess shutting down."); return result; } public static CefSubProcess Create(IEnumerable<string> args) { const string typePrefix = "--type="; var typeArgument = args.SingleOrDefault(arg => arg.StartsWith(typePrefix)); var type = typeArgument.Substring(typePrefix.Length); switch (type) { case "renderer": return new CefRenderProcess(args); case "gpu-process": return new CefGpuProcess(args); default: return new CefSubProcess(args); } } } }
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using CefSharp.Internals; namespace CefSharp.BrowserSubprocess { public class Program { public static int Main(string[] args) { Kernel32.OutputDebugString("BrowserSubprocess starting up with command line: " + String.Join("\n", args)); MessageBox.Show("Please attach debugger now", null, MessageBoxButtons.OK, MessageBoxIcon.Information); int result; using (var subprocess = Create(args)) { result = subprocess.Run(); } Kernel32.OutputDebugString("BrowserSubprocess shutting down."); return result; } public static CefSubProcess Create(IEnumerable<string> args) { const string typePrefix = "--type="; var typeArgument = args.SingleOrDefault(arg => arg.StartsWith(typePrefix)); var type = typeArgument.Substring(typePrefix.Length); switch (type) { case "renderer": return new CefRenderProcess(args); case "gpu-process": return new CefGpuProcess(args); default: return new CefSubProcess(args); } } } }
bsd-3-clause
C#
dd279f55bd9ec763a85e0388eaed40b44f57b187
Add a test to confirm down migrations are run in reverse order of up migrations
itn3000/fluentmigrator,FabioNascimento/fluentmigrator,fluentmigrator/fluentmigrator,eloekset/fluentmigrator,spaccabit/fluentmigrator,itn3000/fluentmigrator,igitur/fluentmigrator,amroel/fluentmigrator,schambers/fluentmigrator,schambers/fluentmigrator,FabioNascimento/fluentmigrator,lcharlebois/fluentmigrator,lcharlebois/fluentmigrator,igitur/fluentmigrator,stsrki/fluentmigrator,stsrki/fluentmigrator,fluentmigrator/fluentmigrator,eloekset/fluentmigrator,spaccabit/fluentmigrator,amroel/fluentmigrator
src/FluentMigrator.Tests/Unit/AutoReversingMigrationTests.cs
src/FluentMigrator.Tests/Unit/AutoReversingMigrationTests.cs
using NUnit.Framework; using FluentMigrator.Infrastructure; namespace FluentMigrator.Tests.Unit { using System.Collections.ObjectModel; using System.Linq; using FluentMigrator.Expressions; using Moq; [TestFixture] public class AutoReversingMigrationTests { private Mock<IMigrationContext> context; [SetUp] public void SetUp() { context = new Mock<IMigrationContext>(); context.SetupAllProperties(); } [Test] public void CreateTableUpAutoReversingMigrationGivesDeleteTableDown() { var autoReversibleMigration = new TestAutoReversingMigrationCreateTable(); context.Object.Expressions = new Collection<IMigrationExpression>(); autoReversibleMigration.GetDownExpressions(context.Object); Assert.True(context.Object.Expressions.Any(me => me is DeleteTableExpression && ((DeleteTableExpression)me).TableName == "Foo")); } [Test] public void DownMigrationsAreInReverseOrderOfUpMigrations() { var autoReversibleMigration = new TestAutoReversingMigrationCreateTable(); context.Object.Expressions = new Collection<IMigrationExpression>(); autoReversibleMigration.GetDownExpressions(context.Object); Assert.IsAssignableFrom(typeof(RenameTableExpression), context.Object.Expressions.ToList()[0]); Assert.IsAssignableFrom(typeof(DeleteTableExpression), context.Object.Expressions.ToList()[1]); } } internal class TestAutoReversingMigrationCreateTable : AutoReversingMigration { public override void Up() { Create.Table("Foo"); Rename.Table("Foo").InSchema("FooSchema").To("Bar"); } } }
using NUnit.Framework; using FluentMigrator.Infrastructure; namespace FluentMigrator.Tests.Unit { using System.Collections.ObjectModel; using System.Linq; using FluentMigrator.Expressions; using Moq; [TestFixture] public class AutoReversingMigrationTests { private Mock<IMigrationContext> context; [SetUp] public void SetUp() { context = new Mock<IMigrationContext>(); context.SetupAllProperties(); } [Test] public void CreateTableUpAutoReversingMigrationGivesDeleteTableDown() { var autoReversibleMigration = new TestAutoReversingMigrationCreateTable(); context.Object.Expressions = new Collection<IMigrationExpression>(); autoReversibleMigration.GetDownExpressions(context.Object); Assert.True(context.Object.Expressions.Any(me => me is DeleteTableExpression && ((DeleteTableExpression)me).TableName == "Foo")); } } internal class TestAutoReversingMigrationCreateTable : AutoReversingMigration { public override void Up() { Create.Table("Foo"); } } }
apache-2.0
C#
8bfb0058c95e99c1a0ad1b7f94c2519f611c74a8
Update KeepWordsTokenFilter.cs
mac2000/elasticsearch-net,adam-mccoy/elasticsearch-net,elastic/elasticsearch-net,KodrAus/elasticsearch-net,jonyadamit/elasticsearch-net,ststeiger/elasticsearch-net,starckgates/elasticsearch-net,cstlaurent/elasticsearch-net,UdiBen/elasticsearch-net,KodrAus/elasticsearch-net,wawrzyn/elasticsearch-net,faisal00813/elasticsearch-net,joehmchan/elasticsearch-net,gayancc/elasticsearch-net,joehmchan/elasticsearch-net,robrich/elasticsearch-net,jonyadamit/elasticsearch-net,adam-mccoy/elasticsearch-net,tkirill/elasticsearch-net,KodrAus/elasticsearch-net,gayancc/elasticsearch-net,tkirill/elasticsearch-net,gayancc/elasticsearch-net,abibell/elasticsearch-net,TheFireCookie/elasticsearch-net,elastic/elasticsearch-net,ststeiger/elasticsearch-net,RossLieberman/NEST,UdiBen/elasticsearch-net,LeoYao/elasticsearch-net,azubanov/elasticsearch-net,joehmchan/elasticsearch-net,wawrzyn/elasticsearch-net,SeanKilleen/elasticsearch-net,faisal00813/elasticsearch-net,RossLieberman/NEST,LeoYao/elasticsearch-net,cstlaurent/elasticsearch-net,DavidSSL/elasticsearch-net,SeanKilleen/elasticsearch-net,robrich/elasticsearch-net,UdiBen/elasticsearch-net,SeanKilleen/elasticsearch-net,adam-mccoy/elasticsearch-net,robrich/elasticsearch-net,cstlaurent/elasticsearch-net,azubanov/elasticsearch-net,azubanov/elasticsearch-net,LeoYao/elasticsearch-net,junlapong/elasticsearch-net,mac2000/elasticsearch-net,RossLieberman/NEST,junlapong/elasticsearch-net,starckgates/elasticsearch-net,DavidSSL/elasticsearch-net,junlapong/elasticsearch-net,TheFireCookie/elasticsearch-net,mac2000/elasticsearch-net,tkirill/elasticsearch-net,CSGOpenSource/elasticsearch-net,ststeiger/elasticsearch-net,abibell/elasticsearch-net,TheFireCookie/elasticsearch-net,robertlyson/elasticsearch-net,faisal00813/elasticsearch-net,wawrzyn/elasticsearch-net,CSGOpenSource/elasticsearch-net,abibell/elasticsearch-net,jonyadamit/elasticsearch-net,starckgates/elasticsearch-net,CSGOpenSource/elasticsearch-net,robertlyson/elasticsearch-net,robertlyson/elasticsearch-net,DavidSSL/elasticsearch-net
src/Nest/Domain/Analysis/TokenFilter/KeepWordsTokenFilter.cs
src/Nest/Domain/Analysis/TokenFilter/KeepWordsTokenFilter.cs
using System.Collections.Generic; using Newtonsoft.Json; namespace Nest { /// <summary> /// A token filter of type keep that only keeps tokens with text contained in a predefined set of words. /// </summary> public class KeepWordsTokenFilter : TokenFilterBase { public KeepWordsTokenFilter() : base("keep") { } /// <summary> /// A list of words to keep. /// </summary> [JsonProperty("keep_words")] public IEnumerable<string> KeepWords { get; set; } /// <summary> /// A path to a words file. /// </summary> [JsonProperty("keep_words_path")] public string KeepWordsPath { get; set; } /// <summary> /// A boolean indicating whether to lower case the words. /// </summary> [JsonProperty("keep_words_case")] public bool? KeepWordsCase { get; set; } } }
using System.Collections.Generic; using Newtonsoft.Json; namespace Nest { /// <summary> /// A token filter of type keep that only keeps tokens with text contained in a predefined set of words. /// </summary> public class KeepWordsTokenFilter : TokenFilterBase { public KeepWordsTokenFilter() : base("keep") { } /// <summary> /// A list of words to keep. /// </summary> [JsonProperty("keep_words")] public IEnumerable<string> KeepWords { get; set; } /// <summary> /// A path to a words file. /// </summary> [JsonProperty("rules_path")] public string KeepWordsPath { get; set; } /// <summary> /// A boolean indicating whether to lower case the words. /// </summary> [JsonProperty("keep_words_case")] public bool? KeepWordsCase { get; set; } } }
apache-2.0
C#
604e8a87c59420a3d315ea9a13046238bebba626
Change Pad-Palettes behavior to be more like the old version.
Prof9/PixelPet
PixelPet/CLI/Commands/PadPalettesCmd.cs
PixelPet/CLI/Commands/PadPalettesCmd.cs
using LibPixelPet; using System; namespace PixelPet.CLI.Commands { internal class PadPalettesCmd : CliCommand { public PadPalettesCmd() : base("Pad-Palettes", new Parameter(true, new ParameterValue("width", "0")) ) { } public override void Run(Workbench workbench, ILogger logger) { int width = FindUnnamedParameter(0).Values[0].ToInt32(); if (width < 1) { logger?.Log("Invalid palette width.", LogLevel.Error); return; } if (workbench.PaletteSet.Count == 0) { logger?.Log("No palettes to pad. Creating 1 palette based on current bitmap format.", LogLevel.Information); Palette pal = new Palette(workbench.BitmapFormat, -1); workbench.PaletteSet.Add(pal); } int addedColors = 0; foreach (PaletteEntry pe in workbench.PaletteSet) { while (pe.Palette.Count < width) { pe.Palette.Add(0); addedColors++; } } logger?.Log("Padded palettes to width " + width + " (added " + addedColors + " colors).", LogLevel.Information); } } }
using LibPixelPet; using System; namespace PixelPet.CLI.Commands { internal class PadPalettesCmd : CliCommand { public PadPalettesCmd() : base("Pad-Palettes", new Parameter(true, new ParameterValue("width", "0")) ) { } public override void Run(Workbench workbench, ILogger logger) { int width = FindUnnamedParameter(0).Values[0].ToInt32(); if (width < 1) { logger?.Log("Invalid palette width.", LogLevel.Error); return; } int addedColors = 0; foreach (PaletteEntry pe in workbench.PaletteSet) { while (pe.Palette.Count % width != 0) { pe.Palette.Add(0); addedColors++; } } logger?.Log("Padded palettes to width " + width + " (added " + addedColors + " colors).", LogLevel.Information); } } }
mit
C#
f165fe365b1e5201b7619999ad9c34dc0baac118
fix JsonConverter
signumsoftware/framework,avifatal/framework,AlejandroCano/framework,AlejandroCano/framework,avifatal/framework,signumsoftware/framework
Signum.Web/Signum/Controllers/JsonConverters.cs
Signum.Web/Signum/Controllers/JsonConverters.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Script.Serialization; using Signum.Entities; using Signum.Engine; using Signum.Utilities; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Signum.Web.Controllers { public class LiteJavaScriptConverter : JsonConverter { public override bool CanConvert(Type objectType) { return typeof(Lite<IdentifiableEntity>).IsAssignableFrom(objectType); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { JObject jsonObject = JObject.Load(reader); string liteKey = (string)jsonObject["Key"]; return Lite.Parse(liteKey); } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { Lite<IdentifiableEntity> lite = (Lite<IdentifiableEntity>)value; writer.WriteStartObject(); writer.WritePropertyName("Key"); serializer.Serialize(writer, lite.Key()); writer.WritePropertyName("Id"); serializer.Serialize(writer, lite.Id); writer.WritePropertyName("ToStr"); serializer.Serialize(writer, lite.ToString()); writer.WriteEndObject(); } } public class EnumJavaScriptConverter : JsonConverter { public override bool CanConvert(Type objectType) { return objectType == typeof(Enum); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { throw new NotImplementedException(); } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { Enum myEnum = (Enum)value; writer.WritePropertyName("Id"); serializer.Serialize(writer, Convert.ToInt32(myEnum)); writer.WritePropertyName("Value"); serializer.Serialize(writer, myEnum.ToString()); writer.WritePropertyName("ToStr"); serializer.Serialize(writer, myEnum.NiceToString()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Script.Serialization; using Signum.Entities; using Signum.Engine; using Signum.Utilities; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Signum.Web.Controllers { public class LiteJavaScriptConverter : JsonConverter { public override bool CanConvert(Type objectType) { return typeof(Lite<IdentifiableEntity>).IsAssignableFrom(objectType); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { JObject jsonObject = JObject.Load(reader); string liteKey = (string)jsonObject["Key"]; return Lite.Parse(liteKey); } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { Lite<IdentifiableEntity> lite = (Lite<IdentifiableEntity>)value; writer.WritePropertyName("Key"); serializer.Serialize(writer, lite.Key()); writer.WritePropertyName("Id"); serializer.Serialize(writer, lite.Id); writer.WritePropertyName("ToStr"); serializer.Serialize(writer, lite.ToString()); } } public class EnumJavaScriptConverter : JsonConverter { public override bool CanConvert(Type objectType) { return objectType == typeof(Enum); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { throw new NotImplementedException(); } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { Enum myEnum = (Enum)value; writer.WritePropertyName("Id"); serializer.Serialize(writer, Convert.ToInt32(myEnum)); writer.WritePropertyName("Value"); serializer.Serialize(writer, myEnum.ToString()); writer.WritePropertyName("ToStr"); serializer.Serialize(writer, myEnum.NiceToString()); } } }
mit
C#
b6af93911cef8edb3228618069cca64873600ac7
Disable another failing Net.Security test
cydhaselton/corefx,JosephTremoulet/corefx,krytarowski/corefx,tijoytom/corefx,billwert/corefx,dotnet-bot/corefx,zhenlan/corefx,ravimeda/corefx,cydhaselton/corefx,BrennanConroy/corefx,gkhanna79/corefx,ViktorHofer/corefx,stephenmichaelf/corefx,seanshpark/corefx,Jiayili1/corefx,stone-li/corefx,ravimeda/corefx,rjxby/corefx,seanshpark/corefx,gkhanna79/corefx,yizhang82/corefx,the-dwyer/corefx,alexperovich/corefx,shimingsg/corefx,rjxby/corefx,MaggieTsang/corefx,shimingsg/corefx,wtgodbe/corefx,rjxby/corefx,marksmeltzer/corefx,twsouthwick/corefx,parjong/corefx,Jiayili1/corefx,MaggieTsang/corefx,rahku/corefx,stephenmichaelf/corefx,elijah6/corefx,dhoehna/corefx,nchikanov/corefx,fgreinacher/corefx,jlin177/corefx,the-dwyer/corefx,shimingsg/corefx,axelheer/corefx,wtgodbe/corefx,ViktorHofer/corefx,krytarowski/corefx,marksmeltzer/corefx,JosephTremoulet/corefx,rjxby/corefx,zhenlan/corefx,BrennanConroy/corefx,yizhang82/corefx,weltkante/corefx,gkhanna79/corefx,weltkante/corefx,parjong/corefx,elijah6/corefx,ravimeda/corefx,ViktorHofer/corefx,Ermiar/corefx,jlin177/corefx,Jiayili1/corefx,jlin177/corefx,nbarbettini/corefx,alexperovich/corefx,gkhanna79/corefx,fgreinacher/corefx,Petermarcu/corefx,Petermarcu/corefx,elijah6/corefx,rubo/corefx,tijoytom/corefx,parjong/corefx,ptoonen/corefx,mazong1123/corefx,YoupHulsebos/corefx,krytarowski/corefx,nbarbettini/corefx,nchikanov/corefx,weltkante/corefx,mazong1123/corefx,rubo/corefx,stephenmichaelf/corefx,billwert/corefx,richlander/corefx,wtgodbe/corefx,jlin177/corefx,yizhang82/corefx,jlin177/corefx,parjong/corefx,wtgodbe/corefx,weltkante/corefx,alexperovich/corefx,jlin177/corefx,weltkante/corefx,ptoonen/corefx,nchikanov/corefx,the-dwyer/corefx,ravimeda/corefx,Petermarcu/corefx,twsouthwick/corefx,seanshpark/corefx,twsouthwick/corefx,ptoonen/corefx,mazong1123/corefx,DnlHarvey/corefx,krk/corefx,ericstj/corefx,alexperovich/corefx,rjxby/corefx,the-dwyer/corefx,yizhang82/corefx,marksmeltzer/corefx,elijah6/corefx,Petermarcu/corefx,gkhanna79/corefx,dhoehna/corefx,wtgodbe/corefx,MaggieTsang/corefx,richlander/corefx,stone-li/corefx,JosephTremoulet/corefx,ericstj/corefx,DnlHarvey/corefx,ericstj/corefx,zhenlan/corefx,krytarowski/corefx,dotnet-bot/corefx,ericstj/corefx,zhenlan/corefx,YoupHulsebos/corefx,mmitche/corefx,krk/corefx,krytarowski/corefx,ViktorHofer/corefx,dhoehna/corefx,Jiayili1/corefx,axelheer/corefx,ravimeda/corefx,Petermarcu/corefx,rahku/corefx,shimingsg/corefx,dhoehna/corefx,fgreinacher/corefx,alexperovich/corefx,nbarbettini/corefx,rahku/corefx,alexperovich/corefx,gkhanna79/corefx,axelheer/corefx,wtgodbe/corefx,shimingsg/corefx,ptoonen/corefx,billwert/corefx,stone-li/corefx,dotnet-bot/corefx,MaggieTsang/corefx,nchikanov/corefx,mmitche/corefx,MaggieTsang/corefx,YoupHulsebos/corefx,zhenlan/corefx,krk/corefx,Jiayili1/corefx,YoupHulsebos/corefx,cydhaselton/corefx,zhenlan/corefx,billwert/corefx,mazong1123/corefx,stone-li/corefx,parjong/corefx,rahku/corefx,mmitche/corefx,parjong/corefx,weltkante/corefx,Ermiar/corefx,ericstj/corefx,ericstj/corefx,dotnet-bot/corefx,JosephTremoulet/corefx,tijoytom/corefx,rjxby/corefx,cydhaselton/corefx,gkhanna79/corefx,dotnet-bot/corefx,marksmeltzer/corefx,krytarowski/corefx,dhoehna/corefx,richlander/corefx,YoupHulsebos/corefx,twsouthwick/corefx,parjong/corefx,krk/corefx,elijah6/corefx,YoupHulsebos/corefx,DnlHarvey/corefx,shimingsg/corefx,ptoonen/corefx,billwert/corefx,nchikanov/corefx,stone-li/corefx,ravimeda/corefx,seanshpark/corefx,nchikanov/corefx,DnlHarvey/corefx,marksmeltzer/corefx,tijoytom/corefx,stone-li/corefx,rubo/corefx,mmitche/corefx,mazong1123/corefx,tijoytom/corefx,DnlHarvey/corefx,seanshpark/corefx,tijoytom/corefx,marksmeltzer/corefx,cydhaselton/corefx,richlander/corefx,fgreinacher/corefx,stephenmichaelf/corefx,yizhang82/corefx,ptoonen/corefx,mmitche/corefx,richlander/corefx,rjxby/corefx,stephenmichaelf/corefx,seanshpark/corefx,axelheer/corefx,rubo/corefx,richlander/corefx,yizhang82/corefx,JosephTremoulet/corefx,stone-li/corefx,rahku/corefx,yizhang82/corefx,ericstj/corefx,elijah6/corefx,mazong1123/corefx,seanshpark/corefx,the-dwyer/corefx,the-dwyer/corefx,mmitche/corefx,rahku/corefx,Jiayili1/corefx,MaggieTsang/corefx,JosephTremoulet/corefx,Ermiar/corefx,ptoonen/corefx,Petermarcu/corefx,Ermiar/corefx,nbarbettini/corefx,krytarowski/corefx,the-dwyer/corefx,ViktorHofer/corefx,billwert/corefx,axelheer/corefx,JosephTremoulet/corefx,tijoytom/corefx,twsouthwick/corefx,MaggieTsang/corefx,rahku/corefx,ViktorHofer/corefx,krk/corefx,Jiayili1/corefx,weltkante/corefx,krk/corefx,rubo/corefx,Petermarcu/corefx,twsouthwick/corefx,krk/corefx,dhoehna/corefx,nbarbettini/corefx,dotnet-bot/corefx,shimingsg/corefx,BrennanConroy/corefx,nchikanov/corefx,elijah6/corefx,nbarbettini/corefx,twsouthwick/corefx,mazong1123/corefx,ViktorHofer/corefx,cydhaselton/corefx,stephenmichaelf/corefx,YoupHulsebos/corefx,dotnet-bot/corefx,zhenlan/corefx,mmitche/corefx,Ermiar/corefx,marksmeltzer/corefx,ravimeda/corefx,Ermiar/corefx,nbarbettini/corefx,dhoehna/corefx,stephenmichaelf/corefx,axelheer/corefx,alexperovich/corefx,richlander/corefx,jlin177/corefx,DnlHarvey/corefx,billwert/corefx,wtgodbe/corefx,Ermiar/corefx,cydhaselton/corefx,DnlHarvey/corefx
src/System.Net.Security/tests/FunctionalTests/LoggingTest.cs
src/System.Net.Security/tests/FunctionalTests/LoggingTest.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.Collections.Concurrent; using System.Diagnostics; using System.Diagnostics.Tracing; using Xunit; namespace System.Net.Security.Tests { public class LoggingTest : RemoteExecutorTestBase { [Fact] public void EventSource_ExistsWithCorrectId() { Type esType = typeof(SslStream).Assembly.GetType("System.Net.NetEventSource", throwOnError: true, ignoreCase: false); Assert.NotNull(esType); Assert.Equal("Microsoft-System-Net-Security", EventSource.GetName(esType)); Assert.Equal(Guid.Parse("066c0e27-a02d-5a98-9a4d-078cc3b1a896"), EventSource.GetGuid(esType)); Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location)); } [Fact] [ActiveIssue(16516, TestPlatforms.Windows)] public void EventSource_EventsRaisedAsExpected() { RemoteInvoke(() => { using (var listener = new TestEventListener("Microsoft-System-Net-Security", EventLevel.Verbose)) { var events = new ConcurrentQueue<EventWrittenEventArgs>(); listener.RunWithCallback(events.Enqueue, () => { // Invoke tests that'll cause some events to be generated var test = new SslStreamStreamToStreamTest_Async(); test.SslStream_StreamToStream_Authentication_Success(); test.SslStream_StreamToStream_Successive_ClientWrite_Sync_Success(); }); Assert.DoesNotContain(events, ev => ev.EventId == 0); // errors from the EventSource itself Assert.InRange(events.Count, 1, int.MaxValue); } return SuccessExitCode; }).Dispose(); } } }
// 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.Collections.Concurrent; using System.Diagnostics; using System.Diagnostics.Tracing; using Xunit; namespace System.Net.Security.Tests { public class LoggingTest : RemoteExecutorTestBase { [Fact] public void EventSource_ExistsWithCorrectId() { Type esType = typeof(SslStream).Assembly.GetType("System.Net.NetEventSource", throwOnError: true, ignoreCase: false); Assert.NotNull(esType); Assert.Equal("Microsoft-System-Net-Security", EventSource.GetName(esType)); Assert.Equal(Guid.Parse("066c0e27-a02d-5a98-9a4d-078cc3b1a896"), EventSource.GetGuid(esType)); Assert.NotEmpty(EventSource.GenerateManifest(esType, esType.Assembly.Location)); } [Fact] public void EventSource_EventsRaisedAsExpected() { RemoteInvoke(() => { using (var listener = new TestEventListener("Microsoft-System-Net-Security", EventLevel.Verbose)) { var events = new ConcurrentQueue<EventWrittenEventArgs>(); listener.RunWithCallback(events.Enqueue, () => { // Invoke tests that'll cause some events to be generated var test = new SslStreamStreamToStreamTest_Async(); test.SslStream_StreamToStream_Authentication_Success(); test.SslStream_StreamToStream_Successive_ClientWrite_Sync_Success(); }); Assert.DoesNotContain(events, ev => ev.EventId == 0); // errors from the EventSource itself Assert.InRange(events.Count, 1, int.MaxValue); } return SuccessExitCode; }).Dispose(); } } }
mit
C#
88527ca8e8c431e5aeeb675cdf24649517212733
Fix copywrite date
alecgorge/adzerk-dot-net
StackExchange.Adzerk/Properties/AssemblyInfo.cs
StackExchange.Adzerk/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("StackExchange.Adzerk")] [assembly: AssemblyDescription("Unofficial Adzerk API client.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Stack Overflow")] [assembly: AssemblyProduct("StackExchange.Adzerk")] [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("d05e1e25-d95d-43d6-a74b-3cb38492fa7e")] // 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.0.0.31")] [assembly: AssemblyFileVersion("0.0.0.31")]
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("StackExchange.Adzerk")] [assembly: AssemblyDescription("Unofficial Adzerk API client.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Stack Overflow")] [assembly: AssemblyProduct("StackExchange.Adzerk")] [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("d05e1e25-d95d-43d6-a74b-3cb38492fa7e")] // 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.0.0.31")] [assembly: AssemblyFileVersion("0.0.0.31")]
mit
C#
6534f5db18e63c8868b2c67bc7f119cabffe0149
make circle radius available
dev-zzo/Spritesse,dev-zzo/Spritesse
ThreeSheeps.Spritesse/Physics/PhysicalCircle.cs
ThreeSheeps.Spritesse/Physics/PhysicalCircle.cs
using Microsoft.Xna.Framework; namespace ThreeSheeps.Spritesse.Physics { public sealed class PhysicalCircle : PhysicalShape { public new sealed class CreationInfo : PhysicalShape.CreationInfo { public float Radius; } public PhysicalCircle(ICollisionResolverService resolver, CreationInfo info) : this(info) { this.resolver = resolver; resolver.Insert(this); } private PhysicalCircle(CreationInfo info) : base(info) { this.radius = info.Radius; } public override Vector2 HalfDimensions { get { return new Vector2(this.radius, this.radius); } } public float Radius { get { return this.radius; } } private float radius; } }
using Microsoft.Xna.Framework; namespace ThreeSheeps.Spritesse.Physics { public sealed class PhysicalCircle : PhysicalShape { public new sealed class CreationInfo : PhysicalShape.CreationInfo { public float Radius; } public PhysicalCircle(ICollisionResolverService resolver, CreationInfo info) : this(info) { this.resolver = resolver; resolver.Insert(this); } private PhysicalCircle(CreationInfo info) : base(info) { this.radius = info.Radius; } public override Vector2 HalfDimensions { get { return new Vector2(this.radius, this.radius); } } private float radius; } }
unlicense
C#
50312544f0173436ec756233ab4f5502762c9696
Add LocationViewTypes repo to unit of work
cmoussalli/DynThings,MagedAlNaamani/DynThings,cmoussalli/DynThings,cmoussalli/DynThings,MagedAlNaamani/DynThings,cmoussalli/DynThings,MagedAlNaamani/DynThings,MagedAlNaamani/DynThings
DynThings.Data.Repositories/Core/UnitOfWork.cs
DynThings.Data.Repositories/Core/UnitOfWork.cs
///////////////////////////////////////////////////////////////// // Created by : Caesar Moussalli // // TimeStamp : 31-1-2016 // // Content : Associate Repositories to the Unit of Work // // Notes : Send DB context to repositories to reduce DB // // connectivity sessions count // ///////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DynThings.Data.Models; namespace DynThings.Data.Repositories { public static class UnitOfWork { #region Repositories public static LocationViewsRepository repoLocationViews = new LocationViewsRepository(); public static LocationViewTypesRepository repoLocationViewTypes = new LocationViewTypesRepository(); public static LocationsRepository repoLocations = new LocationsRepository(); public static EndpointsRepository repoEndpoints = new EndpointsRepository(); public static EndpointIOsRepository repoEndpointIOs = new EndpointIOsRepository(); public static EndPointTypesRepository repoEndpointTypes = new EndPointTypesRepository(); public static DevicesRepositories repoDevices = new DevicesRepositories(); #endregion #region Enums public enum RepositoryMethodResultType { Ok = 1, Failed = 2 } #endregion } }
///////////////////////////////////////////////////////////////// // Created by : Caesar Moussalli // // TimeStamp : 31-1-2016 // // Content : Associate Repositories to the Unit of Work // // Notes : Send DB context to repositories to reduce DB // // connectivity sessions count // ///////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DynThings.Data.Models; namespace DynThings.Data.Repositories { public static class UnitOfWork { #region Repositories public static LocationViewsRepository repoLocationViews = new LocationViewsRepository(); public static LocationsRepository repoLocations = new LocationsRepository(); public static EndpointsRepository repoEndpoints = new EndpointsRepository(); public static EndpointIOsRepository repoEndpointIOs = new EndpointIOsRepository(); public static EndPointTypesRepository repoEndpointTypes = new EndPointTypesRepository(); public static DevicesRepositories repoDevices = new DevicesRepositories(); #endregion #region Enums public enum RepositoryMethodResultType { Ok = 1, Failed = 2 } #endregion } }
mit
C#
501284ea6bbd1b65acb8763e3fade77a1352ca40
Normalize strings before Assert
cskeppstedt/t4ts,AkosLukacs/t4ts,cskeppstedt/t4ts,AkosLukacs/t4ts,dolly22/t4ts,bazubii/t4ts,bazubii/t4ts,dolly22/t4ts
T4TS.Tests/Fixtures/Inheritance/Test.cs
T4TS.Tests/Fixtures/Inheritance/Test.cs
using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Linq; using T4TS.Example.Models; using T4TS.Tests.Fixtures.Basic; using T4TS.Tests.Utils; namespace T4TS.Tests.Fixtures.Inheritance { [TestClass] public class Test { [TestMethod] public void InheritanceModelHasExpectedOutput() { // Generated output var solution = DTETransformer.BuildDteSolution( typeof(InheritanceModel), typeof(ModelFromDifferentProject), typeof(BasicModel) ); var settings = new Settings(); var generator = new CodeTraverser(solution, settings); var data = generator.GetAllInterfaces().ToList(); var generatedOutput = OutputFormatter.GetOutput(data, settings); const string expectedOutput = @" /**************************************************************************** Generated by T4TS.tt - don't make any changes in this file ****************************************************************************/ declare module External { /** Generated from T4TS.Example.Models.ModelFromDifferentProject **/ export interface ModelFromDifferentProject { Id: number; } } declare module T4TS { /** Generated from T4TS.Tests.Fixtures.Inheritance.InheritanceModel **/ export interface InheritanceModel { Basic: T4TS.BasicModel; External: External.ModelFromDifferentProject; } /** Generated from T4TS.Tests.Fixtures.Basic.BasicModel **/ export interface BasicModel { MyProperty: number; } } "; Assert.AreEqual(Normalize(expectedOutput), Normalize(generatedOutput)); } private string Normalize(string input) { return Regex.Replace(input, @"\r\n|\n\r|\n|\r", "\n").Trim(); } } }
using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Linq; using T4TS.Example.Models; using T4TS.Tests.Fixtures.Basic; using T4TS.Tests.Utils; namespace T4TS.Tests.Fixtures.Inheritance { [TestClass] public class Test { [TestMethod] public void InheritanceModelHasExpectedOutput() { // Generated output var solution = DTETransformer.BuildDteSolution( typeof(InheritanceModel), typeof(ModelFromDifferentProject), typeof(BasicModel) ); var settings = new Settings(); var generator = new CodeTraverser(solution, settings); var data = generator.GetAllInterfaces().ToList(); var generatedOutput = OutputFormatter.GetOutput(data, settings); const string expectedOutput = @" /**************************************************************************** Generated by T4TS.tt - don't make any changes in this file ****************************************************************************/ declare module External { /** Generated from T4TS.Example.Models.ModelFromDifferentProject **/ export interface ModelFromDifferentProject { Id: number; } } declare module T4TS { /** Generated from T4TS.Tests.Fixtures.Inheritance.InheritanceModel **/ export interface InheritanceModel { Basic: T4TS.BasicModel; External: External.ModelFromDifferentProject; } /** Generated from T4TS.Tests.Fixtures.Basic.BasicModel **/ export interface BasicModel { MyProperty: number; } } "; Assert.AreEqual(expectedOutput.Trim(), generatedOutput.Trim()); } } }
apache-2.0
C#
98926cc5c9233574e541f0c2c67007e3fa25e992
bump to version 1.2.5
Terradue/DotNetTep,Terradue/DotNetTep
Terradue.Tep/Properties/AssemblyInfo.cs
Terradue.Tep/Properties/AssemblyInfo.cs
/*! \namespace Terradue.Tep @{ Terradue.Tep Software Package provides with all the functionalities specific to the TEP. \xrefitem sw_version "Versions" "Software Package Version" 1.2.5 \xrefitem sw_link "Links" "Software Package List" [Terradue.Tep](https://git.terradue.com/sugar/Terradue.Tep) \xrefitem sw_license "License" "Software License" [AGPL](https://git.terradue.com/sugar/Terradue.Tep/LICENSE) \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch \xrefitem sw_req "Require" "Software Dependencies" \ref ServiceStack \xrefitem sw_req "Require" "Software Dependencies" \ref log4net \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Portal \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Authentication.Umsso \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Cloud \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Github \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Metadata.EarthObservation \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.News \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenNebula \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.GeoJson \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.RdfEO \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Tumblr \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Twitter \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Ogc.OwsContext \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Syndication \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.WebService.Model \ingroup Tep @} */ /*! \defgroup Tep Tep Modules @{ This is a super component that encloses all Thematic Exploitation Platform related functional components. Their main functionnalities are targeted to enhance the basic \ref Core functionalities for the thematic usage of the plaform. @} */ using System.Reflection; using System.Runtime.CompilerServices; using NuGet4Mono.Extensions; [assembly: AssemblyTitle("Terradue.Tep")] [assembly: AssemblyDescription("Terradue Tep .Net library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Terradue")] [assembly: AssemblyProduct("Terradue.Tep")] [assembly: AssemblyCopyright("Terradue")] [assembly: AssemblyAuthors("Enguerran Boissier")] [assembly: AssemblyProjectUrl("https://git.terradue.com/sugar/Terradue.Tep")] [assembly: AssemblyLicenseUrl("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.2.5")] [assembly: AssemblyInformationalVersion("1.2.5")] [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
/*! \namespace Terradue.Tep @{ Terradue.Tep Software Package provides with all the functionalities specific to the TEP. \xrefitem sw_version "Versions" "Software Package Version" 1.2.4 \xrefitem sw_link "Links" "Software Package List" [Terradue.Tep](https://git.terradue.com/sugar/Terradue.Tep) \xrefitem sw_license "License" "Software License" [AGPL](https://git.terradue.com/sugar/Terradue.Tep/LICENSE) \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch \xrefitem sw_req "Require" "Software Dependencies" \ref ServiceStack \xrefitem sw_req "Require" "Software Dependencies" \ref log4net \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Portal \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Authentication.Umsso \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Cloud \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Github \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.Metadata.EarthObservation \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.News \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenNebula \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.GeoJson \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.RdfEO \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Tumblr \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.OpenSearch.Twitter \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Ogc.OwsContext \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Syndication \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.WebService.Model \ingroup Tep @} */ /*! \defgroup Tep Tep Modules @{ This is a super component that encloses all Thematic Exploitation Platform related functional components. Their main functionnalities are targeted to enhance the basic \ref Core functionalities for the thematic usage of the plaform. @} */ using System.Reflection; using System.Runtime.CompilerServices; using NuGet4Mono.Extensions; [assembly: AssemblyTitle("Terradue.Tep")] [assembly: AssemblyDescription("Terradue Tep .Net library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Terradue")] [assembly: AssemblyProduct("Terradue.Tep")] [assembly: AssemblyCopyright("Terradue")] [assembly: AssemblyAuthors("Enguerran Boissier")] [assembly: AssemblyProjectUrl("https://git.terradue.com/sugar/Terradue.Tep")] [assembly: AssemblyLicenseUrl("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.2.4")] [assembly: AssemblyInformationalVersion("1.2.4")] [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
agpl-3.0
C#
7028767e50cf248272d3b34f83d6df8f987a45f4
Fix regression in HoldFocus behaviour
DrabWeb/osu,smoogipoo/osu,smoogipooo/osu,peppy/osu,naoey/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu-new,ppy/osu,ppy/osu,johnneijzen/osu,UselessToucan/osu,peppy/osu,ZLima12/osu,2yangk23/osu,NeoAdonis/osu,UselessToucan/osu,NeoAdonis/osu,NeoAdonis/osu,DrabWeb/osu,smoogipoo/osu,2yangk23/osu,DrabWeb/osu,ppy/osu,peppy/osu,EVAST9919/osu,johnneijzen/osu,ZLima12/osu,naoey/osu,naoey/osu,EVAST9919/osu
osu.Game/Graphics/UserInterface/FocusedTextBox.cs
osu.Game/Graphics/UserInterface/FocusedTextBox.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; using osu.Framework.Input; using System; using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface { /// <summary> /// A textbox which holds focus eagerly. /// </summary> public class FocusedTextBox : OsuTextBox { protected override Color4 BackgroundUnfocused => new Color4(10, 10, 10, 255); protected override Color4 BackgroundFocused => new Color4(10, 10, 10, 255); public Action Exit; private bool focus; public bool HoldFocus { get { return focus; } set { focus = value; if (!focus && HasFocus) base.KillFocus(); } } // We may not be focused yet, but we need to handle keyboard input to be able to request focus public override bool HandleKeyboardInput => HoldFocus || base.HandleKeyboardInput; protected override void OnFocus(InputState state) { base.OnFocus(state); BorderThickness = 0; } protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { if (!HasFocus) return false; return base.OnKeyDown(state, args); } public override bool OnPressed(GlobalAction action) { if (action == GlobalAction.Back) { if (Text.Length > 0) { Text = string.Empty; return true; } } return base.OnPressed(action); } protected override void KillFocus() { base.KillFocus(); Exit?.Invoke(); } public override bool RequestsFocus => HoldFocus; } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; using osu.Framework.Input; using System; using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface { /// <summary> /// A textbox which holds focus eagerly. /// </summary> public class FocusedTextBox : OsuTextBox { protected override Color4 BackgroundUnfocused => new Color4(10, 10, 10, 255); protected override Color4 BackgroundFocused => new Color4(10, 10, 10, 255); public Action Exit; private bool focus; public bool HoldFocus { get { return focus; } set { focus = value; if (!focus && HasFocus) KillFocus(); } } // We may not be focused yet, but we need to handle keyboard input to be able to request focus public override bool HandleKeyboardInput => HoldFocus || base.HandleKeyboardInput; protected override void OnFocus(InputState state) { base.OnFocus(state); BorderThickness = 0; } protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { if (!HasFocus) return false; return base.OnKeyDown(state, args); } public override bool OnPressed(GlobalAction action) { if (action == GlobalAction.Back) { if (Text.Length > 0) { Text = string.Empty; return true; } } return base.OnPressed(action); } protected override void KillFocus() { base.KillFocus(); Exit?.Invoke(); } public override bool RequestsFocus => HoldFocus; } }
mit
C#
62cef3471a796ce1c56f492e08ac093a9129da32
Make sure daemon password console works on Windows 7
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi/Helpers/PasswordConsole.cs
WalletWasabi/Helpers/PasswordConsole.cs
using System; using System.Collections.Generic; using System.Text; namespace WalletWasabi.Helpers { public static class PasswordConsole { /// <summary> /// Gets the console password. /// </summary> public static string ReadPassword() { try { var sb = new StringBuilder(); while (true) { ConsoleKeyInfo cki = Console.ReadKey(true); if (cki.Key == ConsoleKey.Enter) { Console.WriteLine(); break; } if (cki.Key == ConsoleKey.Backspace) { if (sb.Length > 0) { Console.Write("\b \b"); sb.Length--; } continue; } Console.Write('*'); sb.Append(cki.KeyChar); } return sb.ToString(); } catch (InvalidOperationException) { return Console.ReadLine(); } } } }
using System; using System.Collections.Generic; using System.Text; namespace WalletWasabi.Helpers { public static class PasswordConsole { /// <summary> /// Gets the console password. /// </summary> public static string ReadPassword() { var sb = new StringBuilder(); while (true) { ConsoleKeyInfo cki = Console.ReadKey(true); if (cki.Key == ConsoleKey.Enter) { Console.WriteLine(); break; } if (cki.Key == ConsoleKey.Backspace) { if (sb.Length > 0) { Console.Write("\b \b"); sb.Length--; } continue; } Console.Write('*'); sb.Append(cki.KeyChar); } return sb.ToString(); } } }
mit
C#
7d117da3d1c2589a3727257e5e75e71eddaf6027
Update OneApiExamples/Scenarios/GetInboundMessages.cs
infobip/oneapi-dot-net
OneApiExamples/Scenarios/GetInboundMessages.cs
OneApiExamples/Scenarios/GetInboundMessages.cs
using System; using System.IO; using log4net.Config; using OneApi.Config; using OneApi.Client.Impl; using OneApi.Model; using OneApi.Exceptions; namespace OneApi.Scenarios { /** * To run this example follow these 3 steps: * * 1.) Download 'OneApiExample' project - available at www.github.com/parseco or www.parseco.com/apis * * 2.) Open 'Scenarios.GetInboundMessages' class to edit where you should populate the following fields: * 'username' * 'password' * * 3.) Run the 'OneApiExample' project, where an a example list with ordered numbers will be displayed in the console. * There you will enter the appropriate example number in the console and press 'Enter' key * on which the result will be displayed in the Console. **/ public class GetInboundMessages { private static string apiUrl = "http://api.parseco.com"; private static string username = "FILL USERNAME HERE !!!"; private static string password = "FILL PASSWORD HERE !!!"; public static void Execute() { //Configure in the 'app.config' which Logger levels are enabled(all levels are enabled in the example) //Check http://logging.apache.org/log4net/release/manual/configuration.html for more informations about the log4net configuration XmlConfigurator.Configure(new FileInfo("OneApiExamples.exe.config")); //Initialize Configuration object Configuration configuration = new Configuration(username, password); configuration.ApiUrl = apiUrl; //Initialize SMSClient using the Configuration object SMSClient smsClient = new SMSClient(configuration); try { //Get Inbound Messages InboundSMSMessageList inboundSMSMessageList = smsClient.SmsMessagingClient.GetInboundMessages(); Console.WriteLine("Inbound Messages " + string.Join("Inbound Message: ", (Object[])inboundSMSMessageList.InboundSMSMessage)); } catch (RequestException e) { Console.WriteLine("Exception: " + e.Message); } } } }
using System; using System.IO; using log4net.Config; using OneApi.Config; using OneApi.Client.Impl; using OneApi.Model; using OneApi.Exceptions; namespace OneApi.Scenarios { /** * To run this example follow these 3 steps: * * 1.) Download 'OneApiExample' project - available at www.github.com/parseco or www.parseco.com/apis * * 2.) Open 'Scenarios.GetInboundMessages' class to edit where you should populate the following fields: * 'apiUrl' * 'username' * 'password' * * 3.) Run the 'OneApiExample' project, where an a example list with ordered numbers will be displayed in the console. * There you will enter the appropriate example number in the console and press 'Enter' key * on which the result will be displayed in the Console. **/ public class GetInboundMessages { private static string apiUrl = "http://api.parseco.com"; private static string username = ""; private static string password = ""; public static void Execute() { //Configure in the 'app.config' which Logger levels are enabled(all levels are enabled in the example) //Check http://logging.apache.org/log4net/release/manual/configuration.html for more informations about the log4net configuration XmlConfigurator.Configure(new FileInfo("OneApiExamples.exe.config")); //Initialize Configuration object Configuration configuration = new Configuration(username, password); configuration.ApiUrl = apiUrl; //Initialize SMSClient using the Configuration object SMSClient smsClient = new SMSClient(configuration); try { //Get Inbound Messages InboundSMSMessageList inboundSMSMessageList = smsClient.SmsMessagingClient.GetInboundMessages(); Console.WriteLine("Inbound Messages " + string.Join("Inbound Message: ", (Object[])inboundSMSMessageList.InboundSMSMessage)); } catch (RequestException e) { Console.WriteLine("Exception: " + e.Message); } } } }
apache-2.0
C#
a70efd1fdf6a8de57e8129a27fbc8ba94535b2ab
create the first attempted mysql test. This only runs locally if you have a database configured as opensim-nunit with user opensim-nunit / password opensim-nunit that has full perms on the database.
N3X15/VoxelSim,AlphaStaxLLC/taiga,TomDataworks/opensim,Michelle-Argus/ArribasimExtract,bravelittlescientist/opensim-performance,AlphaStaxLLC/taiga,ft-/arribasim-dev-tests,ft-/arribasim-dev-extras,zekizeki/agentservice,AlexRa/opensim-mods-Alex,BogusCurry/arribasim-dev,M-O-S-E-S/opensim,allquixotic/opensim-autobackup,BogusCurry/arribasim-dev,TomDataworks/opensim,cdbean/CySim,AlphaStaxLLC/taiga,ft-/opensim-optimizations-wip,TechplexEngineer/Aurora-Sim,BogusCurry/arribasim-dev,rryk/omp-server,intari/OpenSimMirror,bravelittlescientist/opensim-performance,ft-/arribasim-dev-extras,cdbean/CySim,M-O-S-E-S/opensim,OpenSimian/opensimulator,QuillLittlefeather/opensim-1,M-O-S-E-S/opensim,TomDataworks/opensim,N3X15/VoxelSim,intari/OpenSimMirror,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,AlexRa/opensim-mods-Alex,cdbean/CySim,ft-/arribasim-dev-extras,N3X15/VoxelSim,OpenSimian/opensimulator,AlphaStaxLLC/taiga,QuillLittlefeather/opensim-1,M-O-S-E-S/opensim,TomDataworks/opensim,N3X15/VoxelSim,allquixotic/opensim-autobackup,cdbean/CySim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,justinccdev/opensim,rryk/omp-server,AlphaStaxLLC/taiga,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,justinccdev/opensim,intari/OpenSimMirror,ft-/arribasim-dev-tests,OpenSimian/opensimulator,intari/OpenSimMirror,ft-/arribasim-dev-tests,allquixotic/opensim-autobackup,OpenSimian/opensimulator,ft-/opensim-optimizations-wip-tests,ft-/opensim-optimizations-wip-extras,ft-/arribasim-dev-tests,TechplexEngineer/Aurora-Sim,M-O-S-E-S/opensim,allquixotic/opensim-autobackup,BogusCurry/arribasim-dev,ft-/opensim-optimizations-wip-extras,AlphaStaxLLC/taiga,TechplexEngineer/Aurora-Sim,M-O-S-E-S/opensim,TechplexEngineer/Aurora-Sim,BogusCurry/arribasim-dev,zekizeki/agentservice,N3X15/VoxelSim,RavenB/opensim,QuillLittlefeather/opensim-1,Michelle-Argus/ArribasimExtract,zekizeki/agentservice,QuillLittlefeather/opensim-1,bravelittlescientist/opensim-performance,rryk/omp-server,N3X15/VoxelSim,zekizeki/agentservice,RavenB/opensim,allquixotic/opensim-autobackup,ft-/arribasim-dev-extras,TomDataworks/opensim,ft-/opensim-optimizations-wip,justinccdev/opensim,AlphaStaxLLC/taiga,ft-/opensim-optimizations-wip-extras,AlexRa/opensim-mods-Alex,ft-/arribasim-dev-extras,justinccdev/opensim,RavenB/opensim,Michelle-Argus/ArribasimExtract,OpenSimian/opensimulator,bravelittlescientist/opensim-performance,ft-/arribasim-dev-extras,QuillLittlefeather/opensim-1,AlphaStaxLLC/taiga,RavenB/opensim,cdbean/CySim,cdbean/CySim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,RavenB/opensim,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,ft-/arribasim-dev-tests,ft-/opensim-optimizations-wip-tests,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,RavenB/opensim,justinccdev/opensim,ft-/opensim-optimizations-wip,zekizeki/agentservice,rryk/omp-server,allquixotic/opensim-autobackup,ft-/opensim-optimizations-wip-tests,ft-/opensim-optimizations-wip,QuillLittlefeather/opensim-1,bravelittlescientist/opensim-performance,ft-/opensim-optimizations-wip-extras,intari/OpenSimMirror,OpenSimian/opensimulator,Michelle-Argus/ArribasimExtract,justinccdev/opensim,ft-/opensim-optimizations-wip-extras,QuillLittlefeather/opensim-1,M-O-S-E-S/opensim,rryk/omp-server,rryk/omp-server,RavenB/opensim,Michelle-Argus/ArribasimExtract,intari/OpenSimMirror,TomDataworks/opensim,bravelittlescientist/opensim-performance,BogusCurry/arribasim-dev,AlexRa/opensim-mods-Alex,ft-/arribasim-dev-tests,AlexRa/opensim-mods-Alex,EriHoss/OpenSim_0.8.2.0_Dev_LibLSLCC,N3X15/VoxelSim,AlexRa/opensim-mods-Alex,OpenSimian/opensimulator,TomDataworks/opensim,ft-/opensim-optimizations-wip-tests,zekizeki/agentservice,ft-/opensim-optimizations-wip-tests,N3X15/VoxelSim,Michelle-Argus/ArribasimExtract
OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs
OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs
/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the OpenSim Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; using System.IO; using System.Collections.Generic; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenSim.Framework; using OpenSim.Data.Tests; using OpenSim.Data.MySQL; using OpenSim.Region.Environment.Scenes; using OpenMetaverse; using log4net; namespace OpenSim.Data.MySQL.Tests { [TestFixture] public class MySQLInventoryTest : BasicInventoryTest { public string file; public MySQLManager database; public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; [TestFixtureSetUp] public void Init() { SuperInit(); try { database = new MySQLManager(connect); db = new MySQLInventoryData(); db.Initialise(connect); } catch (Exception e) { System.Console.WriteLine("Exception {0}", e); Assert.Ignore(); } } [TestFixtureTearDown] public void Cleanup() { if (database != null) { database.ExecuteSql("drop table migrations"); database.ExecuteSql("drop table inventoryitems"); database.ExecuteSql("drop table inventoryfolders"); } } } }
/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the OpenSim Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; using System.IO; using System.Collections.Generic; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenSim.Framework; using OpenSim.Data.Tests; using OpenSim.Data.MySQL; using OpenSim.Region.Environment.Scenes; using OpenMetaverse; using log4net; namespace OpenSim.Data.MySQL.Tests { [TestFixture] public class MySQLInventoryTest : BasicInventoryTest { public string file; public string connect; [TestFixtureSetUp] public void Init() { SuperInit(); Assert.Ignore(); file = Path.GetTempFileName() + ".db"; connect = "URI=file:" + file + ",version=3"; } [TestFixtureTearDown] public void Cleanup() { } } }
bsd-3-clause
C#
1c7d709388bc7782fcfac490d30626211e7675b0
Update ExampleListener.cs
hengineer/CaptainsMess
Assets/CaptainsMess/Example/ExampleListener.cs
Assets/CaptainsMess/Example/ExampleListener.cs
using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; public class ExampleListener : CaptainsMessListener { public enum NetworkState { Init, Offline, Connecting, Connected, Disrupted }; [HideInInspector] public NetworkState networkState = NetworkState.Init; public Text networkStateField; public ExampleGameSession gameSession; public void Start() { networkState = NetworkState.Offline; } public override void OnStartConnecting() { networkState = NetworkState.Connecting; } public override void OnStopConnecting() { networkState = NetworkState.Offline; } public override void OnJoinedLobby() { networkState = NetworkState.Connected; gameSession.OnJoinedLobby(); } public override void OnLeftLobby() { networkState = NetworkState.Offline; gameSession.OnLeftLobby(); } public override void OnCountdownStarted() { gameSession.OnCountdownStarted(); } public override void OnCountdownCancelled() { gameSession.OnCountdownCancelled(); } public override void OnStartGame(List<CaptainsMessPlayer> aStartingPlayers) { Debug.Log("GO!"); gameSession.OnStartGame(aStartingPlayers); } public override void OnAbortGame() { Debug.Log("ABORT!"); gameSession.OnAbortGame(); } void Update() { networkStateField.text = networkState.ToString(); } }
using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; public class ExampleListener : CaptainsMessListener { public enum NetworkState { Init, Offline, Connecting, Connected, Disrupted }; public NetworkState networkState = NetworkState.Init; public Text networkStateField; public ExampleGameSession gameSession; public void Start() { networkState = NetworkState.Offline; } public override void OnStartConnecting() { networkState = NetworkState.Connecting; } public override void OnStopConnecting() { networkState = NetworkState.Offline; } public override void OnJoinedLobby() { networkState = NetworkState.Connected; gameSession.OnJoinedLobby(); } public override void OnLeftLobby() { networkState = NetworkState.Offline; gameSession.OnLeftLobby(); } public override void OnCountdownStarted() { gameSession.OnCountdownStarted(); } public override void OnCountdownCancelled() { gameSession.OnCountdownCancelled(); } public override void OnStartGame(List<CaptainsMessPlayer> aStartingPlayers) { Debug.Log("GO!"); gameSession.OnStartGame(aStartingPlayers); } public override void OnAbortGame() { Debug.Log("ABORT!"); gameSession.OnAbortGame(); } void Update() { networkStateField.text = networkState.ToString(); } }
mit
C#
02cc3358191673d481b0c6085be27203653a8e30
Simplify Markdown value converter
stvnhrlnd/SH,stvnhrlnd/SH,stvnhrlnd/SH
SH.Site/PropertyValueConverters/MarkdownEditorValueConverter.cs
SH.Site/PropertyValueConverters/MarkdownEditorValueConverter.cs
using CommonMark; using System.Web; using Umbraco.Core; using Umbraco.Core.Models.PublishedContent; using Umbraco.Core.PropertyEditors; namespace SH.Site.PropertyValueConverters { [PropertyValueType(typeof(IHtmlString))] public class MarkdownEditorValueConverter : PropertyValueConverterBase { public override bool IsConverter(PublishedPropertyType propertyType) { return Constants.PropertyEditors.MarkdownEditorAlias.Equals(propertyType.PropertyEditorAlias); } public override object ConvertDataToSource(PublishedPropertyType propertyType, object data, bool preview) { var markdown = data as string; if (string.IsNullOrWhiteSpace(markdown)) return null; var html = CommonMarkConverter.Convert(markdown); return new HtmlString(html); } } }
using CommonMark; using System.Web; using Umbraco.Core; using Umbraco.Core.Models.PublishedContent; using Umbraco.Core.PropertyEditors; using Umbraco.Web.Templates; namespace SH.Site.PropertyValueConverters { [PropertyValueType(typeof(IHtmlString))] [PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Request)] public class MarkdownEditorValueConverter : PropertyValueConverterBase { public override bool IsConverter(PublishedPropertyType propertyType) { return Constants.PropertyEditors.MarkdownEditorAlias.Equals(propertyType.PropertyEditorAlias); } public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview) { if (source == null) { return null; } var sourceString = source.ToString(); sourceString = TemplateUtilities.ParseInternalLinks(sourceString); sourceString = TemplateUtilities.ResolveUrlsFromTextString(sourceString); return sourceString; } public override object ConvertSourceToObject(PublishedPropertyType propertyType, object source, bool preview) { return new HtmlString(source == null ? string.Empty : CommonMarkConverter.Convert(source.ToString())); } public override object ConvertSourceToXPath(PublishedPropertyType propertyType, object source, bool preview) { return source; } } }
mit
C#
8c98a4cdb3f721ac2ddeb83e86553b6b8e072024
Read PolicyId from settings
manuelmeyer1/AzureDeveloperBootcamp,manuelmeyer1/AzureDeveloperBootcamp,manuelmeyer1/AzureDeveloperBootcamp,Trivadis/AzureDeveloperBootcamp,Trivadis/AzureDeveloperBootcamp,Trivadis/AzureDeveloperBootcamp,Trivadis/AzureDeveloperBootcamp,manuelmeyer1/AzureDeveloperBootcamp
Trivadis.AzureBootcamp.WebApp/Authentication/PolicyAuthorize.cs
Trivadis.AzureBootcamp.WebApp/Authentication/PolicyAuthorize.cs
using System; using System.Collections.Generic; using System.Web; using System.Web.Mvc; using Microsoft.Owin.Security; using Microsoft.Owin.Security.OpenIdConnect; namespace Trivadis.AzureBootcamp.WebApp.Authentication { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] internal class PolicyAuthorize : System.Web.Mvc.AuthorizeAttribute { public string Policy { get; set; } protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext) { filterContext.HttpContext.GetOwinContext().Authentication.Challenge( new AuthenticationProperties( new Dictionary<string, string> { {AzureB2CSettings.PolicyKey, Policy} }) { RedirectUri = "/", } , OpenIdConnectAuthenticationDefaults.AuthenticationType); base.HandleUnauthorizedRequest(filterContext); } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] internal class SignInPolicyAttribute : PolicyAuthorize { public SignInPolicyAttribute() { Policy = AzureB2CSettings.SignInPolicyId; } } }
using System; using System.Collections.Generic; using System.Web; using System.Web.Mvc; using Microsoft.Owin.Security; using Microsoft.Owin.Security.OpenIdConnect; namespace Trivadis.AzureBootcamp.WebApp.Authentication { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] internal class PolicyAuthorize : System.Web.Mvc.AuthorizeAttribute { public string Policy { get; set; } protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext) { filterContext.HttpContext.GetOwinContext().Authentication.Challenge( new AuthenticationProperties( new Dictionary<string, string> { {AzureB2CSettings.PolicyKey, Policy} }) { RedirectUri = "/", } , OpenIdConnectAuthenticationDefaults.AuthenticationType); base.HandleUnauthorizedRequest(filterContext); } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] internal class SignInPolicyAttribute : PolicyAuthorize { public SignInPolicyAttribute() { Policy = "B2C_1_sign_in"; } } }
mit
C#
394be77badd02895bd472111fd1cd6a6a3b8318d
Fix Run Issue
thesecretlab/NonCombativeFPS
Solitude/Assets/Scripts/Hacking/CountDownTimer.cs
Solitude/Assets/Scripts/Hacking/CountDownTimer.cs
using UnityEngine; using UnityEngine.UI; using System.Collections; using UnityEngine.SceneManagement; using System; public class CountDownTimer { float timeLeft = 50.0f; float closetime = 3.0f; bool Gameover = false; public Text text; void Update() { if (!Gameover) { timeLeft -= Time.deltaTime; text.text = "Time Remaining:" + Mathf.Round(timeLeft); } if (timeLeft < 0) { Gameover = true; text.text = "#!HACK FAILED!#"; closetime -= Time.deltaTime; SceneManager.LoadScene("MainGame"); } if(GlobalVars.GlobalVariables.SYSCORE_FOUND == 1) { Gameover = true; text.text = "HACK SUCCESSFUL"; closetime -= Time.deltaTime; SceneManager.LoadScene("MainGame"); } } }
using UnityEngine; using UnityEngine.UI; using System.Collections; using UnityEngine.SceneManagement; using System; public class CountDownTimer : Terminal { float timeLeft = 50.0f; float closetime = 3.0f; bool Gameover = false; public Text text; protected override void doUpdate() { if (!Gameover) { timeLeft -= Time.deltaTime; text.text = "Time Remaining:" + Mathf.Round(timeLeft); } if (timeLeft < 0) { Gameover = true; text.text = "#!HACK FAILED!#"; closetime -= Time.deltaTime; SceneManager.LoadScene("MainGame"); } if(GlobalVars.GlobalVariables.SYSCORE_FOUND == 1) { Gameover = true; text.text = "HACK SUCCESSFUL"; closetime -= Time.deltaTime; SceneManager.LoadScene("MainGame"); } } protected override void initialise() { throw new NotImplementedException(); } public override void interact() { throw new NotImplementedException(); } }
mit
C#
30dde364ba71cb8e86a4521fb6a2d06e7c7888bf
Fix bug with IB instrument addition window
leo90skk/qdms,Jumaga2015/qdms,qusma/qdms,leo90skk/qdms,underwater/qdms,qusma/qdms,underwater/qdms
QDMSServer/Windows/AddInstrumentInteractiveBrokersWindow.xaml.cs
QDMSServer/Windows/AddInstrumentInteractiveBrokersWindow.xaml.cs
// ----------------------------------------------------------------------- // <copyright file="AddInstrumentInteractiveBrokersWindow.xaml.cs" company=""> // Copyright 2016 Alexander Soffronow Pagonidis // </copyright> // ----------------------------------------------------------------------- using MahApps.Metro.Controls; using MahApps.Metro.Controls.Dialogs; using NLog; using QDMSServer.ViewModels; using System; using System.Windows; using System.Windows.Input; namespace QDMSServer { /// <summary> /// Interaction logic for AddInstrumentInteractiveBrokersWindow.xaml /// </summary> public partial class AddInstrumentInteractiveBrokersWindow : MetroWindow { private readonly Logger _logger = LogManager.GetCurrentClassLogger(); public AddInstrumentInteractiveBrokersWindow() { try { ViewModel = new AddInstrumentIbViewModel(DialogCoordinator.Instance); } catch (Exception ex) { Hide(); _logger.Log(LogLevel.Error, ex.Message); return; } DataContext = ViewModel; InitializeComponent(); ShowDialog(); } private void CloseBtn_Click(object sender, RoutedEventArgs e) { Hide(); } private void DXWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (ViewModel != null) { ViewModel.Dispose(); } } private void SymbolTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) ViewModel.Search.Execute(null); } public AddInstrumentIbViewModel ViewModel { get; set; } } }
// ----------------------------------------------------------------------- // <copyright file="AddInstrumentInteractiveBrokersWindow.xaml.cs" company=""> // Copyright 2016 Alexander Soffronow Pagonidis // </copyright> // ----------------------------------------------------------------------- using MahApps.Metro.Controls; using MahApps.Metro.Controls.Dialogs; using NLog; using QDMSServer.ViewModels; using System; using System.Windows; using System.Windows.Input; namespace QDMSServer { /// <summary> /// Interaction logic for AddInstrumentInteractiveBrokersWindow.xaml /// </summary> public partial class AddInstrumentInteractiveBrokersWindow : MetroWindow { private readonly Logger _logger = LogManager.GetCurrentClassLogger(); public AddInstrumentInteractiveBrokersWindow() { try { ViewModel = new AddInstrumentIbViewModel(DialogCoordinator.Instance); } catch (Exception ex) { Hide(); _logger.Log(LogLevel.Error, ex.Message); return; } DataContext = ViewModel; InitializeComponent(); Show(); } private void CloseBtn_Click(object sender, RoutedEventArgs e) { Hide(); } private void DXWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (ViewModel != null) { ViewModel.Dispose(); } } private void SymbolTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) ViewModel.Search.Execute(null); } public AddInstrumentIbViewModel ViewModel { get; set; } } }
bsd-3-clause
C#
0edd4cf3b96ec717e5eba44ae834c8a72d85838e
Allow Factory4 creation using CreateDXGIFactory2 with debug flag.
sharpdx/SharpDX,sharpdx/SharpDX,sharpdx/SharpDX
Source/SharpDX.DXGI/Factory4.cs
Source/SharpDX.DXGI/Factory4.cs
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // 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 System; namespace SharpDX.DXGI { public partial class Factory4 { /// <summary> /// Initializes a new instance of <see cref="Factory4"/> class. /// </summary> public Factory4() : this(IntPtr.Zero) { IntPtr factoryPtr; DXGI.CreateDXGIFactory1(Utilities.GetGuidFromType(GetType()), out factoryPtr); NativePointer = factoryPtr; } /// <summary> /// Initializes a new instance of <see cref="Factory4"/> class. /// </summary> /// <param name="debug">True - to set the DXGI_CREATE_FACTORY_DEBUG flag.</param> public Factory4(bool debug = false) : this(IntPtr.Zero) { IntPtr factoryPtr; DXGI.CreateDXGIFactory2(debug ? DXGI.CreateFactoryDebug : 0x00, Utilities.GetGuidFromType(typeof(Factory4)), out factoryPtr); NativePointer = factoryPtr; } /// <summary> /// Gets the default warp adapter. /// </summary> /// <returns>The warp adapter.</returns> public Adapter GetWarpAdapter() { IntPtr adapterPtr; EnumWarpAdapter(Utilities.GetGuidFromType(typeof(Adapter)), out adapterPtr); return new Adapter(adapterPtr); } /// <summary> /// Gets the adapter for the specified LUID. /// </summary> /// <param name="adapterLuid">A unique value that identifies the adapter.</param> /// <returns>The adapter.</returns> public Adapter GetAdapterByLuid(long adapterLuid) { IntPtr adapterPtr; EnumAdapterByLuid(adapterLuid, Utilities.GetGuidFromType(typeof(Adapter)), out adapterPtr); return new Adapter(adapterPtr); } } }
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // 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 System; namespace SharpDX.DXGI { public partial class Factory4 { /// <summary> /// Initializes a new instance of <see cref="Factory4"/> class. /// </summary> public Factory4() : this(IntPtr.Zero) { IntPtr factoryPtr; DXGI.CreateDXGIFactory1(Utilities.GetGuidFromType(GetType()), out factoryPtr); NativePointer = factoryPtr; } /// <summary> /// Gets the default warp adapter. /// </summary> /// <returns>The warp adapter.</returns> public Adapter GetWarpAdapter() { IntPtr adapterPtr; EnumWarpAdapter(Utilities.GetGuidFromType(typeof(Adapter)), out adapterPtr); return new Adapter(adapterPtr); } /// <summary> /// Gets the adapter for the specified LUID. /// </summary> /// <param name="adapterLuid">A unique value that identifies the adapter.</param> /// <returns>The adapter.</returns> public Adapter GetAdapterByLuid(long adapterLuid) { IntPtr adapterPtr; EnumAdapterByLuid(adapterLuid, Utilities.GetGuidFromType(typeof(Adapter)), out adapterPtr); return new Adapter(adapterPtr); } } }
mit
C#
a0646acea9eef785d04eefabca685e5ec259ae86
Remove extra method.
PaulTrampert/PTrampert.AspNetCore.Identity.MongoDB
PTrampert.AspNetCore.Identity.MongoDB/ServiceCollectionExtensions.cs
PTrampert.AspNetCore.Identity.MongoDB/ServiceCollectionExtensions.cs
using System; using System.Collections.Generic; using System.Text; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using MongoDB.Driver; using PTrampert.AspNetCore.Identity.MongoDB.Configuration; namespace PTrampert.AspNetCore.Identity.MongoDB { public static class ServiceCollectionExtensions { public static IServiceCollection AddMongoUserStore<T>(this IServiceCollection services, Action<MongoUserStoreOptions<T>> configure) where T : IdentityUser { services.Configure(configure); services.AddSingleton<MongoUserStore<T>>(); return services; } public static IServiceCollection AddMongoUserStore<T>(this IServiceCollection services, IConfiguration configuration) where T: IdentityUser { services.Configure<MongoUserStoreOptions<T>>(configuration); services.AddSingleton<MongoUserStore<T>>(); return services; } public static IServiceCollection AddMongoRoleStore(this IServiceCollection services, Action<MongoRoleStoreOptions> configure) { services.Configure(configure); services.AddSingleton<MongoRoleStore>(); return services; } public static IServiceCollection AddMongoRoleStore(this IServiceCollection services, IConfiguration configuration) { services.Configure<MongoRoleStoreOptions>(configuration); services.AddSingleton<MongoRoleStore>(); return services; } } }
using System; using System.Collections.Generic; using System.Text; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using MongoDB.Driver; using PTrampert.AspNetCore.Identity.MongoDB.Configuration; namespace PTrampert.AspNetCore.Identity.MongoDB { public static class ServiceCollectionExtensions { public static IServiceCollection AddMongoUserStore<T>(this IServiceCollection services, Action<MongoUserStoreOptions<T>> configure) where T : IdentityUser { services.Configure(configure); services.AddSingleton<MongoUserStore<T>>(); return services; } public static IServiceCollection AddMongoUserStore<T>(this IServiceCollection services, IConfiguration configuration) where T: IdentityUser { services.Configure<MongoUserStoreOptions<T>>(configuration); services.AddSingleton<MongoUserStore<T>>(); return services; } public static IServiceCollection AddMongoRoleStore(this IServiceCollection services, Action<MongoRoleStoreOptions> configure) { services.Configure(configure); services.AddSingleton<MongoRoleStore>(); return services; } public static IServiceCollection AddMongoRoleStore(this IServiceCollection services, IConfiguration configuration) { services.Configure<MongoRoleStoreOptions>(configuration); services.AddSingleton<MongoRoleStore>(); return services; } public static IServiceCollection AddMongoRoleStore(this IServiceCollection services) { services.AddSingleton<MongoRoleStore>(); return services; } } }
mit
C#
41ee82e4a5d6864dae832b219a25cb17458d8054
Add zero ptr check to UrhoTypeRegistryGenerator
florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho
SharpieBinder/UrhoTypeRegistryGenerator.cs
SharpieBinder/UrhoTypeRegistryGenerator.cs
using System.IO; namespace SharpieBinder { public class UrhoTypeRegistryGenerator { string appendedLines = string.Empty; readonly string outputDir; const string SwitchCasesPlaceholder = "%CASES%"; const string CsTemplate = @"// WARNING - AUTOGENERATED - DO NOT EDIT // // Generated using `sharpie urho` // // Copyright 2015 Xamarin Inc. All rights reserved. using System; namespace Urho { public partial class UrhoObjectsRegistry { public static T CreateInstance<T>(IntPtr ptr, int hash) where T : class { return (T)CreateInstance(ptr, hash); } public static object CreateInstance(IntPtr ptr, int hash) { if (ptr == IntPtr.Zero) return null; switch (hash) { " + SwitchCasesPlaceholder + @" default: return null; } } } }"; public UrhoTypeRegistryGenerator(string outputDir) { this.outputDir = outputDir; } public void AppendType(string typeName) { var code = CalculateTypeHashCode(typeName); string line = $"\t\t\t\tcase {code}: return new {typeName}(ptr);\n"; appendedLines += line; } public void Flush() { string content = CsTemplate.Replace(SwitchCasesPlaceholder, appendedLines); File.WriteAllText(Path.Combine(outputDir, "UrhoObjectsRegistry.cs"), content); } /// <summary> /// According to StringHash.cpp impl /// </summary> static int CalculateTypeHashCode(string typeName) { int hash = 0; foreach (var c in typeName) hash = char.ToLower(c) + (hash << 6) + (hash << 16) - hash; return hash; } } }
using System.IO; namespace SharpieBinder { public class UrhoTypeRegistryGenerator { string appendedLines = string.Empty; readonly string outputDir; const string SwitchCasesPlaceholder = "%CASES%"; const string CsTemplate = @"// WARNING - AUTOGENERATED - DO NOT EDIT // // Generated using `sharpie urho` // // Copyright 2015 Xamarin Inc. All rights reserved. using System; namespace Urho { public partial class UrhoObjectsRegistry { public static T CreateInstance<T>(IntPtr ptr, StringHash hash) where T : class { return (T)CreateInstance(ptr, hash.Code); } public static object CreateInstance(IntPtr ptr, int code) { switch (code) { " + SwitchCasesPlaceholder + @" default: return null; } } } }"; public UrhoTypeRegistryGenerator(string outputDir) { this.outputDir = outputDir; } public void AppendType(string typeName) { var code = CalculateTypeHashCode(typeName); string line = $"\t\t\t\tcase {code}: return new {typeName}(ptr);\n"; appendedLines += line; } public void Flush() { string content = CsTemplate.Replace(SwitchCasesPlaceholder, appendedLines); File.WriteAllText(Path.Combine(outputDir, "UrhoObjectsRegistry.cs"), content); } /// <summary> /// According to StringHash.cpp impl /// </summary> static int CalculateTypeHashCode(string typeName) { int hash = 0; foreach (var c in typeName) hash = char.ToLower(c) + (hash << 6) + (hash << 16) - hash; return hash; } } }
mit
C#
9d0311b7d8d73af7f84b07923d6fb612273f67f1
Update JsonSerializer.cs
tiksn/TIKSN-Framework
TIKSN.Core/Serialization/JsonSerializer.cs
TIKSN.Core/Serialization/JsonSerializer.cs
using Newtonsoft.Json; namespace TIKSN.Serialization { public class JsonSerializer : SerializerBase<string> { protected override string SerializeInternal<T>(T obj) => JsonConvert.SerializeObject(obj); } }
using Newtonsoft.Json; namespace TIKSN.Serialization { public class JsonSerializer : SerializerBase<string> { protected override string SerializeInternal<T>(T obj) { return JsonConvert.SerializeObject(obj); } } }
mit
C#
fedc68bad2fb399a5c9a742cbcdfbcb2c626957a
Simplify VoidResult to a value type
DotNetAnalyzers/StyleCopAnalyzers
StyleCop.Analyzers/StyleCop.Analyzers/Helpers/SpecializedTasks.cs
StyleCop.Analyzers/StyleCop.Analyzers/Helpers/SpecializedTasks.cs
namespace StyleCop.Analyzers.Helpers { using System.Threading.Tasks; internal static class SpecializedTasks { internal static Task CompletedTask { get; } = Task.FromResult(default(VoidResult)); private struct VoidResult { } } }
namespace StyleCop.Analyzers.Helpers { using System.Threading.Tasks; internal static class SpecializedTasks { internal static Task CompletedTask { get; } = Task.FromResult(default(VoidResult)); private sealed class VoidResult { private VoidResult() { } } } }
mit
C#
6f00561edd10133b93cb1d5def98ca9db46b819d
Add a comment
ytabuchi/Teachathon
XF_Stopwatch/XF_Stopwatch/XF_Stopwatch/Views/MainPageXaml.xaml.cs
XF_Stopwatch/XF_Stopwatch/XF_Stopwatch/Views/MainPageXaml.xaml.cs
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; using XF_Stopwatch.Models; using XF_Stopwatch.ViewModels; namespace XF_Stopwatch.Views { public partial class MainPageXaml : ContentPage { public MainPageXaml() { InitializeComponent(); // 参考:https://developer.xamarin.com/guides/cross-platform/xamarin-forms/messaging-center/ // 第2引数が同じSendとSubscribeでやり取りをするようです // ここにこんなに盛り込んでいいのか? // App.ChangeFormatはApp.isShowedを参照してしまっている… MessagingCenter.Subscribe<MainViewModel, ObservableCollection<LapTimes>>(this, "TotalTime", async (sender, arg) => { var ms = arg.Sum(l => l.LapTime); var max = App.ChangeFormat(arg.Max(i => i.LapTime)); var min = App.ChangeFormat(arg.Min(j => j.LapTime)); var alertTitle = string.Format("Total Time: {0}",App.ChangeFormat(ms)); var res = await DisplayAlert(alertTitle, string.Format("Max laptime: {0}\nMin laptime: {1}\n\nShow all lap result?", max, min), "Yes", "No"); if (res) await Navigation.PushAsync(new ResultPage(App.lapTimes)); // TODO:VMのVmLapTimesを参照したい。して良い?出来る? else { App.lapTimes.Clear(); // TODO:VMのVmLapTimesを参照したい。して良い?出来る? } }); } } }
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; using XF_Stopwatch.Models; using XF_Stopwatch.ViewModels; namespace XF_Stopwatch.Views { public partial class MainPageXaml : ContentPage { public MainPageXaml() { InitializeComponent(); // 参考:https://developer.xamarin.com/guides/cross-platform/xamarin-forms/messaging-center/ // 第2引数が同じSendとSubscribeでやり取りをするようです // ここにこんなに盛り込んでいいのか? MessagingCenter.Subscribe<MainViewModel, ObservableCollection<LapTimes>>(this, "TotalTime", async (sender, arg) => { var ms = arg.Sum(l => l.LapTime); var max = App.ChangeFormat(arg.Max(i => i.LapTime)); var min = App.ChangeFormat(arg.Min(j => j.LapTime)); var alertTitle = string.Format("Total Time: {0}",App.ChangeFormat(ms)); var res = await DisplayAlert(alertTitle, string.Format("Max laptime: {0}\nMin laptime: {1}\n\nShow all lap result?", max, min), "Yes", "No"); if (res) await Navigation.PushAsync(new ResultPage(App.lapTimes)); // TODO:VMのVmLapTimesを参照したい。して良い?出来る? else { App.lapTimes.Clear(); // TODO:VMのVmLapTimesを参照したい。して良い?出来る? } }); } } }
mit
C#
8c22ec3cb3be608475216cd33b548f43fb7e8794
Fix license.
modern-dev/dice
ModernDev.Dice.Tests/MersenneTwisterTest.cs
ModernDev.Dice.Tests/MersenneTwisterTest.cs
// // This file\code is part of InTouch project. // // InTouch - is a .NET wrapper for the vk.com API. // https://github.com/virtyaluk/InTouch // // Copyright (c) 2016 Bohdan Shtepan // http://modern-dev.com/ // // Licensed under the MIT license. // using NUnit.Framework; using static NUnit.Framework.Assert; namespace ModernDev.Dice.Tests { [TestFixture] public class MersenneTwisterTest { [Test] public void Generator() { const uint seed = 321; using (var mt1 = new MersenneTwister(seed)) { using (var mt2 = new MersenneTwister(seed)) { for (var i = 0; i < 5; i++) { IsTrue(mt1.GenRandInt32() == mt2.GenRandInt32(), "mt1.GenRandInt32() == mt2.GenRandInt32()"); } } } } } }
// // This file\code is part of InTouch project. // // InTouch - is a .NET wrapper for the vk.com API. // https://github.com/virtyaluk/InTouch // // Copyright (c) 2016 Bohdan Shtepan // http://modern-dev.com/ // // Licensed under the GPLv3 license. // using NUnit.Framework; using static NUnit.Framework.Assert; namespace ModernDev.Dice.Tests { [TestFixture] public class MersenneTwisterTest { [Test] public void Generator() { const uint seed = 321; using (var mt1 = new MersenneTwister(seed)) { using (var mt2 = new MersenneTwister(seed)) { for (var i = 0; i < 5; i++) { IsTrue(mt1.GenRandInt32() == mt2.GenRandInt32(), "mt1.GenRandInt32() == mt2.GenRandInt32()"); } } } } } }
mit
C#
98e239f6bfbd1e25998b128806de53d18784248f
Bump version.
wasker/nsight.piwik.api
Nsight.Piwik.Api/Properties/AssemblyInfo.cs
Nsight.Piwik.Api/Properties/AssemblyInfo.cs
using System.Resources; 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("Nsight.Piwik.Api")] [assembly: AssemblyDescription("Piwik API implementation")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ByteGems.com Software")] [assembly: AssemblyProduct("Nsight.Piwik.Api")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // 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.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: InternalsVisibleTo("Nsight.Piwik.Api.Tests")]
using System.Resources; 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("Nsight.Piwik.Api")] [assembly: AssemblyDescription("Piwik API implementation")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ByteGems.com Software")] [assembly: AssemblyProduct("Nsight.Piwik.Api")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // 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")] [assembly: InternalsVisibleTo("Nsight.Piwik.Api.Tests")]
mit
C#
ee34c5ccb457e582868ced659a6d0f952cb98665
Add a flip step to mania placement test scenes
ZLima12/osu,NeoAdonis/osu,2yangk23/osu,UselessToucan/osu,NeoAdonis/osu,EVAST9919/osu,NeoAdonis/osu,UselessToucan/osu,smoogipooo/osu,ZLima12/osu,2yangk23/osu,smoogipoo/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,peppy/osu,ppy/osu,smoogipoo/osu,peppy/osu-new,johnneijzen/osu,ppy/osu,peppy/osu,EVAST9919/osu,johnneijzen/osu
osu.Game.Rulesets.Mania.Tests/ManiaPlacementBlueprintTestScene.cs
osu.Game.Rulesets.Mania.Tests/ManiaPlacementBlueprintTestScene.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 System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Timing; using osu.Game.Rulesets.Mania.Edit; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; using osu.Game.Tests.Visual; using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Mania.Tests { [Cached(Type = typeof(IManiaHitObjectComposer))] public abstract class ManiaPlacementBlueprintTestScene : PlacementBlueprintTestScene, IManiaHitObjectComposer { private readonly Column column; [Cached(typeof(IReadOnlyList<Mod>))] private IReadOnlyList<Mod> mods { get; set; } = Array.Empty<Mod>(); [Cached(typeof(IScrollingInfo))] private IScrollingInfo scrollingInfo; protected ManiaPlacementBlueprintTestScene() { scrollingInfo = ((ScrollingTestContainer)HitObjectContainer).ScrollingInfo; Add(column = new Column(0) { Anchor = Anchor.Centre, Origin = Anchor.Centre, AccentColour = Color4.OrangeRed, Clock = new FramedClock(new StopwatchClock()), // No scroll }); AddStep("change direction", () => ((ScrollingTestContainer)HitObjectContainer).Flip()); } protected override Container CreateHitObjectContainer() => new ScrollingTestContainer(ScrollingDirection.Down) { RelativeSizeAxes = Axes.Both }; protected override void AddHitObject(DrawableHitObject hitObject) => column.Add((DrawableManiaHitObject)hitObject); public Column ColumnAt(Vector2 screenSpacePosition) => column; public int TotalColumns => 1; } }
// 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 System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Timing; using osu.Game.Rulesets.Mania.Edit; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; using osu.Game.Tests.Visual; using osuTK; using osuTK.Graphics; namespace osu.Game.Rulesets.Mania.Tests { [Cached(Type = typeof(IManiaHitObjectComposer))] public abstract class ManiaPlacementBlueprintTestScene : PlacementBlueprintTestScene, IManiaHitObjectComposer { private readonly Column column; [Cached(typeof(IReadOnlyList<Mod>))] private IReadOnlyList<Mod> mods { get; set; } = Array.Empty<Mod>(); protected ManiaPlacementBlueprintTestScene() { Add(column = new Column(0) { Anchor = Anchor.Centre, Origin = Anchor.Centre, AccentColour = Color4.OrangeRed, Clock = new FramedClock(new StopwatchClock()), // No scroll }); } protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { var dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); dependencies.CacheAs(((ScrollingTestContainer)HitObjectContainer).ScrollingInfo); return dependencies; } protected override Container CreateHitObjectContainer() => new ScrollingTestContainer(ScrollingDirection.Down) { RelativeSizeAxes = Axes.Both }; protected override void AddHitObject(DrawableHitObject hitObject) => column.Add((DrawableManiaHitObject)hitObject); public Column ColumnAt(Vector2 screenSpacePosition) => column; public int TotalColumns => 1; } }
mit
C#
380cd1e03619e45ad580356342f99498c0f59592
Add test coverage for lack of customisation on free mod select
peppy/osu,ppy/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,ppy/osu,ppy/osu
osu.Game.Tests/Visual/Multiplayer/TestSceneFreeModSelectScreen.cs
osu.Game.Tests/Visual/Multiplayer/TestSceneFreeModSelectScreen.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.Linq; using NUnit.Framework; using osu.Framework.Graphics.Containers; using osu.Framework.Testing; using osu.Game.Overlays.Mods; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Screens.OnlinePlay; namespace osu.Game.Tests.Visual.Multiplayer { public class TestSceneFreeModSelectScreen : MultiplayerTestScene { private FreeModSelectScreen freeModSelectScreen; [Test] public void TestFreeModSelect() { createFreeModSelect(); AddUntilStep("all visible mods are playable", () => this.ChildrenOfType<ModPanel>() .Where(panel => panel.IsPresent) .All(panel => panel.Mod.HasImplementation && panel.Mod.UserPlayable)); AddToggleStep("toggle visibility", visible => { if (freeModSelectScreen != null) freeModSelectScreen.State.Value = visible ? Visibility.Visible : Visibility.Hidden; }); } [Test] public void TestCustomisationNotAvailable() { createFreeModSelect(); AddStep("select difficulty adjust", () => freeModSelectScreen.SelectedMods.Value = new[] { new OsuModDifficultyAdjust() }); AddWaitStep("wait some", 3); AddAssert("customisation area not expanded", () => this.ChildrenOfType<ModSettingsArea>().Single().Height == 0); } private void createFreeModSelect() { AddStep("create free mod select screen", () => Child = freeModSelectScreen = new FreeModSelectScreen { State = { Value = Visibility.Visible } }); AddUntilStep("all column content loaded", () => freeModSelectScreen.ChildrenOfType<ModColumn>().Any() && freeModSelectScreen.ChildrenOfType<ModColumn>().All(column => column.IsLoaded && column.ItemsLoaded)); } } }
// 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.Linq; using NUnit.Framework; using osu.Framework.Graphics.Containers; using osu.Framework.Testing; using osu.Game.Overlays.Mods; using osu.Game.Screens.OnlinePlay; namespace osu.Game.Tests.Visual.Multiplayer { public class TestSceneFreeModSelectScreen : MultiplayerTestScene { [Test] public void TestFreeModSelect() { FreeModSelectScreen freeModSelectScreen = null; AddStep("create free mod select screen", () => Child = freeModSelectScreen = new FreeModSelectScreen { State = { Value = Visibility.Visible } }); AddUntilStep("all column content loaded", () => freeModSelectScreen.ChildrenOfType<ModColumn>().Any() && freeModSelectScreen.ChildrenOfType<ModColumn>().All(column => column.IsLoaded && column.ItemsLoaded)); AddUntilStep("all visible mods are playable", () => this.ChildrenOfType<ModPanel>() .Where(panel => panel.IsPresent) .All(panel => panel.Mod.HasImplementation && panel.Mod.UserPlayable)); AddToggleStep("toggle visibility", visible => { if (freeModSelectScreen != null) freeModSelectScreen.State.Value = visible ? Visibility.Visible : Visibility.Hidden; }); } } }
mit
C#
22bbee088b433b764fc54511c4999a8358b8f634
use up to 16 threads for benchmarks
etishor/Metrics.NET,DeonHeyns/Metrics.NET,cvent/Metrics.NET,MetaG8/Metrics.NET,Liwoj/Metrics.NET,ntent-ad/Metrics.NET,ntent-ad/Metrics.NET,mnadel/Metrics.NET,huoxudong125/Metrics.NET,alhardy/Metrics.NET,alhardy/Metrics.NET,etishor/Metrics.NET,MetaG8/Metrics.NET,Recognos/Metrics.NET,DeonHeyns/Metrics.NET,MetaG8/Metrics.NET,cvent/Metrics.NET,Recognos/Metrics.NET,huoxudong125/Metrics.NET,mnadel/Metrics.NET,Liwoj/Metrics.NET
Samples/Metrics.StupidBenchmarks/Program.cs
Samples/Metrics.StupidBenchmarks/Program.cs
 using System; using Metrics.Core; using Metrics.Utils; namespace Metrics.StupidBenchmarks { class Program { static void Main(string[] args) { Clock.TestClock clock = new Clock.TestClock(); Timer timer = new TimerMetric(SamplingType.FavourRecent, clock); //Counter counter = new CounterMetric(); //Meter meter = new MeterMetric(clock); for (int i = 1; i < 16; i++) { //TestMeter(clock, meter, i); //TestCounter(counter, i); TestTimer(clock, timer, i); } Console.WriteLine("done"); Console.ReadKey(); } private static void TestMeter(Clock.TestClock clock, Meter meter, int threadCount) { var meterResult = Benchmark.Run((i, l) => { meter.Mark(i); clock.Advance(TimeUnit.Milliseconds, l); }, iterations: 50000, threadCount: threadCount); Console.WriteLine("{0}\t{1}", threadCount, meterResult.PerSecond); } private static void TestCounter(Counter counter, int threadCount) { var counterResult = Benchmark.Run((i, l) => counter.Increment(l), iterations: 100000, threadCount: threadCount); Console.WriteLine("{0}\t{1}", threadCount, counterResult.PerSecond); } private static void TestTimer(Clock.TestClock clock, Timer timer, int threadCount) { var timerResult = Benchmark.Run((i, l) => { using (timer.NewContext()) { clock.Advance(TimeUnit.Milliseconds, l); } }, iterations: 100000, threadCount: threadCount); Console.WriteLine("{0}\t{1}", threadCount, timerResult.PerSecond); } } }
 using System; using Metrics.Core; using Metrics.Utils; namespace Metrics.StupidBenchmarks { class Program { static void Main(string[] args) { Clock.TestClock clock = new Clock.TestClock(); Timer timer = new TimerMetric(SamplingType.FavourRecent, clock); //Counter counter = new CounterMetric(); //Meter meter = new MeterMetric(clock); for (int i = 1; i < 8; i++) { //TestMeter(clock, meter, i); //TestCounter(counter, i); TestTimer(clock, timer, i); } Console.WriteLine("done"); Console.ReadKey(); } private static void TestMeter(Clock.TestClock clock, Meter meter, int threadCount) { var meterResult = Benchmark.Run((i, l) => { meter.Mark(i); clock.Advance(TimeUnit.Milliseconds, l); }, iterations: 50000, threadCount: threadCount); Console.WriteLine("{0}\t{1}", threadCount, meterResult.PerSecond); } private static void TestCounter(Counter counter, int threadCount) { var counterResult = Benchmark.Run((i, l) => counter.Increment(l), iterations: 100000, threadCount: threadCount); Console.WriteLine("{0}\t{1}", threadCount, counterResult.PerSecond); } private static void TestTimer(Clock.TestClock clock, Timer timer, int threadCount) { var timerResult = Benchmark.Run((i, l) => { using (timer.NewContext()) { clock.Advance(TimeUnit.Milliseconds, l); } }, iterations: 100000, threadCount: threadCount); Console.WriteLine("{0}\t{1}", threadCount, timerResult.PerSecond); } } }
apache-2.0
C#
6023fdea80e0a12ddbf92a0241aab2a3a11c187b
Add offline sync.
ijufumi/garbage_calendar
garbage_calendar/Repository/GarbageDay.cs
garbage_calendar/Repository/GarbageDay.cs
using System; namespace garbage_calendar.Repository { public class GarbageDay { public int Year { get; set; } public int Month { get; set; } public int Type { get; set; } public DateTime CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } } }
namespace garbage_calendar.Repository { public class GarbageDay { } }
mit
C#
52ba2fa75298ce27b6a2c9724b1f168b7c5f08c0
Fix chunk loading for negative co-ordinates.
LambdaSix/InfiniMap,LambdaSix/InfiniMap
InfiniMap/Map.cs
InfiniMap/Map.cs
using System; using System.Collections.Generic; namespace InfiniMap { public class Map { public IDictionary<Tuple<int, int>, Chunk> Chunks; private int _chunkWidth; private int _chunkHeight; public Map(int chunkHeight, int chunkWidth) { _chunkHeight = chunkHeight; _chunkWidth = chunkWidth; Chunks = new Dictionary<Tuple<int, int>, Chunk>(64); } public Block this[int x, int y] { get { var xChunk = (int) Math.Floor(x/(float) _chunkHeight); var yChunk = (int) Math.Floor(y/(float) _chunkWidth); Chunk chunk; var foundChunk = Chunks.TryGetValue(Tuple.Create(xChunk, yChunk), out chunk); if (foundChunk) { return chunk[x, y]; } var newChunk = new Chunk(_chunkHeight, _chunkWidth); Chunks.Add(Tuple.Create(xChunk, yChunk), newChunk); return newChunk[x, y]; } set { // Block is a reference type, so we just discard a local pointer after // alterting the object var block = this[x, y]; block = value; } } } }
using System; using System.Collections.Generic; namespace InfiniMap { public class Map { public IDictionary<Tuple<int, int>, Chunk> Chunks; private int _chunkWidth; private int _chunkHeight; public Map(int chunkHeight, int chunkWidth) { _chunkHeight = chunkHeight; _chunkWidth = chunkWidth; Chunks = new Dictionary<Tuple<int, int>, Chunk>(64); } public Block this[int x, int y] { get { int xChunk = (x/_chunkHeight); int yChunk = (y/_chunkWidth); Chunk chunk; var foundChunk = Chunks.TryGetValue(Tuple.Create(xChunk, yChunk), out chunk); if (foundChunk) { return chunk[x, y]; } var newChunk = new Chunk(_chunkHeight, _chunkWidth); Chunks.Add(Tuple.Create(xChunk, yChunk), newChunk); return newChunk[x, y]; } set { // Block is a reference type, so we just discard a local pointer after // alterting the object var block = this[x, y]; block = value; } } } }
mit
C#
db1a8fc9291b73f4324a0531ecb5e6dbd5e971b2
Make IPlasma IEnumerable<IAether>
tainicom/Aether
Source/Elementary/IPlasma.cs
Source/Elementary/IPlasma.cs
#region License // Copyright 2015 Kastellanos Nikolaos // // 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. #endregion using System.Collections.Generic; namespace tainicom.Aether.Elementary { /// <summary> /// Plasma is a group of other particles /// </summary> public interface IPlasma : IAether, IEnumerable<IAether>, IList<IAether> { } }
#region License // Copyright 2015 Kastellanos Nikolaos // // 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. #endregion using System.Collections.Generic; namespace tainicom.Aether.Elementary { /// <summary> /// Plasma is a group of other particles /// </summary> public interface IPlasma : IAether, IList<IAether> { } }
apache-2.0
C#
19ea11c993b625b487553474f4ec9df7fd58bd85
fix TimeoutNotifyProducerConsumer not start bug
sdgdsffdsfff/hermes.net
Arch.CMessaging.Client/Core/Collections/TimeoutNotifyProducerConsumer.cs
Arch.CMessaging.Client/Core/Collections/TimeoutNotifyProducerConsumer.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Arch.CMessaging.Client.Core.Collections { public class TimeoutNotifyProducerConsumer<TItem> : AbstractProducerConsumer<SequentialNode<TItem>, TimeoutNotifyQueue<TItem>> { private TimeoutNotifyQueue<TItem> blockingQueue; public TimeoutNotifyProducerConsumer(int capacity) { this.blockingQueue = new TimeoutNotifyQueue<TItem>(capacity); base.StartPolling(); } public bool Produce(object key, TItem item, int timeout) { return blockingQueue.Offer(key, item, timeout); } public bool TryRemoveThoseWaitToTimeout(object key, out TItem item) { return blockingQueue.TryRemove(key, out item); } protected override TimeoutNotifyQueue<TItem> BlockingQueue { get { return blockingQueue; } } protected override IConsumingItem TakeConsumingItem() { var sequenceNode = blockingQueue.Take(); var itemList = new List<TItem>(); do { itemList.Add(sequenceNode.Item); sequenceNode = sequenceNode.Next; } while (sequenceNode != null); return new ChunkedConsumingItem<TItem>(itemList.ToArray()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Arch.CMessaging.Client.Core.Collections { public class TimeoutNotifyProducerConsumer<TItem> : AbstractProducerConsumer<SequentialNode<TItem>, TimeoutNotifyQueue<TItem>> { private TimeoutNotifyQueue<TItem> blockingQueue; public TimeoutNotifyProducerConsumer(int capacity) { this.blockingQueue = new TimeoutNotifyQueue<TItem>(capacity); } public bool Produce(object key, TItem item, int timeout) { return blockingQueue.Offer(key, item, timeout); } public bool TryRemoveThoseWaitToTimeout(object key, out TItem item) { return blockingQueue.TryRemove(key, out item); } protected override TimeoutNotifyQueue<TItem> BlockingQueue { get { return blockingQueue; } } protected override IConsumingItem TakeConsumingItem() { var sequenceNode = blockingQueue.Take(); var itemList = new List<TItem>(); do { itemList.Add(sequenceNode.Item); sequenceNode = sequenceNode.Next; } while (sequenceNode != null); return new ChunkedConsumingItem<TItem>(itemList.ToArray()); } } }
apache-2.0
C#
11f22c9475f917764a6ae1af582a25758c538691
Update SharedAssemblyInfo.cs
wieslawsoltes/PanAndZoom,PanAndZoom/PanAndZoom,PanAndZoom/PanAndZoom,wieslawsoltes/MatrixPanAndZoomDemo,wieslawsoltes/PanAndZoom
src/Shared/SharedAssemblyInfo.cs
src/Shared/SharedAssemblyInfo.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Reflection; [assembly: AssemblyCompany("Wiesław Šoltés")] [assembly: AssemblyCopyright("Copyright © Wiesław Šoltés 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyVersion("0.4.1")] [assembly: AssemblyFileVersion("0.4.1")] [assembly: AssemblyInformationalVersion("0.4.1")]
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Reflection; [assembly: AssemblyCompany("Wiesław Šoltés")] [assembly: AssemblyCopyright("Copyright © Wiesław Šoltés 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyVersion("0.4.0")] [assembly: AssemblyFileVersion("0.4.0")] [assembly: AssemblyInformationalVersion("0.4.0")]
mit
C#
0b50d3ec6ff9fa62e980b46015b3980b76cf400b
Remove not used
YAFNET/YAFNET,YAFNET/YAFNET,YAFNET/YAFNET,YAFNET/YAFNET
yafsrc/YAF.Types/Constants/InfoMessage.cs
yafsrc/YAF.Types/Constants/InfoMessage.cs
/* Yet Another Forum.NET * Copyright (C) 2003-2005 Bjørnar Henden * Copyright (C) 2006-2013 Jaben Cargman * Copyright (C) 2014-2021 Ingo Herbote * https://www.yetanotherforum.net/ * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 * https://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. */ namespace YAF.Types.Constants { /// <summary> /// Enumerates forum info messages. /// </summary> public enum InfoMessage { /// <summary> /// after posting to moderated forum /// </summary> Moderated = 1, /// <summary> /// informs user he's suspended /// </summary> Suspended = 2, /// <summary> /// informs user about registration email being sent /// </summary> RegistrationEmail = 3, /// <summary> /// access was denied /// </summary> AccessDenied = 4, /// <summary> /// informs user about feature being disabled by admin /// </summary> Disabled = 5, /// <summary> /// informs user about invalid input/request /// </summary> Invalid = 6, /// <summary> /// system error /// </summary> Failure = 7, /// <summary> /// requires cookies /// </summary> RequiresCookies = 8, /// <summary> /// The message for admin to ask access for admin pages viewing. /// </summary> HostAdminPermissionsAreRequired = 11 } }
/* Yet Another Forum.NET * Copyright (C) 2003-2005 Bjørnar Henden * Copyright (C) 2006-2013 Jaben Cargman * Copyright (C) 2014-2021 Ingo Herbote * https://www.yetanotherforum.net/ * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 * https://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. */ namespace YAF.Types.Constants { /// <summary> /// Enumerates forum info messages. /// </summary> public enum InfoMessage { /// <summary> /// after posting to moderated forum /// </summary> Moderated = 1, /// <summary> /// informs user he's suspended /// </summary> Suspended = 2, /// <summary> /// informs user about registration email being sent /// </summary> RegistrationEmail = 3, /// <summary> /// access was denied /// </summary> AccessDenied = 4, /// <summary> /// informs user about feature being disabled by admin /// </summary> Disabled = 5, /// <summary> /// informs user about invalid input/request /// </summary> Invalid = 6, /// <summary> /// system error /// </summary> Failure = 7, /// <summary> /// requires cookies /// </summary> RequiresCookies = 8, /// <summary> /// requires JS /// </summary> RequiresEcmaScript = 9, /// <summary> /// unsupported JS version /// </summary> EcmaScriptVersionUnsupported = 10, /// <summary> /// The message for admin to ask access for admin pages viewing. /// </summary> HostAdminPermissionsAreRequired = 11 } }
apache-2.0
C#
13ea95032e4e9fa53b6e354bbebd99232a014cdf
Add AuthString() override to UnixMonoTransport
Tragetaschen/dbus-sharp,openmedicus/dbus-sharp,arfbtwn/dbus-sharp,arfbtwn/dbus-sharp,mono/dbus-sharp,mono/dbus-sharp,openmedicus/dbus-sharp,Tragetaschen/dbus-sharp
src/UnixMonoTransport.cs
src/UnixMonoTransport.cs
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; using System.IO; using System.Net; using System.Net.Sockets; using Mono.Unix; using Mono.Unix.Native; namespace NDesk.DBus.Transports { class UnixMonoTransport : UnixTransport { protected Socket socket; public override void Open (string path, bool @abstract) { if (@abstract) socket = OpenAbstractUnix (path); else socket = OpenUnix (path); socket.Blocking = true; SocketHandle = (long)socket.Handle; //Stream = new UnixStream ((int)socket.Handle); Stream = new NetworkStream (socket); } //send peer credentials null byte. note that this might not be portable //there are also selinux, BSD etc. considerations public override void WriteCred () { Stream.WriteByte (0); } public override string AuthString () { long uid = UnixUserInfo.GetRealUserId (); return uid.ToString (); } protected Socket OpenAbstractUnix (string path) { AbstractUnixEndPoint ep = new AbstractUnixEndPoint (path); Socket client = new Socket (AddressFamily.Unix, SocketType.Stream, 0); client.Connect (ep); return client; } public Socket OpenUnix (string path) { UnixEndPoint remoteEndPoint = new UnixEndPoint (path); Socket client = new Socket (AddressFamily.Unix, SocketType.Stream, 0); client.Connect (remoteEndPoint); return client; } } }
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; using System.IO; using System.Net; using System.Net.Sockets; using Mono.Unix; using Mono.Unix.Native; namespace NDesk.DBus.Transports { class UnixMonoTransport : UnixTransport { protected Socket socket; public override void Open (string path, bool @abstract) { if (@abstract) socket = OpenAbstractUnix (path); else socket = OpenUnix (path); socket.Blocking = true; SocketHandle = (long)socket.Handle; //Stream = new UnixStream ((int)socket.Handle); Stream = new NetworkStream (socket); } //send peer credentials null byte. note that this might not be portable //there are also selinux, BSD etc. considerations public override void WriteCred () { Stream.WriteByte (0); } protected Socket OpenAbstractUnix (string path) { AbstractUnixEndPoint ep = new AbstractUnixEndPoint (path); Socket client = new Socket (AddressFamily.Unix, SocketType.Stream, 0); client.Connect (ep); return client; } public Socket OpenUnix (string path) { UnixEndPoint remoteEndPoint = new UnixEndPoint (path); Socket client = new Socket (AddressFamily.Unix, SocketType.Stream, 0); client.Connect (remoteEndPoint); return client; } } }
mit
C#
372010684d7d4dfa305f7e3e3cd56f9bda41ac79
Change port of urls in multi tenant admin
huoxudong125/Orchard,spraiin/Orchard,escofieldnaxos/Orchard,ericschultz/outercurve-orchard,AndreVolksdorf/Orchard,Codinlab/Orchard,jaraco/orchard,KeithRaven/Orchard,AndreVolksdorf/Orchard,jchenga/Orchard,alejandroaldana/Orchard,enspiral-dev-academy/Orchard,armanforghani/Orchard,geertdoornbos/Orchard,LaserSrl/Orchard,asabbott/chicagodevnet-website,bigfont/orchard-cms-modules-and-themes,OrchardCMS/Orchard-Harvest-Website,cooclsee/Orchard,Ermesx/Orchard,bigfont/orchard-continuous-integration-demo,dcinzona/Orchard-Harvest-Website,qt1/Orchard,jimasp/Orchard,Ermesx/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,JRKelso/Orchard,abhishekluv/Orchard,jimasp/Orchard,TalaveraTechnologySolutions/Orchard,mgrowan/Orchard,jtkech/Orchard,mvarblow/Orchard,Lombiq/Orchard,fortunearterial/Orchard,SeyDutch/Airbrush,hhland/Orchard,marcoaoteixeira/Orchard,li0803/Orchard,vard0/orchard.tan,Praggie/Orchard,KeithRaven/Orchard,planetClaire/Orchard-LETS,RoyalVeterinaryCollege/Orchard,OrchardCMS/Orchard,bedegaming-aleksej/Orchard,enspiral-dev-academy/Orchard,harmony7/Orchard,stormleoxia/Orchard,JRKelso/Orchard,jerryshi2007/Orchard,mgrowan/Orchard,jersiovic/Orchard,jersiovic/Orchard,MpDzik/Orchard,smartnet-developers/Orchard,AdvantageCS/Orchard,salarvand/orchard,Praggie/Orchard,MpDzik/Orchard,angelapper/Orchard,fortunearterial/Orchard,spraiin/Orchard,xiaobudian/Orchard,Praggie/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,AEdmunds/beautiful-springtime,tobydodds/folklife,dmitry-urenev/extended-orchard-cms-v10.1,salarvand/Portal,vairam-svs/Orchard,MpDzik/Orchard,patricmutwiri/Orchard,sfmskywalker/Orchard,escofieldnaxos/Orchard,hannan-azam/Orchard,armanforghani/Orchard,escofieldnaxos/Orchard,harmony7/Orchard,hbulzy/Orchard,hhland/Orchard,planetClaire/Orchard-LETS,fassetar/Orchard,fortunearterial/Orchard,dozoft/Orchard,tobydodds/folklife,MpDzik/Orchard,jchenga/Orchard,jersiovic/Orchard,austinsc/Orchard,Fogolan/OrchardForWork,jimasp/Orchard,dcinzona/Orchard,yonglehou/Orchard,omidnasri/Orchard,jimasp/Orchard,aaronamm/Orchard,yersans/Orchard,TalaveraTechnologySolutions/Orchard,omidnasri/Orchard,bigfont/orchard-cms-modules-and-themes,patricmutwiri/Orchard,abhishekluv/Orchard,brownjordaninternational/OrchardCMS,grapto/Orchard.CloudBust,jtkech/Orchard,huoxudong125/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,phillipsj/Orchard,jerryshi2007/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,jchenga/Orchard,AEdmunds/beautiful-springtime,fassetar/Orchard,KeithRaven/Orchard,andyshao/Orchard,cryogen/orchard,grapto/Orchard.CloudBust,armanforghani/Orchard,mgrowan/Orchard,qt1/Orchard,Lombiq/Orchard,arminkarimi/Orchard,aaronamm/Orchard,caoxk/orchard,xkproject/Orchard,Anton-Am/Orchard,hannan-azam/Orchard,spraiin/Orchard,vairam-svs/Orchard,ehe888/Orchard,KeithRaven/Orchard,salarvand/Portal,mvarblow/Orchard,yersans/Orchard,cooclsee/Orchard,planetClaire/Orchard-LETS,phillipsj/Orchard,austinsc/Orchard,Fogolan/OrchardForWork,Cphusion/Orchard,spraiin/Orchard,hbulzy/Orchard,MetSystem/Orchard,Sylapse/Orchard.HttpAuthSample,TalaveraTechnologySolutions/Orchard,omidnasri/Orchard,SouleDesigns/SouleDesigns.Orchard,luchaoshuai/Orchard,li0803/Orchard,grapto/Orchard.CloudBust,ehe888/Orchard,xiaobudian/Orchard,marcoaoteixeira/Orchard,RoyalVeterinaryCollege/Orchard,planetClaire/Orchard-LETS,hannan-azam/Orchard,luchaoshuai/Orchard,Cphusion/Orchard,qt1/orchard4ibn,DonnotRain/Orchard,alejandroaldana/Orchard,Ermesx/Orchard,SeyDutch/Airbrush,jtkech/Orchard,MpDzik/Orchard,yersans/Orchard,dburriss/Orchard,jagraz/Orchard,oxwanawxo/Orchard,omidnasri/Orchard,geertdoornbos/Orchard,geertdoornbos/Orchard,KeithRaven/Orchard,JRKelso/Orchard,bedegaming-aleksej/Orchard,oxwanawxo/Orchard,dcinzona/Orchard-Harvest-Website,LaserSrl/Orchard,mvarblow/Orchard,hhland/Orchard,mgrowan/Orchard,stormleoxia/Orchard,xkproject/Orchard,johnnyqian/Orchard,Inner89/Orchard,Cphusion/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,DonnotRain/Orchard,Morgma/valleyviewknolls,smartnet-developers/Orchard,johnnyqian/Orchard,austinsc/Orchard,SouleDesigns/SouleDesigns.Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,ehe888/Orchard,qt1/Orchard,gcsuk/Orchard,armanforghani/Orchard,jchenga/Orchard,alejandroaldana/Orchard,marcoaoteixeira/Orchard,caoxk/orchard,Anton-Am/Orchard,escofieldnaxos/Orchard,neTp9c/Orchard,NIKASoftwareDevs/Orchard,qt1/orchard4ibn,dmitry-urenev/extended-orchard-cms-v10.1,m2cms/Orchard,dcinzona/Orchard-Harvest-Website,JRKelso/Orchard,luchaoshuai/Orchard,mvarblow/Orchard,abhishekluv/Orchard,TalaveraTechnologySolutions/Orchard,mvarblow/Orchard,Serlead/Orchard,DonnotRain/Orchard,jerryshi2007/Orchard,yonglehou/Orchard,enspiral-dev-academy/Orchard,li0803/Orchard,sfmskywalker/Orchard,salarvand/orchard,IDeliverable/Orchard,neTp9c/Orchard,cooclsee/Orchard,MetSystem/Orchard,JRKelso/Orchard,dozoft/Orchard,TalaveraTechnologySolutions/Orchard,huoxudong125/Orchard,openbizgit/Orchard,NIKASoftwareDevs/Orchard,SeyDutch/Airbrush,AndreVolksdorf/Orchard,smartnet-developers/Orchard,smartnet-developers/Orchard,DonnotRain/Orchard,openbizgit/Orchard,geertdoornbos/Orchard,Sylapse/Orchard.HttpAuthSample,qt1/Orchard,hbulzy/Orchard,spraiin/Orchard,ericschultz/outercurve-orchard,kgacova/Orchard,cryogen/orchard,angelapper/Orchard,TaiAivaras/Orchard,emretiryaki/Orchard,Anton-Am/Orchard,openbizgit/Orchard,vard0/orchard.tan,asabbott/chicagodevnet-website,SouleDesigns/SouleDesigns.Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,angelapper/Orchard,fassetar/Orchard,sfmskywalker/Orchard,yonglehou/Orchard,sebastienros/msc,marcoaoteixeira/Orchard,dcinzona/Orchard,huoxudong125/Orchard,Serlead/Orchard,phillipsj/Orchard,jchenga/Orchard,bigfont/orchard-cms-modules-and-themes,TalaveraTechnologySolutions/Orchard,tobydodds/folklife,omidnasri/Orchard,brownjordaninternational/OrchardCMS,cryogen/orchard,grapto/Orchard.CloudBust,Inner89/Orchard,RoyalVeterinaryCollege/Orchard,ericschultz/outercurve-orchard,vairam-svs/Orchard,AdvantageCS/Orchard,m2cms/Orchard,AdvantageCS/Orchard,phillipsj/Orchard,enspiral-dev-academy/Orchard,Dolphinsimon/Orchard,planetClaire/Orchard-LETS,AndreVolksdorf/Orchard,sfmskywalker/Orchard,oxwanawxo/Orchard,SzymonSel/Orchard,arminkarimi/Orchard,andyshao/Orchard,fortunearterial/Orchard,Serlead/Orchard,jaraco/orchard,harmony7/Orchard,andyshao/Orchard,sfmskywalker/Orchard,omidnasri/Orchard,fortunearterial/Orchard,jimasp/Orchard,rtpHarry/Orchard,NIKASoftwareDevs/Orchard,LaserSrl/Orchard,cooclsee/Orchard,jaraco/orchard,AdvantageCS/Orchard,jersiovic/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,SouleDesigns/SouleDesigns.Orchard,salarvand/orchard,dmitry-urenev/extended-orchard-cms-v10.1,sebastienros/msc,Dolphinsimon/Orchard,andyshao/Orchard,aaronamm/Orchard,yonglehou/Orchard,luchaoshuai/Orchard,OrchardCMS/Orchard,dburriss/Orchard,AdvantageCS/Orchard,NIKASoftwareDevs/Orchard,Dolphinsimon/Orchard,cryogen/orchard,stormleoxia/Orchard,asabbott/chicagodevnet-website,IDeliverable/Orchard,Serlead/Orchard,m2cms/Orchard,qt1/Orchard,omidnasri/Orchard,stormleoxia/Orchard,Sylapse/Orchard.HttpAuthSample,TaiAivaras/Orchard,dcinzona/Orchard,abhishekluv/Orchard,phillipsj/Orchard,asabbott/chicagodevnet-website,emretiryaki/Orchard,tobydodds/folklife,jtkech/Orchard,SeyDutch/Airbrush,jaraco/orchard,tobydodds/folklife,patricmutwiri/Orchard,Fogolan/OrchardForWork,Ermesx/Orchard,johnnyqian/Orchard,Morgma/valleyviewknolls,infofromca/Orchard,sfmskywalker/Orchard,RoyalVeterinaryCollege/Orchard,rtpHarry/Orchard,fassetar/Orchard,bigfont/orchard-continuous-integration-demo,vard0/orchard.tan,brownjordaninternational/OrchardCMS,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,Codinlab/Orchard,Inner89/Orchard,alejandroaldana/Orchard,gcsuk/Orchard,MetSystem/Orchard,sfmskywalker/Orchard,li0803/Orchard,jagraz/Orchard,salarvand/Portal,brownjordaninternational/OrchardCMS,abhishekluv/Orchard,OrchardCMS/Orchard,kouweizhong/Orchard,arminkarimi/Orchard,jagraz/Orchard,salarvand/orchard,yersans/Orchard,OrchardCMS/Orchard-Harvest-Website,SzymonSel/Orchard,smartnet-developers/Orchard,aaronamm/Orchard,Lombiq/Orchard,geertdoornbos/Orchard,vairam-svs/Orchard,angelapper/Orchard,salarvand/orchard,Serlead/Orchard,jagraz/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,kgacova/Orchard,bedegaming-aleksej/Orchard,dcinzona/Orchard-Harvest-Website,johnnyqian/Orchard,arminkarimi/Orchard,MpDzik/Orchard,SouleDesigns/SouleDesigns.Orchard,kouweizhong/Orchard,johnnyqian/Orchard,luchaoshuai/Orchard,oxwanawxo/Orchard,omidnasri/Orchard,hhland/Orchard,dcinzona/Orchard,angelapper/Orchard,IDeliverable/Orchard,OrchardCMS/Orchard-Harvest-Website,bigfont/orchard-cms-modules-and-themes,xiaobudian/Orchard,caoxk/orchard,infofromca/Orchard,m2cms/Orchard,IDeliverable/Orchard,Anton-Am/Orchard,vard0/orchard.tan,armanforghani/Orchard,cooclsee/Orchard,vard0/orchard.tan,enspiral-dev-academy/Orchard,Inner89/Orchard,openbizgit/Orchard,m2cms/Orchard,hannan-azam/Orchard,kgacova/Orchard,neTp9c/Orchard,jerryshi2007/Orchard,Lombiq/Orchard,SeyDutch/Airbrush,jersiovic/Orchard,Sylapse/Orchard.HttpAuthSample,infofromca/Orchard,Ermesx/Orchard,LaserSrl/Orchard,sebastienros/msc,OrchardCMS/Orchard,bigfont/orchard-cms-modules-and-themes,Morgma/valleyviewknolls,TalaveraTechnologySolutions/Orchard,yersans/Orchard,jerryshi2007/Orchard,Morgma/valleyviewknolls,TaiAivaras/Orchard,bigfont/orchard-continuous-integration-demo,DonnotRain/Orchard,openbizgit/Orchard,hbulzy/Orchard,neTp9c/Orchard,AndreVolksdorf/Orchard,qt1/orchard4ibn,tobydodds/folklife,grapto/Orchard.CloudBust,omidnasri/Orchard,Praggie/Orchard,kouweizhong/Orchard,xkproject/Orchard,harmony7/Orchard,Dolphinsimon/Orchard,Codinlab/Orchard,bedegaming-aleksej/Orchard,Fogolan/OrchardForWork,LaserSrl/Orchard,SzymonSel/Orchard,austinsc/Orchard,bigfont/orchard-continuous-integration-demo,grapto/Orchard.CloudBust,kouweizhong/Orchard,escofieldnaxos/Orchard,MetSystem/Orchard,AEdmunds/beautiful-springtime,AEdmunds/beautiful-springtime,oxwanawxo/Orchard,gcsuk/Orchard,salarvand/Portal,arminkarimi/Orchard,ehe888/Orchard,mgrowan/Orchard,Codinlab/Orchard,patricmutwiri/Orchard,vard0/orchard.tan,sebastienros/msc,TaiAivaras/Orchard,OrchardCMS/Orchard-Harvest-Website,Cphusion/Orchard,dozoft/Orchard,xkproject/Orchard,ehe888/Orchard,NIKASoftwareDevs/Orchard,yonglehou/Orchard,hannan-azam/Orchard,jtkech/Orchard,gcsuk/Orchard,Sylapse/Orchard.HttpAuthSample,OrchardCMS/Orchard,rtpHarry/Orchard,qt1/orchard4ibn,harmony7/Orchard,aaronamm/Orchard,IDeliverable/Orchard,marcoaoteixeira/Orchard,Praggie/Orchard,Anton-Am/Orchard,dburriss/Orchard,xiaobudian/Orchard,xiaobudian/Orchard,Codinlab/Orchard,Dolphinsimon/Orchard,emretiryaki/Orchard,RoyalVeterinaryCollege/Orchard,emretiryaki/Orchard,ericschultz/outercurve-orchard,dcinzona/Orchard-Harvest-Website,SzymonSel/Orchard,sfmskywalker/Orchard,gcsuk/Orchard,dozoft/Orchard,caoxk/orchard,infofromca/Orchard,dburriss/Orchard,rtpHarry/Orchard,andyshao/Orchard,qt1/orchard4ibn,rtpHarry/Orchard,abhishekluv/Orchard,xkproject/Orchard,Lombiq/Orchard,stormleoxia/Orchard,hhland/Orchard,dcinzona/Orchard,emretiryaki/Orchard,MetSystem/Orchard,sebastienros/msc,huoxudong125/Orchard,dozoft/Orchard,kgacova/Orchard,dcinzona/Orchard-Harvest-Website,TaiAivaras/Orchard,Cphusion/Orchard,fassetar/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,brownjordaninternational/OrchardCMS,salarvand/Portal,alejandroaldana/Orchard,patricmutwiri/Orchard,bedegaming-aleksej/Orchard,qt1/orchard4ibn,OrchardCMS/Orchard-Harvest-Website,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,jagraz/Orchard,neTp9c/Orchard,vairam-svs/Orchard,TalaveraTechnologySolutions/Orchard,SzymonSel/Orchard,hbulzy/Orchard,kgacova/Orchard,infofromca/Orchard,Morgma/valleyviewknolls,austinsc/Orchard,kouweizhong/Orchard,Inner89/Orchard,dburriss/Orchard,li0803/Orchard,OrchardCMS/Orchard-Harvest-Website,Fogolan/OrchardForWork
src/Orchard.Web/Modules/Orchard.MultiTenancy/Extensions/UrlHelperExtensions.cs
src/Orchard.Web/Modules/Orchard.MultiTenancy/Extensions/UrlHelperExtensions.cs
using System.Web.Mvc; using Orchard.Environment.Configuration; namespace Orchard.MultiTenancy.Extensions { public static class UrlHelperExtensions { public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) { //info: (heskew) might not keep the port insertion around beyond... var port = string.Empty; string host = urlHelper.RequestContext.HttpContext.Request.Headers["Host"]; if(host.Contains(":")) port = host.Substring(host.IndexOf(":")); return string.Format( "http://{0}/{1}", !string.IsNullOrEmpty(tenantShellSettings.RequestUrlHost) ? tenantShellSettings.RequestUrlHost + port : host, tenantShellSettings.RequestUrlPrefix); } } }
using System.Web.Mvc; using Orchard.Environment.Configuration; namespace Orchard.MultiTenancy.Extensions { public static class UrlHelperExtensions { public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) { return string.Format( "http://{0}/{1}", !string.IsNullOrEmpty(tenantShellSettings.RequestUrlHost) ? tenantShellSettings.RequestUrlHost : urlHelper.RequestContext.HttpContext.Request.Headers["Host"], tenantShellSettings.RequestUrlPrefix); } } }
bsd-3-clause
C#
e713d72f4fb02fa8d1157f471e7799ce81e32146
Add cqrs installer
generik0/Rik.CodeCamp
Src/Hosts/Rik.CodeCamp.Host/Bootstrapper.cs
Src/Hosts/Rik.CodeCamp.Host/Bootstrapper.cs
using System.Linq; using System.Text; using Castle.Core.Logging; using Castle.MicroKernel; using Castle.MicroKernel.Handlers; using Castle.Windsor; using Castle.Windsor.Diagnostics; using GAIT.Utilities; using Rik.CodeCamp.Core.Installers; using Rik.CodeCamp.Data; namespace Rik.CodeCamp.Host { internal class Bootstrapper : GeneralBootstrapper { public Bootstrapper() { CreateInversionOfControlContainer(); Container.Install(new DataFactoryInstaller(), new CqrsInstaller()); ActivatorFactory.Resolve<NancyBootstrapper>(Container); CheckForPotentiallyMisconfiguredComponents(Container); } private static void CheckForPotentiallyMisconfiguredComponents(IWindsorContainer container) { var host = (IDiagnosticsHost)container.Kernel.GetSubSystem(SubSystemConstants.DiagnosticsKey); var diagnostics = host.GetDiagnostic<IPotentiallyMisconfiguredComponentsDiagnostic>(); var handlers = diagnostics.Inspect(); if (!handlers.Any()) return; var message = new StringBuilder(); var inspector = new DependencyInspector(message); foreach (var handler1 in handlers) { var handler = (IExposeDependencyInfo)handler1; handler.ObtainDependencyDetails(inspector); } var logger = container.Resolve<ILogger>(); logger.Debug($"Dependancy errors:\n{message}"); } } }
using System.Linq; using System.Text; using Castle.Core.Logging; using Castle.MicroKernel; using Castle.MicroKernel.Handlers; using Castle.Windsor; using Castle.Windsor.Diagnostics; using GAIT.Utilities; using Rik.CodeCamp.Core.Installers; using Rik.CodeCamp.Data; namespace Rik.CodeCamp.Host { internal class Bootstrapper : GeneralBootstrapper { public Bootstrapper() { CreateInversionOfControlContainer(); Container.Install(new DataFactoryInstaller()); ActivatorFactory.Resolve<NancyBootstrapper>(Container); CheckForPotentiallyMisconfiguredComponents(Container); } private static void CheckForPotentiallyMisconfiguredComponents(IWindsorContainer container) { var host = (IDiagnosticsHost)container.Kernel.GetSubSystem(SubSystemConstants.DiagnosticsKey); var diagnostics = host.GetDiagnostic<IPotentiallyMisconfiguredComponentsDiagnostic>(); var handlers = diagnostics.Inspect(); if (!handlers.Any()) return; var message = new StringBuilder(); var inspector = new DependencyInspector(message); foreach (var handler1 in handlers) { var handler = (IExposeDependencyInfo)handler1; handler.ObtainDependencyDetails(inspector); } var logger = container.Resolve<ILogger>(); logger.Debug($"Dependancy errors:\n{message}"); } } }
mit
C#
33fd1555f23a45c4d325c4db4d4d2aa643a6c0c1
Update `TestSceneRoundedButton` with new colour assertions
peppy/osu,ppy/osu,peppy/osu,NeoAdonis/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,peppy/osu,ppy/osu
osu.Game.Tests/Visual/UserInterface/TestSceneRoundedButton.cs
osu.Game.Tests/Visual/UserInterface/TestSceneRoundedButton.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.Linq; using NUnit.Framework; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Testing; using osu.Game.Graphics; using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Overlays; using osu.Game.Overlays.Settings; namespace osu.Game.Tests.Visual.UserInterface { public class TestSceneRoundedButton : ThemeComparisonTestScene { private readonly BindableBool enabled = new BindableBool(true); protected override Drawable CreateContent() { return new FillFlowContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new RoundedButton { Width = 400, Text = "Test button", Anchor = Anchor.Centre, Origin = Anchor.Centre, Enabled = { BindTarget = enabled }, }, new SettingsButton { Text = "Test button", Anchor = Anchor.Centre, Origin = Anchor.Centre, Enabled = { BindTarget = enabled }, }, } }; } [Test] public void TestDisabled() { AddToggleStep("toggle disabled", disabled => enabled.Value = !disabled); } [Test] public void TestBackgroundColour() { AddStep("set red scheme", () => CreateThemedContent(OverlayColourScheme.Red)); AddAssert("rounded button has correct colour", () => Cell(0, 1).ChildrenOfType<RoundedButton>().First().BackgroundColour == new OsuColour().Blue3); AddAssert("settings button has correct colour", () => Cell(0, 1).ChildrenOfType<SettingsButton>().First().BackgroundColour == new OverlayColourProvider(OverlayColourScheme.Red).Highlight1); } } }
// 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.Linq; using NUnit.Framework; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Testing; using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Overlays; namespace osu.Game.Tests.Visual.UserInterface { public class TestSceneRoundedButton : ThemeComparisonTestScene { private readonly BindableBool enabled = new BindableBool(true); protected override Drawable CreateContent() => new RoundedButton { Width = 400, Text = "Test button", Anchor = Anchor.Centre, Origin = Anchor.Centre, Enabled = { BindTarget = enabled }, }; [Test] public void TestDisabled() { AddToggleStep("toggle disabled", disabled => enabled.Value = !disabled); } [Test] public void TestBackgroundColour() { AddStep("set red scheme", () => CreateThemedContent(OverlayColourScheme.Red)); AddAssert("first button has correct colour", () => Cell(0, 1).ChildrenOfType<RoundedButton>().First().BackgroundColour == new OverlayColourProvider(OverlayColourScheme.Red).Highlight1); } } }
mit
C#
0c4291def6a452961c51eb1b59239fe40543f96c
use debug message writer in factory
Simply360/tSQLt.NET
Tsqlt/TestEnvironmentFactory.cs
Tsqlt/TestEnvironmentFactory.cs
using System.Reflection; namespace Tsqlt { public static class TestEnvironmentFactory { public static ITestEnvironment Create(string connectionString, Assembly testAssembly, string testResourcePath, IDbMigrator dbMigrator = null) { // Poor-man's Dependency Injection var embeddedTextResourceReader = new EmbeddedTextResourceReader(); var sqlBatchExtractor = new SqlBatchExtractor(); var tsqltInstaller = new EmbeddedResourceTsqltInstaller(embeddedTextResourceReader, sqlBatchExtractor); var testClassInstaller = new TsqltTestClassInstaller(embeddedTextResourceReader); var testClassDiscoverer = new AssemblyResourceTestClassDiscoverer(testAssembly, testResourcePath, embeddedTextResourceReader); var bootstrapper = new TestEnvironmentBootstrapper(tsqltInstaller, dbMigrator ?? new DefaultDbMigrator(), testClassDiscoverer, testClassInstaller); var outputMessageWriter = new DebugTestOutputMessageWriter(); var sqlTestExecutor = new MessageWritingSqlTestExecutor(outputMessageWriter, new SqlTestExecutor()); return new BootstrappedTestEnvironment(connectionString, bootstrapper, sqlTestExecutor); } } }
using System.Reflection; namespace Tsqlt { public static class TestEnvironmentFactory { public static ITestEnvironment Create(string connectionString, Assembly testAssembly, string testResourcePath, IDbMigrator dbMigrator = null) { // Poor-man's Dependency Injection var embeddedTextResourceReader = new EmbeddedTextResourceReader(); var sqlBatchExtractor = new SqlBatchExtractor(); var tsqltInstaller = new EmbeddedResourceTsqltInstaller(embeddedTextResourceReader, sqlBatchExtractor); var testClassInstaller = new TsqltTestClassInstaller(embeddedTextResourceReader); var testClassDiscoverer = new AssemblyResourceTestClassDiscoverer(testAssembly, testResourcePath, embeddedTextResourceReader); var bootstrapper = new TestEnvironmentBootstrapper(tsqltInstaller, dbMigrator ?? new DefaultDbMigrator(), testClassDiscoverer, testClassInstaller); var sqlTestExecutor = new SqlTestExecutor(); return new BootstrappedTestEnvironment(connectionString, bootstrapper, sqlTestExecutor); } } }
mit
C#
3b5948f6552defe0e220b6fc768a8c4eb2f046a3
Update src/Abc.Zebus.Tests/Dispatch/DispatchMessages/ExecutableEvent.cs
Abc-Arbitrage/Zebus
src/Abc.Zebus.Tests/Dispatch/DispatchMessages/ExecutableEvent.cs
src/Abc.Zebus.Tests/Dispatch/DispatchMessages/ExecutableEvent.cs
using System; using System.Threading; using Abc.Zebus.Dispatch; using Abc.Zebus.Testing.Dispatch; using Abc.Zebus.Util; using ProtoBuf; namespace Abc.Zebus.Tests.Dispatch.DispatchMessages { [ProtoContract] public class ExecutableEvent : ICommand, IExecutableMessage { private readonly ManualResetEventSlim _blockingSignal = new ManualResetEventSlim(); public bool IsBlocking { get; set; } public Action<IMessageHandlerInvocation> Callback { get; set; } public ManualResetEventSlim HandleStarted { get; } = new ManualResetEventSlim(); public string DispatchQueueName { get; private set; } public void Execute(IMessageHandlerInvocation invocation) { HandleStarted.Set(); DispatchQueueName = DispatchQueue.GetCurrentDispatchQueueName(); Callback?.Invoke(invocation); if (IsBlocking) _blockingSignal.Wait(5.Seconds()); } public void Unblock() { _blockingSignal.Set(); } } }
using System; using System.Threading; using Abc.Zebus.Dispatch; using Abc.Zebus.Testing.Dispatch; using Abc.Zebus.Util; using ProtoBuf; namespace Abc.Zebus.Tests.Dispatch.DispatchMessages { [ProtoContract] public class ExecutableEvent : ICommand, IExecutableMessage { private readonly ManualResetEventSlim _blockingSignal = new ManualResetEventSlim(); public bool IsBlocking { get; set; } public Action<IMessageHandlerInvocation> Callback { get; set; } public ManualResetEventSlim HandleStarted { get; } = new ManualResetEventSlim(); public string DispatchQueueName { get; private set; } public void Execute(IMessageHandlerInvocation invocation) { HandleStarted.Set(); DispatchQueueName = DispatchQueue.GetCurrentDispatchQueueName(); Callback?.Invoke(invocation); if (IsBlocking) _blockingSignal.Wait(5.Second()); } public void Unblock() { _blockingSignal.Set(); } } }
mit
C#
0a2bf1bb0a537f1c1c7d1510a8a80538dddfe23a
revert the version bump
Brightspace/D2L.Security.OAuth2
src/D2L.Security.OAuth2.TestFramework/Properties/AssemblyInfo.cs
src/D2L.Security.OAuth2.TestFramework/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("D2L.Security.OAuth2.TestFramework")] [assembly: AssemblyDescription("Library for obtaining authorization in tests")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Desire2Learn")] [assembly: AssemblyProduct("D2L.Security.OAuth2.TestFramework")] [assembly: AssemblyCopyright("Copyright © Desire2Learn 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("82aa807f-8c33-476f-bd5f-6378f13bae20")] // 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("5.2.1.0")] [assembly: AssemblyFileVersion("5.2.1.0")] [assembly: InternalsVisibleTo( "D2L.Security.OAuth2.Benchmarks" )] [assembly: InternalsVisibleTo( "D2L.Security.OAuth2.UnitTests" )] [assembly: InternalsVisibleTo( "D2L.Security.OAuth2.IntegrationTests" )]
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("D2L.Security.OAuth2.TestFramework")] [assembly: AssemblyDescription("Library for obtaining authorization in tests")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Desire2Learn")] [assembly: AssemblyProduct("D2L.Security.OAuth2.TestFramework")] [assembly: AssemblyCopyright("Copyright © Desire2Learn 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("82aa807f-8c33-476f-bd5f-6378f13bae20")] // 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("5.2.2.0")] [assembly: AssemblyFileVersion("5.2.2.0")] [assembly: InternalsVisibleTo( "D2L.Security.OAuth2.Benchmarks" )] [assembly: InternalsVisibleTo( "D2L.Security.OAuth2.UnitTests" )] [assembly: InternalsVisibleTo( "D2L.Security.OAuth2.IntegrationTests" )]
apache-2.0
C#
5648532e982c624084c8ce6dc100d0904a9a12c6
Update version
AlegriGroup/FeatureSwitcher.VstsConfiguration
src/FeatureSwitcher.VstsConfiguration/Properties/AssemblyInfo.cs
src/FeatureSwitcher.VstsConfiguration/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("FeatureSwitcher.VstsConfiguration")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Alegri International Service GmbH")] [assembly: AssemblyProduct("FeatureSwitcher.VstsConfiguration")] [assembly: AssemblyCopyright("Copyright © Alegri International Service GmbH 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("ba9392fc-fb58-45ca-9142-bd77bb26f21c")] // 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.*")] #pragma warning disable CS7035 // The specified version string does not conform to the recommended format - major.minor.build.revision [assembly: AssemblyFileVersion("1.0.*")] #pragma warning restore CS7035 // The specified version string does not conform to the recommended format - major.minor.build.revision [assembly: InternalsVisibleTo("FeatureSwitcher.VstsConfiguration.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("FeatureSwitcher.VstsConfiguration")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Alegri International Service GmbH")] [assembly: AssemblyProduct("FeatureSwitcher.VstsConfiguration")] [assembly: AssemblyCopyright("Copyright © Alegri International Service GmbH 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("ba9392fc-fb58-45ca-9142-bd77bb26f21c")] // 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.1.*")] #pragma warning disable CS7035 // The specified version string does not conform to the recommended format - major.minor.build.revision [assembly: AssemblyFileVersion("0.1.*")] #pragma warning restore CS7035 // The specified version string does not conform to the recommended format - major.minor.build.revision [assembly: InternalsVisibleTo("FeatureSwitcher.VstsConfiguration.Tests")]
mit
C#
3a238d1b88d41fc1ca4db5405503cbc525e23b40
Address PR feedback
naveensrinivasan/VisualStudio,GProulx/VisualStudio,yovannyr/VisualStudio,GuilhermeSa/VisualStudio,mariotristan/VisualStudio,github/VisualStudio,ChristopherHackett/VisualStudio,shaunstanislaus/VisualStudio,SaarCohen/VisualStudio,bradthurber/VisualStudio,8v060htwyc/VisualStudio,nulltoken/VisualStudio,modulexcite/VisualStudio,github/VisualStudio,Dr0idKing/VisualStudio,github/VisualStudio,luizbon/VisualStudio,bbqchickenrobot/VisualStudio,HeadhunterXamd/VisualStudio,pwz3n0/VisualStudio,YOTOV-LIMITED/VisualStudio,radnor/VisualStudio,AmadeusW/VisualStudio,amytruong/VisualStudio
src/GitHub.VisualStudio/Converters/CountToVisibilityConverter.cs
src/GitHub.VisualStudio/Converters/CountToVisibilityConverter.cs
using System; using System.Globalization; using System.Windows; using System.Windows.Data; using NullGuard; namespace GitHub.VisualStudio.Converters { /// <summary> /// Convert a count to visibility based on the following rule: /// * If count == 0, return Visibility.Visible /// * If count > 0, return Visibility.Collapsed /// </summary> public class CountToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, [AllowNull] object parameter, [AllowNull] CultureInfo culture) { return ((int)value == 0) ? Visibility.Visible : Visibility.Collapsed; } [return: AllowNull] public object ConvertBack(object value, Type targetType, [AllowNull] object parameter, [AllowNull] CultureInfo culture) { return null; } } }
using System; using System.Globalization; using System.Windows; using System.Windows.Data; using NullGuard; namespace GitHub.VisualStudio.Converters { /// <summary> /// Convert a count to visibility based on the following rule: /// * If count == 0, return Visibility.Visible /// * If count > 0, return Visibility.Collapsed /// </summary> public class CountToVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, [AllowNull] object parameter, [AllowNull] CultureInfo culture) { return ((int)value == 0) ? Visibility.Visible : Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, [AllowNull] object parameter, [AllowNull] CultureInfo culture) { return null; } } }
mit
C#
76ca7668406f6d51292deff75512e38ad1150b20
Fix kebab-case in ids and classes.
Lombiq/Helpful-Extensions,Lombiq/Helpful-Extensions
Views/BootstrapAccordion.cshtml
Views/BootstrapAccordion.cshtml
@using Lombiq.HelpfulExtensions.Models @using OrchardCore.Mvc.Utilities @{ var additionalClasses = Model.AdditionalClasses?.ToString() ?? string.Empty; } <div class="card-accordion @additionalClasses"> @foreach (BootstrapAccordionItem items in Model.Children) { var id = items.Title.Value.HtmlClassify(); <div class="card"> <div class="card-header d-flex justify-content-between" id="heading-@id" data-target="#collapse-@id" aria-expanded="true" aria-controls="collapse-@id"> <h5 class="mb-0">@items.Title</h5> <div class="card-header-icon"> <i class="fas fa-chevron-right"></i> </div> <div class="card-header-icon hide"> <i class="fas fa-chevron-down"></i> </div> </div> <div id="collapse-@id" class="collapse" aria-labelledby="heading-@id" data-parent=".card-accordion"> <div class="card-body"> @await DisplayAsync(items.Shape) </div> </div> </div> } </div> <script at="Foot"> (function ($) { $(function() { $('.card-accordion .card-header').click(function () { var accordionBodySelector = $(this).data('target'); $(accordionBodySelector).collapse('toggle') $('.card-accordion .card-header-icon').toggle(); }); $('.card-accordion .hide').hide(); }); }(jQuery)) </script>
@using Lombiq.HelpfulExtensions.Models @using OrchardCore.Mvc.Utilities @{ var additionalClasses = Model.AdditionalClasses?.ToString() ?? string.Empty; } <div class="card-accordion @additionalClasses"> @foreach (BootstrapAccordionItem items in Model.Children) { var id = items.Title.Value.HtmlClassify(); <div class="card"> <div class="card-header d-flex justify-content-between" id="heading@(id)" data-target="#collapse@(id)" aria-expanded="true" aria-controls="collapse@(id)"> <h5 class="mb-0">@items.Title</h5> <div class="card-header-icon"> <i class="fas fa-chevron-right"></i> </div> <div class="card-header-icon hide"> <i class="fas fa-chevron-down"></i> </div> </div> <div id="collapse@(id)" class="collapse" aria-labelledby="heading@(id)" data-parent=".card-accordion"> <div class="card-body"> @await DisplayAsync(items.Shape) </div> </div> </div> } </div> <script at="Foot"> (function ($) { $(function() { $('.card-accordion .card-header').click(function () { var accordionBodySelector = $(this).data('target'); $(accordionBodySelector).collapse('toggle') $('.card-accordion .card-header-icon').toggle(); }); $('.card-accordion .hide').hide(); }); }(jQuery)) </script>
bsd-3-clause
C#
6f599cf10da6c9cf444521a9cec95b37b6aaa58f
Fix #1240 by disabling Glimpse rendering for non-Admin local users
mtian/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,JetBrains/ReSharperGallery,ScottShingler/NuGetGallery,ScottShingler/NuGetGallery,KuduApps/NuGetGallery,skbkontur/NuGetGallery,projectkudu/SiteExtensionGallery,mtian/SiteExtensionGallery,KuduApps/NuGetGallery,skbkontur/NuGetGallery,KuduApps/NuGetGallery,grenade/NuGetGallery_download-count-patch,JetBrains/ReSharperGallery,projectkudu/SiteExtensionGallery,KuduApps/NuGetGallery,ScottShingler/NuGetGallery,projectkudu/SiteExtensionGallery,skbkontur/NuGetGallery,mtian/SiteExtensionGallery,KuduApps/NuGetGallery,JetBrains/ReSharperGallery,grenade/NuGetGallery_download-count-patch
Website/Diagnostics/GlimpseRuntimePolicy.cs
Website/Diagnostics/GlimpseRuntimePolicy.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Glimpse.Core.Extensibility; using Glimpse.Core.Policy; using NuGetGallery.Configuration; namespace NuGetGallery.Diagnostics { public class GlimpseRuntimePolicy : IRuntimePolicy { public IAppConfiguration Configuration { get; protected set; } protected GlimpseRuntimePolicy() { } public GlimpseRuntimePolicy(IAppConfiguration configuration) { Configuration = configuration; } public RuntimeEvent ExecuteOn { get { return RuntimeEvent.BeginSessionAccess; } } public RuntimePolicy Execute(IRuntimePolicyContext policyContext) { return Execute(policyContext.GetRequestContext<HttpContextBase>()); } public RuntimePolicy Execute(HttpContextBase context) { // Policy is: Localhost collects data, admins always see Glimpse (even when remote) but only over SSL if SSL is required, everyone uses the setting in web config. if (context.Request.IsAuthenticated && (!Configuration.RequireSSL || context.Request.IsSecureConnection) && context.User.IsAdministrator()) { return RuntimePolicy.On; } else if (context.Request.IsLocal) { return RuntimePolicy.PersistResults; } return RuntimePolicy.Off; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Glimpse.Core.Extensibility; using Glimpse.Core.Policy; using NuGetGallery.Configuration; namespace NuGetGallery.Diagnostics { public class GlimpseRuntimePolicy : IRuntimePolicy { public IAppConfiguration Configuration { get; protected set; } protected GlimpseRuntimePolicy() { } public GlimpseRuntimePolicy(IAppConfiguration configuration) { Configuration = configuration; } public RuntimeEvent ExecuteOn { get { return RuntimeEvent.BeginSessionAccess; } } public RuntimePolicy Execute(IRuntimePolicyContext policyContext) { return Execute(policyContext.GetRequestContext<HttpContextBase>()); } public RuntimePolicy Execute(HttpContextBase context) { // Policy is: Localhost sees everything, admins always see Glimpse (even when remote) but only over SSL if SSL is required, everyone uses the setting in web config. if (context.Request.IsLocal || (context.Request.IsAuthenticated && (!Configuration.RequireSSL || context.Request.IsSecureConnection) && context.User.IsAdministrator())) { return RuntimePolicy.On; } return RuntimePolicy.Off; } } }
apache-2.0
C#
c84943aaf6773d5c239d8c99d8a7b910b230fb15
Increment assembly version
ZacMarcus/YahooFinance.NET
YahooFinance.NET/Properties/AssemblyInfo.cs
YahooFinance.NET/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("YahooFinance.NET")] [assembly: AssemblyDescription("Download historical end of day stock data and historical dividend data via the Yahoo Finance API")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("https://github.com/ZacMarcus")] [assembly: AssemblyProduct("YahooFinance.NET")] [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("ffaa8437-97a3-43dc-972a-8c358d37a98f")] // 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("3.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("YahooFinance.NET")] [assembly: AssemblyDescription("Download historical end of day stock data and historical dividend data via the Yahoo Finance API")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("https://github.com/ZacMarcus")] [assembly: AssemblyProduct("YahooFinance.NET")] [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("ffaa8437-97a3-43dc-972a-8c358d37a98f")] // 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.1")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
06d552bd08c2db95b67604d7c42a57d5d01e7a54
Implement AppHarborClient#CreateApplication
appharbor/appharbor-cli
src/AppHarbor/AppHarborClient.cs
src/AppHarbor/AppHarborClient.cs
namespace AppHarbor { public class AppHarborClient { private readonly AuthInfo _authInfo; public AppHarborClient(AuthInfo authInfo) { _authInfo = authInfo; } public void CreateApplication(string name, string regionIdentifier) { var appHarborApi = new AppHarborApi(_authInfo); appHarborApi.CreateApplication(name, regionIdentifier); } } }
namespace AppHarbor { public class AppHarborClient { private readonly AuthInfo _authInfo; public AppHarborClient(AuthInfo authInfo) { _authInfo = authInfo; } } }
mit
C#
e94aa47040e874a14a350fc5b60606f0fc736d92
Add SetComparison to the default build
jamesfoster/DeepEqual
src/DeepEquals/DeepComparison.cs
src/DeepEquals/DeepComparison.cs
namespace DeepEquals { using System.Collections; public class DeepComparison { public static IEqualityComparer CreateComparer() { return new ComparisonComparer(Create()); } public static CompositeComparison Create() { var root = new CompositeComparison(); root.AddRange( new DefaultComparison(), new EnumComparison(), new SetComparison(root), new ListComparison(root), new ComplexObjectComparison(root)); return root; } } }
namespace DeepEquals { using System.Collections; public class DeepComparison { public static IEqualityComparer CreateComparer() { return new ComparisonComparer(Create()); } public static CompositeComparison Create() { var root = new CompositeComparison(); root.AddRange( new DefaultComparison(), new EnumComparison(), new ListComparison(root), new ComplexObjectComparison(root)); return root; } } }
mit
C#
5da5249e6979564325f40bbe3c49411df66084d1
Fix csharp video codecs argument
TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets
video/rest/rooms/create-group-room-with-h264/create-group-room.5.x.cs
video/rest/rooms/create-group-room-with-h264/create-group-room.5.x.cs
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp using System; using Twilio; using Twilio.Rest.Video.V1; class Example { static void Main (string[] args) { // Find your Account SID and Auth Token at twilio.com/console const string apiKeySid = "SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; const string apiKeySecret = "your_api_key_secret"; TwilioClient.Init(apiKeySid, apiKeySecret); var room = RoomResource.Create( uniqueName: "DailyStandupWithH264Codec", type: RoomResource.RoomTypeEnum.Group, videoCodecs: RoomResource.VideoCodecEnum.H264, statusCallback: new Uri("http://example.org")); Console.WriteLine(room.Sid); } }
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp using System; using Twilio; using Twilio.Rest.Video.V1; class Example { static void Main (string[] args) { // Find your Account SID and Auth Token at twilio.com/console const string apiKeySid = "SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; const string apiKeySecret = "your_api_key_secret"; TwilioClient.Init(apiKeySid, apiKeySecret); var room = RoomResource.Create( uniqueName: "DailyStandupWithH264Codec", type: RoomResource.RoomTypeEnum.Group, videoCodecs: 'H264', statusCallback: new Uri("http://example.org")); Console.WriteLine(room.Sid); } }
mit
C#
5fc473e33c518b151135c8ce8f5673e62d4ebe45
Update the docs here, too.
kirilsi/csharp-sparkpost,darrencauthon/csharp-sparkpost,darrencauthon/csharp-sparkpost,SparkPost/csharp-sparkpost,kirilsi/csharp-sparkpost
src/SparkPost/IRecipientLists.cs
src/SparkPost/IRecipientLists.cs
using System.Collections.Generic; using System.Threading.Tasks; namespace SparkPost { public interface IRecipientLists { /// <summary> /// Creates a recipient list. /// </summary> /// <param name="recipientList">The properties of the recipientList to create.</param> /// <returns>The response from the API.</returns> Task<SendRecipientListsResponse> Create(RecipientList recipientList); /// <summary> /// Retrieves a recipient list. /// </summary> /// <param name="recipientListsId">The id of the recipient list to retrieve.</param> /// <returns>The response from the API.</returns> Task<RetrieveRecipientListsResponse> Retrieve(string recipientListsId); } }
using System.Collections.Generic; using System.Threading.Tasks; namespace SparkPost { public interface IRecipientLists { /// <summary> /// Creates a recipient list. /// </summary> /// <param name="recipientList">The properties of the recipientList to create.</param> /// <returns>The response from the API.</returns> Task<SendRecipientListsResponse> Create(RecipientList recipientList); /// <summary> /// Retrieves an email transmission. /// </summary> /// <param name="recipientListsId">The id of the transmission to retrieve.</param> /// <returns>The response from the API.</returns> Task<RetrieveRecipientListsResponse> Retrieve(string recipientListsId); } }
apache-2.0
C#
d5f24c40baa45798e5a768d8ce7398fed0880807
Fix the Additional solver throwing a cast exception
samfun123/KtaneTwitchPlays
TwitchPlaysAssembly/Src/ComponentSolvers/Modded/Misc/AdditionComponentSolver.cs
TwitchPlaysAssembly/Src/ComponentSolvers/Modded/Misc/AdditionComponentSolver.cs
using System; using System.Collections; using UnityEngine; public class AdditionComponentSolver : ComponentSolver { public AdditionComponentSolver(TwitchModule module) : base(module) { _component = module.BombComponent.GetComponent(ComponentType); numberSelectables = _component.GetValue<KMSelectable[]>("buttons"); ModInfo = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Submit or input a number using '!{0} <submit|input> <number>'. Cycle, clear, or submit by using '!{0} <cycle|clear|submit>'."); } protected internal override IEnumerator RespondToCommandInternal(string inputCommand) { var split = inputCommand.ToLowerInvariant().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (split.Length == 2 && split[0] == "submit" || split[0] == "input" && split[1].RegexMatch("^[0-9]+$")) { yield return null; foreach (char c in split[1]) { yield return DoInteractionClick(numberSelectables[c - '0']); } if (split[0] == "submit") { KMSelectable selectable = _component.GetValue<KMSelectable>("SubmitButton"); yield return DoInteractionClick(selectable); } } else if (split.Length == 1 && split[0] == "cycle" || split[0] == "clear" || split[0] == "submit") { yield return null; bool cycle = split[0] == "cycle"; bool clear = split[0] == "clear"; int count = cycle ? 10 : 1; KMSelectable selectable = _component.GetValue<KMSelectable>(cycle ? "ScreenCycler" : clear ? "Clear" : "SubmitButton"); for (int i = 0; i < count; i++) { yield return DoInteractionClick(selectable); yield return new WaitForSeconds(1.5f); } } } protected override IEnumerator ForcedSolveIEnumerator() { string correctAnswer = _component.GetValue<int>("solution").ToString(); yield return RespondToCommandInternal("clear"); yield return RespondToCommandInternal($"submit {correctAnswer}"); } private static readonly Type ComponentType = ReflectionHelper.FindType("AdditionScript"); private readonly object _component; private readonly KMSelectable[] numberSelectables; }
using System; using System.Collections; using UnityEngine; public class AdditionComponentSolver : ComponentSolver { public AdditionComponentSolver(TwitchModule module) : base(module) { _component = module.BombComponent.GetComponent(ComponentType); numberSelectables = _component.GetValue<KMSelectable[]>("buttons"); ModInfo = ComponentSolverFactory.GetModuleInfo(GetModuleType(), "Submit or input a number using '!{0} <submit|input> <number>'. Cycle, clear, or submit by using '!{0} <cycle|clear|submit>'."); } protected internal override IEnumerator RespondToCommandInternal(string inputCommand) { var split = inputCommand.ToLowerInvariant().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (split.Length == 2 && split[0] == "submit" || split[0] == "input" && split[1].RegexMatch("^[0-9]+$")) { yield return null; foreach (char c in split[1]) { yield return DoInteractionClick(numberSelectables[c - '0']); } if (split[0] == "submit") { KMSelectable selectable = _component.GetValue<KMSelectable>("SubmitButton"); yield return DoInteractionClick(selectable); } } else if (split.Length == 1 && split[0] == "cycle" || split[0] == "clear" || split[0] == "submit") { yield return null; bool cycle = split[0] == "cycle"; bool clear = split[0] == "clear"; int count = cycle ? 10 : 1; KMSelectable selectable = _component.GetValue<KMSelectable>(cycle ? "ScreenCycler" : clear ? "Clear" : "SubmitButton"); for (int i = 0; i < count; i++) { yield return DoInteractionClick(selectable); yield return new WaitForSeconds(1.5f); } } } protected override IEnumerator ForcedSolveIEnumerator() { string correctAnswer = _component.GetValue<long>("solution").ToString(); yield return RespondToCommandInternal("clear"); yield return RespondToCommandInternal($"submit {correctAnswer}"); } private static readonly Type ComponentType = ReflectionHelper.FindType("AdditionScript"); private readonly object _component; private readonly KMSelectable[] numberSelectables; }
mit
C#
db1c6cd3735075979c80126ca1e4b577db237cf5
Update Path2DLineEffect.cs
wieslawsoltes/Draw2D,wieslawsoltes/Draw2D,wieslawsoltes/Draw2D
src/Draw2D.ViewModels/Style/PathEffects/Path2DLineEffect.cs
src/Draw2D.ViewModels/Style/PathEffects/Path2DLineEffect.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Collections.Generic; using System.Runtime.Serialization; namespace Draw2D.ViewModels.Style.PathEffects { [DataContract(IsReference = true)] public class Path2DLineEffect : ViewModelBase, IPathEffect { private double _width; private Matrix _matrix; [DataMember(IsRequired = false, EmitDefaultValue = false)] public double Width { get => _width; set => Update(ref _width, value); } [DataMember(IsRequired = false, EmitDefaultValue = false)] public Matrix Matrix { get => _matrix; set => Update(ref _matrix, value); } public Path2DLineEffect() { } public Path2DLineEffect(double width, Matrix matrix) { this.Width = width; this.Matrix = matrix; } public static IPathEffect MakeHatchHorizontalLines() { // TODO: double width = 3; var matrix = Matrix.MakeIdentity(); matrix.ScaleX = 6; matrix.ScaleY = 6; return new Path2DLineEffect(width, matrix) { Title = "HatchHorizontalLines" }; } public static IPathEffect MakeHatchVerticalLines() { // TODO: double width = 6; var matrix = Matrix.MakeIdentity(); return new Path2DLineEffect(width, matrix) { Title = "HatchVerticalLines" }; } public static IPathEffect MakeHatchDiagonalLines() { // TODO: double width = 12; var matrix = Matrix.MakeIdentity(); return new Path2DLineEffect(width, matrix) { Title = "HatchDiagonalLines" }; } public object Copy(Dictionary<object, object> shared) { return new Path2DLineEffect() { Title = this.Title, Width = this.Width, Matrix = (Matrix)this.Matrix.Copy(shared) }; } } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Collections.Generic; using System.Runtime.Serialization; namespace Draw2D.ViewModels.Style.PathEffects { [DataContract(IsReference = true)] public class Path2DLineEffect : ViewModelBase, IPathEffect { private double _width; private Matrix _matrix; [DataMember(IsRequired = false, EmitDefaultValue = false)] public double Width { get => _width; set => Update(ref _width, value); } [DataMember(IsRequired = false, EmitDefaultValue = false)] public Matrix Matrix { get => _matrix; set => Update(ref _matrix, value); } public Path2DLineEffect() { } public Path2DLineEffect(double width, Matrix matrix) { this.Width = width; this.Matrix = matrix; } public static IPathEffect MakeHatchHorizontalLines() { // TODO: double width = 3; var matrix = Matrix.MakeIdentity(); return new Path2DLineEffect(width, matrix) { Title = "HatchHorizontalLines" }; } public static IPathEffect MakeHatchVerticalLines() { // TODO: double width = 6; var matrix = Matrix.MakeIdentity(); return new Path2DLineEffect(width, matrix) { Title = "HatchVerticalLines" }; } public static IPathEffect MakeHatchDiagonalLines() { // TODO: double width = 12; var matrix = Matrix.MakeIdentity(); return new Path2DLineEffect(width, matrix) { Title = "HatchDiagonalLines" }; } public object Copy(Dictionary<object, object> shared) { return new Path2DLineEffect() { Title = this.Title, Width = this.Width, Matrix = (Matrix)this.Matrix.Copy(shared) }; } } }
mit
C#
d3b6283ed129929ad758229d2c157d320bd26aae
Add note for cookies
codingoutloud/azuremap-aspnet,codingoutloud/azuremap-aspnet
AzureMap/Views/Home/Index.cshtml
AzureMap/Views/Home/Index.cshtml
@{ ViewBag.Title = ""; } <div class="jumbotron"> <p class="lead">Map of <b>Windows Azure Data Centers</b> around the world</p> @if (!Request.Browser.Cookies) { <h4>&rArr; The map is static when cookies are not enabled, but becomes interactive with cookies.</h4> } </div> <div id='dcMap' style="position:relative; width:100%; height:600px;"></div> <ul> <li>Some data centers are in Production already (4 in North America, 2 in Europe, 2 in Asia), some are in Preview (2 in mainland China), some have been announced (2 in Japan, 2 in Australia, 1 in Brazil). Click on any data center map pin for more information.</li> <li>A line is drawn from a data center to its fail-over data center (e.g., where Windows Azure Storage geo-replicates).</li> <li>Currently, only full data centers are shown. CDN edge nodes will be added later.</li> <li>Location are approximate to provide an approximate idea of general regions. The exact street addresses for data centers are not published by Microsoft. (Even if it was, that level of information would not be of practical value to the public.)</li> </ul> <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script> <script type="text/javascript" src="/dcLocList.js"></script> <script type="text/javascript" src="/Scripts/DataCenterMapper.js"></script> <link rel="stylesheet" href="/Content/DataCenterMapper.css" type="text/css" /> <script type="text/javascript"> LoadMap(); </script>
@{ ViewBag.Title = "Home Page"; } <div class="jumbotron"> <p class="lead">Map of <b>Windows Azure Data Centers</b> around the world</p> </div> <div id='dcMap' style="position:relative; width:100%; height:600px;"></div> <ul> <li>Some data centers are in Production already (4 in North America, 2 in Europe, 2 in Asia), some are in Preview (2 in mainland China), some have been announced (2 in Japan, 2 in Australia, 1 in Brazil). Click on any data center map pin for more information.</li> <li>A line is drawn from a data center to its fail-over data center (e.g., where Windows Azure Storage geo-replicates).</li> <li>Currently, only full data centers are shown. CDN edge nodes will be added later.</li> <li>Location are approximate to provide an approximate idea of general regions. The exact street addresses for data centers are not published by Microsoft. (Even if it was, that level of information would not be of practical value to the public.)</li> </ul> <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script> <script type="text/javascript" src="/dcLocList.js"></script> <script type="text/javascript" src="/Scripts/DataCenterMapper.js"></script> <link rel="stylesheet" href="/Content/DataCenterMapper.css" type="text/css" /> <script type="text/javascript"> LoadMap(); </script>
apache-2.0
C#
ed0aa7f14ab30035ac2f7e642e59bb7061e57ed3
Use DetectIsJson string extension as opposed to a horrible try/catch
robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,bjarnef/Umbraco-CMS,robertjf/Umbraco-CMS,madsoulswe/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,hfloyd/Umbraco-CMS,robertjf/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,leekelleher/Umbraco-CMS,dawoe/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,bjarnef/Umbraco-CMS,leekelleher/Umbraco-CMS,NikRimington/Umbraco-CMS,KevinJump/Umbraco-CMS,abryukhov/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abryukhov/Umbraco-CMS,arknu/Umbraco-CMS,hfloyd/Umbraco-CMS,bjarnef/Umbraco-CMS,bjarnef/Umbraco-CMS,madsoulswe/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,hfloyd/Umbraco-CMS,umbraco/Umbraco-CMS,umbraco/Umbraco-CMS,tcmorris/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,madsoulswe/Umbraco-CMS,mattbrailsford/Umbraco-CMS,mattbrailsford/Umbraco-CMS,abryukhov/Umbraco-CMS,leekelleher/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,leekelleher/Umbraco-CMS,dawoe/Umbraco-CMS,hfloyd/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,NikRimington/Umbraco-CMS,umbraco/Umbraco-CMS,abjerner/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abryukhov/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,mattbrailsford/Umbraco-CMS,NikRimington/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,leekelleher/Umbraco-CMS,tcmorris/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS
src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Embed.cshtml
src/Umbraco.Web.UI/Views/Partials/Grid/Editors/Embed.cshtml
@model dynamic @using Umbraco.Web.Templates @{ string embedValue = Convert.ToString(Model.value); embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value; } <div class="video-wrapper"> @Html.Raw(embedValue) </div>
@model dynamic @using Umbraco.Web.Templates @{ var embedValue = string.Empty; try { embedValue = Model.value.preview; } catch(Exception ex) { embedValue = Model.value; } } <div class="video-wrapper"> @Html.Raw(embedValue) </div>
mit
C#
b89486410113d4d8e45b30d6c64fff0ee150e5a2
Fix `AsNonNull` not working on release configuration
ppy/osu-framework,peppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,peppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework
osu.Framework/Extensions/ObjectExtensions/ObjectExtensions.cs
osu.Framework/Extensions/ObjectExtensions/ObjectExtensions.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.Diagnostics; using System.Diagnostics.CodeAnalysis; using NUnit.Framework; namespace osu.Framework.Extensions.ObjectExtensions { /// <summary> /// Extensions that apply to all objects. /// </summary> public static class ObjectExtensions { /// <summary> /// Coerces a nullable object as non-nullable. This is an alternative to the C# 8 null-forgiving operator "<c>!</c>". /// </summary> /// <remarks> /// This should only be used when an assertion or other handling is not a reasonable alternative. /// </remarks> /// <param name="obj">The nullable object.</param> /// <typeparam name="T">The type of the object.</typeparam> /// <returns>The non-nullable object corresponding to <paramref name="obj"/>.</returns> public static T AsNonNull<T>(this T? obj) where T : class { Trace.Assert(obj != null); Debug.Assert(obj != null); return obj; } /// <summary> /// If the given object is null. /// </summary> public static bool IsNull<T>([NotNullWhen(false)] this T obj) => ReferenceEquals(obj, null); /// <summary> /// <c>true</c> if the given object is not null, <c>false</c> otherwise. /// </summary> public static bool IsNotNull<T>([NotNullWhen(true)] this T obj) => !ReferenceEquals(obj, null); } }
// 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.Diagnostics; using System.Diagnostics.CodeAnalysis; namespace osu.Framework.Extensions.ObjectExtensions { /// <summary> /// Extensions that apply to all objects. /// </summary> public static class ObjectExtensions { /// <summary> /// Coerces a nullable object as non-nullable. This is an alternative to the C# 8 null-forgiving operator "<c>!</c>". /// </summary> /// <remarks> /// This should only be used when an assertion or other handling is not a reasonable alternative. /// </remarks> /// <param name="obj">The nullable object.</param> /// <typeparam name="T">The type of the object.</typeparam> /// <returns>The non-nullable object corresponding to <paramref name="obj"/>.</returns> public static T AsNonNull<T>(this T? obj) where T : class { Debug.Assert(obj != null); return obj; } /// <summary> /// If the given object is null. /// </summary> public static bool IsNull<T>([NotNullWhen(false)] this T obj) => ReferenceEquals(obj, null); /// <summary> /// <c>true</c> if the given object is not null, <c>false</c> otherwise. /// </summary> public static bool IsNotNull<T>([NotNullWhen(true)] this T obj) => !ReferenceEquals(obj, null); } }
mit
C#
8b815296a0b72ceba8645c57443266d1b7826d09
Fix for plan settings.
Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex
src/Squidex/Areas/Api/Controllers/Plans/Models/AppPlansDto.cs
src/Squidex/Areas/Api/Controllers/Plans/Models/AppPlansDto.cs
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.ComponentModel.DataAnnotations; using System.Linq; using Squidex.Domain.Apps.Entities.Apps; using Squidex.Domain.Apps.Entities.Apps.Services; namespace Squidex.Areas.Api.Controllers.Plans.Models { public sealed class AppPlansDto { /// <summary> /// The available plans. /// </summary> [Required] public PlanDto[] Plans { get; set; } /// <summary> /// The current plan id. /// </summary> public string CurrentPlanId { get; set; } /// <summary> /// The plan owner. /// </summary> public string PlanOwner { get; set; } /// <summary> /// Indicates if there is a billing portal. /// </summary> public bool HasPortal { get; set; } public static AppPlansDto FromApp(IAppEntity app, IAppPlansProvider plans, bool hasPortal) { var planId = app.Plan?.PlanId; var response = new AppPlansDto { CurrentPlanId = planId, Plans = plans.GetAvailablePlans().Select(PlanDto.FromPlan).ToArray(), PlanOwner = app.Plan?.Owner.Identifier, HasPortal = hasPortal }; return response; } } }
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.ComponentModel.DataAnnotations; using System.Linq; using Squidex.Domain.Apps.Entities.Apps; using Squidex.Domain.Apps.Entities.Apps.Services; namespace Squidex.Areas.Api.Controllers.Plans.Models { public sealed class AppPlansDto { /// <summary> /// The available plans. /// </summary> [Required] public PlanDto[] Plans { get; set; } /// <summary> /// The current plan id. /// </summary> public string CurrentPlanId { get; set; } /// <summary> /// The plan owner. /// </summary> public string PlanOwner { get; set; } /// <summary> /// Indicates if there is a billing portal. /// </summary> public bool HasPortal { get; set; } public static AppPlansDto FromApp(IAppEntity app, IAppPlansProvider plans, bool hasPortal) { var planId = plans.GetPlanForApp(app).Id; var response = new AppPlansDto { CurrentPlanId = planId, Plans = plans.GetAvailablePlans().Select(PlanDto.FromPlan).ToArray(), PlanOwner = app.Plan?.Owner.Identifier, HasPortal = hasPortal }; return response; } } }
mit
C#
b6f307420d37e2d3c01e5804ee097cdc6ea42d21
Tweak to `DittoMultiProcessorAttribute` constructors
leekelleher/umbraco-ditto,rasmusjp/umbraco-ditto
src/Our.Umbraco.Ditto/ComponentModel/Attributes/DittoMultiProcessorAttribute.cs
src/Our.Umbraco.Ditto/ComponentModel/Attributes/DittoMultiProcessorAttribute.cs
using System; using System.Collections.Generic; using System.Linq; namespace Our.Umbraco.Ditto { /// <summary> /// Represents a multi-ditto processor capable of wrapping multiple attributes into a single attribute definition /// </summary> [AttributeUsage(Ditto.ProcessorAttributeTargets, AllowMultiple = true, Inherited = false)] [DittoProcessorMetaData(ValueType = typeof(object), ContextType = typeof(DittoMultiProcessorContext))] public abstract class DittoMultiProcessorAttribute : DittoProcessorAttribute { /// <summary> /// Initializes a new instance of the <see cref="DittoMultiProcessorAttribute" /> class. /// </summary> protected DittoMultiProcessorAttribute() { this.Attributes = new List<DittoProcessorAttribute>(); } /// <summary> /// Initializes a new instance of the <see cref="DittoMultiProcessorAttribute" /> class. /// </summary> /// <param name="attributes">The attributes.</param> protected DittoMultiProcessorAttribute(IEnumerable<DittoProcessorAttribute> attributes) : this() { this.Attributes.AddRange(attributes); } /// <summary> /// Gets or sets the attributes. /// </summary> /// <value> /// The attributes. /// </value> protected List<DittoProcessorAttribute> Attributes { get; set; } /// <summary> /// Processes the value. /// </summary> /// <returns> /// The <see cref="object" /> representing the processed value. /// </returns> public override object ProcessValue() { var ctx = (DittoMultiProcessorContext)this.Context; foreach (var processorAttr in this.Attributes) { // Get the right context type var newCtx = ctx.ContextCache.GetOrCreateContext(processorAttr.ContextType); // Process value this.Value = processorAttr.ProcessValue(this.Value, newCtx); } return this.Value; } } }
using System; using System.Collections.Generic; using System.Linq; namespace Our.Umbraco.Ditto { /// <summary> /// Represents a multi-ditto processor capable of wrapping multiple attributes into a single attribute definition /// </summary> [AttributeUsage(Ditto.ProcessorAttributeTargets, AllowMultiple = true, Inherited = false)] [DittoProcessorMetaData(ValueType = typeof(object), ContextType = typeof(DittoMultiProcessorContext))] public abstract class DittoMultiProcessorAttribute : DittoProcessorAttribute { /// <summary> /// Initializes a new instance of the <see cref="DittoMultiProcessorAttribute" /> class. /// </summary> /// <param name="attributes">The attributes.</param> protected DittoMultiProcessorAttribute(IEnumerable<DittoProcessorAttribute> attributes) { this.Attributes = new List<DittoProcessorAttribute>(attributes); } /// <summary> /// Initializes a new instance of the <see cref="DittoMultiProcessorAttribute" /> class. /// </summary> protected DittoMultiProcessorAttribute() : this(Enumerable.Empty<DittoProcessorAttribute>()) { } /// <summary> /// Gets or sets the attributes. /// </summary> /// <value> /// The attributes. /// </value> public List<DittoProcessorAttribute> Attributes { get; set; } /// <summary> /// Processes the value. /// </summary> /// <returns> /// The <see cref="object" /> representing the processed value. /// </returns> public override object ProcessValue() { var ctx = (DittoMultiProcessorContext)this.Context; foreach (var processorAttr in this.Attributes) { // Get the right context type var newCtx = ctx.ContextCache.GetOrCreateContext(processorAttr.ContextType); // Process value this.Value = processorAttr.ProcessValue(this.Value, newCtx); } return this.Value; } } }
mit
C#
d1eeba90af85dd203aa27adbb30a28e45b54e23d
Add test for IComponent typeconverter register in TypeDescriptor (#40959)
ericstj/corefx,wtgodbe/corefx,wtgodbe/corefx,ericstj/corefx,ViktorHofer/corefx,shimingsg/corefx,ViktorHofer/corefx,shimingsg/corefx,ViktorHofer/corefx,shimingsg/corefx,ericstj/corefx,shimingsg/corefx,ericstj/corefx,ericstj/corefx,wtgodbe/corefx,shimingsg/corefx,ViktorHofer/corefx,wtgodbe/corefx,ericstj/corefx,shimingsg/corefx,ViktorHofer/corefx,shimingsg/corefx,wtgodbe/corefx,ViktorHofer/corefx,wtgodbe/corefx,ericstj/corefx,ViktorHofer/corefx,wtgodbe/corefx
src/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.netcoreapp.cs
src/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.netcoreapp.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 Xunit; namespace System.ComponentModel.Tests { public partial class TypeDescriptorTests { [Theory] [InlineData(typeof(Version), typeof(VersionConverter))] [InlineData(typeof(IComponent), typeof(ComponentConverter))] public static void GetConverter_NetCoreApp(Type targetType, Type resultConverterType) => GetConverter(targetType, resultConverterType); } }
// 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 Xunit; namespace System.ComponentModel.Tests { public partial class TypeDescriptorTests { [Theory] [InlineData(typeof(Version), typeof(VersionConverter))] public static void GetConverter_NetCoreApp(Type targetType, Type resultConverterType) => GetConverter(targetType, resultConverterType); } }
mit
C#
5df2f4e01031475c5338d6009c0a5637eab37357
Add message possibility for InsufficientBalanceException
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
MagicalCryptoWallet/Exceptions/InsufficientBalanceException.cs
MagicalCryptoWallet/Exceptions/InsufficientBalanceException.cs
using System; using System.Collections.Generic; using System.Text; namespace MagicalCryptoWallet.Exceptions { public class InsufficientBalanceException : Exception { public InsufficientBalanceException(string message = "") : base(message) { } } }
using System; using System.Collections.Generic; using System.Text; namespace MagicalCryptoWallet.Exceptions { public class InsufficientBalanceException : Exception { public InsufficientBalanceException() { } } }
mit
C#
e79969ac28940ebf9b0421246ffc478b27744217
Add function for get the center of mass
dummer/HarbourCraneHelper
ControlInterface/NonClassicLogic/Expert.cs
ControlInterface/NonClassicLogic/Expert.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NonClassicLogic { class ExpertPoint //точки на графике { public double x, y; public ExpertPoint(double x, double y) { this.x = x; this.y = y; } } class Expert { private static double signSquare(ExpertPoint p1, ExpertPoint p2, ExpertPoint p3) //знаковая площадь треугольника { return ((p2.x - p1.x) * (p3.y - p1.y) - (p2.y - p1.y) * (p3.x - p1.x)) / 2; } private static ExpertPoint centroid(ExpertPoint p1, ExpertPoint p2, ExpertPoint p3) // центроид треугольника { return new ExpertPoint((p1.x + p2.x + p3.x) / 3, (p1.y + p2.y + p3.y) / 3); } public static ExpertPoint centerOfMass(List<ExpertPoint> points) // нахождение центра массы { ExpertPoint p = new ExpertPoint(0, 0); // произвольная точка для подсчета double x = 0; double y = 0; double s = 0; for (int i = 0; i < points.Count - 1; i++) { double s1 = signSquare(p, points[i], points[i + 1]); ExpertPoint r = centroid(p, points[i], points[i + 1]); x += r.x * s1; y += r.y * s1; s += s1; } if (s != 0) { return new ExpertPoint(x / s, y / s); } else { return new ExpertPoint(0, 0); } } double cargoSquare = 31.589472; // м^2 double cargoWeight = 30.4; // кг private double windStrenght ( double windSpeed ) { return windSpeed * windSpeed * 0.61 * cargoSquare; } // ----- public double getCranePos( double windSpeed, double lenght ) { return lenght * windStrenght(windSpeed) / (cargoWeight * 10); } public double getMaxCargoSpeed( double lenght, double distance ) { return distance - lenght; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NonClassicLogic { class Expert { double cargoSquare = 31589.472; // м^2 double cargoWeight = 30.4; // кг private double windStrenght ( double windSpeed ) { return windSpeed * windSpeed * 0.61 * cargoSquare; } // ----- public double getCranePos( double windSpeed, double lenght ) { return lenght * windStrenght(windSpeed) / (cargoWeight * 10); } public double getMaxCargoSpeed( double lenght, double distance ) { return distance - lenght; } } }
mit
C#
3628797c73e26dae6e8070e88b0ebdd77e31068c
Update delete signature to use only id
tvanfosson/dapper-integration-testing
DapperTesting/Core/Data/IUserRepository.cs
DapperTesting/Core/Data/IUserRepository.cs
using System.Collections.Generic; using DapperTesting.Core.Model; namespace DapperTesting.Core.Data { public interface IUserRepository { void Create(User user); void Delete(int id); User Get(int id); User Get(string email); List<User> GetAll(); void Update(User user); } }
using System.Collections.Generic; using DapperTesting.Core.Model; namespace DapperTesting.Core.Data { public interface IUserRepository { void Create(User user); void Delete(User user); User Get(int id); User Get(string email); List<User> GetAll(); void Update(User user); } }
mit
C#
0b8bc1c269aa906ab2bb13ba575c7c6e8fda2fc7
Fix where embedded file provider looks for resources by default
peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype
src/Glimpse.Server.Dnx/Internal/Resources/EmbeddedFileResource.cs
src/Glimpse.Server.Dnx/Internal/Resources/EmbeddedFileResource.cs
using System; using System.Collections.Generic; using System.Reflection; using Glimpse.Server.Resources; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.StaticFiles; namespace Glimpse.Server.Internal.Resources { public abstract class EmbeddedFileResource : IResourceStartup { public void Configure(IResourceBuilder resourceBuilder) { var appBuilder = resourceBuilder.AppBuilder; appBuilder.ModifyResponseWith(response => response.EnableCaching()); appBuilder.ModifyResponseWith(res => res.EnableCors()); appBuilder.UseFileServer(new FileServerOptions { RequestPath = "", EnableDefaultFiles = true, FileProvider = new EmbeddedFileProvider(typeof(IResourceManager).GetTypeInfo().Assembly, BaseNamespace) }); foreach (var registration in Register) { resourceBuilder.Register(registration.Key, registration.Value); } } public abstract ResourceType Type { get; } public abstract string BaseNamespace { get; } public abstract IDictionary<string, string> Register { get; } } public class ClientEmbeddedFileResource : EmbeddedFileResource { public override ResourceType Type => ResourceType.Client; public override string BaseNamespace => "Glimpse.Server.Core.Internal.Resources.Embeded.Client"; public override IDictionary<string, string> Register => new Dictionary<string, string> { { "client", "index.html?hash={hash}{&requestId,follow,metadataUri}"}, { "hud", "hud.js?hash={hash}" } }; } public class AgentEmbeddedFileResource : EmbeddedFileResource { public override ResourceType Type => ResourceType.Agent; public override string BaseNamespace => "Glimpse.Server.Core.Internal.Resources.Embeded.Agent"; public override IDictionary<string, string> Register => new Dictionary<string, string> { { "agent", "agent.js?hash={hash}"} }; } }
using System; using System.Collections.Generic; using System.Reflection; using Glimpse.Server.Resources; using Microsoft.AspNet.Builder; using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.StaticFiles; namespace Glimpse.Server.Internal.Resources { public abstract class EmbeddedFileResource : IResourceStartup { public void Configure(IResourceBuilder resourceBuilder) { var appBuilder = resourceBuilder.AppBuilder; appBuilder.ModifyResponseWith(response => response.EnableCaching()); appBuilder.ModifyResponseWith(res => res.EnableCors()); appBuilder.UseFileServer(new FileServerOptions { RequestPath = "", EnableDefaultFiles = true, FileProvider = new EmbeddedFileProvider(typeof (EmbeddedFileResource).GetTypeInfo().Assembly, BaseNamespace) }); foreach (var registration in Register) { resourceBuilder.Register(registration.Key, registration.Value); } } public abstract ResourceType Type { get; } public abstract string BaseNamespace { get; } public abstract IDictionary<string, string> Register { get; } } public class ClientEmbeddedFileResource : EmbeddedFileResource { public override ResourceType Type => ResourceType.Client; public override string BaseNamespace => "Glimpse.Server.Internal.Resources.Embeded.Client"; public override IDictionary<string, string> Register => new Dictionary<string, string> { { "client", "index.html?hash={hash}{&requestId,follow,metadataUri}"}, { "hud", "hud.js?hash={hash}" } }; } public class AgentEmbeddedFileResource : EmbeddedFileResource { public override ResourceType Type => ResourceType.Agent; public override string BaseNamespace => "Glimpse.Server.Internal.Resources.Embeded.Agent"; public override IDictionary<string, string> Register => new Dictionary<string, string> { { "agent", "agent.js?hash={hash}"} }; } }
mit
C#
a683a2b6607bb5cac986ef08d81edad4ce692b4e
Update ValueChangedTriggerBehavior.cs
wieslawsoltes/AvaloniaBehaviors,wieslawsoltes/AvaloniaBehaviors
src/Avalonia.Xaml.Interactions/Custom/ValueChangedTriggerBehavior.cs
src/Avalonia.Xaml.Interactions/Custom/ValueChangedTriggerBehavior.cs
using System; using Avalonia.Xaml.Interactivity; namespace Avalonia.Xaml.Interactions.Custom { /// <summary> /// A behavior that performs actions when the bound data produces new value. /// </summary> public class ValueChangedTriggerBehavior : Trigger { static ValueChangedTriggerBehavior() { BindingProperty.Changed.Subscribe(e => OnValueChanged(e.Sender, e)); } /// <summary> /// Identifies the <seealso cref="Binding"/> avalonia property. /// </summary> public static readonly StyledProperty<object?> BindingProperty = AvaloniaProperty.Register<ValueChangedTriggerBehavior, object?>(nameof(Binding)); /// <summary> /// Gets or sets the bound object that the <see cref="ValueChangedTriggerBehavior"/> will listen to. This is a avalonia property. /// </summary> public object? Binding { get => GetValue(BindingProperty); set => SetValue(BindingProperty, value); } private static void OnValueChanged(IAvaloniaObject avaloniaObject, AvaloniaPropertyChangedEventArgs args) { if (avaloniaObject is not ValueChangedTriggerBehavior behavior || behavior.AssociatedObject is null) { return; } var binding = behavior.Binding; if (binding is { }) { Interaction.ExecuteActions(behavior.AssociatedObject, behavior.Actions, args); } } } }
using System; using Avalonia.Xaml.Interactivity; namespace Avalonia.Xaml.Interactions.Custom { /// <summary> /// A behavior that performs actions when the bound data produces new value. /// </summary> public class ValueChangedTriggerBehavior : Trigger { static ValueChangedTriggerBehavior() { BindingProperty.Changed.Subscribe(e => OnValueChanged(e.Sender, e)); } /// <summary> /// Identifies the <seealso cref="Binding"/> avalonia property. /// </summary> public static readonly StyledProperty<object?> BindingProperty = AvaloniaProperty.Register<ValueChangedTriggerBehavior, object?>(nameof(Binding)); /// <summary> /// Gets or sets the bound object that the <see cref="ValueChangedTriggerBehavior"/> will listen to. This is a avalonia property. /// </summary> public object? Binding { get => GetValue(BindingProperty); set => SetValue(BindingProperty, value); } private static void OnValueChanged(IAvaloniaObject avaloniaObject, AvaloniaPropertyChangedEventArgs args) { if (!(avaloniaObject is ValueChangedTriggerBehavior behavior) || behavior.AssociatedObject is null) { return; } var binding = behavior.Binding; if (binding is { }) { Interaction.ExecuteActions(behavior.AssociatedObject, behavior.Actions, args); } } } }
mit
C#
decd49117fa4eb3cf410f4f86ec83b238e6a9417
stop adding TraceSource to DI container
RadicalFx/Radical.Windows
src/Radical.Windows/Presentation/Boot/Installers/DefaultInstaller.cs
src/Radical.Windows/Presentation/Boot/Installers/DefaultInstaller.cs
using Microsoft.Extensions.DependencyInjection; using Radical.ComponentModel; using Radical.ComponentModel.Messaging; using Radical.Linq; using Radical.Messaging; using Radical.Windows.Presentation.Boot.Features; using Radical.Windows.Presentation.ComponentModel; using Radical.Windows.Threading; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Windows; namespace Radical.Windows.Presentation.Boot.Installers { class DefaultInstaller : IDependenciesInstaller { public void Install(BootstrapConventions conventions, IServiceCollection services, IEnumerable<Type> assemblyScanningResults) { services.AddSingleton<IFeature, Cultures>(); services.AddSingleton<IFeature, CurrentPrincipal>(); services.AddSingleton(container => Application.Current); services.AddSingleton(container => Application.Current.Dispatcher); if (!services.IsRegistered<IDispatcher>()) { services.AddSingleton<IDispatcher, WpfDispatcher>(); } if (!services.IsRegistered<IReleaseComponents>()) { services.AddSingleton<IReleaseComponents, DefaultComponentReleaser>(); } } } }
using Microsoft.Extensions.DependencyInjection; using Radical.ComponentModel; using Radical.ComponentModel.Messaging; using Radical.Linq; using Radical.Messaging; using Radical.Windows.Presentation.Boot.Features; using Radical.Windows.Presentation.ComponentModel; using Radical.Windows.Threading; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Windows; namespace Radical.Windows.Presentation.Boot.Installers { class DefaultInstaller : IDependenciesInstaller { public void Install(BootstrapConventions conventions, IServiceCollection services, IEnumerable<Type> assemblyScanningResults) { services.AddSingleton<IFeature, Cultures>(); services.AddSingleton<IFeature, CurrentPrincipal>(); services.AddSingleton(container => { //TODO: figure out best way to do settings //var name = ConfigurationManager // .AppSettings["radical/windows/presentation/diagnostics/applicationTraceSourceName"] // .Return(s => s, "default"); return new TraceSource("default"); }); services.AddSingleton(container => Application.Current); services.AddSingleton(container => Application.Current.Dispatcher); if (!services.IsRegistered<IDispatcher>()) { services.AddSingleton<IDispatcher, WpfDispatcher>(); } if (!services.IsRegistered<IReleaseComponents>()) { services.AddSingleton<IReleaseComponents, DefaultComponentReleaser>(); } } } }
mit
C#
d7e6890e531151227201e3d504e21367f829de16
fix indentation
aliyeysides/Rosie
Rosie/Program.cs
Rosie/Program.cs
using System; using System.Threading.Tasks; using Discord; using Discord.Commands; using Discord.WebSocket; namespace Rosie { public class Program { private readonly DiscordSocketClient _client; public static void Main(string[] args) => new Program().MainAsync().GetAwaiter().GetResult(); public async Task MainAsync() { var client = new DiscordSocketClient(); client.Log += Logger; string token = APIKeys.DiscordClientToken; await client.LoginAsync(TokenType.Bot, token); await client.StartAsync(); // Block this task until the program is closed. await Task.Delay(-1); } private Program() { _client = new DiscordSocketClient(new DiscordSocketConfig { LogLevel = LogSeverity.Info, }); } private Task Logger(LogMessage msg) { Console.WriteLine(msg.ToString()); return Task.CompletedTask; } } }
using System; using System.Threading.Tasks; using Discord; using Discord.Commands; using Discord.WebSocket; namespace Rosie { public class Program { private readonly DiscordSocketClient _client; public static void Main(string[] args) => new Program().MainAsync().GetAwaiter().GetResult(); public async Task MainAsync() { var client = new DiscordSocketClient(); client.Log += Logger; string token = APIKeys.DiscordClientToken; await client.LoginAsync(TokenType.Bot, token); await client.StartAsync(); // Block this task until the program is closed. await Task.Delay(-1); } private Program() { _client = new DiscordSocketClient(new DiscordSocketConfig { LogLevel = LogSeverity.Info, }); } private Task Logger(LogMessage msg) { Console.WriteLine(msg.ToString()); return Task.CompletedTask; } } }
mit
C#
41e1cc136087274b2219c13343b2a4809ae17658
Fix formatting
ViktorHofer/corefx,ptoonen/corefx,ravimeda/corefx,ptoonen/corefx,Jiayili1/corefx,ericstj/corefx,ptoonen/corefx,shimingsg/corefx,shimingsg/corefx,Ermiar/corefx,axelheer/corefx,ptoonen/corefx,mmitche/corefx,ericstj/corefx,ViktorHofer/corefx,wtgodbe/corefx,Ermiar/corefx,mmitche/corefx,seanshpark/corefx,seanshpark/corefx,seanshpark/corefx,ravimeda/corefx,BrennanConroy/corefx,ericstj/corefx,parjong/corefx,shimingsg/corefx,zhenlan/corefx,Jiayili1/corefx,Jiayili1/corefx,ViktorHofer/corefx,mmitche/corefx,wtgodbe/corefx,Jiayili1/corefx,ericstj/corefx,axelheer/corefx,Ermiar/corefx,fgreinacher/corefx,zhenlan/corefx,parjong/corefx,wtgodbe/corefx,zhenlan/corefx,ViktorHofer/corefx,BrennanConroy/corefx,ravimeda/corefx,ericstj/corefx,wtgodbe/corefx,ericstj/corefx,zhenlan/corefx,mmitche/corefx,parjong/corefx,ravimeda/corefx,ravimeda/corefx,Jiayili1/corefx,mmitche/corefx,fgreinacher/corefx,zhenlan/corefx,ptoonen/corefx,Jiayili1/corefx,shimingsg/corefx,shimingsg/corefx,Ermiar/corefx,Jiayili1/corefx,parjong/corefx,fgreinacher/corefx,wtgodbe/corefx,ViktorHofer/corefx,seanshpark/corefx,ravimeda/corefx,ravimeda/corefx,axelheer/corefx,Ermiar/corefx,ericstj/corefx,ViktorHofer/corefx,shimingsg/corefx,zhenlan/corefx,mmitche/corefx,zhenlan/corefx,parjong/corefx,seanshpark/corefx,ViktorHofer/corefx,wtgodbe/corefx,Ermiar/corefx,seanshpark/corefx,axelheer/corefx,wtgodbe/corefx,parjong/corefx,parjong/corefx,axelheer/corefx,axelheer/corefx,shimingsg/corefx,Ermiar/corefx,ptoonen/corefx,seanshpark/corefx,fgreinacher/corefx,mmitche/corefx,BrennanConroy/corefx,ptoonen/corefx
src/System.Diagnostics.PerformanceCounter/src/misc/EnvironmentHelpers.cs
src/System.Diagnostics.PerformanceCounter/src/misc/EnvironmentHelpers.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.ComponentModel; using System.Security; using System.Security.Principal; namespace System { internal static class EnvironmentHelpers { private static volatile bool s_isAppContainerProcess; private static volatile bool s_isAppContainerProcessInitalized; internal const int TokenIsAppContainer = 29; public static bool IsAppContainerProcess { get { if(!s_isAppContainerProcessInitalized) { if(Environment.OSVersion.Platform != PlatformID.Win32NT) { s_isAppContainerProcess = false; } else if(Environment.OSVersion.Version.Major < 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1)) { // Windows 7 or older. s_isAppContainerProcess = false; } else { s_isAppContainerProcess = HasAppContainerToken(); } s_isAppContainerProcessInitalized = true; } return s_isAppContainerProcess; } } [SecuritySafeCritical] private static unsafe bool HasAppContainerToken() { int* dwIsAppContainerPtr = stackalloc int[1]; uint dwLength = 0; using (WindowsIdentity wi = WindowsIdentity.GetCurrent(TokenAccessLevels.Query)) { if (!Interop.Advapi32.GetTokenInformation(wi.Token, TokenIsAppContainer, new IntPtr(dwIsAppContainerPtr), sizeof(int), out dwLength)) { throw new Win32Exception(); } } return (*dwIsAppContainerPtr != 0); } } }
// 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.ComponentModel; using System.Security; using System.Security.Principal; namespace System { internal static class EnvironmentHelpers { private static volatile bool s_isAppContainerProcess; private static volatile bool s_isAppContainerProcessInitalized; internal const int TokenIsAppContainer = 29; public static bool IsAppContainerProcess { get { if(!s_isAppContainerProcessInitalized) { if(Environment.OSVersion.Platform != PlatformID.Win32NT) { s_isAppContainerProcess = false; } else if(Environment.OSVersion.Version.Major < 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1)) { // Windows 7 or older. s_isAppContainerProcess = false; } else { s_isAppContainerProcess = HasAppContainerToken(); } s_isAppContainerProcessInitalized = true; } return s_isAppContainerProcess; } } [SecuritySafeCritical] private static unsafe bool HasAppContainerToken() { int* dwIsAppContainerPtr = stackalloc int[1]; uint dwLength = 0; using (WindowsIdentity wi = WindowsIdentity.GetCurrent(TokenAccessLevels.Query)) { if (!Interop.Advapi32.GetTokenInformation(wi.Token, TokenIsAppContainer, new IntPtr(dwIsAppContainerPtr), sizeof(int), out dwLength)) { throw new Win32Exception(); } } return (*dwIsAppContainerPtr != 0); } } }
mit
C#
0c3a097c0f482c63e0f813a272cba3226c4392ac
Update IComplier.Extension.cs
NMSLanX/Natasha
src/Natasha/Core/Engine/ComplierModule/IComplier.Extension.cs
src/Natasha/Core/Engine/ComplierModule/IComplier.Extension.cs
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Formatting; using System.Collections.Generic; using System.Diagnostics; using System.Linq; namespace Natasha.Complier { public static class IComplierExtension { private readonly static AdhocWorkspace _workSpace; private readonly static CSharpParseOptions _options; static IComplierExtension() { _workSpace = new AdhocWorkspace(); _workSpace.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId("formatter"), VersionStamp.Default)); _options = new CSharpParseOptions(LanguageVersion.Latest); } public static void Deconstruct( this string text, out SyntaxTree tree, out string formatter, out IEnumerable<Diagnostic> errors) { tree = CSharpSyntaxTree.ParseText(text.Trim(), _options); SyntaxNode root = Formatter.Format(tree.GetCompilationUnitRoot(), _workSpace); tree = root.SyntaxTree; formatter = root.ToString(); errors = root.GetDiagnostics(); } } }
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Formatting; using System.Collections.Generic; using System.Linq; namespace Natasha.Complier { public static class IComplierExtension { private readonly static AdhocWorkspace _workSpace; static IComplierExtension() { _workSpace = new AdhocWorkspace(); _workSpace.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId("formatter"), VersionStamp.Default)); } public static void Deconstruct( this string text, out SyntaxTree tree, out string formatter, out IEnumerable<Diagnostic> errors) { text = text.Trim(); tree = CSharpSyntaxTree.ParseText(text, new CSharpParseOptions(LanguageVersion.Latest)); CompilationUnitSyntax root = tree.GetCompilationUnitRoot(); root = (CompilationUnitSyntax)Formatter.Format(root, _workSpace); tree = root.SyntaxTree; formatter = root.ToString(); errors = root.GetDiagnostics(); } } }
mpl-2.0
C#
c4a7383349dfe0c47c5ae18f7828f12113c389a5
Use static import for repeated EditorGUI.* calls
mysticfall/Alensia
Assets/Editor/Alensia/Core/I18n/TranslatableTextPropertyDrawer.cs
Assets/Editor/Alensia/Core/I18n/TranslatableTextPropertyDrawer.cs
using UnityEditor; using UnityEngine; using static UnityEditor.EditorGUI; namespace Alensia.Core.I18n { [CustomPropertyDrawer(typeof(TranslatableText))] public class TranslatableTextPropertyDrawer : PropertyDrawer { public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var text = property.FindPropertyRelative("_text"); var textKey = property.FindPropertyRelative("_textKey"); BeginProperty(position, label, text); var xMin = position.xMin; position.height = EditorGUIUtility.singleLineHeight; BeginChangeCheck(); var textValue = TextField(position, label, text.stringValue); if (EndChangeCheck()) { text.stringValue = textValue; } EndProperty(); position.xMin = xMin; position.yMin += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; BeginProperty(position, label, textKey); position.height = EditorGUIUtility.singleLineHeight; BeginChangeCheck(); var textKeyValue = TextField( position, $"{property.displayName} (I18n Key)", textKey.stringValue); if (EndChangeCheck()) { textKey.stringValue = textKeyValue; } EndProperty(); } public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { const int rows = 2; return base.GetPropertyHeight(property, label) * rows + (rows - 1) * EditorGUIUtility.standardVerticalSpacing; } } }
using UnityEditor; using UnityEngine; namespace Alensia.Core.I18n { [CustomPropertyDrawer(typeof(TranslatableText))] public class TranslatableTextPropertyDrawer : PropertyDrawer { public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var text = property.FindPropertyRelative("_text"); var textKey = property.FindPropertyRelative("_textKey"); EditorGUI.BeginProperty(position, label, text); var xMin = position.xMin; position.height = EditorGUIUtility.singleLineHeight; EditorGUI.BeginChangeCheck(); var textValue = EditorGUI.TextField(position, label, text.stringValue); if (EditorGUI.EndChangeCheck()) { text.stringValue = textValue; } EditorGUI.EndProperty(); position.xMin = xMin; position.yMin += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; EditorGUI.BeginProperty(position, label, textKey); position.height = EditorGUIUtility.singleLineHeight; EditorGUI.BeginChangeCheck(); var textKeyValue = EditorGUI.TextField( position, $"{property.displayName} (I18n Key)", textKey.stringValue); if (EditorGUI.EndChangeCheck()) { textKey.stringValue = textKeyValue; } EditorGUI.EndProperty(); } public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { const int rows = 2; return base.GetPropertyHeight(property, label) * rows + (rows - 1) * EditorGUIUtility.standardVerticalSpacing; } } }
apache-2.0
C#
6fd18d1cec8b3162a0e700ad8afefbf5e09de100
Remove the second Unitypackage being generated, since it's now unneeded.
grobm/OSVR-Unity,JeroMiya/OSVR-Unity,DuFF14/OSVR-Unity,grobm/OSVR-Unity,OSVR/OSVR-Unity
OSVR-Unity/Assets/Editor/OSVRUnityBuild.cs
OSVR-Unity/Assets/Editor/OSVRUnityBuild.cs
using UnityEditor; using System.Collections; public class OSVRUnityBuild { static void build() { string[] assets = { "Assets/OSVRUnity", "Assets/Plugins" }; AssetDatabase.ExportPackage(assets, "OSVR-Unity.unitypackage", ExportPackageOptions.IncludeDependencies | ExportPackageOptions.Recurse); } }
using UnityEditor; using System.Collections; public class OSVRUnityBuild { static void build() { string[] assets = { "Assets/OSVRUnity", "Assets/Plugins" }; AssetDatabase.ExportPackage(assets, "OSVR-Unity.unitypackage", ExportPackageOptions.IncludeDependencies | ExportPackageOptions.Recurse); AssetDatabase.ExportPackage("Assets/_scenes/minigame.unity", "OSVR-Unity-sample.unitypackage", ExportPackageOptions.IncludeDependencies | ExportPackageOptions.Recurse | ExportPackageOptions.IncludeLibraryAssets); } }
apache-2.0
C#
7a38ce2c691a188e9dc805f6180e51e40353da2f
Update UI
seksarn/ParkingSpace,seksarn/ParkingSpace,seksarn/ParkingSpace
ParkingSpace.Web/Views/GateIn/Index.cshtml
ParkingSpace.Web/Views/GateIn/Index.cshtml
@using ParkingSpace.Models; @{ ViewBag.Title = "Index"; var t = (ParkingTicket)TempData["NewTicket"]; } <h2>Gate In</h2> <div class="well well-sm"> @ViewBag.GateID </div> @using (Html.BeginForm("CreateTicket", "GateIn")) { <div> Plate No.:<br /> @Html.TextBox("plateNo")<br /> <br /> <button type="submit" class="btn btn-success"> Issue Parking Ticket </button> </div> } @if (t != null) { <br /> <div class="well"> @t.ID <br /> @t.PlateNo <br /> @t.DateIn </div> }
@using ParkingSpace.Models; @{ ViewBag.Title = "Index"; var t = (ParkingTicket)TempData["NewTicket"]; } <h2>Gate In [@ViewBag.GateID]</h2> @using (Html.BeginForm("CreateTicket", "GateIn")) { <div> Plate No.:<br /> @Html.TextBox("plateNo")<br /> <br /> <button type="submit" class="btn btn-success"> Issue Parking Ticket </button> </div> } @if (t != null) { <br /> <div class="well"> @t.ID <br /> @t.PlateNo <br /> @t.DateIn </div> }
mit
C#
0df4aed0964362aceb190a86d2888c8dd6871231
Update AssemblyVersionInfo.cs
MindscapeHQ/raygun4net,MindscapeHQ/raygun4net,MindscapeHQ/raygun4net
Mindscape.Raygun4Net.AspNetCore/Properties/AssemblyVersionInfo.cs
Mindscape.Raygun4Net.AspNetCore/Properties/AssemblyVersionInfo.cs
using System.Reflection; // 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("6.6.3")] [assembly: AssemblyFileVersion("6.6.3")]
using System.Reflection; // 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("6.6.2")] [assembly: AssemblyFileVersion("6.6.2")]
mit
C#
9027c99171e710ad93647b1ffa17798e590a9657
simplify check for headers and content type
watson-developer-cloud/dotnet-standard-sdk,watson-developer-cloud/dotnet-standard-sdk
src/IBM.WatsonDeveloperCloud/Http/Filters/ErrorFilter.cs
src/IBM.WatsonDeveloperCloud/Http/Filters/ErrorFilter.cs
/** * Copyright 2017 IBM Corp. 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 * * 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.Net.Http; using IBM.WatsonDeveloperCloud.Http.Exceptions; using Newtonsoft.Json; namespace IBM.WatsonDeveloperCloud.Http.Filters { public class ErrorFilter : IHttpFilter { public void OnRequest(IRequest request, HttpRequestMessage requestMessage) { } public void OnResponse(IResponse response, HttpResponseMessage responseMessage) { if (!responseMessage.IsSuccessStatusCode) { ServiceResponseException exception = new ServiceResponseException(response, responseMessage, $"The API query failed with status code {responseMessage.StatusCode}: {responseMessage.ReasonPhrase}"); var error = responseMessage.Content.ReadAsStringAsync().Result; if (responseMessage.Content.Headers?.ContentType?.MediaType == HttpMediaType.APPLICATION_JSON) { exception.Error = JsonConvert.DeserializeObject<Error>(error); } else { exception.Error = new Error() { CodeDescription = responseMessage.StatusCode.ToString(), Message = error }; } throw exception; } } } }
/** * Copyright 2017 IBM Corp. 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 * * 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.Net.Http; using IBM.WatsonDeveloperCloud.Http.Exceptions; using Newtonsoft.Json; namespace IBM.WatsonDeveloperCloud.Http.Filters { public class ErrorFilter : IHttpFilter { public void OnRequest(IRequest request, HttpRequestMessage requestMessage) { } public void OnResponse(IResponse response, HttpResponseMessage responseMessage) { if (!responseMessage.IsSuccessStatusCode) { ServiceResponseException exception = new ServiceResponseException(response, responseMessage, $"The API query failed with status code {responseMessage.StatusCode}: {responseMessage.ReasonPhrase}"); var error = responseMessage.Content.ReadAsStringAsync().Result; if (responseMessage.Content.Headers.ContentType != null && responseMessage.Content.Headers.ContentType.MediaType == HttpMediaType.APPLICATION_JSON) { exception.Error = JsonConvert.DeserializeObject<Error>(error); } else { exception.Error = new Error() { CodeDescription = responseMessage.StatusCode.ToString(), Message = error }; } throw exception; } } } }
apache-2.0
C#
dfe41f09118996474addae842da666f690e9c8b5
Move TestEnvironmentSetUpFixture into project root namespace
ulrichb/ImplicitNullability,ulrichb/ImplicitNullability,ulrichb/ImplicitNullability
Src/ImplicitNullability.Plugin.Tests/ZoneMarkerAndSetUpFixture.cs
Src/ImplicitNullability.Plugin.Tests/ZoneMarkerAndSetUpFixture.cs
using JetBrains.Application.BuildScript.Application.Zones; using JetBrains.ReSharper.TestFramework; using JetBrains.TestFramework; using JetBrains.TestFramework.Application.Zones; using NUnit.Framework; [assembly: RequiresSTA] namespace ImplicitNullability.Plugin.Tests { [ZoneDefinition] public interface IImplicitNullabilityTestEnvironmentZone : ITestsZone, IRequire<PsiFeatureTestZone>, IRequire<IImplicitNullabilityZone> { } [ZoneMarker] public class ZoneMarker : IRequire<IImplicitNullabilityTestEnvironmentZone> { } [SetUpFixture] public class TestEnvironmentSetUpFixture : ExtensionTestEnvironmentAssembly<IImplicitNullabilityTestEnvironmentZone> { } }
using ImplicitNullability.Plugin.Tests; using JetBrains.Application.BuildScript.Application.Zones; using JetBrains.ReSharper.TestFramework; using JetBrains.TestFramework; using JetBrains.TestFramework.Application.Zones; using NUnit.Framework; [assembly: RequiresSTA] namespace ImplicitNullability.Plugin.Tests { [ZoneDefinition] public interface IImplicitNullabilityTestEnvironmentZone : ITestsZone, IRequire<PsiFeatureTestZone>, IRequire<IImplicitNullabilityZone> { } [ZoneMarker] public class ZoneMarker : IRequire<IImplicitNullabilityTestEnvironmentZone> { } } // ReSharper disable once CheckNamespace [SetUpFixture] public class TestEnvironmentSetUpFixture : ExtensionTestEnvironmentAssembly<IImplicitNullabilityTestEnvironmentZone> { }
mit
C#
8f66e64e2a6046cbd5cf4215b1303bbda4c17cf6
simplify test
Fody/Fody,GeertvanHorrik/Fody
Tests/Fody/ProjectWeaversReaderTests/ProjectWeaversReaderTests.cs
Tests/Fody/ProjectWeaversReaderTests/ProjectWeaversReaderTests.cs
using ApprovalTests; using Fody; using Xunit; public class ProjectWeaversReaderTests : TestBase { [Fact] public void Invalid() { var path = @"Fody\ProjectWeaversReaderTests\Invalid.txt"; var exception = Assert.Throws<WeavingException>(() => XDocumentEx.Load(path)); Approvals.Verify(exception.Message); } }
using System.IO; using ApprovalTests; using Fody; using Xunit; public class ProjectWeaversReaderTests : TestBase { [Fact] public void Invalid() { var currentDirectory = AssemblyLocation.CurrentDirectory; var path = Path.Combine(currentDirectory, @"Fody\ProjectWeaversReaderTests\Invalid.txt"); var exception = Assert.Throws<WeavingException>(() => XDocumentEx.Load(path)); Approvals.Verify(exception.Message.Replace(currentDirectory, "")); } }
mit
C#
70454454ed41aac93370cd19655713b1f49633ca
add properties to interface
marcoaoteixeira/NEventStore,paritoshmmmec/NEventStore,gael-ltd/NEventStore,NEventStore/NEventStore,chris-evans/NEventStore,D3-LucaPiombino/NEventStore,nerdamigo/NEventStore,jamiegaines/NEventStore,adamfur/NEventStore,deltatre-webplu/NEventStore,AGiorgetti/NEventStore
src/proj/EventStore.Persistence.SqlPersistence/ISqlDialect.cs
src/proj/EventStore.Persistence.SqlPersistence/ISqlDialect.cs
namespace EventStore.Persistence.SqlPersistence { using System; using System.Data; using System.Transactions; public interface ISqlDialect { string InitializeStorage { get; } string PurgeStorage { get; } string GetCommitsFromStartingRevision { get; } string GetCommitsFromInstant { get; } string GetCommitsFromToInstant { get; } string PersistCommit { get; } string DuplicateCommit { get; } string GetStreamsRequiringSnapshots { get; } string GetSnapshot { get; } string AppendSnapshotToCommit { get; } string GetUndispatchedCommits { get; } string MarkCommitAsDispatched { get; } string StreamId { get; } string StreamRevision { get; } string MaxStreamRevision { get; } string Items { get; } string CommitId { get; } string CommitSequence { get; } string CommitStamp { get; } string CommitStampStart { get; } string CommitStampEnd { get; } string Headers { get; } string Payload { get; } string Threshold { get; } string Limit { get; } string Skip { get; } bool CanPage { get; } object CoalesceParameterValue(object value); IDbTransaction OpenTransaction(IDbConnection connection); IDbStatement BuildStatement( TransactionScope scope, IDbConnection connection, IDbTransaction transaction); bool IsDuplicate(Exception exception); } }
namespace EventStore.Persistence.SqlPersistence { using System; using System.Data; using System.Transactions; public interface ISqlDialect { string InitializeStorage { get; } string PurgeStorage { get; } string GetCommitsFromStartingRevision { get; } string GetCommitsFromInstant { get; } string PersistCommit { get; } string DuplicateCommit { get; } string GetStreamsRequiringSnapshots { get; } string GetSnapshot { get; } string AppendSnapshotToCommit { get; } string GetUndispatchedCommits { get; } string MarkCommitAsDispatched { get; } string StreamId { get; } string StreamRevision { get; } string MaxStreamRevision { get; } string Items { get; } string CommitId { get; } string CommitSequence { get; } string CommitStamp { get; } string Headers { get; } string Payload { get; } string Threshold { get; } string Limit { get; } string Skip { get; } bool CanPage { get; } object CoalesceParameterValue(object value); IDbTransaction OpenTransaction(IDbConnection connection); IDbStatement BuildStatement( TransactionScope scope, IDbConnection connection, IDbTransaction transaction); bool IsDuplicate(Exception exception); } }
mit
C#
a20cd1413a2ef5b8d0881b164a973401e1d35da6
Add a 60 sec pause before SQL Server connection
lecaillon/Evolve
test/Evolve.Core.Test.Driver/CoreReflectionBasedDriverTest.cs
test/Evolve.Core.Test.Driver/CoreReflectionBasedDriverTest.cs
using System.Data; using System.Threading; using Evolve.Driver; using Xunit; namespace Evolve.Core.Test.Driver { public class CoreReflectionBasedDriverTest { [Fact(DisplayName = "MicrosoftDataSqliteDriver_works")] public void MicrosoftDataSqliteDriver_works() { var driver = new CoreMicrosoftDataSqliteDriver(TestContext.DriverResourcesDepsFile, TestContext.NugetPackageFolder); var cnn = driver.CreateConnection("Data Source=:memory:"); cnn.Open(); Assert.True(cnn.State == ConnectionState.Open); } [Fact(DisplayName = "NpgsqlDriver_works")] public void NpgsqlDriver_works() { var driver = new CoreNpgsqlDriver(TestContext.DriverResourcesDepsFile, TestContext.NugetPackageFolder); var cnn = driver.CreateConnection($"Server=127.0.0.1;Port=5432;Database=my_database;User Id=postgres;Password={TestContext.PgPassword};"); cnn.Open(); Assert.True(cnn.State == ConnectionState.Open); } [Fact(DisplayName = "SqlClientDriver_works")] public void SqlClientDriver_works() { Thread.Sleep(60000); var driver = new CoreSqlClientDriver(TestContext.DriverResourcesDepsFile, TestContext.NugetPackageFolder); var cnn = driver.CreateConnection("Server=127.0.0.1;Database=master;User Id=sa;Password=Password12!;"); cnn.Open(); Assert.True(cnn.State == ConnectionState.Open); } } }
using System.Data; using System.Threading; using Evolve.Driver; using Xunit; namespace Evolve.Core.Test.Driver { public class CoreReflectionBasedDriverTest { [Fact(DisplayName = "MicrosoftDataSqliteDriver_works")] public void MicrosoftDataSqliteDriver_works() { var driver = new CoreMicrosoftDataSqliteDriver(TestContext.DriverResourcesDepsFile, TestContext.NugetPackageFolder); var cnn = driver.CreateConnection("Data Source=:memory:"); cnn.Open(); Assert.True(cnn.State == ConnectionState.Open); } [Fact(DisplayName = "NpgsqlDriver_works")] public void NpgsqlDriver_works() { var driver = new CoreNpgsqlDriver(TestContext.DriverResourcesDepsFile, TestContext.NugetPackageFolder); var cnn = driver.CreateConnection($"Server=127.0.0.1;Port=5432;Database=my_database;User Id=postgres;Password={TestContext.PgPassword};"); cnn.Open(); Assert.True(cnn.State == ConnectionState.Open); } [Fact(DisplayName = "SqlClientDriver_works")] public void SqlClientDriver_works() { Thread.Sleep(30000); var driver = new CoreSqlClientDriver(TestContext.DriverResourcesDepsFile, TestContext.NugetPackageFolder); var cnn = driver.CreateConnection("Server=127.0.0.1;Database=master;User Id=sa;Password=Password12!;"); cnn.Open(); Assert.True(cnn.State == ConnectionState.Open); } } }
mit
C#
cdccb0a42b75c88015c63429a08863c5d9ff9643
Fix format and switch to HTML message
elanderson/ASP.NET-Core-Email,elanderson/ASP.NET-Core-Email,elanderson/ASP.NET-Core-Email
ASP.NET-Core-Email/src/ASP.NET-Core-Email/Services/MessageServices.cs
ASP.NET-Core-Email/src/ASP.NET-Core-Email/Services/MessageServices.cs
using System; using System.Collections.Generic; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; using ASP.NET_Core_Email.Configuration; using Microsoft.Extensions.Options; namespace ASP.NET_Core_Email.Services { // This class is used by the application to send Email and SMS // when you turn on two-factor authentication in ASP.NET Identity. // For more details see this link http://go.microsoft.com/fwlink/?LinkID=532713 public class AuthMessageSender : IEmailSender, ISmsSender { private readonly EmailSettings _emailSettings; public AuthMessageSender(IOptions<EmailSettings> emailOptions) { _emailSettings = emailOptions.Value; } public async Task SendEmailAsync(string email, string subject, string message) { using (var client = new HttpClient { BaseAddress = new Uri(_emailSettings.ApiBaseUri) }) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes(_emailSettings.ApiKey))); var content = new FormUrlEncodedContent(new[] { new KeyValuePair<string, string>("from", _emailSettings.From), new KeyValuePair<string, string>("to", email), new KeyValuePair<string, string>("subject", subject), new KeyValuePair<string, string>("html", message) }); await client.PostAsync(_emailSettings.RequestUri, content).ConfigureAwait(false); } } public Task SendSmsAsync(string number, string message) { // Plug in your SMS service here to send a text message. return Task.FromResult(0); } } }
using System; using System.Collections.Generic; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; using ASP.NET_Core_Email.Configuration; using Microsoft.Extensions.Options; namespace ASP.NET_Core_Email.Services { // This class is used by the application to send Email and SMS // when you turn on two-factor authentication in ASP.NET Identity. // For more details see this link http://go.microsoft.com/fwlink/?LinkID=532713 public class AuthMessageSender : IEmailSender, ISmsSender { private readonly EmailSettings _emailSettings; public AuthMessageSender(IOptions<EmailSettings> emailOptions) { _emailSettings = emailOptions.Value; } public async Task SendEmailAsync(string email, string subject, string message) { using (var client = new HttpClient { BaseAddress = new Uri(_emailSettings.ApiBaseUri) }) { client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes(_emailSettings.ApiKey))); var content = new FormUrlEncodedContent(new[] { new KeyValuePair<string, string>("from", _emailSettings.From), new KeyValuePair<string, string>("to", email), new KeyValuePair<string, string>("subject", subject), new KeyValuePair<string, string>("text", message) }); await client.PostAsync(_emailSettings.RequestUri, content).ConfigureAwait(false); } } public Task SendSmsAsync(string number, string message) { // Plug in your SMS service here to send a text message. return Task.FromResult(0); } } }
mit
C#
af29f9cfe3392fc145e898e19673303cd29af7a4
Use CVOptionFlags in CVPixelBuffer.Lock: * Fixes 39794
xamarin/monotouch-samples,xamarin/monotouch-samples,xamarin/monotouch-samples
MediaCapture/MediaCapture/CaptureManager/VideoFrameSamplerDelegate.cs
MediaCapture/MediaCapture/CaptureManager/VideoFrameSamplerDelegate.cs
using System; using UIKit; using AVFoundation; using CoreVideo; using CoreMedia; using CoreGraphics; namespace MediaCapture { public class VideoFrameSamplerDelegate : AVCaptureVideoDataOutputSampleBufferDelegate { #region events public EventHandler<ImageCaptureEventArgs> ImageCaptured; void OnImageCaptured (UIImage image) { if (ImageCaptured != null) { var args = new ImageCaptureEventArgs { Image = image, CapturedAt = DateTime.Now }; ImageCaptured (this, args); } } public EventHandler<CaptureErrorEventArgs> CaptureError; void OnCaptureError (string errorMessage ) { if (CaptureError == null) return; try { var args = new CaptureErrorEventArgs { ErrorMessage = errorMessage }; CaptureError (this, args); } catch (Exception e) { Console.WriteLine (e.Message); } } #endregion public override void DidOutputSampleBuffer (AVCaptureOutput captureOutput, CMSampleBuffer sampleBuffer, AVCaptureConnection connection) { try { // render the image into the debug preview pane UIImage image = getImageFromSampleBuffer (sampleBuffer); // event the capture up OnImageCaptured (image); // make sure AVFoundation does not run out of buffers sampleBuffer.Dispose (); } catch (Exception ex) { string exceptionText = ErrorHandling.GetExceptionDetailedText (ex); string errorMessage = $"Failed to process image capture: {exceptionText}"; OnCaptureError (errorMessage); } } UIImage getImageFromSampleBuffer (CMSampleBuffer sampleBuffer) { // Get the CoreVideo image using (var pixelBuffer = sampleBuffer.GetImageBuffer () as CVPixelBuffer) { // Lock the base address pixelBuffer.Lock (CVOptionFlags.None); // Get the number of bytes per row for the pixel buffer var baseAddress = pixelBuffer.BaseAddress; var bytesPerRow = (int) pixelBuffer.BytesPerRow; var width = (int) pixelBuffer.Width; var height = (int) pixelBuffer.Height; var flags = CGBitmapFlags.PremultipliedFirst | CGBitmapFlags.ByteOrder32Little; // Create a CGImage on the RGB colorspace from the configured parameter above using (var cs = CGColorSpace.CreateDeviceRGB ()) using (var context = new CGBitmapContext (baseAddress,width, height, 8, bytesPerRow, cs, (CGImageAlphaInfo) flags)) using (var cgImage = context.ToImage ()) { pixelBuffer.Unlock (CVOptionFlags.None); return UIImage.FromImage (cgImage); } } } } }
using System; using UIKit; using AVFoundation; using CoreVideo; using CoreMedia; using CoreGraphics; namespace MediaCapture { public class VideoFrameSamplerDelegate : AVCaptureVideoDataOutputSampleBufferDelegate { #region events public EventHandler<ImageCaptureEventArgs> ImageCaptured; void OnImageCaptured (UIImage image) { if (ImageCaptured != null) { var args = new ImageCaptureEventArgs { Image = image, CapturedAt = DateTime.Now }; ImageCaptured (this, args); } } public EventHandler<CaptureErrorEventArgs> CaptureError; void OnCaptureError (string errorMessage ) { if (CaptureError == null) return; try { var args = new CaptureErrorEventArgs { ErrorMessage = errorMessage }; CaptureError (this, args); } catch (Exception e) { Console.WriteLine (e.Message); } } #endregion public override void DidOutputSampleBuffer (AVCaptureOutput captureOutput, CMSampleBuffer sampleBuffer, AVCaptureConnection connection) { try { // render the image into the debug preview pane UIImage image = getImageFromSampleBuffer (sampleBuffer); // event the capture up OnImageCaptured (image); // make sure AVFoundation does not run out of buffers sampleBuffer.Dispose (); } catch (Exception ex) { string exceptionText = ErrorHandling.GetExceptionDetailedText (ex); string errorMessage = $"Failed to process image capture: {exceptionText}"; OnCaptureError (errorMessage); } } UIImage getImageFromSampleBuffer (CMSampleBuffer sampleBuffer) { // Get the CoreVideo image using (var pixelBuffer = sampleBuffer.GetImageBuffer () as CVPixelBuffer) { // Lock the base address pixelBuffer.Lock ((CVPixelBufferLock)0); // Get the number of bytes per row for the pixel buffer var baseAddress = pixelBuffer.BaseAddress; var bytesPerRow = (int) pixelBuffer.BytesPerRow; var width = (int) pixelBuffer.Width; var height = (int) pixelBuffer.Height; var flags = CGBitmapFlags.PremultipliedFirst | CGBitmapFlags.ByteOrder32Little; // Create a CGImage on the RGB colorspace from the configured parameter above using (var cs = CGColorSpace.CreateDeviceRGB ()) using (var context = new CGBitmapContext (baseAddress,width, height, 8, bytesPerRow, cs, (CGImageAlphaInfo) flags)) using (var cgImage = context.ToImage ()) { pixelBuffer.Unlock ((CVPixelBufferLock)0); return UIImage.FromImage (cgImage); } } } } }
mit
C#
7ba69105e1fcd16557247797a2b313871f6d23eb
update DwzProxy
ranta-library/Ranta.Proxy
Ranat.Proxy/ShortUrl/DwzProxy.cs
Ranat.Proxy/ShortUrl/DwzProxy.cs
using Newtonsoft.Json; using Ranta.Utility; using System; using System.Collections.Generic; using System.Text; namespace Ranat.Proxy.ShortUrl { /// <summary> /// dwz.cn提供的短网址服务 /// </summary> public static class DwzProxy { private const string DwzHost = "http://dwz.cn/create.php"; public static string GetShortUrl(string longUrl) { string url = string.Empty; string requestContent = string.Format("url={0}", longUrl); var response = RestfulUtility.PostForJson<DwzResponse>(DwzHost, requestContent, ContentType.FormUrlEncoded); return url; } public class DwzResponse { [JsonProperty("tinyurl")] public string TinyUrl { get; set; } [JsonProperty("status")] public int Status { get; set; } [JsonProperty("longurl")] public string LongUrl { get; set; } [JsonProperty("err_msg")] public string ErrorMessage { get; set; } } } }
using Newtonsoft.Json; using Ranta.Utility; using System; using System.Collections.Generic; using System.Text; namespace Ranat.Proxy.ShortUrl { /// <summary> /// dwz.cn提供的短网址服务 /// </summary> public static class DwzProxy { private const string DwzHost = "http://dwz.cn/create.php"; public static string GetShortUrl(string longUrl) { string url = string.Empty; //var dict = new Dictionary<string, string>(); //dict.Add("url", longUrl); string requestContent = string.Format("url={0}", longUrl); var response = RestfulUtility.PostJson<string, DwzResponse>(DwzHost, requestContent); return url; } public class DwzResponse { [JsonProperty("tinyurl")] public string TinyUrl { get; set; } [JsonProperty("status")] public int Status { get; set; } [JsonProperty("longurl")] public string LongUrl { get; set; } [JsonProperty("err_msg")] public string ErrorMessage { get; set; } } } }
mit
C#