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
3701ea2d9fc00a2317d44c2b1da5ea638d142188
Use new AddPolicyRegistry() overload
martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site,martincostello/alexa-london-travel-site
src/LondonTravel.Site/Extensions/PollyServiceCollectionExtensions.cs
src/LondonTravel.Site/Extensions/PollyServiceCollectionExtensions.cs
// Copyright (c) Martin Costello, 2017. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. using System; using System.Net.Http; using Microsoft.Extensions.DependencyInjection; using Polly; using Polly.Extensions.Http; using Polly.Registry; namespace MartinCostello.LondonTravel.Site.Extensions { /// <summary> /// A class containing Polly-related extension methods for the <see cref="IServiceCollection"/> interface. This class cannot be inherited. /// </summary> public static class PollyServiceCollectionExtensions { /// <summary> /// Adds Polly to the services. /// </summary> /// <param name="services">The <see cref="IServiceCollection"/> to add Polly to.</param> /// <returns> /// The value specified by <paramref name="services"/>. /// </returns> public static IServiceCollection AddPolly(this IServiceCollection services) { return services.AddPolicyRegistry((_, registry) => { var sleepDurations = new[] { TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(10), }; var readPolicy = HttpPolicyExtensions.HandleTransientHttpError() .WaitAndRetryAsync(sleepDurations) .WithPolicyKey("ReadPolicy"); var writePolicy = Policy.NoOpAsync() .AsAsyncPolicy<HttpResponseMessage>() .WithPolicyKey("WritePolicy"); var policies = new[] { readPolicy, writePolicy, }; foreach (var policy in policies) { registry.Add(policy.PolicyKey, policy); } }); } } }
// Copyright (c) Martin Costello, 2017. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. using System; using System.Net.Http; using Microsoft.Extensions.DependencyInjection; using Polly; using Polly.Extensions.Http; using Polly.Registry; namespace MartinCostello.LondonTravel.Site.Extensions { /// <summary> /// A class containing Polly-related extension methods for the <see cref="IServiceCollection"/> interface. This class cannot be inherited. /// </summary> public static class PollyServiceCollectionExtensions { /// <summary> /// Adds Polly to the services. /// </summary> /// <param name="services">The <see cref="IServiceCollection"/> to add Polly to.</param> /// <returns> /// The value specified by <paramref name="services"/>. /// </returns> public static IServiceCollection AddPolly(this IServiceCollection services) { var sleepDurations = new[] { TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(10), }; var readPolicy = HttpPolicyExtensions.HandleTransientHttpError() .WaitAndRetryAsync(sleepDurations) .WithPolicyKey("ReadPolicy"); var writePolicy = Policy.NoOpAsync() .AsAsyncPolicy<HttpResponseMessage>() .WithPolicyKey("WritePolicy"); var policies = new[] { readPolicy, writePolicy, }; IPolicyRegistry<string> registry = services.AddPolicyRegistry(); foreach (var policy in policies) { registry.Add(policy.PolicyKey, policy); } return services; } } }
apache-2.0
C#
15b216929076b3be7a2c1ad0822a6cb57eb2dde7
Remove C# 7.0 features.
eylvisaker/AgateLib
AgateLib.Tests.WinForms/DisplayTests/BasicDrawing/DrawingTester.cs
AgateLib.Tests.WinForms/DisplayTests/BasicDrawing/DrawingTester.cs
// The contents of this file are public domain. // You may use them as you wish. // using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Text; using System.Windows.Forms; namespace AgateLib.Tests.DisplayTests.BasicDrawing { public partial class DrawingTester : Form { public DrawingTester() { InitializeComponent(); } public Color SelectedColor { get { return Color.FromArgb((int) (nudAlpha.Value * 255.0m), btnColor.BackColor); } set { var backColor = Color.FromArgb(value.R, value.G, value.B); nudAlpha.Value = (decimal)(value.A / 255.0); btnColor.BackColor = backColor; } } private void btnColor_Click(object sender, EventArgs e) { colorDialog1.Color = btnColor.BackColor; if (colorDialog1.ShowDialog() == DialogResult.OK) btnColor.BackColor = colorDialog1.Color; } } }
// The contents of this file are public domain. // You may use them as you wish. // using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Text; using System.Windows.Forms; namespace AgateLib.Tests.DisplayTests.BasicDrawing { public partial class DrawingTester : Form { public DrawingTester() { InitializeComponent(); } public Color SelectedColor { get => Color.FromArgb((int)(nudAlpha.Value * 255.0m), btnColor.BackColor); set { var backColor = Color.FromArgb(value.R, value.G, value.B); nudAlpha.Value = (decimal)(value.A / 255.0); btnColor.BackColor = backColor; } } private void btnColor_Click(object sender, EventArgs e) { colorDialog1.Color = btnColor.BackColor; if (colorDialog1.ShowDialog() == DialogResult.OK) btnColor.BackColor = colorDialog1.Color; } } }
mit
C#
688f48fb2dd09194be9a1d48cf13b7ba00dd2555
Fix text translations to be non-blocking
atifaziz/WebLinq,atifaziz/WebLinq,weblinq/WebLinq,weblinq/WebLinq
src/Core/Text/TextQuery.cs
src/Core/Text/TextQuery.cs
#region Copyright (c) 2016 Atif Aziz. 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. // #endregion namespace WebLinq.Text { using System; using System.Net.Http; using System.Reactive.Linq; using System.Text; public static class TextQuery { public static IObservable<string> Delimited<T>(this IObservable<T> query, string delimiter) => query.Aggregate(new StringBuilder(), (sb, e) => sb.Append(e), sb => sb.ToString()); public static IObservable<HttpFetch<string>> Text(this IObservable<HttpFetch<HttpContent>> query) => from fetch in query from text in fetch.Content.ReadAsStringAsync() select fetch.WithContent(text); } }
#region Copyright (c) 2016 Atif Aziz. 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. // #endregion namespace WebLinq.Text { using System; using System.Net.Http; using System.Reactive.Linq; using System.Text; public static class TextQuery { public static IObservable<string> Delimited<T>(this IObservable<T> query, string delimiter) => query.Aggregate(new StringBuilder(), (sb, e) => sb.Append(e), sb => sb.ToString()); public static IObservable<HttpFetch<string>> Text(this IObservable<HttpFetch<HttpContent>> query) => // TODO fix to be non-blocking from fetch in query select fetch.WithContent(fetch.Content.ReadAsStringAsync().Result); } }
apache-2.0
C#
4f60d355bce2da5be6070b1870a31c6b811d8abe
Fix prob 1int= 4byte
cedric-demongivert/unity-voxel
Assets/MeshSaver/Editor/VoxelSaverEditor.cs
Assets/MeshSaver/Editor/VoxelSaverEditor.cs
using UnityEditor; using UnityEngine; using System.Collections; using System.Collections.Generic; using System.IO; using org.rnp.voxel.unity.components.meshes; public static class VoxelSaverEditor { [MenuItem("CONTEXT/VoxelMesh/Save VoxelMesh...")] public static void SaveMeshInPlace(MenuCommand menuCommand) { VoxelMesh vm = menuCommand.context as VoxelMesh; SaveVoxelStruct(vm); } public static void SaveVoxelStruct(VoxelMesh vm) { string path = EditorUtility.SaveFilePanel("Save Separate Mesh Asset", "Assets/MeshStruct/", "", "vxl"); //Homemade extension if (string.IsNullOrEmpty(path)) return; path = FileUtil.GetProjectRelativePath(path); // Create a file to write to. using (BinaryWriter bw = new BinaryWriter(File.Open(path, FileMode.Create))) { bw.Write(vm.Mesh.Width); bw.Write(vm.Mesh.Height); bw.Write(vm.Mesh.Depth); //bw.Write(vm.Mesh.Start); //bw.Write(vm.Mesh.End); for(int w=0; w< vm.Mesh.Width; w++) { for(int h=0; h<vm.Mesh.Height; h++) { for(int d=0; d<vm.Mesh.Depth; d++) { bw.Write(w); bw.Write(h); bw.Write(d); bw.Write(vm.Mesh[w, h, d].r); bw.Write(vm.Mesh[w, h, d].g); bw.Write(vm.Mesh[w, h, d].b); bw.Write(vm.Mesh[w, h, d].a); } } } bw.Close(); } } }
using UnityEditor; using UnityEngine; using System.Collections; using System.Collections.Generic; using System.IO; using org.rnp.voxel.unity.components.meshes; public static class VoxelSaverEditor { [MenuItem("CONTEXT/VoxelMesh/Save VoxelMesh...")] public static void SaveMeshInPlace(MenuCommand menuCommand) { VoxelMesh vm = menuCommand.context as VoxelMesh; SaveVoxelStruct(vm); } public static void SaveVoxelStruct(VoxelMesh vm) { string path = EditorUtility.SaveFilePanel("Save Separate Mesh Asset", "Assets/MeshStruct/", "", "vxl"); //Homemade extension if (string.IsNullOrEmpty(path)) return; path = FileUtil.GetProjectRelativePath(path); // Create a file to write to. using (FileStream fs = File.Create(path)) { fs.WriteByte((byte)vm.Mesh.Width); fs.WriteByte((byte)vm.Mesh.Height); fs.WriteByte((byte)vm.Mesh.Depth); //fs.WriteByte((byte)vm.Mesh.Start); //fs.WriteByte((byte)vm.Mesh.End); for(int w=0; w< vm.Mesh.Width; w++) { for(int h=0; h<vm.Mesh.Height; h++) { for(int d=0; d<vm.Mesh.Depth; d++) { fs.WriteByte((byte)w); fs.WriteByte((byte)h); fs.WriteByte((byte)d); fs.WriteByte((byte)vm.Mesh[w, h, d].r); fs.WriteByte((byte)vm.Mesh[w, h, d].g); fs.WriteByte((byte)vm.Mesh[w, h, d].b); fs.WriteByte((byte)vm.Mesh[w, h, d].a); } } } fs.Close(); } } }
apache-2.0
C#
a18483264002421e88b91d2e85de87fc504b3ca1
Make the example html.cshtml a little more relevant
amaitland/CefSharp.Owin,amaitland/CefSharp.Owin
CefSharp.Owin.Example.Wpf/Views/Home.cshtml
CefSharp.Owin.Example.Wpf/Views/Home.cshtml
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CefSharp.Own.Example.Wpf</title> </head> <body> <header> <h1>@Model.Text</h1> </header> <section> <h2>CefSharp + OWIN + Nancy + Razor</h2> <ul> <li>No network requests are made, just in memory requests to the OWIN pipeline</li> <li>CefSharp.Owin has no reference to OWIN, just the known Func type that it uses</li> <li>This request was rendered using Nancy and the Razor view engine</li> <li>TODO</li> </ul> </section> </body> </html>
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CefSharp.Own.Example.Wpf</title> </head> <body> <header> <h1>@Model.Text</h1> </header> <section> <h2>Backlog</h2> <ul class="bugs" id="backlog"> <li>a bug</li> </ul> </section> <section> <h2>Working</h2> <ul class="bugs" id="working"> <li>a bug</li> </ul> </section> <section> <h2>Done</h2> <ul class="bugs" id="done"> <li>a bug</li> </ul> </section> </body> </html>
mit
C#
73eec3b9343e5e3ede94034303d18077d1a19c40
Initialize CommandDispatcher with a list of commands
appharbor/appharbor-cli
src/AppHarbor/CommandDispatcher.cs
src/AppHarbor/CommandDispatcher.cs
using System.Collections.Generic; namespace AppHarbor { public class CommandDispatcher { private readonly IEnumerable<ICommand> _commands; public CommandDispatcher(IEnumerable<ICommand> commands) { _commands = commands; } } }
namespace AppHarbor { public class CommandDispatcher { public CommandDispatcher() { } } }
mit
C#
268f909930396b01aacf8bb88d357b3d59ad5cd7
Remove unnecessary null coalescing
ppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,ppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,peppy/osu-framework,peppy/osu-framework
osu.Framework/Graphics/Textures/ArrayPoolTextureUpload.cs
osu.Framework/Graphics/Textures/ArrayPoolTextureUpload.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.Buffers; using osu.Framework.Graphics.Primitives; using osuTK.Graphics.ES30; using SixLabors.ImageSharp.PixelFormats; namespace osu.Framework.Graphics.Textures { public class ArrayPoolTextureUpload : ITextureUpload { private readonly ArrayPool<Rgba32> arrayPool; private readonly Rgba32[] data; /// <summary> /// Create an empty raw texture with an efficient shared memory backing. /// </summary> /// <param name="width">The width of the texture.</param> /// <param name="height">The height of the texture.</param> /// <param name="arrayPool">The source pool to retrieve memory from. Shared default is used if null.</param> public ArrayPoolTextureUpload(int width, int height, ArrayPool<Rgba32> arrayPool = null) { data = (this.arrayPool = ArrayPool<Rgba32>.Shared).Rent(width * height); } public void Dispose() { arrayPool.Return(data); } public Span<Rgba32> RawData => data; public ReadOnlySpan<Rgba32> Data => data; public int Level { get; set; } public virtual PixelFormat Format => PixelFormat.Rgba; public RectangleI Bounds { get; set; } } }
// 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.Buffers; using osu.Framework.Graphics.Primitives; using osuTK.Graphics.ES30; using SixLabors.ImageSharp.PixelFormats; namespace osu.Framework.Graphics.Textures { public class ArrayPoolTextureUpload : ITextureUpload { private readonly ArrayPool<Rgba32> arrayPool; private readonly Rgba32[] data; /// <summary> /// Create an empty raw texture with an efficient shared memory backing. /// </summary> /// <param name="width">The width of the texture.</param> /// <param name="height">The height of the texture.</param> /// <param name="arrayPool">The source pool to retrieve memory from. Shared default is used if null.</param> public ArrayPoolTextureUpload(int width, int height, ArrayPool<Rgba32> arrayPool = null) { data = (this.arrayPool ??= ArrayPool<Rgba32>.Shared).Rent(width * height); } public void Dispose() { arrayPool.Return(data); } public Span<Rgba32> RawData => data; public ReadOnlySpan<Rgba32> Data => data; public int Level { get; set; } public virtual PixelFormat Format => PixelFormat.Rgba; public RectangleI Bounds { get; set; } } }
mit
C#
9810ec14f16d262c3b9750a723168f0d9a90338a
Drop unused field
DanielRose/GitVersion,GeertvanHorrik/GitVersion,onovotny/GitVersion,MarkZuber/GitVersion,Philo/GitVersion,JakeGinnivan/GitVersion,distantcam/GitVersion,pascalberger/GitVersion,dpurge/GitVersion,GitTools/GitVersion,ParticularLabs/GitVersion,onovotny/GitVersion,pascalberger/GitVersion,asbjornu/GitVersion,Kantis/GitVersion,gep13/GitVersion,gep13/GitVersion,dazinator/GitVersion,openkas/GitVersion,ermshiperete/GitVersion,dpurge/GitVersion,pascalberger/GitVersion,dpurge/GitVersion,RaphHaddad/GitVersion,FireHost/GitVersion,dpurge/GitVersion,GeertvanHorrik/GitVersion,anobleperson/GitVersion,JakeGinnivan/GitVersion,dazinator/GitVersion,orjan/GitVersion,alexhardwicke/GitVersion,ParticularLabs/GitVersion,orjan/GitVersion,ermshiperete/GitVersion,ermshiperete/GitVersion,distantcam/GitVersion,onovotny/GitVersion,anobleperson/GitVersion,JakeGinnivan/GitVersion,asbjornu/GitVersion,DanielRose/GitVersion,FireHost/GitVersion,RaphHaddad/GitVersion,GitTools/GitVersion,alexhardwicke/GitVersion,JakeGinnivan/GitVersion,TomGillen/GitVersion,Philo/GitVersion,TomGillen/GitVersion,openkas/GitVersion,Kantis/GitVersion,MarkZuber/GitVersion,DanielRose/GitVersion,anobleperson/GitVersion,Kantis/GitVersion,ermshiperete/GitVersion
GitFlowVersion/VersionForDirectoryFinder.cs
GitFlowVersion/VersionForDirectoryFinder.cs
namespace GitFlowVersion { using LibGit2Sharp; public class VersionForRepositoryFinder { public VersionAndBranch GetVersion(Repository repository) { var gitFlowVersionFinder = new GitVersionFinder(); return gitFlowVersionFinder.FindVersion(new GitVersionContext { CurrentBranch = repository.Head, Repository = repository }); } } }
namespace GitFlowVersion { using LibGit2Sharp; public class VersionForRepositoryFinder { public SemanticVersion SemanticVersion; public VersionAndBranch GetVersion(Repository repository) { var gitFlowVersionFinder = new GitVersionFinder(); return gitFlowVersionFinder.FindVersion(new GitVersionContext { CurrentBranch = repository.Head, Repository = repository }); } } }
mit
C#
8560b0350a8d5b178234b4e11111f8eeaf1876a0
bump version to 2.4.3.0
dwmkerr/sharpgl,Nuclearfossil/sharpgl
source/SharpGL/SharedAssemblyInfo.cs
source/SharpGL/SharedAssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Dave Kerr")] [assembly: AssemblyProduct("SharpGL")] [assembly: AssemblyCopyright("Copyright © Dave Kerr 2019")] // 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.3.0")] [assembly: AssemblyFileVersion("2.4.3.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Dave Kerr")] [assembly: AssemblyProduct("SharpGL")] [assembly: AssemblyCopyright("Copyright © Dave Kerr 2019")] // 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.1.2")] [assembly: AssemblyFileVersion("2.4.1.2")]
mit
C#
4fa74b70b31e4356c84e0182628f41cf56d6a3d7
Change name.
JornWildt/Elfisk.ECS,JornWildt/Elfisk.ECS
Elfisk.ECS.Core/Components/NameComponent.cs
Elfisk.ECS.Core/Components/NameComponent.cs
namespace Elfisk.ECS.Core.Components { public class NamedComponent : Component { public string Name { get; set; } public NamedComponent(EntityId entityId, string name) : base(entityId) { Name = name; } public override string ToString() { return $"Name: {Name}"; } } }
namespace Elfisk.ECS.Core.Components { public class NameComponent : Component { public string Name { get; set; } public NameComponent(EntityId entityId, string name) : base(entityId) { Name = name; } public override string ToString() { return $"Name: {Name}"; } } }
mit
C#
fee45ec74cbbae690937005279f8aeed31bd0064
Rename MiddlewareFunc to MidFunc (idiomatic!)
wtilton/Nancy,Crisfole/Nancy,malikdiarra/Nancy,dbabox/Nancy,dbabox/Nancy,VQComms/Nancy,murador/Nancy,hitesh97/Nancy,danbarua/Nancy,blairconrad/Nancy,felipeleusin/Nancy,guodf/Nancy,tareq-s/Nancy,anton-gogolev/Nancy,AlexPuiu/Nancy,khellang/Nancy,thecodejunkie/Nancy,tparnell8/Nancy,ccellar/Nancy,Worthaboutapig/Nancy,fly19890211/Nancy,dbabox/Nancy,asbjornu/Nancy,AlexPuiu/Nancy,davidallyoung/Nancy,MetSystem/Nancy,jeff-pang/Nancy,NancyFx/Nancy,charleypeng/Nancy,blairconrad/Nancy,JoeStead/Nancy,jmptrader/Nancy,charleypeng/Nancy,thecodejunkie/Nancy,jmptrader/Nancy,jchannon/Nancy,tparnell8/Nancy,Worthaboutapig/Nancy,NancyFx/Nancy,murador/Nancy,danbarua/Nancy,jmptrader/Nancy,tparnell8/Nancy,malikdiarra/Nancy,Novakov/Nancy,MetSystem/Nancy,murador/Nancy,EliotJones/NancyTest,khellang/Nancy,AlexPuiu/Nancy,AcklenAvenue/Nancy,jeff-pang/Nancy,jonathanfoster/Nancy,ayoung/Nancy,AIexandr/Nancy,thecodejunkie/Nancy,duszekmestre/Nancy,ayoung/Nancy,daniellor/Nancy,SaveTrees/Nancy,Novakov/Nancy,damianh/Nancy,joebuschmann/Nancy,jchannon/Nancy,VQComms/Nancy,SaveTrees/Nancy,AcklenAvenue/Nancy,dbolkensteyn/Nancy,nicklv/Nancy,sadiqhirani/Nancy,sroylance/Nancy,MetSystem/Nancy,jongleur1983/Nancy,jongleur1983/Nancy,tareq-s/Nancy,jchannon/Nancy,joebuschmann/Nancy,rudygt/Nancy,phillip-haydon/Nancy,tareq-s/Nancy,asbjornu/Nancy,jchannon/Nancy,vladlopes/Nancy,jchannon/Nancy,albertjan/Nancy,lijunle/Nancy,blairconrad/Nancy,grumpydev/Nancy,ccellar/Nancy,tsdl2013/Nancy,albertjan/Nancy,ayoung/Nancy,NancyFx/Nancy,AcklenAvenue/Nancy,daniellor/Nancy,albertjan/Nancy,horsdal/Nancy,adamhathcock/Nancy,guodf/Nancy,VQComms/Nancy,xt0rted/Nancy,danbarua/Nancy,EliotJones/NancyTest,vladlopes/Nancy,thecodejunkie/Nancy,danbarua/Nancy,SaveTrees/Nancy,anton-gogolev/Nancy,nicklv/Nancy,davidallyoung/Nancy,sroylance/Nancy,damianh/Nancy,davidallyoung/Nancy,NancyFx/Nancy,SaveTrees/Nancy,cgourlay/Nancy,EIrwin/Nancy,cgourlay/Nancy,jongleur1983/Nancy,dbolkensteyn/Nancy,fly19890211/Nancy,adamhathcock/Nancy,JoeStead/Nancy,blairconrad/Nancy,phillip-haydon/Nancy,duszekmestre/Nancy,rudygt/Nancy,vladlopes/Nancy,charleypeng/Nancy,AIexandr/Nancy,malikdiarra/Nancy,lijunle/Nancy,Novakov/Nancy,felipeleusin/Nancy,Crisfole/Nancy,horsdal/Nancy,ccellar/Nancy,davidallyoung/Nancy,cgourlay/Nancy,ccellar/Nancy,joebuschmann/Nancy,adamhathcock/Nancy,phillip-haydon/Nancy,charleypeng/Nancy,Crisfole/Nancy,felipeleusin/Nancy,khellang/Nancy,EliotJones/NancyTest,jonathanfoster/Nancy,murador/Nancy,jeff-pang/Nancy,sloncho/Nancy,Worthaboutapig/Nancy,daniellor/Nancy,grumpydev/Nancy,VQComms/Nancy,sadiqhirani/Nancy,daniellor/Nancy,anton-gogolev/Nancy,sroylance/Nancy,tsdl2013/Nancy,wtilton/Nancy,AIexandr/Nancy,damianh/Nancy,nicklv/Nancy,lijunle/Nancy,VQComms/Nancy,EIrwin/Nancy,sadiqhirani/Nancy,tparnell8/Nancy,felipeleusin/Nancy,AlexPuiu/Nancy,lijunle/Nancy,guodf/Nancy,sroylance/Nancy,jonathanfoster/Nancy,Novakov/Nancy,sloncho/Nancy,MetSystem/Nancy,khellang/Nancy,malikdiarra/Nancy,cgourlay/Nancy,JoeStead/Nancy,vladlopes/Nancy,EIrwin/Nancy,grumpydev/Nancy,xt0rted/Nancy,wtilton/Nancy,duszekmestre/Nancy,xt0rted/Nancy,tsdl2013/Nancy,AcklenAvenue/Nancy,sloncho/Nancy,rudygt/Nancy,tsdl2013/Nancy,hitesh97/Nancy,guodf/Nancy,duszekmestre/Nancy,wtilton/Nancy,sadiqhirani/Nancy,tareq-s/Nancy,Worthaboutapig/Nancy,asbjornu/Nancy,dbolkensteyn/Nancy,hitesh97/Nancy,AIexandr/Nancy,hitesh97/Nancy,joebuschmann/Nancy,AIexandr/Nancy,EliotJones/NancyTest,albertjan/Nancy,jmptrader/Nancy,davidallyoung/Nancy,asbjornu/Nancy,EIrwin/Nancy,jonathanfoster/Nancy,adamhathcock/Nancy,sloncho/Nancy,dbolkensteyn/Nancy,rudygt/Nancy,xt0rted/Nancy,jeff-pang/Nancy,horsdal/Nancy,JoeStead/Nancy,phillip-haydon/Nancy,grumpydev/Nancy,fly19890211/Nancy,horsdal/Nancy,nicklv/Nancy,charleypeng/Nancy,dbabox/Nancy,anton-gogolev/Nancy,asbjornu/Nancy,ayoung/Nancy,fly19890211/Nancy,jongleur1983/Nancy
src/Nancy/Owin/DelegateExtensions.cs
src/Nancy/Owin/DelegateExtensions.cs
namespace Nancy.Owin { using System; using AppFunc = System.Func< System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>; using MidFunc = System.Func< System.Func< System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>, System.Func< System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>>; /// <summary> /// OWIN extensions for the delegate-based approach. /// </summary> public static class DelegateExtensions { /// <summary> /// Adds Nancy to the OWIN pipeline. /// </summary> /// <param name="builder">The application builder delegate.</param> /// <param name="action">A configuration builder action.</param> /// <returns>The application builder delegate.</returns> public static Action<MidFunc> UseNancy(this Action<MidFunc> builder, Action<NancyOptions> action) { var options = new NancyOptions(); action(options); return builder.UseNancy(options); } /// <summary> /// Adds Nancy to the OWIN pipeline. /// </summary> /// <param name="builder">The application builder delegate.</param> /// <param name="options">The Nancy options.</param> /// <returns>The application builder delegate.</returns> public static Action<MidFunc> UseNancy(this Action<MidFunc> builder, NancyOptions options = null) { var nancyOptions = options ?? new NancyOptions(); builder(NancyMiddleware.UseNancy(nancyOptions).Invoke); return builder; } } }
namespace Nancy.Owin { using System; using AppFunc = System.Func< System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>; using MiddlewareFunc = System.Func< System.Func< System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>, System.Func< System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>>; /// <summary> /// OWIN extensions for the delegate-based approach. /// </summary> public static class DelegateExtensions { /// <summary> /// Adds Nancy to the OWIN pipeline. /// </summary> /// <param name="builder">The application builder delegate.</param> /// <param name="action">A configuration builder action.</param> /// <returns>The application builder delegate.</returns> public static Action<MiddlewareFunc> UseNancy(this Action<MiddlewareFunc> builder, Action<NancyOptions> action) { var options = new NancyOptions(); action(options); return builder.UseNancy(options); } /// <summary> /// Adds Nancy to the OWIN pipeline. /// </summary> /// <param name="builder">The application builder delegate.</param> /// <param name="options">The Nancy options.</param> /// <returns>The application builder delegate.</returns> public static Action<MiddlewareFunc> UseNancy(this Action<MiddlewareFunc> builder, NancyOptions options = null) { var nancyOptions = options ?? new NancyOptions(); builder(next => new NancyMiddleware(next, nancyOptions).Invoke); return builder; } } }
mit
C#
62e02b319ac4d9bf84374af55bb437686e6585d5
Include URI in DataPackage when sharing a skin
lmadhavan/lol-handbook
LolHandbook/Pages/ChampionSkinsPage.xaml.cs
LolHandbook/Pages/ChampionSkinsPage.xaml.cs
using DataDragon; using LolHandbook.ViewModels; using System; using System.Collections.Generic; using Windows.ApplicationModel.DataTransfer; using Windows.Storage.Streams; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; namespace LolHandbook.Pages { public sealed partial class ChampionSkinsPage : Page, ISupportSharing { public ChampionSkinsPage() { this.InitializeComponent(); } private ChampionSkinsViewModel ViewModel => DataContext as ChampionSkinsViewModel; protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is IList<ChampionSkin>) { ViewModel.Skins = (IList<ChampionSkin>)e.Parameter; } } public void OnDataRequested(DataRequest request) { request.Data.Properties.Title = ViewModel.CurrentSkinName; request.Data.SetUri(ViewModel.CurrentSkinUri); DataRequestDeferral deferral = request.GetDeferral(); try { string filename = ViewModel.CurrentSkinName + ".jpg"; Uri uri = ViewModel.CurrentSkinUri; RandomAccessStreamReference streamReference = RandomAccessStreamReference.CreateFromUri(uri); request.Data.Properties.Thumbnail = streamReference; request.Data.SetBitmap(streamReference); } finally { deferral.Complete(); } } private void Share_Click(object sender, RoutedEventArgs e) { DataTransferManager.ShowShareUI(); } } }
using DataDragon; using LolHandbook.ViewModels; using System; using System.Collections.Generic; using Windows.ApplicationModel.DataTransfer; using Windows.Storage.Streams; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; namespace LolHandbook.Pages { public sealed partial class ChampionSkinsPage : Page, ISupportSharing { public ChampionSkinsPage() { this.InitializeComponent(); } private ChampionSkinsViewModel ViewModel => DataContext as ChampionSkinsViewModel; protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is IList<ChampionSkin>) { ViewModel.Skins = (IList<ChampionSkin>)e.Parameter; } } public void OnDataRequested(DataRequest request) { request.Data.Properties.Title = ViewModel.CurrentSkinName; DataRequestDeferral deferral = request.GetDeferral(); try { string filename = ViewModel.CurrentSkinName + ".jpg"; Uri uri = ViewModel.CurrentSkinUri; RandomAccessStreamReference streamReference = RandomAccessStreamReference.CreateFromUri(uri); request.Data.Properties.Thumbnail = streamReference; request.Data.SetBitmap(streamReference); } finally { deferral.Complete(); } } private void Share_Click(object sender, RoutedEventArgs e) { DataTransferManager.ShowShareUI(); } } }
mit
C#
4d676e3920cfc3a0402dc19a3f5a457f35a1404b
Bump Assembly version.
mskcc/Medidata.RWS.NET,mskcc/Medidata.RWS.NET
Medidata.RWS.NET/Properties/AssemblyInfo.cs
Medidata.RWS.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("Medidata.RWS.NET")] [assembly: AssemblyDescription("Provides classes that can be serialized to and deserialized from CDISC ODM (Operational Data Model) XML, and a fluent interface to Medidata RAVE Web Services.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MSKCC")] [assembly: AssemblyProduct("Medidata.RWS.NET")] [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("5dd385a9-f93e-457f-99bf-c70ef5ccd8c5")] // 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.3.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("Medidata.RWS.NET")] [assembly: AssemblyDescription("Provides classes that can be serialized to and deserialized from CDISC ODM (Operational Data Model) XML, and a fluent interface to Medidata RAVE Web Services.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MSKCC")] [assembly: AssemblyProduct("Medidata.RWS.NET")] [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("5dd385a9-f93e-457f-99bf-c70ef5ccd8c5")] // 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.2.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
877d8cdce2573d86d43a316cd1628c25a16f6091
Update test case to suit test data
wongjiahau/TTAP-UTAR,wongjiahau/TTAP-UTAR
NUnit.Tests2/Test_StartDateEndDateFinder.cs
NUnit.Tests2/Test_StartDateEndDateFinder.cs
using NUnit.Framework; using System; using System.IO; using Time_Table_Arranging_Program; using Time_Table_Arranging_Program.Class; namespace NUnit.Tests2 { [TestFixture] public class Test_StartDateEndDateFinder { string input = Helper.RawStringOfTestFile("SampleData-FAM-2017-2ndSem.html"); [Test] public void Test_1() { var parser = new StartDateEndDateFinder(input); Assert.True(parser.GetStartDate() == new DateTime(2017 , 10 , 16 , 0 , 0 , 0)); Assert.True(parser.GetEndDate() == new DateTime(2017 , 12 , 3 , 0 , 0 , 0)); } } }
using NUnit.Framework; using System; using System.IO; using Time_Table_Arranging_Program; using Time_Table_Arranging_Program.Class; namespace NUnit.Tests2 { [TestFixture] public class Test_StartDateEndDateFinder { string input = Helper.RawStringOfTestFile("SampleData-FAM-2017-2ndSem.html"); [Test] public void Test_1() { var parser = new StartDateEndDateFinder(input); Assert.True(parser.GetStartDate() == new DateTime(2017 , 5 , 29 , 0 , 0 , 0)); Assert.True(parser.GetEndDate() == new DateTime(2017 , 9 , 3 , 0 , 0 , 0)); } } }
agpl-3.0
C#
a153bc00bcb9092700bd536874df4cfadb076c3f
Use indented json formatting in json content formatter
bit-foundation/bit-framework,bit-foundation/bit-framework,bit-foundation/bit-framework,bit-foundation/bit-framework
src/Server/Bit.Owin/Implementations/DefaultJsonContentFormatter.cs
src/Server/Bit.Owin/Implementations/DefaultJsonContentFormatter.cs
using Bit.Core.Contracts; using Newtonsoft.Json; namespace Bit.Owin.Implementations { public class DefaultJsonContentFormatter : IContentFormatter { private static IContentFormatter _current; public static IContentFormatter Current { get { if (_current == null) _current = new DefaultJsonContentFormatter(); return _current; } set => _current = value; } public virtual T DeSerialize<T>(string objAsStr) { return JsonConvert.DeserializeObject<T>(objAsStr, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore, DateFormatHandling = DateFormatHandling.IsoDateFormat, TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple, TypeNameHandling = TypeNameHandling.All }); } public virtual string Serialize<T>(T obj) { return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore, DateFormatHandling = DateFormatHandling.IsoDateFormat, Formatting = Formatting.Indented }); } } }
using Bit.Core.Contracts; using Newtonsoft.Json; namespace Bit.Owin.Implementations { public class DefaultJsonContentFormatter : IContentFormatter { private static IContentFormatter _current; public static IContentFormatter Current { get { if (_current == null) _current = new DefaultJsonContentFormatter(); return _current; } set => _current = value; } public virtual T DeSerialize<T>(string objAsStr) { return JsonConvert.DeserializeObject<T>(objAsStr, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore, DateFormatHandling = DateFormatHandling.IsoDateFormat, TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple, TypeNameHandling = TypeNameHandling.All }); } public virtual string Serialize<T>(T obj) { return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore, DateFormatHandling = DateFormatHandling.IsoDateFormat }); } } }
mit
C#
14e5853f63aa029897de1c76d132c43851187f57
fix mapp regression tests
charlenni/Mapsui,charlenni/Mapsui
Samples/Mapsui.Samples.Common/AllSamples.cs
Samples/Mapsui.Samples.Common/AllSamples.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using Mapsui.Logging; namespace Mapsui.Samples.Common { public static class AllSamples { public static IEnumerable<ISample> GetSamples() { var type = typeof(ISample); var assemblies = AppDomain.CurrentDomain.GetAssemblies() .Where(a => a.FullName.StartsWith("Mapsui")); try { return (assemblies? .SelectMany(s => s.GetTypes()) .Where(p => type.IsAssignableFrom(p) && !p.IsInterface && !p.IsAbstract) .Select(Activator.CreateInstance)).Where(f => f is not null).OfType<ISample>() .OrderBy(s => s?.Name) .ThenBy(s => s?.Category) .ToList(); } catch (ReflectionTypeLoadException ex) { var sb = new StringBuilder(); foreach (var exSub in ex.LoaderExceptions) { sb.AppendLine(exSub.Message); if (exSub is FileNotFoundException exFileNotFound) { if (!string.IsNullOrEmpty(exFileNotFound.FusionLog)) { sb.AppendLine("Fusion Log:"); sb.AppendLine(exFileNotFound.FusionLog); } } sb.AppendLine(); } Logger.Log(LogLevel.Error, sb.ToString(), ex); } return new List<ISample>(); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using Mapsui.Logging; namespace Mapsui.Samples.Common { public static class AllSamples { public static IEnumerable<ISample> GetSamples() { var type = typeof(ISample); var assemblies = AppDomain.CurrentDomain.GetAssemblies() .Where(a => a.FullName.StartsWith("Mapsui")); try { return (assemblies? .SelectMany(s => s.GetTypes()) .Where(p => type.IsAssignableFrom(p) && !p.IsInterface) .Select(Activator.CreateInstance)).Where(f => f is not null).OfType<ISample>() .OrderBy(s => s?.Name) .ThenBy(s => s?.Category) .ToList(); } catch (ReflectionTypeLoadException ex) { var sb = new StringBuilder(); foreach (var exSub in ex.LoaderExceptions) { sb.AppendLine(exSub.Message); if (exSub is FileNotFoundException exFileNotFound) { if (!string.IsNullOrEmpty(exFileNotFound.FusionLog)) { sb.AppendLine("Fusion Log:"); sb.AppendLine(exFileNotFound.FusionLog); } } sb.AppendLine(); } Logger.Log(LogLevel.Error, sb.ToString(), ex); } return new List<ISample>(); } } }
mit
C#
982569f1e1cde4d14580a2b8ecb03b4c68522928
Remove dungeons in AdjustPos (#2463)
LtRipley36706/ACE,ACEmulator/ACE,ACEmulator/ACE,LtRipley36706/ACE,ACEmulator/ACE,LtRipley36706/ACE
Source/ACE.Server/Physics/Util/AdjustPos.cs
Source/ACE.Server/Physics/Util/AdjustPos.cs
using System.Collections.Generic; using System.Numerics; using ACE.Entity; namespace ACE.Server.Physics.Util { /// <summary> /// Some dungeons require position adjustments, as well as cell adjustments /// </summary> public class AdjustPos { public static Dictionary<uint, AdjustPosProfile> DungeonProfiles; static AdjustPos() { DungeonProfiles = new Dictionary<uint, AdjustPosProfile>(); // Burial Temple // No longer needed as of 11/24/19 //var burialTemple = new AdjustPosProfile(); //burialTemple.BadPosition = new Vector3(30.389999f, -37.439999f, 0.000000f); //burialTemple.BadRotation = new Quaternion(-0f, 0, 0, -1f); //burialTemple.GoodPosition = new Vector3(30f, -146.30799865723f, 0.0049999998882413f); //burialTemple.GoodRotation = new Quaternion(1, 0, 0, 0); //DungeonProfiles.Add(0x13e, burialTemple); // No longer needed as of 11/24/19 // North Glenden Prison // No longer needed as of 09/22/19 //var glendenPrison = new AdjustPosProfile(); //glendenPrison.BadPosition = new Vector3(38.400002f, -18.600000f, 6.000000f); //glendenPrison.BadRotation = new Quaternion(-0.782608f, 0, 0, -0.622514f); //glendenPrison.GoodPosition = new Vector3(61, -20, -17.995000839233f); //glendenPrison.GoodRotation = new Quaternion(-0.70710700750351f, 0, 0, -0.70710700750351f); //DungeonProfiles.Add(0x1e4, glendenPrison); // No longer needed as of 09/22/19 // Nuhmudira's Dungeon // No longer needed as of 11/24/19 //var nuhmudirasDungeon = new AdjustPosProfile(); //nuhmudirasDungeon.BadPosition = new Vector3(149.242996f, -49.946301f, -5.995000f); //nuhmudirasDungeon.BadRotation = new Quaternion(-0.707107f, 0, 0, -0.707107f); //nuhmudirasDungeon.GoodPosition = new Vector3(149.24299621582f, -129.94599914551f, -5.9949998855591f); //nuhmudirasDungeon.GoodRotation = new Quaternion(0.6967059969902f, 0, 0, 0.71735697984695f); //DungeonProfiles.Add(0x536d, nuhmudirasDungeon); // No longer needed as of 11/24/19 } public static bool Adjust(uint dungeonID, Position pos) { if (!DungeonProfiles.TryGetValue(dungeonID, out var profile)) return false; pos.Pos += profile.GoodPosition - profile.BadPosition; //pos.Rotation *= profile.GoodRotation * Quaternion.Inverse(profile.BadRotation); return true; } } }
using System.Collections.Generic; using System.Numerics; using ACE.Entity; namespace ACE.Server.Physics.Util { /// <summary> /// Some dungeons require position adjustments, as well as cell adjustments /// </summary> public class AdjustPos { public static Dictionary<uint, AdjustPosProfile> DungeonProfiles; static AdjustPos() { DungeonProfiles = new Dictionary<uint, AdjustPosProfile>(); // Burial Temple var burialTemple = new AdjustPosProfile(); burialTemple.BadPosition = new Vector3(30.389999f, -37.439999f, 0.000000f); burialTemple.BadRotation = new Quaternion(-0f, 0, 0, -1f); burialTemple.GoodPosition = new Vector3(30f, -146.30799865723f, 0.0049999998882413f); burialTemple.GoodRotation = new Quaternion(1, 0, 0, 0); DungeonProfiles.Add(0x13e, burialTemple); // Nuhmudira's Dungeon var nuhmudirasDungeon = new AdjustPosProfile(); nuhmudirasDungeon.BadPosition = new Vector3(149.242996f, -49.946301f, -5.995000f); nuhmudirasDungeon.BadRotation = new Quaternion(-0.707107f, 0, 0, -0.707107f); nuhmudirasDungeon.GoodPosition = new Vector3(149.24299621582f, -129.94599914551f, -5.9949998855591f); nuhmudirasDungeon.GoodRotation = new Quaternion(0.6967059969902f, 0, 0, 0.71735697984695f); DungeonProfiles.Add(0x536d, nuhmudirasDungeon); } public static bool Adjust(uint dungeonID, Position pos) { if (!DungeonProfiles.TryGetValue(dungeonID, out var profile)) return false; pos.Pos += profile.GoodPosition - profile.BadPosition; //pos.Rotation *= profile.GoodRotation * Quaternion.Inverse(profile.BadRotation); return true; } } }
agpl-3.0
C#
b13e6fd4425d14c934d4e8fecd2bab987bc4fcf6
Improve test to avoid potential race condition
Microsoft/ApplicationInsights-SDK-Labs
WCF/Shared.Tests/Integration/OneWayTests.cs
WCF/Shared.Tests/Integration/OneWayTests.cs
using Microsoft.ApplicationInsights.DataContracts; using Microsoft.ApplicationInsights.Wcf.Tests.Channels; using Microsoft.ApplicationInsights.Wcf.Tests.Service; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Linq; namespace Microsoft.ApplicationInsights.Wcf.Tests.Integration { [TestClass] public class OneWayTests { [TestMethod] [TestCategory("Integration"), TestCategory("One-Way")] public void SuccessfulOneWayCallGeneratesRequestEvent() { TestTelemetryChannel.Clear(); using ( var host = new HostingContext<OneWayService, IOneWayService>() ) { host.Open(); IOneWayService client = host.GetChannel(); client.SuccessfullOneWayCall(); } var req = TestTelemetryChannel.CollectedData() .FirstOrDefault(x => x is RequestTelemetry); Assert.IsNotNull(req); } [TestMethod] [TestCategory("Integration"), TestCategory("One-Way")] public void FailedOneWayCallGeneratesExceptionEvent() { TestTelemetryChannel.Clear(); var host = new HostingContext<OneWayService, IOneWayService>() .ExpectFailure().ShouldWaitForCompletion(); using ( host ) { host.Open(); IOneWayService client = host.GetChannel(); try { client.FailureOneWayCall(); } catch { } } var req = TestTelemetryChannel.CollectedData() .FirstOrDefault(x => x is ExceptionTelemetry); Assert.IsNotNull(req); } } }
using Microsoft.ApplicationInsights.DataContracts; using Microsoft.ApplicationInsights.Wcf.Tests.Channels; using Microsoft.ApplicationInsights.Wcf.Tests.Service; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Linq; namespace Microsoft.ApplicationInsights.Wcf.Tests.Integration { [TestClass] public class OneWayTests { [TestMethod] [TestCategory("Integration"), TestCategory("One-Way")] public void SuccessfulOneWayCallGeneratesRequestEvent() { TestTelemetryChannel.Clear(); using ( var host = new HostingContext<OneWayService, IOneWayService>() ) { host.Open(); IOneWayService client = host.GetChannel(); client.SuccessfullOneWayCall(); } var req = TestTelemetryChannel.CollectedData() .FirstOrDefault(x => x is RequestTelemetry); Assert.IsNotNull(req); } [TestMethod] [TestCategory("Integration"), TestCategory("One-Way")] public void FailedOneWayCallGeneratesExceptionEvent() { TestTelemetryChannel.Clear(); var host = new HostingContext<OneWayService, IOneWayService>() .ExpectFailure(); using ( host ) { host.Open(); IOneWayService client = host.GetChannel(); try { client.FailureOneWayCall(); } catch { } } var req = TestTelemetryChannel.CollectedData() .FirstOrDefault(x => x is ExceptionTelemetry); Assert.IsNotNull(req); } } }
mit
C#
7a54a670464af8f42aaae4515614cea8b10bfd88
add newline on hr when no "real" console is attached
michaelschnyder/StyleCopCmd
StyleCopCmd/Reporter/ConsoleReporter.cs
StyleCopCmd/Reporter/ConsoleReporter.cs
using System; using StyleCopCmd.Core; using StyleCopCmd.Reader; namespace StyleCopCmd.Reporter { public class ConsoleReporter : StyleCopIssueReporter { private readonly int windowWidth = 150; private readonly bool hasConsole = false; public ConsoleReporter() { try { if (Console.CursorVisible) { this.windowWidth = Console.WindowWidth; this.hasConsole = true; } } catch (Exception) { } } public override void Report(string message) { Console.WriteLine(message); } public override void ProjectAdded(CsProject project) { Console.WriteLine("Added Project '{0}' and its files ({1}) for validation.", project.AssemblyName, project.Files.Count); } public override void Started() { Console.Write(string.Empty.PadRight(this.windowWidth).Replace(' ', '-')); } public override void Completed(ExecutionResult result, string tempFileName) { this.ConsoleHorizontalLine(); Console.WriteLine("Errors: {0}", result.ErrorsCount); Console.WriteLine("Warnings: {0}", result.WarningsCount); } private void ConsoleHorizontalLine() { string line = string.Empty.PadRight(this.windowWidth).Replace(' ', '-'); if (this.hasConsole) { Console.Write(line); } else { Console.WriteLine(line); } } } }
using System; using StyleCopCmd.Core; using StyleCopCmd.Reader; namespace StyleCopCmd.Reporter { public class ConsoleReporter : StyleCopIssueReporter { private int windowWidth = 150; public ConsoleReporter() { try { if (Console.CursorVisible) { this.windowWidth = Console.WindowWidth; } } catch (Exception) { } } public override void Report(string message) { Console.WriteLine(message); } public override void ProjectAdded(CsProject project) { Console.WriteLine("Added Project '{0}' and its files ({1}) for validation.", project.AssemblyName, project.Files.Count); } public override void Started() { Console.Write(string.Empty.PadRight(this.windowWidth).Replace(' ', '-')); } public override void Completed(ExecutionResult result, string tempFileName) { Console.Write(string.Empty.PadRight(this.windowWidth).Replace(' ', '-')); Console.WriteLine("Errors: {0}", result.ErrorsCount); Console.WriteLine("Warnings: {0}", result.WarningsCount); } } }
mit
C#
f533226fb54ff3e70ee4771934505778d4800b7a
Remove unused variable
Chess-Variants-Training/Chess-Variants-Training,Chess-Variants-Training/Chess-Variants-Training,Chess-Variants-Training/Chess-Variants-Training
src/AtomicChessPuzzles/DbRepositories/PuzzleRepository.cs
src/AtomicChessPuzzles/DbRepositories/PuzzleRepository.cs
using AtomicChessPuzzles.Models; using MongoDB.Bson; using MongoDB.Driver; using System; using System.Linq; namespace AtomicChessPuzzles.DbRepositories { public class PuzzleRepository : IPuzzleRepository { MongoSettings settings; IMongoCollection<Puzzle> puzzleCollection; public PuzzleRepository() { settings = new MongoSettings(); GetCollection(); } private void GetCollection() { MongoClient client = new MongoClient(); puzzleCollection = client.GetDatabase(settings.Database).GetCollection<Puzzle>(settings.PuzzleCollectionName); } public bool Add(Puzzle puzzle) { var found = puzzleCollection.Find(new BsonDocument("_id", new BsonString(puzzle.ID))); if (found != null && found.Any()) return false; try { puzzleCollection.InsertOne(puzzle); } catch (Exception e) when (e is MongoWriteException || e is MongoBulkWriteException) { return false; } return true; } public Puzzle Get(string id) { var found = puzzleCollection.Find(new BsonDocument("_id", new BsonString(id))); if (found == null) return null; return found.FirstOrDefault(); } public Puzzle GetOneRandomly() { long count = puzzleCollection.Count(new BsonDocument()); if (count < 1) return null; return puzzleCollection.Find(new BsonDocument()).FirstOrDefault(); } public DeleteResult Remove(string id) { return puzzleCollection.DeleteOne(new BsonDocument("_id", new BsonString(id))); } public DeleteResult RemoveAllBy(string author) { return puzzleCollection.DeleteMany(new BsonDocument("author", new BsonString(author))); } } }
using AtomicChessPuzzles.Models; using MongoDB.Bson; using MongoDB.Driver; using System; using System.Linq; namespace AtomicChessPuzzles.DbRepositories { public class PuzzleRepository : IPuzzleRepository { MongoSettings settings; IMongoCollection<Puzzle> puzzleCollection; Random rnd; public PuzzleRepository() { settings = new MongoSettings(); rnd = new Random(); GetCollection(); } private void GetCollection() { MongoClient client = new MongoClient(); puzzleCollection = client.GetDatabase(settings.Database).GetCollection<Puzzle>(settings.PuzzleCollectionName); } public bool Add(Puzzle puzzle) { var found = puzzleCollection.Find(new BsonDocument("_id", new BsonString(puzzle.ID))); if (found != null && found.Any()) return false; try { puzzleCollection.InsertOne(puzzle); } catch (Exception e) when (e is MongoWriteException || e is MongoBulkWriteException) { return false; } return true; } public Puzzle Get(string id) { var found = puzzleCollection.Find(new BsonDocument("_id", new BsonString(id))); if (found == null) return null; return found.FirstOrDefault(); } public Puzzle GetOneRandomly() { long count = puzzleCollection.Count(new BsonDocument()); if (count < 1) return null; return puzzleCollection.Find(new BsonDocument()).FirstOrDefault(); } public DeleteResult Remove(string id) { return puzzleCollection.DeleteOne(new BsonDocument("_id", new BsonString(id))); } public DeleteResult RemoveAllBy(string author) { return puzzleCollection.DeleteMany(new BsonDocument("author", new BsonString(author))); } } }
agpl-3.0
C#
97d8d76114ee1e9b3bebb7fca47b42d2676976f5
Remove database caching of EightBallResponses in GamesService.
Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW
src/MitternachtBot/Modules/Games/Services/GamesService.cs
src/MitternachtBot/Modules/Games/Services/GamesService.cs
using System; using System.Collections.Concurrent; using System.Linq; using System.Threading; using Mitternacht.Modules.Games.Common; using Mitternacht.Services; namespace Mitternacht.Modules.Games.Services { public class GamesService : IMService { private readonly IBotConfigProvider _bcp; public readonly ConcurrentDictionary<ulong, GirlRating> GirlRatings = new ConcurrentDictionary<ulong, GirlRating>(); public string[] EightBallResponses => _bcp.BotConfig.EightBallResponses.Select(ebr => ebr.Text).ToArray(); public readonly string TypingArticlesPath = "data/typing_articles2.json"; public GamesService(IBotConfigProvider bcp) { _bcp = bcp; var timer = new Timer(_ => { GirlRatings.Clear(); }, null, TimeSpan.FromDays(1), TimeSpan.FromDays(1)); } } }
using System; using System.Collections.Concurrent; using System.Collections.Immutable; using System.Linq; using System.Threading; using Mitternacht.Modules.Games.Common; using Mitternacht.Services; namespace Mitternacht.Modules.Games.Services { public class GamesService : IMService { private readonly IBotConfigProvider _bcp; public readonly ConcurrentDictionary<ulong, GirlRating> GirlRatings = new ConcurrentDictionary<ulong, GirlRating>(); public readonly ImmutableArray<string> EightBallResponses; public readonly string TypingArticlesPath = "data/typing_articles2.json"; public GamesService(IBotConfigProvider bcp) { _bcp = bcp; EightBallResponses = _bcp.BotConfig.EightBallResponses.Select(ebr => ebr.Text).ToImmutableArray(); var timer = new Timer(_ => { GirlRatings.Clear(); }, null, TimeSpan.FromDays(1), TimeSpan.FromDays(1)); } } }
mit
C#
2663f135d7ea104b85dc10b642e52ba2369fb353
Fix build break.
chromium/vs-chromium,chromium/vs-chromium,chromium/vs-chromium,chromium/vs-chromium
src/Server/FileSystemDatabase/IFileContentsMemoization.cs
src/Server/FileSystemDatabase/IFileContentsMemoization.cs
// Copyright 2014 The Chromium 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 VsChromium.Server.FileSystemContents; using VsChromium.Server.FileSystemNames; namespace VsChromium.Server.FileSystemDatabase { interface IFileContentsMemoization { /// <summary> /// Returns the unique instance of <see cref="FileContents"/> identical /// to the passed in <paramref name="fileContents"/>. /// </summary> FileContents Get(FileName fileName, FileContents fileContents); int Count { get; } } }
// Copyright 2014 The Chromium 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 VsChromium.Server.FileSystemContents; using VsChromium.Server.FileSystemNames; namespace VsChromium.Server.FileSystemDatabase { interface IFileContentsMemoization { /// <summary> /// Returns the unique instance of <see cref="FileContents"/> identical /// to the passed in <paramref name="fileContents"/>. /// </summary> FileContents Get(FileName fileName, FileContents fileContents); } }
bsd-3-clause
C#
b240ed88b9456ff8f811b8f91341793eff171a60
Add default macOS install location
droyad/Assent
src/Assent/Reporters/DiffPrograms/VsCodeDiffProgram.cs
src/Assent/Reporters/DiffPrograms/VsCodeDiffProgram.cs
using System; using System.Collections.Generic; using System.Linq; namespace Assent.Reporters.DiffPrograms { public class VsCodeDiffProgram : DiffProgramBase { static VsCodeDiffProgram() { var paths = new List<string>(); if (DiffReporter.IsWindows) { paths.AddRange(WindowsProgramFilePaths .Select(p => $@"{p}\Microsoft VS Code\Code.exe") .ToArray()); } else { paths.Add("/usr/local/bin/code"); paths.Add("/usr/bin/code"); paths.Add("/snap/bin/code"); paths.Add("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"); } DefaultSearchPaths = paths; } public static readonly IReadOnlyList<string> DefaultSearchPaths; public VsCodeDiffProgram() : base(DefaultSearchPaths) { } public VsCodeDiffProgram(IReadOnlyList<string> searchPaths) : base(searchPaths) { } protected override string CreateProcessStartArgs(string receivedFile, string approvedFile) { return $"--diff --wait --new-window \"{receivedFile}\" \"{approvedFile}\""; } } }
using System; using System.Collections.Generic; using System.Linq; namespace Assent.Reporters.DiffPrograms { public class VsCodeDiffProgram : DiffProgramBase { static VsCodeDiffProgram() { var paths = new List<string>(); if (DiffReporter.IsWindows) { paths.AddRange(WindowsProgramFilePaths .Select(p => $@"{p}\Microsoft VS Code\Code.exe") .ToArray()); } else { paths.Add("/usr/local/bin/code"); paths.Add("/usr/bin/code"); paths.Add("/snap/bin/code"); } DefaultSearchPaths = paths; } public static readonly IReadOnlyList<string> DefaultSearchPaths; public VsCodeDiffProgram() : base(DefaultSearchPaths) { } public VsCodeDiffProgram(IReadOnlyList<string> searchPaths) : base(searchPaths) { } protected override string CreateProcessStartArgs(string receivedFile, string approvedFile) { return $"--diff --wait --new-window \"{receivedFile}\" \"{approvedFile}\""; } } }
mit
C#
d43813a024784e32d3faed90c5e02143edb70f18
add a failing test for testing build
nunit/nunit,OmicronPersei/nunit,NikolayPianikov/nunit,pflugs30/nunit,jnm2/nunit,jadarnel27/nunit,nivanov1984/nunit,pcalin/nunit,Green-Bug/nunit,JohanO/nunit,JohanO/nunit,appel1/nunit,jnm2/nunit,Suremaker/nunit,ChrisMaddock/nunit,agray/nunit,agray/nunit,agray/nunit,appel1/nunit,Suremaker/nunit,danielmarbach/nunit,pflugs30/nunit,danielmarbach/nunit,JustinRChou/nunit,nunit/nunit,ggeurts/nunit,jadarnel27/nunit,acco32/nunit,acco32/nunit,mikkelbu/nunit,cPetru/nunit-params,nivanov1984/nunit,pcalin/nunit,pcalin/nunit,danielmarbach/nunit,ChrisMaddock/nunit,Green-Bug/nunit,JohanO/nunit,OmicronPersei/nunit,Green-Bug/nunit,cPetru/nunit-params,acco32/nunit,JustinRChou/nunit,mikkelbu/nunit,ggeurts/nunit,mjedrzejek/nunit,NikolayPianikov/nunit,mjedrzejek/nunit
src/NUnitFramework/tests/Assertions/AssertPassTests.cs
src/NUnitFramework/tests/Assertions/AssertPassTests.cs
// *********************************************************************** // Copyright (c) 2009 Charlie Poole // // 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 NUnit.Framework.Assertions { [TestFixture] public class AssertPassTests { [Test] public void ThrowsSuccessException() { Assert.That( () => Assert.Pass(), Throws.TypeOf<SuccessException>()); } [Test] public void ThrowsSuccessExceptionWithMessage() { Assert.That( () => Assert.Pass("MESSAGE"), Throws.TypeOf<SuccessException>().With.Message.EqualTo("MESSAGE")); } [Test] public void ThrowsSuccessExceptionWithMessageAndArgs() { Assert.That( () => Assert.Pass("MESSAGE: {0}+{1}={2}", 2, 2, 4), Throws.TypeOf<SuccessException>().With.Message.EqualTo("MESSAGE: 2+2=4")); } [Test] public void AssertPassReturnsSuccess() { Assert.Pass("This test is OK!"); } [Test] public void FailingTestForTestingBuild() { Assert.Fail("Fail the build"); } [Test] public void SubsequentFailureIsIrrelevant() { Assert.Pass("This test is OK!"); Assert.Fail("No it's NOT!"); } } }
// *********************************************************************** // Copyright (c) 2009 Charlie Poole // // 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 NUnit.Framework.Assertions { [TestFixture] public class AssertPassTests { [Test] public void ThrowsSuccessException() { Assert.That( () => Assert.Pass(), Throws.TypeOf<SuccessException>()); } [Test] public void ThrowsSuccessExceptionWithMessage() { Assert.That( () => Assert.Pass("MESSAGE"), Throws.TypeOf<SuccessException>().With.Message.EqualTo("MESSAGE")); } [Test] public void ThrowsSuccessExceptionWithMessageAndArgs() { Assert.That( () => Assert.Pass("MESSAGE: {0}+{1}={2}", 2, 2, 4), Throws.TypeOf<SuccessException>().With.Message.EqualTo("MESSAGE: 2+2=4")); } [Test] public void AssertPassReturnsSuccess() { Assert.Pass("This test is OK!"); } [Test] public void SubsequentFailureIsIrrelevant() { Assert.Pass("This test is OK!"); Assert.Fail("No it's NOT!"); } } }
mit
C#
42e3ba819c5e6909a448817e5e76294a24dc899e
Throw an exception if InnerResolve returns null
Fody/PropertyChanged,user1568891/PropertyChanged
PropertyChanged.Fody/TypeResolver.cs
PropertyChanged.Fody/TypeResolver.cs
using System; using System.Collections.Generic; using Mono.Cecil; public partial class ModuleWeaver { Dictionary<string, TypeDefinition> definitions = new Dictionary<string, TypeDefinition>(); public TypeDefinition Resolve(TypeReference reference) { TypeDefinition definition; if (definitions.TryGetValue(reference.FullName, out definition)) { return definition; } return definitions[reference.FullName] = InnerResolve(reference); } static TypeDefinition InnerResolve(TypeReference reference) { TypeDefinition result = null; try { result = reference.Resolve(); } catch (Exception exception) { throw new Exception($"Could not resolve '{reference.FullName}'.", exception); } if(result == null) { throw new Exception($"Could not resolve '{reference.FullName}'."); } return result; } }
using System; using System.Collections.Generic; using Mono.Cecil; public partial class ModuleWeaver { Dictionary<string, TypeDefinition> definitions = new Dictionary<string, TypeDefinition>(); public TypeDefinition Resolve(TypeReference reference) { TypeDefinition definition; if (definitions.TryGetValue(reference.FullName, out definition)) { return definition; } return definitions[reference.FullName] = InnerResolve(reference); } static TypeDefinition InnerResolve(TypeReference reference) { try { return reference.Resolve(); } catch (Exception exception) { throw new Exception($"Could not resolve '{reference.FullName}'.", exception); } } }
mit
C#
976145f97d048a14c626d68cbd9262723b0bac41
update version
ceee/ReadSharp,alexeib/ReadSharp
ReadSharp/Properties/AssemblyInfo.cs
ReadSharp/Properties/AssemblyInfo.cs
using System.Reflection; // 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("ReadSharp")] [assembly: AssemblyDescription("Extract meaningful website contents using a port of NReadability")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("cee")] [assembly: AssemblyProduct("ReadSharp")] [assembly: AssemblyCopyright("Copyright © cee 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 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.1.0")] [assembly: AssemblyFileVersion("6.1.0")]
using System.Reflection; // 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("ReadSharp")] [assembly: AssemblyDescription("Extract meaningful website contents using a port of NReadability")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("cee")] [assembly: AssemblyProduct("ReadSharp")] [assembly: AssemblyCopyright("Copyright © cee 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 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.0.0")] [assembly: AssemblyFileVersion("6.0.0")]
mit
C#
2deafeff0f9d7af66096693f1d4b39d028a1573f
remove unused locator
Intelliflo/JustSaying,Intelliflo/JustSaying,eric-davis/JustSaying
JustEat.Simples.NotificationStack/Lookups/IPublishEndpointProvider.cs
JustEat.Simples.NotificationStack/Lookups/IPublishEndpointProvider.cs
using System; using JustEat.Simples.NotificationStack.Messaging; namespace JustEat.Simples.NotificationStack.Stack.Lookups { public interface IPublishEndpointProvider { string GetLocationName(string location); } public class SnsPublishEndpointProvider : IPublishEndpointProvider { private readonly IMessagingConfig _config; public SnsPublishEndpointProvider(IMessagingConfig config) { _config = config; } public string GetLocationName(string location) { return String.Join("-", new[] { _config.Tenant, _config.Environment, location }).ToLower(); } } }
using System; using JustEat.Simples.NotificationStack.Messaging; namespace JustEat.Simples.NotificationStack.Stack.Lookups { public interface IPublishEndpointProvider { string GetLocationEndpoint(string location); string GetLocationName(string location); } public class SnsPublishEndpointProvider : IPublishEndpointProvider { private readonly IMessagingConfig _config; public SnsPublishEndpointProvider(IMessagingConfig config) { _config = config; } public string GetLocationEndpoint(string location) { throw new NotImplementedException("Not implemented yet. Come back later"); //// Eventually this should come from the Settings API (having been published somewhere by the create process). //switch (location) //{ // case NotificationTopic.OrderDispatch: // return "arn:aws:sns:eu-west-1:507204202721:uk-qa12-order-dispatch"; // case NotificationTopic.CustomerCommunication: // return "arn:aws:sns:eu-west-1:507204202721:uk-qa12-customer-order-communication"; //} //throw new IndexOutOfRangeException("There is no endpoint defined for the provided location type"); } public string GetLocationName(string location) { return String.Join("-", new[] { _config.Tenant, _config.Environment, location }).ToLower(); } } }
apache-2.0
C#
51fcb19c364e2bded12799fc70cc54a1daa80a6c
add new stops
jmrnilsson/efpad,jmrnilsson/efpad,jmrnilsson/efpad,jmrnilsson/efpad
Scaffold/Program.cs
Scaffold/Program.cs
using System; using System.Linq; using System.Diagnostics; using System.Collections.Generic; using Microsoft.Data.Entity; namespace Scaffold { public class Program { public static void Main() { using (var db = new blogContext()) { Console.WriteLine("Starting..."); var stopWatch = new Stopwatch(); stopWatch.Start(); var expression = from b in db.Blog join p in db.Post on b.BlogId equals p.BlogId select new {b.Url, p.Title, p.Content}; long interpret = stopWatch.ElapsedTicks; var items = expression.ToList(); long read = stopWatch.ElapsedTicks; var filtered = items.Where(i => i.Url == "768aea71-c405-4808-b1e6-150692142875").ToList(); long scan = stopWatch.ElapsedTicks; var firstable = filtered.First(); long first = stopWatch.ElapsedTicks; var five = filtered[5]; stopWatch.Stop(); foreach(var item in filtered) { Console.WriteLine("{0} - {1} - {2}", item.Url, item.Title, item.Content); } const double kμ = 0.001; Console.WriteLine(); Console.WriteLine("Read {0} records in {1:N0} μs", items.Count(), (read - interpret) * kμ); Console.WriteLine("Assigned expression in {0:N0} μs", interpret * kμ); Console.WriteLine("Scan in {0:N0} μs", (scan - read) * kμ); Console.WriteLine("Enumerate next in {0:N0} μs", (first - scan) * kμ); Console.WriteLine("Index 5 in {0:N2} μs", (stopWatch.ElapsedTicks - first) * kμ); Console.WriteLine("Total time was {0:N0} μs", stopWatch.ElapsedTicks * kμ); } } } }
using System; using System.Linq; using System.Diagnostics; using System.Collections.Generic; using Microsoft.Data.Entity; namespace Scaffold { public class Program { public static void Main() { using (var db = new blogContext()) { Console.WriteLine("Starting..."); var stopWatch = new Stopwatch(); stopWatch.Start(); var expression = from b in db.Blog join p in db.Post on b.BlogId equals p.BlogId select new {b.Url, p.Title, p.Content}; long interpret = stopWatch.ElapsedTicks; var items = expression.ToList(); long read = stopWatch.ElapsedTicks; var filtered = items.Where(i => i.Url == "768aea71-c405-4808-b1e6-150692142875").ToList(); long scan = stopWatch.ElapsedTicks; var first = filtered.First(); stopWatch.Stop(); foreach(var item in filtered) { Console.WriteLine("{0} - {1} - {2}", item.Url, item.Title, item.Content); } const double kμ = 0.001; Console.WriteLine(); Console.WriteLine("Read {0} records in {1:N0} μs", items.Count(), (read - interpret) * kμ); Console.WriteLine("Assigned expression in {0:N0} μs", interpret * kμ); Console.WriteLine("Scan in {0:N0} μs", (scan - read) * kμ); Console.WriteLine("Enumerate next in {0:N0} μs", (stopWatch.ElapsedTicks - scan) * kμ); Console.WriteLine("Total time was {0:N0} μs", stopWatch.ElapsedTicks * kμ); } } } }
mit
C#
f24938416991ad6d7747fc2368e3077fde665a5a
fix typo in Guard
perrich/Hangfire.MemoryStorage
src/Hangfire.MemoryStorage/Utilities/Guard.cs
src/Hangfire.MemoryStorage/Utilities/Guard.cs
using System; namespace Hangfire.MemoryStorage.Utilities { public static class Guard { public static void ArgumentNotNull(object argument, string name) { if (argument == null) throw new ArgumentException("Argument " + name + " should not be null!"); } public static void ArgumentCondition(bool condition, string name, string message) { if (condition) throw new ArgumentException(message); } } }
using System; namespace Hangfire.MemoryStorage.Utilities { public static class Guard { public static void ArgumentNotNull(object argument, string name) { if (argument == null) throw new ArgumentException("Argment " + name + " should not be null!"); } public static void ArgumentCondition(bool condition, string name, string message) { if (condition) throw new ArgumentException(message); } } }
apache-2.0
C#
7a00c5fc09cb2d52188ab6d39c373b2de79cbd11
Increase size since we add something to the max. 20 chars coming from the request.
jp7677/hellocoreclr,jp7677/hellocoreclr,jp7677/hellocoreclr,jp7677/hellocoreclr
src/HelloCoreClrApp/Data/Entities/Greeting.cs
src/HelloCoreClrApp/Data/Entities/Greeting.cs
using System; using System.ComponentModel.DataAnnotations; namespace HelloCoreClrApp.Data.Entities { public class Greeting { [Key] public Guid GreetingId { get; set; } [Required] [MaxLength(30)] public string Name { get; set; } [Required] public DateTime TimestampUtc { get; set; } } }
using System; using System.ComponentModel.DataAnnotations; namespace HelloCoreClrApp.Data.Entities { public class Greeting { [Key] public Guid GreetingId { get; set; } [Required] [MaxLength(20)] public string Name { get; set; } [Required] public DateTime TimestampUtc { get; set; } } }
mit
C#
3ac50aad29e059165ca199e58c927de7017a2531
Add JsonBody extension method so that you can send a json body request
tparnell8/Nancy,charleypeng/Nancy,murador/Nancy,fly19890211/Nancy,sadiqhirani/Nancy,duszekmestre/Nancy,dbabox/Nancy,Novakov/Nancy,Worthaboutapig/Nancy,sroylance/Nancy,sloncho/Nancy,VQComms/Nancy,jongleur1983/Nancy,ayoung/Nancy,hitesh97/Nancy,SaveTrees/Nancy,adamhathcock/Nancy,duszekmestre/Nancy,vladlopes/Nancy,dbolkensteyn/Nancy,AIexandr/Nancy,AcklenAvenue/Nancy,tsdl2013/Nancy,thecodejunkie/Nancy,Crisfole/Nancy,rudygt/Nancy,horsdal/Nancy,dbolkensteyn/Nancy,guodf/Nancy,ccellar/Nancy,danbarua/Nancy,AIexandr/Nancy,Crisfole/Nancy,khellang/Nancy,AlexPuiu/Nancy,JoeStead/Nancy,hitesh97/Nancy,wtilton/Nancy,EliotJones/NancyTest,dbabox/Nancy,xt0rted/Nancy,JoeStead/Nancy,danbarua/Nancy,asbjornu/Nancy,damianh/Nancy,duszekmestre/Nancy,AcklenAvenue/Nancy,davidallyoung/Nancy,xt0rted/Nancy,vladlopes/Nancy,nicklv/Nancy,nicklv/Nancy,phillip-haydon/Nancy,jongleur1983/Nancy,jchannon/Nancy,JoeStead/Nancy,VQComms/Nancy,jeff-pang/Nancy,tparnell8/Nancy,jmptrader/Nancy,wtilton/Nancy,wtilton/Nancy,jchannon/Nancy,daniellor/Nancy,AIexandr/Nancy,jonathanfoster/Nancy,NancyFx/Nancy,albertjan/Nancy,jchannon/Nancy,blairconrad/Nancy,grumpydev/Nancy,blairconrad/Nancy,anton-gogolev/Nancy,sroylance/Nancy,Worthaboutapig/Nancy,xt0rted/Nancy,felipeleusin/Nancy,VQComms/Nancy,cgourlay/Nancy,Novakov/Nancy,charleypeng/Nancy,EliotJones/NancyTest,adamhathcock/Nancy,jeff-pang/Nancy,EliotJones/NancyTest,Novakov/Nancy,asbjornu/Nancy,ccellar/Nancy,ayoung/Nancy,davidallyoung/Nancy,cgourlay/Nancy,NancyFx/Nancy,rudygt/Nancy,AIexandr/Nancy,MetSystem/Nancy,ccellar/Nancy,murador/Nancy,anton-gogolev/Nancy,thecodejunkie/Nancy,dbabox/Nancy,SaveTrees/Nancy,khellang/Nancy,felipeleusin/Nancy,dbabox/Nancy,jonathanfoster/Nancy,felipeleusin/Nancy,asbjornu/Nancy,albertjan/Nancy,SaveTrees/Nancy,albertjan/Nancy,guodf/Nancy,damianh/Nancy,anton-gogolev/Nancy,felipeleusin/Nancy,sloncho/Nancy,hitesh97/Nancy,charleypeng/Nancy,rudygt/Nancy,joebuschmann/Nancy,horsdal/Nancy,xt0rted/Nancy,vladlopes/Nancy,ccellar/Nancy,grumpydev/Nancy,MetSystem/Nancy,charleypeng/Nancy,thecodejunkie/Nancy,jongleur1983/Nancy,joebuschmann/Nancy,VQComms/Nancy,tareq-s/Nancy,cgourlay/Nancy,EIrwin/Nancy,grumpydev/Nancy,phillip-haydon/Nancy,jmptrader/Nancy,MetSystem/Nancy,NancyFx/Nancy,tareq-s/Nancy,adamhathcock/Nancy,jmptrader/Nancy,fly19890211/Nancy,tparnell8/Nancy,jeff-pang/Nancy,malikdiarra/Nancy,murador/Nancy,AcklenAvenue/Nancy,AlexPuiu/Nancy,dbolkensteyn/Nancy,tparnell8/Nancy,tsdl2013/Nancy,SaveTrees/Nancy,damianh/Nancy,horsdal/Nancy,blairconrad/Nancy,jonathanfoster/Nancy,lijunle/Nancy,wtilton/Nancy,fly19890211/Nancy,sadiqhirani/Nancy,sroylance/Nancy,khellang/Nancy,MetSystem/Nancy,davidallyoung/Nancy,phillip-haydon/Nancy,ayoung/Nancy,davidallyoung/Nancy,jchannon/Nancy,joebuschmann/Nancy,Worthaboutapig/Nancy,malikdiarra/Nancy,jongleur1983/Nancy,adamhathcock/Nancy,asbjornu/Nancy,nicklv/Nancy,vladlopes/Nancy,sloncho/Nancy,JoeStead/Nancy,sadiqhirani/Nancy,sloncho/Nancy,dbolkensteyn/Nancy,hitesh97/Nancy,albertjan/Nancy,joebuschmann/Nancy,horsdal/Nancy,phillip-haydon/Nancy,khellang/Nancy,jmptrader/Nancy,sadiqhirani/Nancy,lijunle/Nancy,tareq-s/Nancy,EIrwin/Nancy,asbjornu/Nancy,Crisfole/Nancy,davidallyoung/Nancy,AIexandr/Nancy,kekekeks/Nancy,danbarua/Nancy,malikdiarra/Nancy,daniellor/Nancy,EliotJones/NancyTest,lijunle/Nancy,VQComms/Nancy,fly19890211/Nancy,jeff-pang/Nancy,ayoung/Nancy,tsdl2013/Nancy,grumpydev/Nancy,tsdl2013/Nancy,rudygt/Nancy,EIrwin/Nancy,EIrwin/Nancy,lijunle/Nancy,AlexPuiu/Nancy,Novakov/Nancy,nicklv/Nancy,jchannon/Nancy,thecodejunkie/Nancy,kekekeks/Nancy,danbarua/Nancy,guodf/Nancy,anton-gogolev/Nancy,duszekmestre/Nancy,AlexPuiu/Nancy,daniellor/Nancy,guodf/Nancy,NancyFx/Nancy,Worthaboutapig/Nancy,daniellor/Nancy,jonathanfoster/Nancy,charleypeng/Nancy,murador/Nancy,tareq-s/Nancy,malikdiarra/Nancy,AcklenAvenue/Nancy,sroylance/Nancy,kekekeks/Nancy,blairconrad/Nancy,cgourlay/Nancy
src/Nancy.Testing/BrowserContextExtensions.cs
src/Nancy.Testing/BrowserContextExtensions.cs
namespace Nancy.Testing { using Nancy.Json; /// <summary> /// Defines extensions for the <see cref="BrowserContext"/> type. /// </summary> public static class BrowserContextExtensions { /// <summary> /// Adds a multipart/form-data encoded request body to the <see cref="Browser"/>, using the default boundary name. /// </summary> /// <param name="browserContext">The <see cref="BrowserContext"/> that the data should be added to.</param> /// <param name="multipartFormData">The multipart/form-data encoded data that should be added.</param> public static void MultiPartFormData(this BrowserContext browserContext, BrowserContextMultipartFormData multipartFormData) { MultiPartFormData(browserContext, multipartFormData, BrowserContextMultipartFormData.DefaultBoundaryName); } /// <summary> /// Adds a multipart/form-data encoded request body to the <see cref="Browser"/>. /// </summary> /// <param name="browserContext">The <see cref="BrowserContext"/> that the data should be added to.</param> /// <param name="multipartFormData">The multipart/form-data encoded data that should be added.</param> /// <param name="boundaryName">The name of the boundary to be used</param> public static void MultiPartFormData(this BrowserContext browserContext, BrowserContextMultipartFormData multipartFormData, string boundaryName) { var contextValues = (IBrowserContextValues)browserContext; contextValues.Body = multipartFormData.Body; contextValues.Headers["Content-Type"] = new[] { "multipart/form-data; boundary=" + boundaryName }; } /// <summary> /// Adds a application/json request body to the <see cref="Browser"/>. /// </summary> /// <param name="browserContext">The <see cref="BrowserContext"/> that the data should be added to.</param> /// <param name="model">The model to be serialized to json.</param> public static void JsonBody(this BrowserContext browserContext, object model) { var serializer = new JavaScriptSerializer(); var content = serializer.Serialize(model); browserContext.Body(content); browserContext.Header("Content-Type", "application/json"); } } }
namespace Nancy.Testing { /// <summary> /// Defines extensions for the <see cref="BrowserContext"/> type. /// </summary> public static class BrowserContextExtensions { /// <summary> /// Adds a multipart/form-data encoded request body to the <see cref="Browser"/>, using the default boundary name. /// </summary> /// <param name="browserContext">The <see cref="BrowserContext"/> that the data should be added to.</param> /// <param name="multipartFormData">The multipart/form-data encoded data that should be added.</param> public static void MultiPartFormData(this BrowserContext browserContext, BrowserContextMultipartFormData multipartFormData) { MultiPartFormData(browserContext, multipartFormData, BrowserContextMultipartFormData.DefaultBoundaryName); } /// <summary> /// Adds a multipart/form-data encoded request body to the <see cref="Browser"/>. /// </summary> /// <param name="browserContext">The <see cref="BrowserContext"/> that the data should be added to.</param> /// <param name="multipartFormData">The multipart/form-data encoded data that should be added.</param> /// <param name="boundaryName">The name of the boundary to be used</param> public static void MultiPartFormData(this BrowserContext browserContext, BrowserContextMultipartFormData multipartFormData, string boundaryName) { var contextValues = (IBrowserContextValues)browserContext; contextValues.Body = multipartFormData.Body; contextValues.Headers["Content-Type"] = new[] { "multipart/form-data; boundary=" + boundaryName }; } } }
mit
C#
e2cadb6d0e1b5b2fa47c9f55cef0cabd2e73eb7d
Update ValuesOut.cs
EricZimmerman/RegistryPlugins
RegistryPlugin.LastVisitedMRU/ValuesOut.cs
RegistryPlugin.LastVisitedMRU/ValuesOut.cs
using System; using RegistryPluginBase.Interfaces; namespace RegistryPlugin.LastVisitedMRU { public class ValuesOut:IValueOut { public ValuesOut(string valueName, string executable, string directory, int mruPosition, DateTimeOffset? openedOn) { Executable = executable; Directory = directory; ValueName = valueName; MruPosition = mruPosition; OpenedOn = openedOn?.UtcDateTime; } public string ValueName { get; } public int MruPosition { get; } public string Executable { get; } public string Directory { get; } public DateTime? OpenedOn { get; } public string BatchKeyPath { get; set; } public string BatchValueName { get; set; } public string BatchValueData1 => $"Exe: {Executable} Folder: {Executable} Directory: {Directory}"; public string BatchValueData2 => $"Opened: {OpenedOn?.ToUniversalTime():yyyy-MM-dd HH:mm:ss.fffffff}"; public string BatchValueData3 => $"MRU: {MruPosition}"; } }
using System; using RegistryPluginBase.Interfaces; namespace RegistryPlugin.LastVisitedMRU { public class ValuesOut:IValueOut { public ValuesOut(string valueName, string executable, string directory, int mruPosition, DateTimeOffset? openedOn) { Executable = executable; Directory = directory; ValueName = valueName; MruPosition = mruPosition; OpenedOn = openedOn?.UtcDateTime; } public string ValueName { get; } public int MruPosition { get; } public string Executable { get; } public string Directory { get; } public DateTime? OpenedOn { get; } public string BatchKeyPath { get; set; } public string BatchValueName { get; set; } public string BatchValueData1 => $"Exe: {Executable} Folder: {Executable} Directory: {Directory}"; public string BatchValueData2 => $"Opened: {OpenedOn?.ToUniversalTime():yyyy-MM-dd HH:mm:ss.fffffff})"; public string BatchValueData3 => $"MRU: {MruPosition}"; } }
mit
C#
2fb484abfc2bb1f678b9c7ce8f23c968f8716620
Work begin on program to test different algorithms for shifting arrays
BoykoNeov/SoftUni---Programming-fundamentals-May-2017
ArraysAndlists/RotateArray/RotateArray.cs
ArraysAndlists/RotateArray/RotateArray.cs
// Program for rotating arrays using different Algorithms using System; using System.Linq; public class RotateArray { public static void Main() { // Reads ints from the Console and converts them to an array of ints Console.WriteLine("Please enter array of integers (integers separated by spaces)"); var intArray = Console.ReadLine() .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray(); // Alternative syntaxis without Linq //var intArray = Array.ConvertAll(Console.ReadLine() // .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries), int.Parse); Console.WriteLine("Enter the number of positions to be shifted"); int d = int.Parse(Console.ReadLine()) % intArray.Length; if (d != 0) SubsetRotation(intArray, d); Console.WriteLine(string.Join(" ", intArray)); } public static void SubsetRotation(int[] array, int d) { int arraySubsetsNumber = EuclideanAlgorithm(array.Length, d); for (int i = 0; i < arraySubsetsNumber; i++) { if (arraySubsetsNumber > 1) { ///////////////////// } else { d = Math.Abs(array.Length - d); for (int k = 0; k < array.Length; k++) { int position = (k * d + d) % array.Length; int temp = array[0]; array[0] = array[position]; array[position] = temp; } } } } //Euclidian algorithm to determine the greatest common divisor public static int EuclideanAlgorithm(int m, int n) { m = m % n; if (m == 0) { return n; } else { return EuclideanAlgorithm(n, m); } } }
// Program for rotating arrays using different Algorithms using System; using System.Linq; public class RotateArray { public static void Main() { // Reads ints from the Console and converts them to an array of ints Console.WriteLine("Please enter array of integers (integers separated by spaces)"); var intArray = Console.ReadLine() .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray(); // Alternative syntaxis without Linq //var intArray = Array.ConvertAll(Console.ReadLine() // .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries), int.Parse); } }
mit
C#
cfd6b18e4f7d1e3e68d57e290ef0b8b4bd919e0d
Add BlockSpecificAction.OnBlockSelected event
spaar/automatron-mod,spaar/automatron-mod
Automatron/Actions/BlockSpecificAction.cs
Automatron/Actions/BlockSpecificAction.cs
using System; using spaar.ModLoader; using UnityEngine; namespace spaar.Mods.Automatron.Actions { public delegate void OnBlockSelected(BlockBehaviour block); public abstract class BlockSpecificAction : Action { protected Guid block; protected bool selectingBlock = false; private Rect selectingInfoRect = new Rect(200, 800, 500, 100); private int selectingInfoId = Util.GetWindowID(); protected event OnBlockSelected OnBlockSelected; protected BlockBehaviour GetBlock() { for (int i = 0; i < Machine.Active().BuildingBlocks.Count; i++) { if (Machine.Active().BuildingBlocks[i].Guid == block) { return Machine.Active().Blocks[i]; } } return null; } public override void OnGUI() { base.OnGUI(); if (selectingBlock) { selectingInfoRect = GUI.Window(selectingInfoId, selectingInfoRect, DoSelectingInfoWindow, "Selecting Block"); } } public override void Update() { if (selectingBlock) { if (Input.GetKeyDown(KeyCode.Escape)) { selectingBlock = false; Hide(false); } if (Input.GetMouseButtonDown(1)) // Right click { RaycastHit hit; if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition) , out hit)) { var obj = hit.transform; var b = obj.GetComponent<BlockBehaviour>(); if (b != null) { block = b.Guid; selectingBlock = false; Hide(false); OnBlockSelected?.Invoke(GetBlock()); } } } } } protected void SelectBlock() { Hide(true); selectingBlock = true; } private void DoSelectingInfoWindow(int id) { GUILayout.Label("Select a block by hovering the mouse over it and " + "right-clicking.\nCancel by pressing Escape."); GUI.DragWindow(); } } }
using System; using spaar.ModLoader; using UnityEngine; namespace spaar.Mods.Automatron.Actions { public abstract class BlockSpecificAction : Action { protected Guid block; protected bool selectingBlock = false; private Rect selectingInfoRect = new Rect(200, 800, 500, 100); private int selectingInfoId = Util.GetWindowID(); protected BlockBehaviour GetBlock() { for (int i = 0; i < Machine.Active().BuildingBlocks.Count; i++) { if (Machine.Active().BuildingBlocks[i].Guid == block) { return Machine.Active().Blocks[i]; } } return null; } public override void OnGUI() { base.OnGUI(); if (selectingBlock) { selectingInfoRect = GUI.Window(selectingInfoId, selectingInfoRect, DoSelectingInfoWindow, "Selecting Block"); } } public override void Update() { if (selectingBlock) { if (Input.GetKeyDown(KeyCode.Escape)) { selectingBlock = false; Hide(false); } if (Input.GetMouseButtonDown(1)) // Right click { RaycastHit hit; if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition) , out hit)) { var obj = hit.transform; var b = obj.GetComponent<BlockBehaviour>(); if (b != null) { block = b.Guid; selectingBlock = false; Hide(false); } } } } } protected void SelectBlock() { Hide(true); selectingBlock = true; } private void DoSelectingInfoWindow(int id) { GUILayout.Label("Select a block by hovering the mouse over it and " + "right-clicking.\nCancel by pressing Escape."); GUI.DragWindow(); } } }
mit
C#
15a81a5aecc726cfa78dd6d52c0b8d7dc4a39ac8
Fix links (was copied over from an MVC6 project)
SSkovboiSS/RefactoringEssentials,SSkovboiSS/RefactoringEssentials,olathunberg/RefactoringEssentials,olathunberg/RefactoringEssentials,icsharpcode/RefactoringEssentials,icsharpcode/RefactoringEssentials,cstick/RefactoringEssentials,Rpinski/RefactoringEssentials,Rpinski/RefactoringEssentials,cstick/RefactoringEssentials
CodeConverterWebApp/Views/Shared/_Layout.cshtml
CodeConverterWebApp/Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>@ViewData["Title"] - Code Converter by Refactoring Essentials</title> <link rel="stylesheet" href="~/Content/bootstrap.min.css"/> <link rel="stylesheet" href="~/Content/site.css" /> </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a href="~/" class="navbar-brand">Code Converter</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li><a href="~/">Home</a></li> <li><a href="~/Home/About">About</a></li> </ul> </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; 2015-@DateTime.Now.Year - Code Converter by Refactoring Essentials</p> </footer> </div> <script src="~/Scripts/jquery-2.1.4.min.js"></script> <script src="~/Scripts/bootstrap.min.js"></script> @RenderSection("scripts", required: false) </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>@ViewData["Title"] - Code Converter by Refactoring Essentials</title> <link rel="stylesheet" href="~/Content/bootstrap.min.css"/> <link rel="stylesheet" href="~/Content/site.css" /> </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a asp-controller="Home" asp-action="Index" class="navbar-brand">Code Converter</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li><a asp-controller="Home" asp-action="Index">Home</a></li> <li><a asp-controller="Home" asp-action="About">About</a></li> </ul> </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; 2015-2016 - Code Converter by Refactoring Essentials</p> </footer> </div> <script src="~/Scripts/jquery-2.1.4.min.js"></script> <script src="~/Scripts/bootstrap.min.js"></script> @RenderSection("scripts", required: false) </body> </html>
mit
C#
b30d05074191cf692ae09ca66ce2fbfefb8b7858
Set up page module
VictorNicollet/SocialToolBox
SocialToolBox.Sample.Web/SocialModules.cs
SocialToolBox.Sample.Web/SocialModules.cs
using SocialToolBox.Cms.Page; using SocialToolBox.Core.Database; using SocialToolBox.Core.Entity; using SocialToolBox.Core.Entity.Web; using SocialToolBox.Core.Mocks.Database; using SocialToolBox.Core.Present.Bootstrap3; using SocialToolBox.Core.Present.RenderingStrategy; using SocialToolBox.Core.Web; using SocialToolBox.Crm.Contact; namespace SocialToolBox.Sample.Web { /// <summary> /// All the modules enabled on this project. /// </summary> public sealed class SocialModules { /// <summary> /// The database driver used by all modules. /// </summary> public IDatabaseDriver Database; /// <summary> /// The web driver used for registering actions. /// </summary> public IWebDriver Web; /// <summary> /// CRM Contacts. /// </summary> public readonly ContactModule Contacts; /// <summary> /// Entities (especially entity pages). /// </summary> public readonly EntityModule Entities; /// <summary> /// CMS Pages. /// </summary> public readonly PageModule Pages; /// <summary> /// Registered web endpoints for entity pages. /// </summary> public readonly EntityPageFacet EntityPages; private SocialModules() { Database = new DatabaseDriver(); var renderingStrategy = new NaiveRenderingStrategy<IWebRequest>(new PageNodeRenderer()); Web = new WebDriver(Database, renderingStrategy); // Instantiate all modules Contacts = new ContactModule(Database); Entities = new EntityModule(Database); Pages = new PageModule(Database); // Set up bridges between modules Contacts.RegisterContactsAsEntities(Entities); Pages.RegisterPagesAsEntities(Entities); // Compile all modules, start background thread Contacts.Compile(); Entities.Compile(); Pages.Compile(); Database.Projections.StartBackgroundThread(); // Install facets EntityPages = new EntityPageFacet(Web, Entities); // Initialize modules InitialData.AddTo(this); } public static SocialModules Instance = new SocialModules(); } }
using SocialToolBox.Core.Database; using SocialToolBox.Core.Entity; using SocialToolBox.Core.Entity.Web; using SocialToolBox.Core.Mocks.Database; using SocialToolBox.Core.Present.Bootstrap3; using SocialToolBox.Core.Present.RenderingStrategy; using SocialToolBox.Core.Web; using SocialToolBox.Crm.Contact; namespace SocialToolBox.Sample.Web { /// <summary> /// All the modules enabled on this project. /// </summary> public class SocialModules { /// <summary> /// The database driver used by all modules. /// </summary> public IDatabaseDriver Database; /// <summary> /// The web driver used for registering actions. /// </summary> public IWebDriver Web; /// <summary> /// CRM Contacts. /// </summary> public readonly ContactModule Contacts; /// <summary> /// Entities (especially entity pages). /// </summary> public readonly EntityModule Entities; /// <summary> /// Registered web endpoints for entity pages. /// </summary> public readonly EntityPageFacet EntityPages; private SocialModules() { Database = new DatabaseDriver(); var renderingStrategy = new NaiveRenderingStrategy<IWebRequest>(new PageNodeRenderer()); Web = new WebDriver(Database, renderingStrategy); // Instantiate all modules Contacts = new ContactModule(Database); Entities = new EntityModule(Database); // Set up bridges between modules Contacts.RegisterContactsAsEntities(Entities); // Compile all modules, start background thread Contacts.Compile(); Entities.Compile(); Database.Projections.StartBackgroundThread(); // Install facets EntityPages = new EntityPageFacet(Web, Entities); // Initialize modules InitialData.AddTo(this); } public static SocialModules Instance = new SocialModules(); } }
mit
C#
826ba34281f74bf7825e5fe88483f70d5bdba840
Fix test line endings
martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode
tests/AdventOfCode.Tests/CharacterRecognitionTests.cs
tests/AdventOfCode.Tests/CharacterRecognitionTests.cs
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.AdventOfCode; public static class CharacterRecognitionTests { [Fact] public static void Can_Parse_Characters() { // Arrange string[] letters = { ".**..***...**..****.****..**..*..*..***...**.*..*.*.....**..***..***..*..*.*...*****.", "*..*.*..*.*..*.*....*....*..*.*..*...*.....*.*.*..*....*..*.*..*.*..*.*..*.*...*...*.", "*..*.***..*....***..***..*....****...*.....*.**...*....*..*.*..*.*..*.*..*..*.*...*..", "****.*..*.*....*....*....*.**.*..*...*.....*.*.*..*....*..*.***..***..*..*...*...*...", "*..*.*..*.*..*.*....*....*..*.*..*...*..*..*.*.*..*....*..*.*....*.*..*..*...*..*....", "*..*.***...**..****.*.....***.*..*..***..**..*..*.****..**..*....*..*..**....*..****.", }; // Act string actual = CharacterRecognition.Read(string.Join(Environment.NewLine, letters)); // Assert actual.ShouldBe("ABCEFGHIJKLOPRUYZ"); } }
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.AdventOfCode; public static class CharacterRecognitionTests { [Fact] public static void Can_Parse_Characters() { // Arrange string letters = @" .**..***...**..****.****..**..*..*..***...**.*..*.*.....**..***..***..*..*.*...*****. *..*.*..*.*..*.*....*....*..*.*..*...*.....*.*.*..*....*..*.*..*.*..*.*..*.*...*...*. *..*.***..*....***..***..*....****...*.....*.**...*....*..*.*..*.*..*.*..*..*.*...*.. ****.*..*.*....*....*....*.**.*..*...*.....*.*.*..*....*..*.***..***..*..*...*...*... *..*.*..*.*..*.*....*....*..*.*..*...*..*..*.*.*..*....*..*.*....*.*..*..*...*..*.... *..*.***...**..****.*.....***.*..*..***..**..*..*.****..**..*....*..*..**....*..****. "; // Act string actual = CharacterRecognition.Read(letters.Trim()); // Assert actual.ShouldBe("ABCEFGHIJKLOPRUYZ"); } }
apache-2.0
C#
4c9570dd021fb0af32b3cb0c8a130fb88d07d674
Fix code style issue
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Tests/UnitTests/GUI/CommandInterpreterTest.cs
WalletWasabi.Tests/UnitTests/GUI/CommandInterpreterTest.cs
using Mono.Options; using System.IO; using WalletWasabi.Gui.CommandLine; using Xunit; namespace WalletWasabi.Tests.UnitTests { public class CommandInterpreterTest { [Fact] public async void CommandInterpreterShowsHelpAsync() { var textWriter = new StringWriter(); var c = new CommandInterpreter(textWriter); await c.ExecuteCommandsAsync(new string[] { "wassabee", "--help" }, new Command("mixer"), new Command("findpassword")); Assert.Equal( @"Usage: wassabee [OPTIONS]+ Launches Wasabi Wallet. -h, --help Displays help page and exit. -v, --version Displays Wasabi version and exit. Available commands are: mixer findpassword ", textWriter.ToString()); } } }
using Mono.Options; using System.IO; using WalletWasabi.Gui.CommandLine; using Xunit; namespace WalletWasabi.Tests.UnitTests { public class CommandInterpreterTest { [Fact] public async void CommandInterpreterShowsHelpAsync() { var textWriter = new StringWriter(); var c = new CommandInterpreter(textWriter); await c.ExecuteCommandsAsync(new string[] { "wassabee", "--help" }, new Command("mixer"), new Command("findpassword")); Assert.Equal( @"Usage: wassabee [OPTIONS]+ Launches Wasabi Wallet. -h, --help Displays help page and exit. -v, --version Displays Wasabi version and exit. Available commands are: mixer findpassword ", textWriter.ToString() ); } } }
mit
C#
d9e03e4ed7fcbba3ae0cf07e6ab42fe61a5575af
Fix harmony patch
gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer,DaggerES/LunaMultiPlayer,gavazquez/LunaMultiPlayer
LmpClient/Harmony/OrbitDriver_TrackRigidbody.cs
LmpClient/Harmony/OrbitDriver_TrackRigidbody.cs
using Harmony; using LmpCommon.Enums; // ReSharper disable All namespace LmpClient.Harmony { /// <summary> /// This harmony patch is intended to call TrackRigidbody correctly when the vessel is kinematic /// If you don't run this patch, then the vessels controlled by other players will have an incorrect obt speed. /// This means that when spectating they will shake and when trying to grab a ladder your kerbal will be sent off /// </summary> [HarmonyPatch(typeof(OrbitDriver))] [HarmonyPatch("TrackRigidbody")] public class OrbitDriver_TrackRigidbody { /// <summary> /// For the prefix we set the vessel as NON kinematic if it's controlled / updated by another player so the TrackRigidbody works as expected /// </summary> [HarmonyPrefix] private static void PrefixTrackRigidbody(OrbitDriver __instance, bool __state) { if (MainSystem.NetworkState < ClientState.Connected) return; __state = false; if (__instance.vessel && __instance.vessel.rootPart && __instance.vessel.rootPart.rb && __instance.vessel.rootPart.rb.isKinematic) { __instance.vessel.rootPart.rb.isKinematic = false; __state = true; } } /// <summary> /// After the orbit calculations are done we put the vessel back to kinematic mode if needed /// </summary> [HarmonyPostfix] private static void PostfixTrackRigidbody(OrbitDriver __instance, bool __state) { if (MainSystem.NetworkState < ClientState.Connected) return; if (__instance.vessel && __instance.vessel.rootPart && __instance.vessel.rootPart.rb && !__instance.vessel.rootPart.rb.isKinematic && __state) { __instance.vessel.rootPart.rb.isKinematic = true; } } } }
using Harmony; using LmpCommon.Enums; // ReSharper disable All namespace LmpClient.Harmony { /// <summary> /// This harmony patch is intended to call TrackRigidbody when the vessel is kinematic /// If you don't run this patch, then the vessels controlled by other players will have an incorrect obt speed. /// This means that when spectating they will shake and when trying to grab a ladder your kerbal will be sent off /// </summary> [HarmonyPatch(typeof(OrbitDriver))] [HarmonyPatch("TrackRigidbody")] public class OrbitDriver_TrackRigidbody { [HarmonyPostfix] private static void PostFixTrackRigidbody(OrbitDriver __instance, CelestialBody refBody, double fdtOffset, ref double ___updateUT) { if (MainSystem.NetworkState < ClientState.Connected) return; if (__instance.updateMode == OrbitDriver.UpdateMode.IDLE) return; if (__instance.vessel == null || __instance.vessel.rootPart == null || __instance.vessel.rootPart.rb == null || !__instance.vessel.rootPart.rb.isKinematic) return; ___updateUT += fdtOffset; __instance.vel = __instance.vessel.velocityD.xzy + __instance.orbit.GetRotFrameVelAtPos(__instance.referenceBody, __instance.pos); if (refBody != __instance.referenceBody) { if (__instance.vessel != null) { var vector3d = __instance.vessel.CoMD - refBody.position; __instance.pos = vector3d.xzy; } var frameVel = __instance; frameVel.vel = frameVel.vel + (__instance.referenceBody.GetFrameVel() - refBody.GetFrameVel()); } __instance.lastTrackUT = ___updateUT; __instance.orbit.UpdateFromStateVectors(__instance.pos, __instance.vel, refBody, ___updateUT); __instance.pos.Swizzle(); __instance.vel.Swizzle(); } } }
mit
C#
f7c1a8c7685d1a1aaf8155c419d04ae1c3303fa6
Remove Account from the filter state persistence
Benrnz/BudgetAnalyser
BudgetAnalyser.Engine/Statement/PersistentFiltersV1.cs
BudgetAnalyser.Engine/Statement/PersistentFiltersV1.cs
using System; using Rees.UserInteraction.Contracts; namespace BudgetAnalyser.Engine.Statement { public class PersistentFiltersV1 : IPersistent { public DateTime? BeginDate { get; set; } public DateTime? EndDate { get; set; } public int LoadSequence => 50; } }
using System; using BudgetAnalyser.Engine.BankAccount; using Rees.UserInteraction.Contracts; namespace BudgetAnalyser.Engine.Statement { public class PersistentFiltersV1 : IPersistent { public Account Account { get; set; } public DateTime? BeginDate { get; set; } public DateTime? EndDate { get; set; } public int LoadSequence => 50; } }
mit
C#
77dfb39e8d77678961dd11d7d86d56dafb35d11a
Fix CzechRepublic translations
tinohager/Nager.Date,tinohager/Nager.Date,tinohager/Nager.Date
Src/Nager.Date/PublicHolidays/CzechRepublicProvider.cs
Src/Nager.Date/PublicHolidays/CzechRepublicProvider.cs
using Nager.Date.Model; using System.Collections.Generic; using System.Linq; namespace Nager.Date.PublicHolidays { public class CzechRepublicProvider : CatholicBaseProvider { public override IEnumerable<PublicHoliday> Get(int year) { //Czech Republic //https://en.wikipedia.org/wiki/Public_holidays_in_the_Czech_Republic var countryCode = CountryCode.CZ; var easterSunday = base.EasterSunday(year); var items = new List<PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "Den obnovy samostatného českého státu; Nový rok", "New Year's Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Velký pátek", "Good Friday", countryCode, 2016)); items.Add(new PublicHoliday(easterSunday, "Velikonoční neděle", "Easter Sunday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Velikonoční pondělí", "Easter Monday", countryCode)); items.Add(new PublicHoliday(year, 5, 1, "Svátek práce", "Labour Day", countryCode)); items.Add(new PublicHoliday(year, 5, 8, "Den vítězství - Den osvobození od fašismu", "Liberation Day", countryCode)); items.Add(new PublicHoliday(year, 7, 5, "Den slovanských věrozvěstů Cyrila a Metoděje", "Saints Cyril and Methodius Day", countryCode)); items.Add(new PublicHoliday(year, 7, 6, "Den upálení mistra Jana Husa", "Jan Hus Day", countryCode)); items.Add(new PublicHoliday(year, 9, 28, "Den české státnosti", "St. Wenceslas Day", countryCode)); items.Add(new PublicHoliday(year, 10, 28, "Den vzniku samostatného československého státu", "Independent Czechoslovak State Day", countryCode)); items.Add(new PublicHoliday(year, 11, 17, "Den boje za svobodu a demokracii", "Struggle for Freedom and Democracy Day", countryCode)); items.Add(new PublicHoliday(year, 12, 24, "Štědrý den", "Christmas Eve", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "1. svátek vánoční", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "2. svátek vánoční", "St. Stephen's Day", countryCode)); return items.OrderBy(o => o.Date); } } }
using Nager.Date.Model; using System.Collections.Generic; using System.Linq; namespace Nager.Date.PublicHolidays { public class CzechRepublicProvider : CatholicBaseProvider { public override IEnumerable<PublicHoliday> Get(int year) { //Czech Republic //https://en.wikipedia.org/wiki/Public_holidays_in_the_Czech_Republic var countryCode = CountryCode.CZ; var easterSunday = base.EasterSunday(year); var items = new List<PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "Den obnovy samostatného českého státu; Nový rok", "New Year's Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Velký pátek", "Good Friday", countryCode, 2016)); items.Add(new PublicHoliday(easterSunday, "Velikonoční", "Easter Sunday", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(1), "Velikonoční pondělí", "Easter Monday", countryCode)); items.Add(new PublicHoliday(year, 5, 1, "Svátek práce", "Labour Day", countryCode)); items.Add(new PublicHoliday(year, 5, 8, "Den vítězství or Den osvobození", "Liberation Day", countryCode)); items.Add(new PublicHoliday(year, 7, 5, "Den slovanských věrozvěstů Cyrila a Metoděje", "Saints Cyril and Methodius Day", countryCode)); items.Add(new PublicHoliday(year, 7, 6, "Den upálení mistra Jana Husa", "Jan Hus Day", countryCode)); items.Add(new PublicHoliday(year, 9, 28, "Den české státnosti", "St. Wenceslas Day", countryCode)); items.Add(new PublicHoliday(year, 10, 28, "Den vzniku samostatného československého státu", "Independent Czechoslovak State Day", countryCode)); items.Add(new PublicHoliday(year, 11, 17, "Den boje za svobodu a demokracii", "Struggle for Freedom and Democracy Day", countryCode)); items.Add(new PublicHoliday(year, 12, 24, "Štědrý den", "Christmas Eve", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "1. svátek vánoční", "Christmas Day", countryCode)); items.Add(new PublicHoliday(year, 12, 26, "2. svátek vánoční", "St. Stephen's Day", countryCode)); return items.OrderBy(o => o.Date); } } }
mit
C#
db644786b7424823b37d01410da8c60b102980d5
Add FormatEscaped extension method
arfbtwn/hyena,arfbtwn/hyena,dufoli/hyena,dufoli/hyena,GNOME/hyena,GNOME/hyena
Hyena.Gui/Hyena.Gui/PangoExtensions.cs
Hyena.Gui/Hyena.Gui/PangoExtensions.cs
// // PangoExtensions.cs // // Author: // Aaron Bockover <abockover@novell.com> // // Copyright 2009 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; using System.Linq; using Pango; namespace Hyena.Gui { public static class PangoExtensions { public static int MeasureTextHeight (this FontDescription description, Context context) { return MeasureTextHeight (description, context, context.Language); } public static int MeasureTextHeight (this FontDescription description, Context context, Language language) { using (var metrics = context.GetMetrics (description, language)) { return ((int)(metrics.Ascent + metrics.Descent) + 512) >> 10; // PANGO_PIXELS (d) } } public static string FormatEscaped (this string format, params object [] args) { return String.Format (format, args.Select (a => GLib.Markup.EscapeText (a.ToString ())).ToArray ()); } } }
// // PangoExtensions.cs // // Author: // Aaron Bockover <abockover@novell.com> // // Copyright 2009 Novell, Inc. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; using Pango; namespace Hyena.Gui { public static class PangoExtensions { public static int MeasureTextHeight (this FontDescription description, Context context) { return MeasureTextHeight (description, context, context.Language); } public static int MeasureTextHeight (this FontDescription description, Context context, Language language) { using (var metrics = context.GetMetrics (description, language)) { return ((int)(metrics.Ascent + metrics.Descent) + 512) >> 10; // PANGO_PIXELS (d) } } } }
mit
C#
17342661f2e92d317fcc6533821835c90f01a20c
Create ready branch. Represents the final step before pushing to master. Master branch from now on will be used only for code which is ready for a pull request. Until the pull request is finalized master branch should not be used for further code pushing.
VasilisMerevis/MSolve,VasilisMerevis/MSolve
ISAAR.MSolve.SamplesConsole/Program.cs
ISAAR.MSolve.SamplesConsole/Program.cs
using ISAAR.MSolve.Analyzers; using ISAAR.MSolve.Logging; using ISAAR.MSolve.Matrices; using ISAAR.MSolve.PreProcessor; using ISAAR.MSolve.Problems; using ISAAR.MSolve.Solvers.Skyline; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ISAAR.MSolve.SamplesConsole { class Program { private static void SolveBuildingInNoSoilSmall() { VectorExtensions.AssignTotalAffinityCount(); Model model = new Model(); model.SubdomainsDictionary.Add(1, new Subdomain() { ID = 1 }); BeamBuildingBuilder.MakeBeamBuilding(model, 20, 20, 20, 5, 4, model.NodesDictionary.Count + 1, model.ElementsDictionary.Count + 1, 1, 4, false, false); model.Loads.Add(new Load() { Amount = -100, Node = model.Nodes[21], DOF = DOFType.X }); model.ConnectDataStructures(); SolverSkyline solver = new SolverSkyline(model); ProblemStructural provider = new ProblemStructural(model, solver.SubdomainsDictionary); LinearAnalyzer analyzer = new LinearAnalyzer(solver, solver.SubdomainsDictionary); StaticAnalyzer parentAnalyzer = new StaticAnalyzer(provider, analyzer, solver.SubdomainsDictionary); analyzer.LogFactories[1] = new LinearAnalyzerLogFactory(new int[] { 420 }); parentAnalyzer.BuildMatrices(); parentAnalyzer.Initialize(); parentAnalyzer.Solve(); } static void Main(string[] args) { //SolveBuildingInNoSoilSmall(); //CantileverExample.Cantilever2DExample(); TrussExample.Truss2DExample(); } } }
using ISAAR.MSolve.Analyzers; using ISAAR.MSolve.Logging; using ISAAR.MSolve.Matrices; using ISAAR.MSolve.PreProcessor; using ISAAR.MSolve.Problems; using ISAAR.MSolve.Solvers.Skyline; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ISAAR.MSolve.SamplesConsole { class Program { private static void SolveBuildingInNoSoilSmall() { VectorExtensions.AssignTotalAffinityCount(); Model model = new Model(); model.SubdomainsDictionary.Add(1, new Subdomain() { ID = 1 }); BeamBuildingBuilder.MakeBeamBuilding(model, 20, 20, 20, 5, 4, model.NodesDictionary.Count + 1, model.ElementsDictionary.Count + 1, 1, 4, false, false); model.Loads.Add(new Load() { Amount = -100, Node = model.Nodes[21], DOF = DOFType.X }); model.ConnectDataStructures(); SolverSkyline solver = new SolverSkyline(model); ProblemStructural provider = new ProblemStructural(model, solver.SubdomainsDictionary); LinearAnalyzer analyzer = new LinearAnalyzer(solver, solver.SubdomainsDictionary); StaticAnalyzer parentAnalyzer = new StaticAnalyzer(provider, analyzer, solver.SubdomainsDictionary); analyzer.LogFactories[1] = new LinearAnalyzerLogFactory(new int[] { 420 }); parentAnalyzer.BuildMatrices(); parentAnalyzer.Initialize(); parentAnalyzer.Solve(); } static void Main(string[] args) { //SolveBuildingInNoSoilSmall();// //CantileverExample.Cantilever2DExample(); TrussExample.Truss2DExample(); } } }
apache-2.0
C#
d541cadb2220d2a7987386cd25acc89df755b38e
Remove unnecessary finalizer (cleanup already guaranteed by the SafeHandle)
jeffhostetler/public_libgit2sharp,xoofx/libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,whoisj/libgit2sharp,AArnott/libgit2sharp,oliver-feng/libgit2sharp,AArnott/libgit2sharp,jamill/libgit2sharp,Skybladev2/libgit2sharp,OidaTiftla/libgit2sharp,dlsteuer/libgit2sharp,AMSadek/libgit2sharp,shana/libgit2sharp,rcorre/libgit2sharp,ethomson/libgit2sharp,GeertvanHorrik/libgit2sharp,nulltoken/libgit2sharp,PKRoma/libgit2sharp,vorou/libgit2sharp,psawey/libgit2sharp,dlsteuer/libgit2sharp,GeertvanHorrik/libgit2sharp,mono/libgit2sharp,jorgeamado/libgit2sharp,github/libgit2sharp,vivekpradhanC/libgit2sharp,shana/libgit2sharp,xoofx/libgit2sharp,psawey/libgit2sharp,yishaigalatzer/LibGit2SharpCheckOutTests,rcorre/libgit2sharp,AMSadek/libgit2sharp,ethomson/libgit2sharp,jeffhostetler/public_libgit2sharp,Skybladev2/libgit2sharp,jorgeamado/libgit2sharp,nulltoken/libgit2sharp,github/libgit2sharp,red-gate/libgit2sharp,oliver-feng/libgit2sharp,vivekpradhanC/libgit2sharp,OidaTiftla/libgit2sharp,whoisj/libgit2sharp,vorou/libgit2sharp,sushihangover/libgit2sharp,red-gate/libgit2sharp,libgit2/libgit2sharp,sushihangover/libgit2sharp,jamill/libgit2sharp,Zoxive/libgit2sharp,mono/libgit2sharp,Zoxive/libgit2sharp
LibGit2Sharp/Core/ObjectSafeWrapper.cs
LibGit2Sharp/Core/ObjectSafeWrapper.cs
using System; using LibGit2Sharp.Core.Handles; namespace LibGit2Sharp.Core { internal class ObjectSafeWrapper : IDisposable { private readonly GitObjectSafeHandle objectPtr; public ObjectSafeWrapper(ObjectId id, RepositorySafeHandle handle, bool allowNullObjectId = false) { Ensure.ArgumentNotNull(handle, "handle"); if (allowNullObjectId && id == null) { objectPtr = new NullGitObjectSafeHandle(); } else { Ensure.ArgumentNotNull(id, "id"); objectPtr = Proxy.git_object_lookup(handle, id, GitObjectType.Any); } } public GitObjectSafeHandle ObjectPtr { get { return objectPtr; } } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } private void Dispose(bool disposing) { objectPtr.SafeDispose(); } } }
using System; using LibGit2Sharp.Core.Handles; namespace LibGit2Sharp.Core { internal class ObjectSafeWrapper : IDisposable { private readonly GitObjectSafeHandle objectPtr; public ObjectSafeWrapper(ObjectId id, RepositorySafeHandle handle, bool allowNullObjectId = false) { Ensure.ArgumentNotNull(handle, "handle"); if (allowNullObjectId && id == null) { objectPtr = new NullGitObjectSafeHandle(); } else { Ensure.ArgumentNotNull(id, "id"); objectPtr = Proxy.git_object_lookup(handle, id, GitObjectType.Any); } } public GitObjectSafeHandle ObjectPtr { get { return objectPtr; } } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } private void Dispose(bool disposing) { objectPtr.SafeDispose(); } ~ObjectSafeWrapper() { Dispose(false); } } }
mit
C#
63942941b263dcd64b4f5371d4ae0e07c1137e34
Fix some focus issues with toolbar spin buttons.
PintaProject/Pinta,PintaProject/Pinta,PintaProject/Pinta
Pinta.Core/Extensions/ToolBarWidget.cs
Pinta.Core/Extensions/ToolBarWidget.cs
// // ToolBarWidget.cs // // Author: // Cameron White <cameronwhite91@gmail.com> // // Copyright (c) 2020 Cameron White // // 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; using Gtk; namespace Pinta.Core { /// <summary> /// Generic tool item implementation that can contain an arbitrary widget. /// </summary> public class ToolBarWidget<WidgetT> : ToolItem where WidgetT : Gtk.Widget { public WidgetT Widget { get; private init; } public ToolBarWidget (WidgetT widget) { Widget = widget; Add (Widget); ShowAll (); // After a spin button is edited, return focus to the canvas so that // tools can handle subsequent key events. if (widget is SpinButton spin_button) { spin_button.ValueChanged += (o, e) => { if (PintaCore.Workspace.HasOpenDocuments) PintaCore.Workspace.ActiveWorkspace.Canvas.GrabFocus (); }; } } } }
// // ToolBarWidget.cs // // Author: // Cameron White <cameronwhite91@gmail.com> // // Copyright (c) 2020 Cameron White // // 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; using Gtk; namespace Pinta.Core { /// <summary> /// Generic tool item implementation that can contain an arbitrary widget. /// </summary> public class ToolBarWidget<WidgetT> : ToolItem where WidgetT : Gtk.Widget { public WidgetT Widget { get; private init; } public ToolBarWidget (WidgetT widget) { Widget = widget; Add (Widget); ShowAll (); } } }
mit
C#
23c3be0969b3c240d53844221f71928fdaa20520
Rename variable
EVAST9919/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,UselessToucan/osu,peppy/osu,EVAST9919/osu,ppy/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,smoogipooo/osu,peppy/osu,NeoAdonis/osu,peppy/osu-new,UselessToucan/osu,smoogipoo/osu,peppy/osu,NeoAdonis/osu
osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ReverseArrowPiece.cs
osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ReverseArrowPiece.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 osu.Framework.Audio.Track; using osu.Framework.Graphics; using osuTK; using osu.Framework.Graphics.Sprites; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Graphics.Containers; using osu.Game.Skinning; using osu.Framework.Allocation; using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class ReverseArrowPiece : BeatSyncedContainer { [Resolved] private DrawableHitObject drawableRepeat { get; set; } public ReverseArrowPiece() { Divisor = 2; MinimumBeatLength = 200; Anchor = Anchor.Centre; Origin = Anchor.Centre; Blending = BlendingParameters.Additive; Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2); Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.ReverseArrow), _ => new SpriteIcon { RelativeSizeAxes = Axes.Both, Icon = FontAwesome.Solid.ChevronRight, Size = new Vector2(0.35f) }) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }; } protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) { if (!drawableRepeat.IsHit) Child.ScaleTo(1.3f).ScaleTo(1f, timingPoint.BeatLength, Easing.Out); } } }
// 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 osu.Framework.Audio.Track; using osu.Framework.Graphics; using osuTK; using osu.Framework.Graphics.Sprites; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Graphics.Containers; using osu.Game.Skinning; using osu.Framework.Allocation; using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class ReverseArrowPiece : BeatSyncedContainer { [Resolved] private DrawableHitObject drawableSlider { get; set; } public ReverseArrowPiece() { Divisor = 2; MinimumBeatLength = 200; Anchor = Anchor.Centre; Origin = Anchor.Centre; Blending = BlendingParameters.Additive; Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2); Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.ReverseArrow), _ => new SpriteIcon { RelativeSizeAxes = Axes.Both, Icon = FontAwesome.Solid.ChevronRight, Size = new Vector2(0.35f) }) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }; } protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) { if (!drawableSlider.IsHit) Child.ScaleTo(1.3f).ScaleTo(1f, timingPoint.BeatLength, Easing.Out); } } }
mit
C#
3203be9eec90bdbe4160195d5a18a5d776df9727
Add reasoning in 'ZoneMarkerAndSetUpFixture.cs'
ulrichb/SerializationInspections
Src/SerializationInspections.Plugin.Tests/ZoneMarkerAndSetUpFixture.cs
Src/SerializationInspections.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; using SerializationInspections.Plugin.Tests; [assembly: RequiresSTA] namespace SerializationInspections.Plugin.Tests { [ZoneDefinition] public interface ISerializationInspectionsTestEnvironmentZone : ITestsZone, IRequire<PsiFeatureTestZone> { } [ZoneMarker] public class ZoneMarker : IRequire<ISerializationInspectionsTestEnvironmentZone> { } } // Note: Global namespace to workaround (or hide) https://youtrack.jetbrains.com/issue/RSRP-464493. [SetUpFixture] public class TestEnvironmentSetUpFixture : ExtensionTestEnvironmentAssembly<ISerializationInspectionsTestEnvironmentZone> { }
using JetBrains.Application.BuildScript.Application.Zones; using JetBrains.ReSharper.TestFramework; using JetBrains.TestFramework; using JetBrains.TestFramework.Application.Zones; using NUnit.Framework; using SerializationInspections.Plugin.Tests; [assembly: RequiresSTA] namespace SerializationInspections.Plugin.Tests { [ZoneDefinition] public interface ISerializationInspectionsTestEnvironmentZone : ITestsZone, IRequire<PsiFeatureTestZone> { } [ZoneMarker] public class ZoneMarker : IRequire<ISerializationInspectionsTestEnvironmentZone> { } } // ReSharper disable once CheckNamespace [SetUpFixture] public class TestEnvironmentSetUpFixture : ExtensionTestEnvironmentAssembly<ISerializationInspectionsTestEnvironmentZone> { }
mit
C#
e196df6d5b9972435af8ec9f24655164a3ece9cc
Add target property for InvokeMethod markup extension
KodamaSakuno/Library
Sakuno.UserInterface/Commands/InvokeMethodExtension.cs
Sakuno.UserInterface/Commands/InvokeMethodExtension.cs
using Sakuno.UserInterface.ObjectOperations; using System; using System.Windows.Data; using System.Windows.Markup; namespace Sakuno.UserInterface.Commands { public class InvokeMethodExtension : MarkupExtension { string r_Method; object r_Parameter; public object Target { get; set; } public InvokeMethodExtension(string rpMethod) : this(rpMethod, null) { } public InvokeMethodExtension(string rpMethod, object rpParameter) { r_Method = rpMethod; r_Parameter = rpParameter; } public override object ProvideValue(IServiceProvider rpServiceProvider) { var rInvokeMethod = new InvokeMethod() { Method = r_Method }; if (r_Parameter != null) { var rParameter = new MethodParameter(); var rBinding = r_Parameter as Binding; if (rBinding == null) rParameter.Value = r_Parameter; else BindingOperations.SetBinding(rParameter, MethodParameter.ValueProperty, rBinding); rInvokeMethod.Parameters.Add(rParameter); } if (Target != null) { var rBinding = Target as Binding; if (rBinding != null) BindingOperations.SetBinding(rInvokeMethod, InvokeMethod.TargetProperty, rBinding); else rInvokeMethod.Target = Target; } return new ObjectOperationCommand() { Operations = { rInvokeMethod } }; } } }
using Sakuno.UserInterface.ObjectOperations; using System; using System.Windows.Data; using System.Windows.Markup; namespace Sakuno.UserInterface.Commands { public class InvokeMethodExtension : MarkupExtension { string r_Method; object r_Parameter; public InvokeMethodExtension(string rpMethod) : this(rpMethod, null) { } public InvokeMethodExtension(string rpMethod, object rpParameter) { r_Method = rpMethod; r_Parameter = rpParameter; } public override object ProvideValue(IServiceProvider rpServiceProvider) { var rInvokeMethod = new InvokeMethod() { Method = r_Method }; if (r_Parameter != null) { var rParameter = new MethodParameter(); var rBinding = r_Parameter as Binding; if (rBinding == null) rParameter.Value = r_Parameter; else BindingOperations.SetBinding(rParameter, MethodParameter.ValueProperty, rBinding); rInvokeMethod.Parameters.Add(rParameter); } return new ObjectOperationCommand() { Operations = { rInvokeMethod } }; } } }
mit
C#
6e8a97de5de006091b69a53599244e8a4ea9c803
Update TriggerOfT.cs
XamlBehaviors/XamlBehaviors,wieslawsoltes/AvaloniaBehaviors,XamlBehaviors/XamlBehaviors,wieslawsoltes/AvaloniaBehaviors
src/Avalonia.Xaml.Interactivity/TriggerOfT.cs
src/Avalonia.Xaml.Interactivity/TriggerOfT.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; using System.ComponentModel; namespace Avalonia.Xaml.Interactivity { /// <summary> /// A base class for behaviors, implementing the basic plumbing of <seealso cref="ITrigger"/>. /// </summary> /// <typeparam name="T">The object type to attach to</typeparam> public abstract class Trigger<T> : Trigger where T : AvaloniaObject { /// <summary> /// Gets the object to which this behavior is attached. /// </summary> public new T AssociatedObject => base.AssociatedObject as T; /// <summary> /// Called after the behavior is attached to the <see cref="Behavior.AssociatedObject"/>. /// </summary> /// <remarks> /// Override this to hook up functionality to the <see cref="Behavior.AssociatedObject"/> /// </remarks> protected override void OnAttached() { base.OnAttached(); if (AssociatedObject == null) { string actualType = base.AssociatedObject.GetType().FullName; string expectedType = typeof(T).FullName; string message = string.Format("AssociatedObject is of type {0} but should be of type {1}.", actualType, expectedType); throw new InvalidOperationException(message); } } } }
// 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; using System.ComponentModel; namespace Avalonia.Xaml.Interactivity { /// <summary> /// A base class for behaviors, implementing the basic plumbing of <seealso cref="ITrigger"/>. /// </summary> /// <typeparam name="T">The object type to attach to</typeparam> public abstract class Trigger<T> : Trigger where T : AvaloniaObject { /// <summary> /// Gets the object to which this behavior is attached. /// </summary> [EditorBrowsable(EditorBrowsableState.Never)] public new T AssociatedObject => base.AssociatedObject as T; /// <summary> /// Called after the behavior is attached to the <see cref="Behavior.AssociatedObject"/>. /// </summary> /// <remarks> /// Override this to hook up functionality to the <see cref="Behavior.AssociatedObject"/> /// </remarks> protected override void OnAttached() { base.OnAttached(); if (AssociatedObject == null) { string actualType = base.AssociatedObject.GetType().FullName; string expectedType = typeof(T).FullName; string message = string.Format("AssociatedObject is of type {0} but should be of type {1}.", actualType, expectedType); throw new InvalidOperationException(message); } } } }
mit
C#
3313fb3617d1bc7889fa6d772aba82e390e7913a
Update _LoginPartial link to point to the new Login.cshtml #139
FanrayMedia/Fanray,FanrayMedia/Fanray,FanrayMedia/Fanray
src/Fan.Web/Views/Shared/_LoginPartial.cshtml
src/Fan.Web/Views/Shared/_LoginPartial.cshtml
@using Microsoft.AspNetCore.Identity @using Fan.Models @inject SignInManager<User> SignInManager @inject UserManager<User> UserManager @if (SignInManager.IsSignedIn(User)) { <form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="navbar-right"> <ul class="nav navbar-nav navbar-right"> <li> <a href="/admin">Admin</a> </li> <li> <a asp-area="" asp-controller="Manage" asp-action="Index" title="Manage">Hello @((await UserManager.FindByNameAsync(User.Identity.Name)).DisplayName)!</a> </li> <li> <button type="submit" class="btn btn-link navbar-btn navbar-link">Log out</button> </li> </ul> </form> } else { <ul class="nav navbar-nav navbar-right"> @*<li><a asp-area="" asp-controller="Account" asp-action="Register">Register</a></li>*@ <li><a asp-page="/login">Log in</a></li> </ul> }
@using Microsoft.AspNetCore.Identity @using Fan.Models @inject SignInManager<User> SignInManager @inject UserManager<User> UserManager @if (SignInManager.IsSignedIn(User)) { <form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="navbar-right"> <ul class="nav navbar-nav navbar-right"> <li> <a href="/admin">Admin</a> </li> <li> <a asp-area="" asp-controller="Manage" asp-action="Index" title="Manage">Hello @((await UserManager.FindByNameAsync(User.Identity.Name)).DisplayName)!</a> </li> <li> <button type="submit" class="btn btn-link navbar-btn navbar-link">Log out</button> </li> </ul> </form> } else { <ul class="nav navbar-nav navbar-right"> @*<li><a asp-area="" asp-controller="Account" asp-action="Register">Register</a></li>*@ <li><a asp-area="" asp-controller="Account" asp-action="Login">Log in</a></li> </ul> }
apache-2.0
C#
836e75865e438ed4f8b83cb82a9e470e6f1be8c3
Fix version number for assembly
sergun/Hangfire.Mongo,persi12/Hangfire.Mongo,sergeyzwezdin/Hangfire.Mongo,sergeyzwezdin/Hangfire.Mongo,sergeyzwezdin/Hangfire.Mongo,persi12/Hangfire.Mongo,sergun/Hangfire.Mongo
src/Hangfire.Mongo/Properties/AssemblyInfo.cs
src/Hangfire.Mongo/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("Hangfire.Mongo")] [assembly: AssemblyDescription("Hangfire MongoDB Storage. https://github.com/sergun/Hangfire.Mongo")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Hangfire.Mongo")] [assembly: AssemblyCopyright("Copyright © 2014-2016 Sergey Zwezdin")] [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("02c80b18-125e-473f-be8b-f50dcd86396b")] // 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.2.8")] [assembly: AssemblyInformationalVersion("0.2.8")] [assembly: AssemblyFileVersion("0.2.8")] [assembly: InternalsVisibleTo("Hangfire.Mongo.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("Hangfire.Mongo")] [assembly: AssemblyDescription("Hangfire MongoDB Storage. https://github.com/sergun/Hangfire.Mongo")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Hangfire.Mongo")] [assembly: AssemblyCopyright("Copyright © 2014-2016 Sergey Zwezdin")] [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("02c80b18-125e-473f-be8b-f50dcd86396b")] // 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.2.6")] [assembly: AssemblyInformationalVersion("0.2.6")] [assembly: AssemblyFileVersion("0.2.6")] [assembly: InternalsVisibleTo("Hangfire.Mongo.Tests")]
mit
C#
82353cd179d4a96dc462b2d7653852c4423b4731
Update Clock.cs (#1328)
exercism/xcsharp,robkeim/xcsharp,exercism/xcsharp,robkeim/xcsharp
exercises/clock/Clock.cs
exercises/clock/Clock.cs
using System; public class Clock { public Clock(int hours, int minutes) { throw new NotImplementedException("You need to implement this function."); } public Clock Add(int minutesToAdd) { throw new NotImplementedException("You need to implement this function."); } public Clock Subtract(int minutesToSubtract) { throw new NotImplementedException("You need to implement this function."); } }
using System; public class Clock { public Clock(int hours, int minutes) { throw new NotImplementedException("You need to implement this function."); } public int Hours { get { throw new NotImplementedException("You need to implement this function."); } } public int Minutes { get { throw new NotImplementedException("You need to implement this function."); } } public Clock Add(int minutesToAdd) { throw new NotImplementedException("You need to implement this function."); } public Clock Subtract(int minutesToSubtract) { throw new NotImplementedException("You need to implement this function."); } public override string ToString() { throw new NotImplementedException("You need to implement this function."); } }
mit
C#
c0dffbafa165d30af98256a9021d2a24b5dbbc17
Fix Datastore partial method implementations
jskeet/gcloud-dotnet,googleapis/google-cloud-dotnet,ctaggart/google-cloud-dotnet,benwulfe/google-cloud-dotnet,iantalarico/google-cloud-dotnet,evildour/google-cloud-dotnet,chrisdunelm/gcloud-dotnet,benwulfe/google-cloud-dotnet,iantalarico/google-cloud-dotnet,jskeet/google-cloud-dotnet,evildour/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,evildour/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,ctaggart/google-cloud-dotnet,jskeet/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,jskeet/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,jskeet/google-cloud-dotnet,benwulfe/google-cloud-dotnet,googleapis/google-cloud-dotnet,ctaggart/google-cloud-dotnet,iantalarico/google-cloud-dotnet
apis/Google.Datastore.V1/Google.Datastore.V1/DatastoreClientPartial.cs
apis/Google.Datastore.V1/Google.Datastore.V1/DatastoreClientPartial.cs
// Copyright 2016, Google Inc. 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 Google.Api.Gax.Grpc; namespace Google.Datastore.V1 { // Partial methods on DatastoreClientImpl to set appropriate client headers. public partial class DatastoreClientImpl { private const string ResourcePrefixHeader = "google-cloud-resource-prefix"; private const string ResourcePrefixHeaderValuePrefix = "projects/"; partial void Modify_AllocateIdsRequest(ref AllocateIdsRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void Modify_BeginTransactionRequest(ref BeginTransactionRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void Modify_CommitRequest(ref CommitRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void Modify_LookupRequest(ref LookupRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void Modify_RollbackRequest(ref RollbackRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void Modify_RunQueryRequest(ref RunQueryRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } } }
// Copyright 2016, Google Inc. 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 Google.Api.Gax.Grpc; namespace Google.Datastore.V1 { // Partial methods on DatastoreClientImpl to set appropriate client headers. public partial class DatastoreClientImpl { private const string ResourcePrefixHeader = "google-cloud-resource-prefix"; private const string ResourcePrefixHeaderValuePrefix = "projects/"; partial void ModifyAllocateIdsRequest(ref AllocateIdsRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void ModifyBeginTransactionRequest(ref BeginTransactionRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void ModifyCommitRequest(ref CommitRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void ModifyLookupRequest(ref LookupRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void ModifyRollbackRequest(ref RollbackRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } partial void ModifyRunQueryRequest(ref RunQueryRequest request, ref CallSettings settings) { settings = settings.WithHeader(ResourcePrefixHeader, "projects/" + request.ProjectId); } } }
apache-2.0
C#
b1219d24049db483778ca14a36c510866dd7a87f
update interval tree
justcoding121/Algorithm-Sandbox,justcoding121/Advanced-Algorithms
Algorithm.Sandbox/DataStructures/Tree/AsIntervalTree.cs
Algorithm.Sandbox/DataStructures/Tree/AsIntervalTree.cs
using System; namespace Algorithm.Sandbox.DataStructures { /// <summary> /// Interval object /// </summary> /// <typeparam name="T"></typeparam> public class AsIntervalTreeNode<T> : IComparable where T : IComparable { /// <summary> /// Start of this interval range /// </summary> public T Start { get; set; } /// <summary> /// End of this interval range /// </summary> public T End { get; set; } /// <summary> /// Max End interval under this interval /// Which would be in the rightmost sub node of BST /// </summary> internal T MaxChild { get; set; } public int CompareTo(object obj) { return this.Start.CompareTo((obj as AsIntervalTreeNode<T>).Start); } } /// <summary> /// An interval tree implementation /// TODO support interval start range that collide /// </summary> /// <typeparam name="T"></typeparam> public class AsIntervalTree<T> where T : IComparable { internal AsRedBlackTree<AsIntervalTreeNode<T>> bst = new AsRedBlackTree<AsIntervalTreeNode<T>>(); /// <summary> /// Insert a new Interval /// </summary> /// <param name="newInterval"></param> public void Insert(AsIntervalTreeNode<T> newInterval) { bst.Insert(newInterval); //TODO //update max nodes under this new node var newNode = bst.Find(newInterval); } /// <summary> /// Delete this interval /// </summary> /// <param name="interval"></param> public void Delete(AsIntervalTreeNode<T> interval) { bst.Delete(interval); //TODO //Update max nodes under the deleted node if it was replaced by a leaf in BST } /// <summary> /// Returns an interval that overlaps with this interval /// </summary> /// <param name="interval"></param> /// <returns></returns> public AsIntervalTreeNode<T> GetOverlap(AsIntervalTreeNode<T> interval) { throw new NotImplementedException(); } /// <summary> /// Does this interval a overlap with b /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns></returns> private bool doOverlap(AsIntervalTreeNode<T> a, AsIntervalTreeNode<T> b) { throw new NotImplementedException(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Algorithm.Sandbox.DataStructures { public class AsIntervalTreeNode<T> where T : IComparable { public T Start { get; set; } public T End { get; set; } internal T MaxRight { get; set; } } public class AsIntervalTree<T> where T : IComparable { internal AsIntervalTreeNode<T> Root; public void Insert(AsIntervalTreeNode<T> newInterval) { if(Root == null) { Root = newInterval; return; } } public void Delete(AsIntervalTreeNode<T> interval) { } public AsArrayList<AsIntervalTreeNode<T>> GetIntersection(AsIntervalTreeNode<T> interval) { throw new NotImplementedException(); } } }
mit
C#
94357cc55bb6d82a33611478823f134678c77db9
Fix bug in test
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Tests/UnitTests/SmartBlockProviderTests.cs
WalletWasabi.Tests/UnitTests/SmartBlockProviderTests.cs
using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Caching.Memory; using NBitcoin; using WalletWasabi.Legal; using WalletWasabi.Wallets; using Xunit; namespace WalletWasabi.Tests.UnitTests { public class SmartBlockProviderTests { [Fact] public async void TestAsync() { var blocks = new Dictionary<uint256, Block> { [uint256.Zero] = Block.CreateBlock(Network.Main), [uint256.One] = Block.CreateBlock(Network.Main) }; var source = new MockProvider(); source.OnGetBlockAsync = async (hash, cancel) => { await Task.Delay(TimeSpan.FromSeconds(0.5)); return blocks[hash]; }; using var cache = new MemoryCache(new MemoryCacheOptions()); var blockProvider = new SmartBlockProvider(source, cache); var b1 = blockProvider.GetBlockAsync(uint256.Zero, CancellationToken.None); var b2 = blockProvider.GetBlockAsync(uint256.One, CancellationToken.None); var b3 = blockProvider.GetBlockAsync(uint256.Zero, CancellationToken.None); await Task.WhenAll(b1, b2, b3); Assert.Equal(await b1, await b3); Assert.NotEqual(await b1, await b2); } private class MockProvider : IBlockProvider { public Func<uint256, CancellationToken, Task<Block>> OnGetBlockAsync { get; set; } public Task<Block> GetBlockAsync(uint256 hash, CancellationToken cancel) { return OnGetBlockAsync(hash, cancel); } } } }
using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Caching.Memory; using NBitcoin; using WalletWasabi.Legal; using WalletWasabi.Wallets; using Xunit; namespace WalletWasabi.Tests.UnitTests { public class SmartBlockProviderTests { [Fact] public async void TestAsync() { var blocks = new Dictionary<uint256, Block> { [uint256.Zero] = Block.CreateBlock(Network.Main), [uint256.One] = Block.CreateBlock(Network.Main) }; var source = new MockProvider(); source.OnGetBlockAsync = async (hash, cancel) => { await Task.Delay(TimeSpan.FromSeconds(0.5)); var block = Block.CreateBlock(Network.Main); return block; }; using var cache = new MemoryCache(new MemoryCacheOptions()); var blockProvider = new SmartBlockProvider(source, cache); var b1 = blockProvider.GetBlockAsync(uint256.Zero, CancellationToken.None); var b2 = blockProvider.GetBlockAsync(uint256.One, CancellationToken.None); var b3 = blockProvider.GetBlockAsync(uint256.Zero, CancellationToken.None); await Task.WhenAll(b1, b2, b3); Assert.Equal(await b1, await b3); Assert.NotEqual(await b1, await b2); } private class MockProvider : IBlockProvider { public Func<uint256, CancellationToken, Task<Block>> OnGetBlockAsync { get; set; } public Task<Block> GetBlockAsync(uint256 hash, CancellationToken cancel) { return OnGetBlockAsync(hash, cancel); } } } }
mit
C#
35b70dac4ec9c2ee98ca3d0d0d892bef62d01224
Update CellLinkTypeConverter.cs
smartsheet-platform/smartsheet-csharp-sdk,smartsheet-platform/smartsheet-csharp-sdk
main/Smartsheet/Api/Internal/Json/CellLinkTypeConverter.cs
main/Smartsheet/Api/Internal/Json/CellLinkTypeConverter.cs
// #[ license] // SmartsheetClient SDK for C# // %% // Copyright (C) 2018 SmartsheetClient // %% // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // %[license] using System; using System.Collections.Generic; using System.Linq; using System.Text; using Newtonsoft.Json; using Smartsheet.Api.Models; namespace Smartsheet.Api.Internal.Json { class CellLinkTypeConverter : JsonConverter { public override bool CanConvert(Type objectType) { return typeof(CellLink).IsAssignableFrom(objectType); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) { if (reader.TokenType == JsonToken.StartObject) { object objectToDeserialize = Activator.CreateInstance(objectType); serializer.Populate(reader, objectToDeserialize); return objectToDeserialize; } return null; } public override void WriteJson(JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) { Newtonsoft.Json.JsonSerializer serializerHelper = new Newtonsoft.Json.JsonSerializer(); serializerHelper.Formatting = Newtonsoft.Json.Formatting.None; serializerHelper.MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore; serializerHelper.DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat; serializerHelper.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore; serializerHelper.ContractResolver = new ContractResolver(); serializerHelper.Converters.Add(new JsonEnumTypeConverter()); CellLink cellLink = (CellLink)value; if (cellLink.IsNull) { writer.WriteNull(); } else serializerHelper.Serialize(writer, value); } } }
// #[ license] // SmartsheetClient SDK for C# // %% // Copyright (C) 2018 SmartsheetClient // %% // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed To in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // %[license] using System; using System.Collections.Generic; using System.Linq; using System.Text; using Newtonsoft.Json; using Smartsheet.Api.Models; namespace Smartsheet.Api.Internal.Json { class CellLinkTypeConverter : JsonConverter { public override bool CanConvert(Type objectType) { return typeof(CellLink).IsAssignableFrom(objectType); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) { if (reader.TokenType == JsonToken.StartObject) { object objectToDeserialize = Activator.CreateInstance(objectType); serializer.Populate(reader, objectToDeserialize); return objectToDeserialize; } return null; } public override void WriteJson(JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) { Newtonsoft.Json.JsonSerializer serializerHelper = new Newtonsoft.Json.JsonSerializer(); serializerHelper.Formatting = Newtonsoft.Json.Formatting.None; serializerHelper.MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore; serializerHelper.DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat; serializerHelper.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore; serializerHelper.ContractResolver = new ContractResolver(); serializerHelper.Converters.Add(new JsonEnumTypeConverter()); CellLink cellLink = (CellLink)value; if (cellLink.IsNull) { writer.WriteNull(); } else serializerHelper.Serialize(writer, value); } } }
apache-2.0
C#
b05acb00738ed25463fbdacbee9b7da68ed01f58
Make `CommentMarkdownTextFlowContainer` render images
ppy/osu,ppy/osu,ppy/osu,peppy/osu,peppy/osu,peppy/osu
osu.Game/Overlays/Comments/CommentMarkdownContainer.cs
osu.Game/Overlays/Comments/CommentMarkdownContainer.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using Markdig.Syntax; using Markdig.Syntax.Inlines; using osu.Framework.Graphics.Containers.Markdown; using osu.Game.Graphics.Containers.Markdown; namespace osu.Game.Overlays.Comments { public class CommentMarkdownContainer : OsuMarkdownContainer { public override MarkdownTextFlowContainer CreateTextFlow() => new CommentMarkdownTextFlowContainer(); protected override MarkdownHeading CreateHeading(HeadingBlock headingBlock) => new CommentMarkdownHeading(headingBlock); private class CommentMarkdownTextFlowContainer : OsuMarkdownTextFlowContainer { protected override void AddImage(LinkInline linkInline) { AddDrawable(new OsuMarkdownImage(linkInline)); } } private class CommentMarkdownHeading : OsuMarkdownHeading { public CommentMarkdownHeading(HeadingBlock headingBlock) : base(headingBlock) { } protected override float GetFontSizeByLevel(int level) { float defaultFontSize = base.GetFontSizeByLevel(6); switch (level) { case 1: return 1.2f * defaultFontSize; case 2: return 1.1f * defaultFontSize; default: return defaultFontSize; } } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using Markdig.Syntax; using Markdig.Syntax.Inlines; using osu.Framework.Graphics.Containers.Markdown; using osu.Game.Graphics.Containers.Markdown; namespace osu.Game.Overlays.Comments { public class CommentMarkdownContainer : OsuMarkdownContainer { public override MarkdownTextFlowContainer CreateTextFlow() => new CommentMarkdownTextFlowContainer(); protected override MarkdownHeading CreateHeading(HeadingBlock headingBlock) => new CommentMarkdownHeading(headingBlock); private class CommentMarkdownTextFlowContainer : OsuMarkdownTextFlowContainer { // Don't render image in comment for now protected override void AddImage(LinkInline linkInline) { } } private class CommentMarkdownHeading : OsuMarkdownHeading { public CommentMarkdownHeading(HeadingBlock headingBlock) : base(headingBlock) { } protected override float GetFontSizeByLevel(int level) { float defaultFontSize = base.GetFontSizeByLevel(6); switch (level) { case 1: return 1.2f * defaultFontSize; case 2: return 1.1f * defaultFontSize; default: return defaultFontSize; } } } } }
mit
C#
08e72717df70f27de42bffe468e1acebfab67ca8
Decrease benchmark durations
Catel/Catel.Benchmarks
src/Catel.Benchmarks.Shared/BenchmarkBase.cs
src/Catel.Benchmarks.Shared/BenchmarkBase.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="BenchmarkBase.cs" company="Catel development team"> // Copyright (c) 2008 - 2017 Catel development team. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Catel.Benchmarks { using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Engines; // Uncomment to make all benchmarks slower (but probably more accurate) [SimpleJob(RunStrategy.Throughput, launchCount: 3, warmupCount: 2, targetCount: 5, invocationCount: 2500)] public abstract class BenchmarkBase { } }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="BenchmarkBase.cs" company="Catel development team"> // Copyright (c) 2008 - 2017 Catel development team. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Catel.Benchmarks { using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Engines; // Uncomment to make all benchmarks slower (but probably more accurate) [SimpleJob(RunStrategy.Throughput, launchCount: 3, warmupCount: 2, targetCount: 10, invocationCount: 5000)] public abstract class BenchmarkBase { } }
mit
C#
0677373629291e321d8f66ddc94512e03956023b
Add possible (insecure) fix for anti forgery token error: suppress identity heuristics
erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner
Zk/Global.asax.cs
Zk/Global.asax.cs
using System.Web; using System.Web.Helpers; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; using WebMatrix.WebData; namespace Zk { public class MvcApplication : HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute ("{resource}.axd/{*pathInfo}"); routes.MapRoute ( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); } protected void Application_Start() { if (!WebSecurity.Initialized) { WebSecurity.InitializeDatabaseConnection("ZkTestDatabaseConnection", "Users", "UserId", "Name", autoCreateTables: true); } // Insecure fix for anti forgery token exception. // See stackoverflow.com/questions/2206595/how-do-i-solve-an-antiforgerytoken-exception-that-occurs-after-an-iisreset-in-my#20421618 AntiForgeryConfig.SuppressIdentityHeuristicChecks = true; AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); } } }
using System; using System.Threading; using System.Web; using System.Web.Mvc; using System.Web.Optimization; using System.Web.Security; using System.Web.Routing; using WebMatrix.WebData; using Zk.Models; namespace Zk { public class MvcApplication : HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute ("{resource}.axd/{*pathInfo}"); routes.MapRoute ( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); } protected void Application_Start() { if (!WebSecurity.Initialized) { WebSecurity.InitializeDatabaseConnection("ZkTestDatabaseConnection", "Users", "UserId", "Name", autoCreateTables: true); } AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); } } }
mit
C#
2f325dca78e9dfab9c468b3e187d5b11ea99fe36
Improve TaskItem implementation (for metadata).
KirillOsenkov/MSBuildStructuredLog,KirillOsenkov/MSBuildStructuredLog
src/StructuredLogger/ObjectModel/TaskItem.cs
src/StructuredLogger/ObjectModel/TaskItem.cs
using System; using System.Collections; using System.Collections.Generic; using Microsoft.Build.Framework; namespace Microsoft.Build.Logging { public class TaskItem : ITaskItem2 { public string ItemSpec { get; set; } public Dictionary<string, string> Metadata { get; } = new Dictionary<string, string>(); public string EvaluatedIncludeEscaped { get; set; } public int MetadataCount => Metadata.Count; public ICollection MetadataNames => Metadata.Keys; public TaskItem() { } public TaskItem(string itemSpec) { ItemSpec = itemSpec; } public IDictionary CloneCustomMetadata() { return Metadata; } public IDictionary CloneCustomMetadataEscaped() { throw new NotImplementedException(); } public void CopyMetadataTo(ITaskItem destinationItem) { foreach (var kvp in Metadata) { destinationItem.SetMetadata(kvp.Key, kvp.Value); } } public string GetMetadata(string metadataName) { Metadata.TryGetValue(metadataName, out var result); return result ?? ""; } public string GetMetadataValueEscaped(string metadataName) { throw new NotImplementedException(); } public void RemoveMetadata(string metadataName) { throw new NotImplementedException(); } public void SetMetadata(string metadataName, string metadataValue) { Metadata[metadataName] = metadataValue; } public void SetMetadataValueLiteral(string metadataName, string metadataValue) { throw new NotImplementedException(); } public override string ToString() => ItemSpec; } }
using System; using System.Collections; using System.Collections.Generic; using Microsoft.Build.Framework; namespace Microsoft.Build.Logging { public class TaskItem : ITaskItem2 { public string ItemSpec { get; set; } public Dictionary<string, string> Metadata { get; } = new Dictionary<string, string>(); public string EvaluatedIncludeEscaped { get; set; } public int MetadataCount => Metadata.Count; public ICollection MetadataNames => Metadata.Keys; public TaskItem() { } public TaskItem(string itemSpec) { ItemSpec = itemSpec; } public IDictionary CloneCustomMetadata() { return Metadata; } public IDictionary CloneCustomMetadataEscaped() { throw new NotImplementedException(); } public void CopyMetadataTo(ITaskItem destinationItem) { throw new NotImplementedException(); } public string GetMetadata(string metadataName) { Metadata.TryGetValue(metadataName, out var result); return result; } public string GetMetadataValueEscaped(string metadataName) { throw new NotImplementedException(); } public void RemoveMetadata(string metadataName) { throw new NotImplementedException(); } public void SetMetadata(string metadataName, string metadataValue) { Metadata[metadataName] = metadataValue; } public void SetMetadataValueLiteral(string metadataName, string metadataValue) { throw new NotImplementedException(); } public override string ToString() => ItemSpec; } }
mit
C#
ce948954372f3f2d44f28cffc4fef9924caff090
Fix Github issue integration test
elastic/elasticsearch-net,elastic/elasticsearch-net
src/Tests/Tests.Reproduce/GithubIssue3084.cs
src/Tests/Tests.Reproduce/GithubIssue3084.cs
using System; using System.Threading.Tasks; using Elastic.Xunit.XunitPlumbing; using FluentAssertions; using Nest; using Tests.Core.Extensions; using Tests.Core.ManagedElasticsearch.Clusters; namespace Tests.Reproduce { public class GithubIssue3084 : IClusterFixture<WritableCluster> { private readonly WritableCluster _cluster; public GithubIssue3084(WritableCluster cluster) => _cluster = cluster; protected static string RandomString() => Guid.NewGuid().ToString("N").Substring(0, 8); [I] public void DeserializeErrorIsTheSameForAsync() { var client = _cluster.Client; var index = $"gh3084-{RandomString()}"; var document = new ObjectVersion1 { Id = 1, Numeric = 0.1 }; var indexResult = client.Index(document, i => i.Index(index)); indexResult.ShouldBeValid(); Action getDoc = () => client.Get<ObjectVersion2>(new GetRequest(index, 1)); Func<Task<IGetResponse<ObjectVersion2>>> getDocAsync = async () => await client.GetAsync<ObjectVersion2>(new GetRequest(index, 1)); getDoc.Should().Throw<Exception>("synchonous code path should throw"); getDocAsync.Should().Throw<Exception>("async code path should throw"); } public class ObjectVersion1 { public int Id { get; set; } public double Numeric { get; set; } } public class ObjectVersion2 { public int Id { get; set; } public int Numeric { get; set; } } } }
using System; using System.Threading.Tasks; using Elastic.Xunit.XunitPlumbing; using FluentAssertions; using Nest; using Tests.Core.Extensions; using Tests.Core.ManagedElasticsearch.Clusters; namespace Tests.Reproduce { public class GithubIssue3084 : IClusterFixture<WritableCluster> { private readonly WritableCluster _cluster; public GithubIssue3084(WritableCluster cluster) => _cluster = cluster; protected static string RandomString() => Guid.NewGuid().ToString("N").Substring(0, 8); [I] public void DeserializeErrorIsTheSameForAsync() { var client = _cluster.Client; var index = $"gh3084-{RandomString()}"; var document = new ObjectVersion1 { Id = 1, Numeric = 0 }; var indexResult = client.Index(document, i => i.Index(index)); indexResult.ShouldBeValid(); Action getDoc = () => client.Get<ObjectVersion2>(new GetRequest(index, 1)); Func<Task<IGetResponse<ObjectVersion2>>> getDocAsync = async () => await client.GetAsync<ObjectVersion2>(new GetRequest(index, 1)); getDoc.Should().Throw<Exception>("synchonous code path should throw"); getDocAsync.Should().Throw<Exception>("async code path should throw"); } public class ObjectVersion1 { public int Id { get; set; } public double Numeric { get; set; } } public class ObjectVersion2 { public int Id { get; set; } public int Numeric { get; set; } } } }
apache-2.0
C#
17ef0565a45b132d179f572c360885eca1c3a907
Fix false verbiage
rmwatson5/Unicorn,GuitarRich/Unicorn,rmwatson5/Unicorn,GuitarRich/Unicorn,kamsar/Unicorn,kamsar/Unicorn
src/Unicorn/ControlPanel/Controls/Heading.cs
src/Unicorn/ControlPanel/Controls/Heading.cs
using System.Linq; using System.Reflection; using System.Web.UI; using Unicorn.ControlPanel.Headings; namespace Unicorn.ControlPanel.Controls { internal class Heading : IControlPanelControl { public bool HasSerializedItems { get; set; } public bool HasValidSerializedItems { get; set; } public bool IsAuthenticated { get; set; } public void Render(HtmlTextWriter writer) { writer.Write(new HeadingService().GetControlPanelHeadingHtml()); if (IsAuthenticated) { var version = (AssemblyInformationalVersionAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false).Single(); writer.Write("<p class=\"version\">Version {0}</p>", version.InformationalVersion); if (!HasSerializedItems) { if(HasValidSerializedItems) writer.Write("<p class=\"warning\">Warning: at least one configuration has not serialized any items yet. Unicorn cannot operate properly until this is complete. Please review the configuration below and then perform initial serialization if it is accurate.</p>"); else writer.Write("<p class=\"warning\">Warning: your current predicate configuration for at least one configuration does not have any valid root items defined. Nothing will be serialized until valid root items to start serializing from can be resolved. Please review your predicate configuration.</p>"); } } } } }
using System.Linq; using System.Reflection; using System.Web.UI; using Unicorn.ControlPanel.Headings; namespace Unicorn.ControlPanel.Controls { internal class Heading : IControlPanelControl { public bool HasSerializedItems { get; set; } public bool HasValidSerializedItems { get; set; } public bool IsAuthenticated { get; set; } public void Render(HtmlTextWriter writer) { writer.Write(new HeadingService().GetControlPanelHeadingHtml()); if (IsAuthenticated) { var version = (AssemblyInformationalVersionAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false).Single(); writer.Write("<p class=\"version\">Version {0}</p>", version.InformationalVersion); if (!HasSerializedItems) { if(HasValidSerializedItems) writer.Write("<p class=\"warning\">Warning: at least one configuration has not serialized any items yet. Unicorn cannot operate properly until this is complete. Please review the configuration below and then perform initial serialization if it is accurate. If you need to change your config, see App_Config\\Include\\Unicorn\\Unicorn.config.</p>"); else writer.Write("<p class=\"warning\">Warning: your current predicate configuration for at least one configuration does not have any valid root items defined. Nothing will be serialized until valid root items to start serializing from can be resolved. Please review your predicate configuration.</p>"); } } } } }
mit
C#
a167becff59af7576ca9a057446da8514bffca2e
bump version to 8.9.0-rc.
hfloyd/Umbraco-CMS,umbraco/Umbraco-CMS,KevinJump/Umbraco-CMS,abryukhov/Umbraco-CMS,mattbrailsford/Umbraco-CMS,umbraco/Umbraco-CMS,arknu/Umbraco-CMS,dawoe/Umbraco-CMS,madsoulswe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,leekelleher/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,madsoulswe/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,hfloyd/Umbraco-CMS,leekelleher/Umbraco-CMS,dawoe/Umbraco-CMS,abjerner/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,leekelleher/Umbraco-CMS,KevinJump/Umbraco-CMS,umbraco/Umbraco-CMS,abryukhov/Umbraco-CMS,mattbrailsford/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,madsoulswe/Umbraco-CMS,bjarnef/Umbraco-CMS,KevinJump/Umbraco-CMS,umbraco/Umbraco-CMS,bjarnef/Umbraco-CMS,hfloyd/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,hfloyd/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,mattbrailsford/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,bjarnef/Umbraco-CMS,leekelleher/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,mattbrailsford/Umbraco-CMS,arknu/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,leekelleher/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,tcmorris/Umbraco-CMS,abryukhov/Umbraco-CMS,robertjf/Umbraco-CMS,abryukhov/Umbraco-CMS,bjarnef/Umbraco-CMS
src/SolutionInfo.cs
src/SolutionInfo.cs
using System.Reflection; using System.Resources; [assembly: AssemblyCompany("Umbraco")] [assembly: AssemblyCopyright("Copyright © Umbraco 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en-US")] // versions // read https://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin // note: do NOT change anything here manually, use the build scripts // this is the ONLY ONE the CLR cares about for compatibility // should change ONLY when "hard" breaking compatibility (manual change) [assembly: AssemblyVersion("8.0.0")] // these are FYI and changed automatically [assembly: AssemblyFileVersion("8.9.0")] [assembly: AssemblyInformationalVersion("8.9.0-rc")]
using System.Reflection; using System.Resources; [assembly: AssemblyCompany("Umbraco")] [assembly: AssemblyCopyright("Copyright © Umbraco 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en-US")] // versions // read https://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin // note: do NOT change anything here manually, use the build scripts // this is the ONLY ONE the CLR cares about for compatibility // should change ONLY when "hard" breaking compatibility (manual change) [assembly: AssemblyVersion("8.0.0")] // these are FYI and changed automatically [assembly: AssemblyFileVersion("8.9.0")] [assembly: AssemblyInformationalVersion("8.9.0")]
mit
C#
5081a23a95d1ee55a7dbaf732c8fcfba99863065
Update `SLComboboxTests`
atata-framework/atata-samples
SalesforceLightning/AtataSamples.SalesforceLightning/SLComboboxTests.cs
SalesforceLightning/AtataSamples.SalesforceLightning/SLComboboxTests.cs
using Atata; using NUnit.Framework; namespace AtataSamples.SalesforceLightning { public class SLComboboxTests : UITestFixture { [Test] [Explicit] public void AsString_GetAndSetValue() { var sut = Go.To<ComboboxPage>().StringBasedCombobox; sut.Should.Be("In Progress"); sut.Set("New"); sut.Should.Be("New"); } [Test] [Explicit] public void AsEnum_GetAndSetValue() { var sut = Go.To<ComboboxPage>().EnumBasedCombobox; sut.Should.Be(ComboboxPage.Progress.InProgress); sut.Set(ComboboxPage.Progress.Finished); sut.Should.Be(ComboboxPage.Progress.Finished); } } }
using Atata; using NUnit.Framework; namespace AtataSamples.SalesforceLightning { public class SLComboboxTests : UITestFixture { [Test] public void AsString_GetAndSetValue() { var sut = Go.To<ComboboxPage>().StringBasedCombobox; sut.Should.Be("In Progress"); sut.Set("New"); sut.Should.Be("New"); } [Test] public void AsEnum_GetAndSetValue() { var sut = Go.To<ComboboxPage>().EnumBasedCombobox; sut.Should.Be(ComboboxPage.Progress.InProgress); sut.Set(ComboboxPage.Progress.Finished); sut.Should.Be(ComboboxPage.Progress.Finished); } } }
apache-2.0
C#
1514bab3ab53eab41d794806eacab8e2d625fd65
Remove ThreadStatic from NSApplicationInitializer.initialized
mono/xwt,lytico/xwt,antmicro/xwt
Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs
Xwt.XamMac/Xwt.Mac/NSApplicationInitializer.cs
// // NSApplicationInitializer.cs // // Author: // Lluis Sanchez Gual <lluis@xamarin.com> // // Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com) // // 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; using AppKit; namespace Xwt.Mac { static class NSApplicationInitializer { static bool initialized; public static void Initialize () { if (!initialized) { initialized = true; NSApplication.IgnoreMissingAssembliesDuringRegistration = true; NSApplication.Init (); } } } }
// // NSApplicationInitializer.cs // // Author: // Lluis Sanchez Gual <lluis@xamarin.com> // // Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com) // // 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; using AppKit; namespace Xwt.Mac { static class NSApplicationInitializer { [ThreadStatic] static bool initialized; public static void Initialize () { if (!initialized) { initialized = true; NSApplication.IgnoreMissingAssembliesDuringRegistration = true; NSApplication.Init (); } } } }
mit
C#
d3228abec5d1d8ed97371973a2ead54295d310ee
Remove unused field gitHubContextService
github/VisualStudio,github/VisualStudio,github/VisualStudio
src/GitHub.VisualStudio/Commands/OpenFromUrlCommand.cs
src/GitHub.VisualStudio/Commands/OpenFromUrlCommand.cs
using System; using System.ComponentModel.Composition; using GitHub.Commands; using GitHub.Services; using GitHub.Services.Vssdk.Commands; using Task = System.Threading.Tasks.Task; namespace GitHub.VisualStudio.Commands { [Export(typeof(IOpenFromUrlCommand))] public class OpenFromUrlCommand : VsCommand<string>, IOpenFromUrlCommand { readonly Lazy<IDialogService> dialogService; readonly Lazy<IRepositoryCloneService> repositoryCloneService; /// <summary> /// Gets the GUID of the group the command belongs to. /// </summary> public static readonly Guid CommandSet = Guids.guidGitHubCmdSet; /// <summary> /// Gets the numeric identifier of the command. /// </summary> public const int CommandId = PkgCmdIDList.openFromUrlCommand; [ImportingConstructor] public OpenFromUrlCommand( Lazy<IDialogService> dialogService, Lazy<IRepositoryCloneService> repositoryCloneService) : base(CommandSet, CommandId) { this.dialogService = dialogService; this.repositoryCloneService = repositoryCloneService; // See https://code.msdn.microsoft.com/windowsdesktop/AllowParams-2005-9442298f ParametersDescription = "u"; // accept a single url } public override async Task Execute(string url) { var cloneDialogResult = await dialogService.Value.ShowCloneDialog(null, url); if (cloneDialogResult != null) { await repositoryCloneService.Value.CloneOrOpenRepository(cloneDialogResult); } } } }
using System; using System.ComponentModel.Composition; using GitHub.Commands; using GitHub.Services; using GitHub.Services.Vssdk.Commands; using Task = System.Threading.Tasks.Task; namespace GitHub.VisualStudio.Commands { [Export(typeof(IOpenFromUrlCommand))] public class OpenFromUrlCommand : VsCommand<string>, IOpenFromUrlCommand { readonly Lazy<IDialogService> dialogService; readonly Lazy<IGitHubContextService> gitHubContextService; readonly Lazy<IRepositoryCloneService> repositoryCloneService; /// <summary> /// Gets the GUID of the group the command belongs to. /// </summary> public static readonly Guid CommandSet = Guids.guidGitHubCmdSet; /// <summary> /// Gets the numeric identifier of the command. /// </summary> public const int CommandId = PkgCmdIDList.openFromUrlCommand; [ImportingConstructor] public OpenFromUrlCommand( Lazy<IDialogService> dialogService, Lazy<IGitHubContextService> gitHubContextService, Lazy<IRepositoryCloneService> repositoryCloneService) : base(CommandSet, CommandId) { this.dialogService = dialogService; this.gitHubContextService = gitHubContextService; this.repositoryCloneService = repositoryCloneService; // See https://code.msdn.microsoft.com/windowsdesktop/AllowParams-2005-9442298f ParametersDescription = "u"; // accept a single url } public override async Task Execute(string url) { var cloneDialogResult = await dialogService.Value.ShowCloneDialog(null, url); if (cloneDialogResult != null) { await repositoryCloneService.Value.CloneOrOpenRepository(cloneDialogResult); } } } }
mit
C#
7ed3fa328f3a904dd084f8375c401ce716a3ec11
Update layout
henkmollema/StudentFollowingSystem,henkmollema/StudentFollowingSystem
src/StudentFollowingSystem/Views/Shared/_Layout.cshtml
src/StudentFollowingSystem/Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - NHL SVS</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> @Html.Action("Menu", "Home") <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - NHL Student Volg Systeem</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - NHL SVS</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> @Html.Action("Menu", "Home") <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - NHL Student Volg Systeem</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
mit
C#
cee341c8024f65c9cffb3dfdc2c3c56b9172de97
Fix typpo
borgmon/ArKitKat
ArKitKat/ArPlaneTools.cs
ArKitKat/ArPlaneTools.cs
// The MIT License(MIT) // Copyright(c) 2017 Borgmon.me using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.iOS; namespace ArKitKat { public class PlaneTools : MonoBehaviour { public static Vector3 GetRealPosition(ARPlaneAnchor planeAnchor) { GameObject anchor = new GameObject("Anchor"); GameObject parent = new GameObject("AnchorParent"); anchor.transform.SetParent(parent.transform); parent.transform.position = UnityARMatrixOps.GetPosition(planeAnchor.transform); parent.transform.rotation = UnityARMatrixOps.GetRotation(planeAnchor.transform); anchor.transform.localPosition = new Vector3(planeAnchor.center.x, planeAnchor.center.y, -planeAnchor.center.z); Vector3 result = anchor.transform.position; Destroy(anchor); Destroy(parent); return result; // Vector3 fix = planeAnchor.center; // fix = new Vector3(fix.x, fix.y, -fix.z); // return UnityARMatrixOps.GetPosition(planeAnchor.transform) + fix; } public static Vector3 GetPosition(ARPlaneAnchor planeAnchor) { return UnityARMatrixOps.GetPosition(planeAnchor.transform); } public static Quaternion GetRotation(ARPlaneAnchor planeAnchor) { return UnityARMatrixOps.GetRotation(planeAnchor.transform); } } }
// The MIT License(MIT) // Copyright(c) 2017 Borgmon.me using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.iOS; namespace ArKitKat { public static class ArPlaneTools { public static Vector3 GetRealPosition(ARPlaneAnchor planeAnchor) { GameObject anchor = new GameObject("Anchor"); GameObject parent = new GameObject("AnchorParent"); anchor.transform.SetParent(parent.transform); parent.transform.position = UnityARMatrixOps.GetPosition(planeAnchor.transform); parent.transform.rotation = UnityARMatrixOps.GetRotation(planeAnchor.transform); anchor.transform.localPosition = new Vector3(planeAnchor.center.x, planeAnchor.center.y, -planeAnchor.center.z); Vector3 result = anchor.transform.position; Destory(anchor); Destory(parent); return result; // Vector3 fix = planeAnchor.center; // fix = new Vector3(fix.x, fix.y, -fix.z); // return UnityARMatrixOps.GetPosition(planeAnchor.transform) + fix; } public static Vector3 GetPosition(ARPlaneAnchor planeAnchor) { return UnityARMatrixOps.GetPosition(planeAnchor.transform); } public static Quaternion GetRotation(ARPlaneAnchor planeAnchor) { return UnityARMatrixOps.GetRotation(planeAnchor.transform); } } }
mit
C#
a7d3956232569d77cf9243326453b2998f3d2137
remove debug.log
AcessDeniedAD/ggj2016,AcessDeniedAD/ggj2016
Assets/Scripts/Enemy1.cs
Assets/Scripts/Enemy1.cs
using UnityEngine; using System.Collections; public class Enemy1 : EnnemisMain { private float timer = 2.1f; private float timeBetweenAttacks = 2.0f; private float timeAnimationAttack = 1.0f; // Use this for initialization void Start () { HP = HPInit; //Init closest tree target = findClosestTree().transform.position; lifeIndicator = transform.Find("LifeIndicator").gameObject; lifeIndicator.GetComponent<Renderer>().enabled = HPInit != HP; animator =gameObject.GetComponent<Animator> (); audioSource =gameObject.GetComponent<AudioSource> (); } public void moveEnemy(){ float step = speed * Time.deltaTime; transform.LookAt(target); transform.position = Vector3.MoveTowards(transform.position, target, step); } // Update is called once per frame void Update () { //Move object if (!hasReachTheTree && isAlive) { moveEnemy (); } if (hasReachTheTree && isAlive) { timer += Time.deltaTime; if (timer > timeBetweenAttacks) { StartCoroutine(attack()); timer=0; } } if(lifeIndicator != null) { //Show only of hurt/wounded lifeIndicator.GetComponent<Renderer>().enabled = HPInit != HP; //Rotate life indicator to face the camera lifeIndicator.transform.LookAt(lifeIndicatorLookTarget.transform.position); } /* // Commit suicide timer += Time.deltaTime; if (timer > 1) { SceneManager.addMana(5); takeDamage(100); timer=0; }*/ } IEnumerator attack() { //ici jouer les animations de mort avant la destruction yield return new WaitForEndOfFrame (); GameObject go = findClosestTree() as GameObject; if (go != null) { Tree tgo = go.GetComponent<Tree>(); tgo.take_dammage(this); } yield return 0; } }
using UnityEngine; using System.Collections; public class Enemy1 : EnnemisMain { private float timer = 2.1f; private float timeBetweenAttacks = 2.0f; private float timeAnimationAttack = 1.0f; // Use this for initialization void Start () { HP = HPInit; //Init closest tree target = findClosestTree().transform.position; lifeIndicator = transform.Find("LifeIndicator").gameObject; lifeIndicator.GetComponent<Renderer>().enabled = HPInit != HP; animator =gameObject.GetComponent<Animator> (); audioSource =gameObject.GetComponent<AudioSource> (); } public void moveEnemy(){ float step = speed * Time.deltaTime; transform.LookAt(target); transform.position = Vector3.MoveTowards(transform.position, target, step); } // Update is called once per frame void Update () { //Move object if (!hasReachTheTree && isAlive) { moveEnemy (); } if (hasReachTheTree && isAlive) { timer += Time.deltaTime; if (timer > timeBetweenAttacks) { StartCoroutine(attack()); timer=0; } } if(lifeIndicator != null) { //Show only of hurt/wounded lifeIndicator.GetComponent<Renderer>().enabled = HPInit != HP; //Rotate life indicator to face the camera lifeIndicator.transform.LookAt(lifeIndicatorLookTarget.transform.position); } /* // Commit suicide timer += Time.deltaTime; if (timer > 1) { SceneManager.addMana(5); takeDamage(100); timer=0; }*/ } IEnumerator attack() { //ici jouer les animations de mort avant la destruction yield return new WaitForEndOfFrame (); GameObject go = findClosestTree() as GameObject; if (go != null) { Tree tgo = go.GetComponent<Tree>(); tgo.take_dammage(this); Debug.Log(tgo.Tree_life); } yield return 0; } }
cc0-1.0
C#
3325b769cac8d11c7d58bdd2eb927f25709b16a1
Fix an exception message within a DomNodePropertyMatch constructor.
SonyWWS/ATF,JSandusky/ATF,JSandusky/ATF,twainj/ATF,jethac/ATF,blue3k/ATF,mszymczyk/ATF,gelahcem/ATF,SonyWWS/ATF,Nuclearfossil/ATF,blue3k/ATF,twainj/ATF,Nuclearfossil/ATF,SonyWWS/ATF,mindbaffle/ATF,mindbaffle/ATF,mszymczyk/ATF,JSandusky/ATF,Nuclearfossil/ATF,dogdirt2000/ATF,blue3k/ATF,blue3k/ATF,twainj/ATF,twainj/ATF,gelahcem/ATF,blue3k/ATF,dogdirt2000/ATF,dogdirt2000/ATF,mindbaffle/ATF,SonyWWS/ATF,gelahcem/ATF,SonyWWS/ATF,JSandusky/ATF,mszymczyk/ATF,jethac/ATF,jethac/ATF,gelahcem/ATF,dogdirt2000/ATF,mszymczyk/ATF,mszymczyk/ATF,gelahcem/ATF,JSandusky/ATF,jethac/ATF,dogdirt2000/ATF,twainj/ATF,jethac/ATF
Framework/Atf.Core/SearchAndReplace/DomNodePropertyMatch.cs
Framework/Atf.Core/SearchAndReplace/DomNodePropertyMatch.cs
//Copyright © 2014 Sony Computer Entertainment America LLC. See License.txt. using System; using System.ComponentModel; namespace Sce.Atf.Dom { /// <summary> /// Class that encapsulates a matching DomNode property, found during a DomNode property query</summary> public class DomNodePropertyMatch : IQueryMatch { /// <summary> /// Constructor</summary> private DomNodePropertyMatch() { } /// <summary> /// Constructor with property and DomNode</summary> /// <param name="property">The matching property</param> /// <param name="domNode">The DomNode with the matching property</param> public DomNodePropertyMatch(PropertyDescriptor property, DomNode domNode) { if (property == null) throw new ArgumentNullException("property", "Cannot create a DomNodePropertyMatchCandiate with a null property."); if (domNode == null) throw new ArgumentNullException("domNode", "Cannot create a DomNodePropertyMatchCandiate with a null domNode."); m_propertyDescriptor = property; m_domNode = domNode; } #region IQueryMatch /// <summary> /// Gets value of the DomNode's matching property</summary> public object GetValue() { return m_propertyDescriptor.GetValue(m_domNode); } /// <summary> /// Sets value of the DomNode's matching property</summary> public void SetValue(object value) { object correctlyTypedValue = Convert.ChangeType(value, GetValue().GetType()); if (correctlyTypedValue == null) throw new InvalidOperationException("Attempted to replace the value of a search result with an incompatible type"); m_propertyDescriptor.SetValue(m_domNode, correctlyTypedValue); } #endregion /// <summary> /// Gets or sets name of the DomNode's matching property</summary> public string Name { get { return m_propertyDescriptor.Name; } set { /* cannot change the name of a property descriptor */} } /// <summary> /// Gets DomNode's matching property descriptor</summary> public PropertyDescriptor PropertyDescriptor { get { return m_propertyDescriptor; } } protected PropertyDescriptor m_propertyDescriptor; protected DomNode m_domNode; } }
//Copyright © 2014 Sony Computer Entertainment America LLC. See License.txt. using System; using System.ComponentModel; namespace Sce.Atf.Dom { /// <summary> /// Class that encapsulates a matching DomNode property, found during a DomNode property query</summary> public class DomNodePropertyMatch : IQueryMatch { /// <summary> /// Constructor</summary> private DomNodePropertyMatch() { } /// <summary> /// Constructor with property and DomNode</summary> /// <param name="property">The matching property</param> /// <param name="domNode">The DomNode with the matching property</param> public DomNodePropertyMatch(PropertyDescriptor property, DomNode domNode) { if (property == null || domNode == null) throw new ArgumentNullException("Cannot create a DomNodePropertyMatchCandiate without valid non-null arguments"); m_propertyDescriptor = property; m_domNode = domNode; } #region IQueryMatch /// <summary> /// Gets value of the DomNode's matching property</summary> public object GetValue() { return m_propertyDescriptor.GetValue(m_domNode); } /// <summary> /// Sets value of the DomNode's matching property</summary> public void SetValue(object value) { object correctlyTypedValue = Convert.ChangeType(value, GetValue().GetType()); if (correctlyTypedValue == null) throw new InvalidOperationException("Attempted to replace the value of a search result with an incompatible type"); m_propertyDescriptor.SetValue(m_domNode, correctlyTypedValue); } #endregion /// <summary> /// Gets or sets name of the DomNode's matching property</summary> public string Name { get { return m_propertyDescriptor.Name; } set { /* cannot change the name of a property descriptor */} } /// <summary> /// Gets DomNode's matching property descriptor</summary> public PropertyDescriptor PropertyDescriptor { get { return m_propertyDescriptor; } } protected PropertyDescriptor m_propertyDescriptor; protected DomNode m_domNode; } }
apache-2.0
C#
73f5db962df459669c3752fc4129a9ee06eed9e6
Create server side API for single multiple answer question
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRespository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var question = _dbContext.SingleMultipleAnswerQuestion.ToList(); return question; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption[] singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); foreach(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOptionElement in singleMultipleAnswerQuestionOption) { singleMultipleAnswerQuestionOptionElement.SingleMultipleAnswerQuestionID = singleMultipleAnswerQuestion.Id; _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOptionElement); } _dbContext.SaveChanges(); } /// <summary> /// Adding single multiple answer question into SingleMultipleAnswerQuestion model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); _dbContext.SaveChanges(); } } }
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRespository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var question = _dbContext.SingleMultipleAnswerQuestion.ToList(); return question; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption[] singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); foreach(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOptionElement in singleMultipleAnswerQuestionOption) { singleMultipleAnswerQuestionOptionElement.SingleMultipleAnswerQuestionID = singleMultipleAnswerQuestion.Id; _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOptionElement); } _dbContext.SaveChanges(); } } }
mit
C#
2c02b56faea02635cd1b6985880ae00dabccbf49
Fix version number 2.0.3.0 => 2.0.3
bungeemonkee/Configgy
Configgy/Properties/AssemblyInfo.cs
Configgy/Properties/AssemblyInfo.cs
using System.Resources; using System.Reflection; // 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("Configgy")] [assembly: AssemblyDescription("Configgy: Configuration library for .NET")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif [assembly: AssemblyCompany("David Love")] [assembly: AssemblyProduct("Configgy")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values. // We will increase these values in the following way: // Major Version : Increased when there is a release that breaks a public api // Minor Version : Increased for each non-api-breaking release // Build Number : 0 for alpha versions, 1 for beta versions, 2 for release candidates, 3 for releases // Revision : Always 0 for release versions, always 1+ for alpha, beta, rc versions to indicate the alpha/beta/rc number [assembly: AssemblyVersion("2.0.3.0")] [assembly: AssemblyFileVersion("2.0.3.0")] // This version number will roughly follow semantic versioning : http://semver.org // The first three numbers will always match the first the numbers of the version above. [assembly: AssemblyInformationalVersion("2.0.3")]
using System.Resources; using System.Reflection; // 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("Configgy")] [assembly: AssemblyDescription("Configgy: Configuration library for .NET")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif [assembly: AssemblyCompany("David Love")] [assembly: AssemblyProduct("Configgy")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values. // We will increase these values in the following way: // Major Version : Increased when there is a release that breaks a public api // Minor Version : Increased for each non-api-breaking release // Build Number : 0 for alpha versions, 1 for beta versions, 2 for release candidates, 3 for releases // Revision : Always 0 for release versions, always 1+ for alpha, beta, rc versions to indicate the alpha/beta/rc number [assembly: AssemblyVersion("2.0.3.0")] [assembly: AssemblyFileVersion("2.0.3.0")] // This version number will roughly follow semantic versioning : http://semver.org // The first three numbers will always match the first the numbers of the version above. [assembly: AssemblyInformationalVersion("2.0.3.0")]
mit
C#
99e84b895e5a4e8fbe0480ed72cdd98ef674ea4a
fix Upgrade_20220513_UserHolder
signumsoftware/framework,signumsoftware/framework
Signum.Upgrade/Upgrades/Upgrade_20220513_UserHolder.cs
Signum.Upgrade/Upgrades/Upgrade_20220513_UserHolder.cs
namespace Signum.Upgrade.Upgrades; class Upgrade_20220513_UserHolder : CodeUpgradeBase { public override string Description => "Adapt to UserEntity.Current being Lite"; public override void Execute(UpgradeContext uctx) { uctx.ForeachCodeFile("*.cs", file => { file.Replace("UserEntity.Current.Role", "RoleEntity.Current"); file.Replace("UserEntity.Current.ToLite()", "UserEntity.Current"); file.Replace("UserEntity.Current.Mixin<UserADMixin>().OID", "UserADMixin.CurrentOID"); file.Replace("UserEntity.Current?.CultureInfo", "UserEntity.CurrentUserCulture"); file.Replace("UserEntity.Current.CultureInfo", "UserEntity.CurrentUserCulture"); }); } }
namespace Signum.Upgrade.Upgrades; class Upgrade_20220513_UserHolder : CodeUpgradeBase { public override string Description => "Replace UserEntity.Current to Lite"; public override void Execute(UpgradeContext uctx) { uctx.ForeachCodeFile("*.cs", file => { file.Replace("UserEntity.Current.Role", "RoleEntity.Current"); file.Replace("UserEntity.Current.ToLite()", "UserEntity.Current"); file.Replace("UserEntity.Current.Mixin<UserADMixin>().OID", "UserADMixin.CurrentOID"); file.Replace("UserEntity.Current?.CultureInfo", "UserEntity.CurrentUserCulture"); file.Replace("UserEntity.Current.CultureInfo", "UserEntity.CurrentUserCulture"); }); } }
mit
C#
b79a28ddf753ccbefce07141bcba68d7c0ef2cf5
Fix multiple transforms test
junlapong/elasticsearch-net,starckgates/elasticsearch-net,RossLieberman/NEST,adam-mccoy/elasticsearch-net,abibell/elasticsearch-net,KodrAus/elasticsearch-net,robrich/elasticsearch-net,gayancc/elasticsearch-net,LeoYao/elasticsearch-net,joehmchan/elasticsearch-net,faisal00813/elasticsearch-net,joehmchan/elasticsearch-net,wawrzyn/elasticsearch-net,UdiBen/elasticsearch-net,starckgates/elasticsearch-net,UdiBen/elasticsearch-net,gayancc/elasticsearch-net,tkirill/elasticsearch-net,amyzheng424/elasticsearch-net,UdiBen/elasticsearch-net,faisal00813/elasticsearch-net,abibell/elasticsearch-net,ststeiger/elasticsearch-net,adam-mccoy/elasticsearch-net,cstlaurent/elasticsearch-net,azubanov/elasticsearch-net,DavidSSL/elasticsearch-net,tkirill/elasticsearch-net,SeanKilleen/elasticsearch-net,robertlyson/elasticsearch-net,cstlaurent/elasticsearch-net,jonyadamit/elasticsearch-net,robrich/elasticsearch-net,mac2000/elasticsearch-net,CSGOpenSource/elasticsearch-net,LeoYao/elasticsearch-net,joehmchan/elasticsearch-net,robertlyson/elasticsearch-net,abibell/elasticsearch-net,junlapong/elasticsearch-net,adam-mccoy/elasticsearch-net,DavidSSL/elasticsearch-net,elastic/elasticsearch-net,TheFireCookie/elasticsearch-net,LeoYao/elasticsearch-net,CSGOpenSource/elasticsearch-net,starckgates/elasticsearch-net,jonyadamit/elasticsearch-net,geofeedia/elasticsearch-net,azubanov/elasticsearch-net,TheFireCookie/elasticsearch-net,ststeiger/elasticsearch-net,mac2000/elasticsearch-net,amyzheng424/elasticsearch-net,RossLieberman/NEST,SeanKilleen/elasticsearch-net,tkirill/elasticsearch-net,RossLieberman/NEST,elastic/elasticsearch-net,azubanov/elasticsearch-net,faisal00813/elasticsearch-net,mac2000/elasticsearch-net,DavidSSL/elasticsearch-net,KodrAus/elasticsearch-net,amyzheng424/elasticsearch-net,TheFireCookie/elasticsearch-net,robrich/elasticsearch-net,SeanKilleen/elasticsearch-net,KodrAus/elasticsearch-net,wawrzyn/elasticsearch-net,junlapong/elasticsearch-net,geofeedia/elasticsearch-net,robertlyson/elasticsearch-net,gayancc/elasticsearch-net,cstlaurent/elasticsearch-net,jonyadamit/elasticsearch-net,ststeiger/elasticsearch-net,geofeedia/elasticsearch-net,wawrzyn/elasticsearch-net,CSGOpenSource/elasticsearch-net
src/Tests/Nest.Tests.Unit/Core/Map/Transform/MappingTansformTests.cs
src/Tests/Nest.Tests.Unit/Core/Map/Transform/MappingTansformTests.cs
using Nest.Tests.MockData.Domain; using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace Nest.Tests.Unit.Core.Map.Transform { [TestFixture] public class MappingTansformTests : BaseJsonTests { [Test] public void SingleTransform() { var result = this._client.Map<ElasticsearchProject>(m => m .Transform(t => t .Script("if (ctx._source['title']?.startsWith('t')) ctx._source['suggest'] = ctx._source['content']") .Params(new Dictionary<string, string> { { "my-variable", "my-value" } }) .Language("groovy") ) ); this.JsonEquals(result.ConnectionStatus.Request, MethodInfo.GetCurrentMethod()); } [Test] public void MultipleTransforms() { var result = this._client.Map<ElasticsearchProject>(m => m .Transform(t => t .Script("ctx._source['suggest'] = ctx._source['content']") ) .Transform(t => t .Script("ctx._source['foo'] = ctx._source['bar'];") ) ); this.JsonEquals(result.ConnectionStatus.Request, MethodInfo.GetCurrentMethod()); } } }
using Nest.Tests.MockData.Domain; using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace Nest.Tests.Unit.Core.Map.Transform { [TestFixture] public class MappingTansformTests : BaseJsonTests { [Test] public void SingleTransform() { var result = this._client.Map<ElasticsearchProject>(m => m .Transform(t => t .Script("if (ctx._source['title']?.startsWith('t')) ctx._source['suggest'] = ctx._source['content']") .Params(new Dictionary<string, string> { { "my-variable", "my-value" } }) .Language("groovy") ) ); this.JsonEquals(result.ConnectionStatus.Request, MethodInfo.GetCurrentMethod()); } [Test] public void MultipleTransformsTest() { var result = this._client.Map<ElasticsearchProject>(m => m .Transform(t => t .Script("ctx._source['suggest'] = ctx._source['content']") ) .Transform(t => t .Script("ctx._source['foo'] = ctx._source['bar'];") ) ); } } }
apache-2.0
C#
f953896395953a16d1ca65aa3093036ef6858155
Change reverted
Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex
backend/tools/Migrate_01/OldEvents/ContentUpdateProposed.cs
backend/tools/Migrate_01/OldEvents/ContentUpdateProposed.cs
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System; using Squidex.Domain.Apps.Core.Contents; using Squidex.Domain.Apps.Events; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Migrations; using Squidex.Infrastructure.Reflection; namespace Migrate_01.OldEvents { [EventType(nameof(ContentUpdateProposed))] [Obsolete] public sealed class ContentUpdateProposed : SquidexEvent, IMigrated<IEvent> { public NamedContentData Data { get; set; } public IEvent Migrate() { return SimpleMapper.Map(this, new NoopConventEvent()); } } }
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System; using Squidex.Domain.Apps.Core.Contents; using Squidex.Domain.Apps.Events; using Squidex.Domain.Apps.Events.Contents; using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Migrations; using Squidex.Infrastructure.Reflection; namespace Migrate_01.OldEvents { [EventType(nameof(ContentUpdateProposed))] [Obsolete] public sealed class ContentUpdateProposed : SquidexEvent, IMigrated<IEvent> { public NamedContentData Data { get; set; } public IEvent Migrate() { return SimpleMapper.Map(this, new ContentUpdated()); } } }
mit
C#
c5dce92a9f5bd94de328a07845692741e00f073f
Make vector3 immutable
dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo,dmweis/DynamixelServo
DynamixelServo.Quadruped/Vector3.cs
DynamixelServo.Quadruped/Vector3.cs
namespace DynamixelServo.Quadruped { public struct Vector3 { public readonly float X; public readonly float Y; public readonly float Z; public Vector3(float x, float y, float z) { X = x; Y = y; Z = z; } public static Vector3 operator +(Vector3 a, Vector3 b) { return new Vector3(a.X + b.X, a.Y + b.Y, a.Z + b.Z); } public static Vector3 operator -(Vector3 a, Vector3 b) { return new Vector3(a.X - b.X, a.Y - b.Y, a.Z - b.Z); } public static Vector3 operator -(Vector3 a, Vector2 b) { return new Vector3(a.X - b.X, a.Y - b.Y, a.Z); } public static explicit operator Vector3(Vector2 vector) { return new Vector3(vector.X, vector.Y, 0); } } }
namespace DynamixelServo.Quadruped { public struct Vector3 { public float X; public float Y; public float Z; public Vector3(float x, float y, float z) { X = x; Y = y; Z = z; } public static Vector3 operator +(Vector3 a, Vector3 b) { return new Vector3(a.X + b.X, a.Y + b.Y, a.Z + b.Z); } public static Vector3 operator -(Vector3 a, Vector3 b) { return new Vector3(a.X - b.X, a.Y - b.Y, a.Z - b.Z); } public static Vector3 operator -(Vector3 a, Vector2 b) { return new Vector3(a.X - b.X, a.Y - b.Y, a.Z); } public static explicit operator Vector3(Vector2 vector) { return new Vector3(vector.X, vector.Y, 0); } } }
apache-2.0
C#
4aac30e7943a46b4cec79077045bec704bf1b2a5
Prepare release 4.5.4 - update file version. Work Item #1920
CslaGenFork/CslaGenFork,CslaGenFork/CslaGenFork,CslaGenFork/CslaGenFork,CslaGenFork/CslaGenFork
trunk/Solutions/CslaGenFork/Properties/AssemblyInfo.cs
trunk/Solutions/CslaGenFork/Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("Csla Generator Fork")] [assembly: AssemblyDescription("CSLA.NET Business Objects and Data Access Layer code generation tool.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("CslaGenFork Project")] [assembly: AssemblyProduct("Csla Generator Fork")] [assembly: AssemblyCopyright("Copyright CslaGen Project 2007, 2009\r\nCopyright Tiago Freitas Leal 2009, 2015")] [assembly: AssemblyTrademark("All Rights Reserved.")] [assembly: AssemblyCulture("")] [assembly: CLSCompliant(false)] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] [assembly: AssemblyVersion("4.5.4")] [assembly: AssemblyFileVersionAttribute("4.5.4")] [assembly: GuidAttribute("5c019c4f-d2ab-40dd-9860-70bd603b6017")] [assembly: ComVisibleAttribute(false)]
using System; using System.Reflection; using System.Runtime.InteropServices; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("Csla Generator Fork")] [assembly: AssemblyDescription("CSLA.NET Business Objects and Data Access Layer code generation tool.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("CslaGenFork Project")] [assembly: AssemblyProduct("Csla Generator Fork")] [assembly: AssemblyCopyright("Copyright CslaGen Project 2007, 2009\r\nCopyright Tiago Freitas Leal 2009, 2015")] [assembly: AssemblyTrademark("All Rights Reserved.")] [assembly: AssemblyCulture("")] [assembly: CLSCompliant(false)] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] [assembly: AssemblyVersion("4.5.3")] [assembly: AssemblyFileVersionAttribute("4.5.3")] [assembly: GuidAttribute("5c019c4f-d2ab-40dd-9860-70bd603b6017")] [assembly: ComVisibleAttribute(false)]
mit
C#
e320cda6443b4db587efd7beaa006b752c13e22b
Refactor to use Krystal.Core
Luke-Wolf/krystal-voicecontrol
Krystal.Voice/Program.cs
Krystal.Voice/Program.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using Krystal.Core; namespace Krystal.Voice { class MyPipeline : UtilMPipeline { /*ProcessStartInfo startMusic = new ProcessStartInfo("..\\..\\Media\\Green Bird.mp3"); ProcessStartInfo startMovie = new ProcessStartInfo("..\\..\\Media\\Frozen.mp4"); ProcessStartInfo startPowerPoint = new ProcessStartInfo("..\\..\\Media\\Proposal.pptx"); */ readonly Controller controller = new Controller(new Core.ICommand[] { new PlayMusicCommand("..\\..\\Media\\Green Bird.mp3"), new PlayVideoCommand("..\\..\\Media\\Frozen.mp4"), new PlayPowerpointCommand("..\\..\\Media\\Proposal.pptx") }); public MyPipeline() : base() { EnableVoiceRecognition(); } public override void OnRecognized(ref PXCMVoiceRecognition.Recognition data) { controller.Execute(data.dictation); /*if (data.dictation.ToString().ToLower().Contains("music")) Process.Start(startMusic); if (data.dictation.ToString().ToLower().Contains("movie")) Process.Start(startMovie); if (data.dictation.ToString().ToLower().Contains("powerpoint")) Process.Start(startPowerPoint); */ //Console.WriteLine("Recognized: " + data.dictation); //if (data.ToString() == "Play music") {} } } static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Kristal()); } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication { class MyPipeline : UtilMPipeline { ProcessStartInfo startMusic = new ProcessStartInfo("..\\..\\Media\\Green Bird.mp3"); ProcessStartInfo startMovie = new ProcessStartInfo("..\\..\\Media\\Frozen.mp4"); ProcessStartInfo startPowerPoint = new ProcessStartInfo("..\\..\\Media\\Proposal.pptx"); public MyPipeline() : base() { EnableVoiceRecognition(); } public override void OnRecognized(ref PXCMVoiceRecognition.Recognition data) { if (data.dictation.ToString().ToLower().Contains("music")) Process.Start(startMusic); if (data.dictation.ToString().ToLower().Contains("movie")) Process.Start(startMovie); if (data.dictation.ToString().ToLower().Contains("powerpoint")) Process.Start(startPowerPoint); //Console.WriteLine("Recognized: " + data.dictation); //if (data.ToString() == "Play music") {} } } static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Kristal()); } } }
apache-2.0
C#
244670a05827316a99946c4e3b3178de67236708
Fix menor de ejemplo
TheXDS/MCART
Examples/PictVGA/MainWindow.xaml.cs
Examples/PictVGA/MainWindow.xaml.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace TheXDS.MCART.Samples.PictVGA { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DataContext = new PictureViewModel(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace TheXDS.MCART.Samples.PictVGA { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } }
mit
C#
a42b145544334f7c1702d50a9e2bb9257fd0cd21
Bump version to 11.2.0.24769
HearthSim/HearthDb
HearthDb/Properties/AssemblyInfo.cs
HearthDb/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("HearthDb")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HearthSim")] [assembly: AssemblyProduct("HearthDb")] [assembly: AssemblyCopyright("Copyright © HearthSim 2018")] [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("7ed14243-e02b-4b94-af00-a67a62c282f0")] // 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("11.2.0.24769")] [assembly: AssemblyFileVersion("11.2.0.24769")]
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("HearthDb")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HearthSim")] [assembly: AssemblyProduct("HearthDb")] [assembly: AssemblyCopyright("Copyright © HearthSim 2018")] [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("7ed14243-e02b-4b94-af00-a67a62c282f0")] // 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("11.1.1.24589")] [assembly: AssemblyFileVersion("11.1.1.24589")]
mit
C#
d791d593f88a9fafc46aeb976991be60955ca547
Truncate unused InternalsVisibleTo
DevExpress/DevExtreme.AspNet.Data,AlekseyMartynov/DevExtreme.AspNet.Data,DevExpress/DevExtreme.AspNet.Data,AlekseyMartynov/DevExtreme.AspNet.Data,AlekseyMartynov/DevExtreme.AspNet.Data,AlekseyMartynov/DevExtreme.AspNet.Data,DevExpress/DevExtreme.AspNet.Data,DevExpress/DevExtreme.AspNet.Data
net/DevExtreme.AspNet.Data/AssemblyInfo.cs
net/DevExtreme.AspNet.Data/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.CompilerServices; #if DEBUG [assembly: InternalsVisibleTo("DevExtreme.AspNet.Data.Tests")] [assembly: InternalsVisibleTo("DevExtreme.AspNet.Data.Tests.Common")] #endif [assembly: CLSCompliant(true)] #if !DEBUG [assembly: AssemblyKeyFile("release.snk")] #endif
using System; using System.Reflection; using System.Runtime.CompilerServices; #if DEBUG [assembly: InternalsVisibleTo("DevExtreme.AspNet.Data.Tests")] [assembly: InternalsVisibleTo("DevExtreme.AspNet.Data.Tests.Common")] [assembly: InternalsVisibleTo("DevExtreme.AspNet.Data.Tests.EF6")] [assembly: InternalsVisibleTo("DevExtreme.AspNet.Data.Tests.EFCore1")] [assembly: InternalsVisibleTo("DevExtreme.AspNet.Data.Tests.EFCore2")] #endif [assembly: CLSCompliant(true)] #if !DEBUG [assembly: AssemblyKeyFile("release.snk")] #endif
mit
C#
77b017cf039ac8b6aaea77889050630d65771374
Switch to kanban by status
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
Battery-Commander.Web/Views/PurchaseOrders/Index.cshtml
Battery-Commander.Web/Views/PurchaseOrders/Index.cshtml
@{ ViewBag.Title = "Purchase Order Tracker"; } <div class="page-header"> <h1>@ViewBag.Title</h1> </div> <div class="btn-group"> @Html.ActionLink("Add New", "Create", "PurchaseOrders", null, new { @class = "btn btn-default" }) </div> <!-- AirTable Embed Script for List --> <iframe class="airtable-embed" src="https://airtable.com/embed/shrnIihqGHfCKkOvp?backgroundColor=gray&viewControls=on" frameborder="0" onmousewheel="" width="100%" height="533" style="background: transparent; border: 1px solid #ccc;"></iframe>
@{ ViewBag.Title = "Purchase Order Tracker"; } <div class="page-header"> <h1>@ViewBag.Title</h1> </div> <div class="btn-group"> @Html.ActionLink("Add New", "Create", "PurchaseOrders", null, new { @class = "btn btn-default" }) </div> <!-- AirTable Embed Script for List --> <iframe class="airtable-embed" src="https://airtable.com/embed/shr0Oyic09SX3DbSN?backgroundColor=gray&viewControls=on" frameborder="0" onmousewheel="" width="100%" height="533" style="background: transparent; border: 1px solid #ccc;"></iframe>
mit
C#
e3107a7837d595220e8a3b08c8491d1e8383eda4
Update CreateInstanceForSerial constructor for .NET lib (#183)
Eclo/nf-debugger,nanoframework/nf-debugger
source/nanoFramework.Tools.DebugLibrary.Net/PortDefinitions/PortBase.cs
source/nanoFramework.Tools.DebugLibrary.Net/PortDefinitions/PortBase.cs
// // Copyright (c) 2017 The nanoFramework project contributors // See LICENSE file in the project root for full license information. // using nanoFramework.Tools.Debugger.PortSerial; namespace nanoFramework.Tools.Debugger { public abstract partial class PortBase { public static PortBase CreateInstanceForSerial(string displayName, object callerApp = null, bool startDeviceWatchers = true) { return new SerialPort(callerApp, startDeviceWatchers); } } }
// // Copyright (c) 2017 The nanoFramework project contributors // See LICENSE file in the project root for full license information. // using nanoFramework.Tools.Debugger.PortSerial; namespace nanoFramework.Tools.Debugger { public abstract partial class PortBase { public static PortBase CreateInstanceForSerial(string displayName, object callerApp = null) { return new SerialPort(callerApp); } } }
apache-2.0
C#
a27f25b216aa16a00fe02616cb4de495b8c0f586
Fix ChildrenOfType<> early exit for matching types
ppy/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,peppy/osu-framework,ZLima12/osu-framework
osu.Framework/Testing/TestingExtensions.cs
osu.Framework/Testing/TestingExtensions.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; namespace osu.Framework.Testing { public static class TestingExtensions { /// <summary> /// Find all children recursively of a specific type. As this is expensive and dangerous, it should only be used for testing purposes. /// </summary> public static IEnumerable<T> ChildrenOfType<T>(this Drawable drawable) where T : Drawable { switch (drawable) { case T found: yield return found; if (found is CompositeDrawable foundComposite) { foreach (var foundChild in handleComposite(foundComposite)) yield return foundChild; } break; case CompositeDrawable composite: foreach (var found in handleComposite(composite)) yield return found; break; } static IEnumerable<T> handleComposite(CompositeDrawable composite) { foreach (var child in composite.InternalChildren) { foreach (var found in child.ChildrenOfType<T>()) yield return found; } } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; namespace osu.Framework.Testing { public static class TestingExtensions { /// <summary> /// Find all children recursively of a specific type. As this is expensive and dangerous, it should only be used for testing purposes. /// </summary> public static IEnumerable<T> ChildrenOfType<T>(this Drawable drawable) where T : Drawable { switch (drawable) { case T found: yield return found; break; case CompositeDrawable composite: foreach (var child in composite.InternalChildren) { foreach (var found in child.ChildrenOfType<T>()) yield return found; } break; } } } }
mit
C#
ce46eb12a651a08731292356163275590b131f64
Split code onto multiple lines for debugging purposes
twxstar/CefSharp,joshvera/CefSharp,wangzheng888520/CefSharp,joshvera/CefSharp,ruisebastiao/CefSharp,jamespearce2006/CefSharp,Octopus-ITSM/CefSharp,Octopus-ITSM/CefSharp,twxstar/CefSharp,rover886/CefSharp,battewr/CefSharp,Haraguroicha/CefSharp,AJDev77/CefSharp,zhangjingpu/CefSharp,battewr/CefSharp,rlmcneary2/CefSharp,Haraguroicha/CefSharp,joshvera/CefSharp,windygu/CefSharp,VioletLife/CefSharp,battewr/CefSharp,dga711/CefSharp,illfang/CefSharp,ITGlobal/CefSharp,gregmartinhtc/CefSharp,AJDev77/CefSharp,Octopus-ITSM/CefSharp,windygu/CefSharp,Livit/CefSharp,Livit/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,rlmcneary2/CefSharp,VioletLife/CefSharp,gregmartinhtc/CefSharp,ruisebastiao/CefSharp,gregmartinhtc/CefSharp,Haraguroicha/CefSharp,dga711/CefSharp,rlmcneary2/CefSharp,illfang/CefSharp,jamespearce2006/CefSharp,Livit/CefSharp,wangzheng888520/CefSharp,Haraguroicha/CefSharp,illfang/CefSharp,ITGlobal/CefSharp,rlmcneary2/CefSharp,haozhouxu/CefSharp,rover886/CefSharp,illfang/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,dga711/CefSharp,yoder/CefSharp,rover886/CefSharp,rover886/CefSharp,NumbersInternational/CefSharp,battewr/CefSharp,twxstar/CefSharp,windygu/CefSharp,yoder/CefSharp,wangzheng888520/CefSharp,NumbersInternational/CefSharp,zhangjingpu/CefSharp,NumbersInternational/CefSharp,gregmartinhtc/CefSharp,wangzheng888520/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,zhangjingpu/CefSharp,twxstar/CefSharp,yoder/CefSharp,NumbersInternational/CefSharp,joshvera/CefSharp,Livit/CefSharp,dga711/CefSharp,AJDev77/CefSharp,ruisebastiao/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,rover886/CefSharp,ITGlobal/CefSharp,ITGlobal/CefSharp,zhangjingpu/CefSharp,Octopus-ITSM/CefSharp,haozhouxu/CefSharp,VioletLife/CefSharp,windygu/CefSharp,AJDev77/CefSharp
CefSharp.BrowserSubprocess/CefRenderProcess.cs
CefSharp.BrowserSubprocess/CefRenderProcess.cs
using CefSharp.Internals; using System.Collections.Generic; using System.ServiceModel; namespace CefSharp.BrowserSubprocess { public class CefRenderProcess : CefSubProcess, IRenderProcess { private DuplexChannelFactory<IBrowserProcess> channelFactory; private CefBrowserBase browser; public CefBrowserBase Browser { get { return browser; } } public CefRenderProcess(IEnumerable<string> args) : base(args) { } protected override void DoDispose(bool isDisposing) { DisposeMember(ref browser); base.DoDispose(isDisposing); } public override void OnBrowserCreated(CefBrowserBase cefBrowserWrapper) { browser = cefBrowserWrapper; if (ParentProcessId == null) { return; } var serviceName = RenderprocessClientFactory.GetServiceName(ParentProcessId.Value, cefBrowserWrapper.BrowserId); channelFactory = new DuplexChannelFactory<IBrowserProcess>( this, new NetNamedPipeBinding(), new EndpointAddress(serviceName) ); channelFactory.Open(); var proxy = CreateBrowserProxy(); var javascriptObject = proxy.GetRegisteredJavascriptObjects(); Bind(javascriptObject); } public object EvaluateScript(int frameId, string script, double timeout) { var result = Browser.EvaluateScript(frameId, script, timeout); return result; } public override IBrowserProcess CreateBrowserProxy() { return channelFactory.CreateChannel(); } } }
using CefSharp.Internals; using System.Collections.Generic; using System.ServiceModel; namespace CefSharp.BrowserSubprocess { public class CefRenderProcess : CefSubProcess, IRenderProcess { private DuplexChannelFactory<IBrowserProcess> channelFactory; private CefBrowserBase browser; public CefBrowserBase Browser { get { return browser; } } public CefRenderProcess(IEnumerable<string> args) : base(args) { } protected override void DoDispose(bool isDisposing) { DisposeMember(ref browser); base.DoDispose(isDisposing); } public override void OnBrowserCreated(CefBrowserBase cefBrowserWrapper) { browser = cefBrowserWrapper; if (ParentProcessId == null) { return; } var serviceName = RenderprocessClientFactory.GetServiceName(ParentProcessId.Value, cefBrowserWrapper.BrowserId); channelFactory = new DuplexChannelFactory<IBrowserProcess>( this, new NetNamedPipeBinding(), new EndpointAddress(serviceName) ); channelFactory.Open(); Bind(CreateBrowserProxy().GetRegisteredJavascriptObjects()); } public object EvaluateScript(int frameId, string script, double timeout) { var result = Browser.EvaluateScript(frameId, script, timeout); return result; } public override IBrowserProcess CreateBrowserProxy() { return channelFactory.CreateChannel(); } } }
bsd-3-clause
C#
5d9f749894b87671c0923cc71bc58c0f1fc70c7d
Bump to 2.1
kcjuntunen/ArchivePDF
ArchivePDF/Properties/AssemblyInfo.cs
ArchivePDF/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("ArchivePDF")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("ArchivePDF")] [assembly: AssemblyCopyright("Copyright © Microsoft 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("f01fe2e7-c626-4193-af90-65c8e15f4713")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.1.0.0")] [assembly: AssemblyFileVersion("2.1.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("ArchivePDF")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("ArchivePDF")] [assembly: AssemblyCopyright("Copyright © Microsoft 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("f01fe2e7-c626-4193-af90-65c8e15f4713")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")]
bsd-3-clause
C#
2d712b4bc391a87d73d6d1e6b9ed8260e32e767a
Bump version.
kyourek/Pagination,kyourek/Pagination,kyourek/Pagination
sln/AssemblyVersion.cs
sln/AssemblyVersion.cs
using System.Reflection; [assembly: AssemblyVersion("2.0.3")]
using System.Reflection; [assembly: AssemblyVersion("2.0.2.1")]
mit
C#
09f5378767503a032accdbe9890ccdd28405345e
Use file-scoped namespace
martincostello/alexa-london-travel
src/LondonTravel.Skill/Log.cs
src/LondonTravel.Skill/Log.cs
// Copyright (c) Martin Costello, 2017. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. using Microsoft.Extensions.Logging; namespace MartinCostello.LondonTravel.Skill; /// <summary> /// A class containing log messages for the skill. /// </summary> [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] internal static partial class Log { [LoggerMessage( EventId = 1, Level = LogLevel.Error, Message = "Failed to handle request for session {SessionId}.")] public static partial void HandlerException(ILogger logger, Exception exception, string sessionId); [LoggerMessage( EventId = 2, Level = LogLevel.Error, Message = "Failed to handle request for session {SessionId}. Error type {ErrorType} with cause {ErrorCause}: {ErrorMessage}")] public static partial void SystemError( ILogger logger, string sessionId, string errorType, string errorCause, string errorMessage); [LoggerMessage( EventId = 3, Level = LogLevel.Information, Message = "User with Id {UserId} has not linked account.")] public static partial void AccountNotLinked(ILogger logger, string userId); [LoggerMessage( EventId = 4, Level = LogLevel.Warning, Message = "Access token is invalid for user Id {UserId} and session Id {SessionId}.")] public static partial void InvalidAccessToken(ILogger logger, string userId, string sessionId); [LoggerMessage( EventId = 5, Level = LogLevel.Information, Message = "User with Id {UserId} has set no line preferences.")] public static partial void NoLinePreferences(ILogger logger, string userId); [LoggerMessage( EventId = 6, Level = LogLevel.Warning, Message = "Unknown intent {IntentName} cannot be handled for session Id {SessionId}.")] public static partial void UnknownIntent(ILogger logger, string intentName, string sessionId); }
// Copyright (c) Martin Costello, 2017. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. using Microsoft.Extensions.Logging; //// TODO Cannot use file-scoped namespace due to https://github.com/dotnet/runtime/issues/57880 namespace MartinCostello.LondonTravel.Skill { /// <summary> /// A class containing log messages for the skill. /// </summary> [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] internal static partial class Log { [LoggerMessage( EventId = 1, Level = LogLevel.Error, Message = "Failed to handle request for session {SessionId}.")] public static partial void HandlerException(ILogger logger, Exception exception, string sessionId); [LoggerMessage( EventId = 2, Level = LogLevel.Error, Message = "Failed to handle request for session {SessionId}. Error type {ErrorType} with cause {ErrorCause}: {ErrorMessage}")] public static partial void SystemError( ILogger logger, string sessionId, string errorType, string errorCause, string errorMessage); [LoggerMessage( EventId = 3, Level = LogLevel.Information, Message = "User with Id {UserId} has not linked account.")] public static partial void AccountNotLinked(ILogger logger, string userId); [LoggerMessage( EventId = 4, Level = LogLevel.Warning, Message = "Access token is invalid for user Id {UserId} and session Id {SessionId}.")] public static partial void InvalidAccessToken(ILogger logger, string userId, string sessionId); [LoggerMessage( EventId = 5, Level = LogLevel.Information, Message = "User with Id {UserId} has set no line preferences.")] public static partial void NoLinePreferences(ILogger logger, string userId); [LoggerMessage( EventId = 6, Level = LogLevel.Warning, Message = "Unknown intent {IntentName} cannot be handled for session Id {SessionId}.")] public static partial void UnknownIntent(ILogger logger, string intentName, string sessionId); } }
apache-2.0
C#
aa6b9b9beafefd807602dd75fba2da7e51817c56
Add support for new custom swagger attributes
JustArchi/ArchiSteamFarm,JustArchi/ArchiSteamFarm,JustArchi/ArchiSteamFarm,JustArchi/ArchiSteamFarm
ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperConfig.cs
ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperConfig.cs
// _ _ _ ____ _ _____ // / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___ // / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \ // / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | | // /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_| // | // Copyright 2015-2021 Łukasz "JustArchi" Domeradzki // Contact: JustArchi@JustArchi.net // | // 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.Immutable; using System.Diagnostics.CodeAnalysis; using ArchiSteamFarm.IPC.Integration; using Newtonsoft.Json; namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper { [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] public sealed class SteamTokenDumperConfig { [JsonProperty(Required = Required.DisallowNull)] public bool Enabled { get; internal set; } [JsonProperty(Required = Required.DisallowNull)] [SwaggerItemsMinMax(MinimumUint = 1, MaximumUint = uint.MaxValue)] public ImmutableHashSet<uint> SecretAppIDs { get; private set; } = ImmutableHashSet<uint>.Empty; [JsonProperty(Required = Required.DisallowNull)] [SwaggerItemsMinMax(MinimumUint = 1, MaximumUint = uint.MaxValue)] public ImmutableHashSet<uint> SecretDepotIDs { get; private set; } = ImmutableHashSet<uint>.Empty; [JsonProperty(Required = Required.DisallowNull)] [SwaggerItemsMinMax(MinimumUint = 1, MaximumUint = uint.MaxValue)] public ImmutableHashSet<uint> SecretPackageIDs { get; private set; } = ImmutableHashSet<uint>.Empty; [JsonProperty(Required = Required.DisallowNull)] public bool SkipAutoGrantPackages { get; private set; } [JsonConstructor] internal SteamTokenDumperConfig() { } } }
// _ _ _ ____ _ _____ // / \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___ // / _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \ // / ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | | // /_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_| // | // Copyright 2015-2021 Łukasz "JustArchi" Domeradzki // Contact: JustArchi@JustArchi.net // | // 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.Immutable; using System.Diagnostics.CodeAnalysis; using Newtonsoft.Json; namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper { [SuppressMessage("ReSharper", "ClassCannotBeInstantiated")] public sealed class SteamTokenDumperConfig { [JsonProperty(Required = Required.DisallowNull)] public bool Enabled { get; internal set; } [JsonProperty(Required = Required.DisallowNull)] public ImmutableHashSet<uint> SecretAppIDs { get; private set; } = ImmutableHashSet<uint>.Empty; [JsonProperty(Required = Required.DisallowNull)] public ImmutableHashSet<uint> SecretDepotIDs { get; private set; } = ImmutableHashSet<uint>.Empty; [JsonProperty(Required = Required.DisallowNull)] public ImmutableHashSet<uint> SecretPackageIDs { get; private set; } = ImmutableHashSet<uint>.Empty; [JsonProperty(Required = Required.DisallowNull)] public bool SkipAutoGrantPackages { get; private set; } [JsonConstructor] internal SteamTokenDumperConfig() { } } }
apache-2.0
C#
92a6a7940225886ca1b575521f6cc7a7d5441fdb
Put link on the product view for subscription.
yyankova/CountryFoodSubscribe,yyankova/CountryFoodSubscribe
CountryFoodSubscribe/CountryFood.Web/Views/Shared/_ProductsPartial.cshtml
CountryFoodSubscribe/CountryFood.Web/Views/Shared/_ProductsPartial.cshtml
@model ICollection<CountryFood.Web.ViewModels.ProductViewModel> <h3>Products</h3> @foreach (var product in Model) { <div class="panel panel-body"> <div> <a href="">@product.Name</a> </div> <div> <span>Votes: </span> @(int.Parse(product.PositiveVotes) + int.Parse(product.NegativeVotes)) </div> <div> <span>Number of subscriptions: </span> @product.NumberOfSubscriptions </div> <div> <span>By: </span>@product.Producer </div> <div> @Html.ActionLink("Subscribe", "Create", "Subscriptions", new { productId = @product.Id }, new { }) </div> </div> }
@model ICollection<CountryFood.Web.ViewModels.ProductViewModel> <h3>Products</h3> @foreach (var product in Model) { <div class="panel panel-body"> <div> <a href="">@product.Name</a> </div> <div> <span>Votes: </span> @(int.Parse(product.PositiveVotes) + int.Parse(product.NegativeVotes)) </div> <div> <span>Number of subscriptions: </span> @product.NumberOfSubscriptions </div> <div> <span>By: </span>@product.Producer </div> </div> }
mit
C#
d9e4165235d779a262eb7525b54cd2567822f2b6
Fix a missing using
DotNetKit/DotNetKit.Wpf.Printing
DotNetKit.Wpf.Printing/Windows/Documents/Printables/IDataGridPrintable.cs
DotNetKit.Wpf.Printing/Windows/Documents/Printables/IDataGridPrintable.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using DotNetKit.Windows.Controls; namespace DotNetKit.Windows.Documents { /// <summary> /// Represents a printable object /// whose <see cref="DataTemplate"/> produces a control /// which implements <see cref="IPrintableDataGridContainer"/>. /// </summary> public interface IDataGridPrintable { IEnumerable Items { get; } object CreatePage(IEnumerable items, int pageIndex, int pageCount); } }
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace DotNetKit.Windows.Documents { /// <summary> /// Represents a printable object /// whose <see cref="DataTemplate"/> produces a control /// which implements <see cref="IPrintableDataGridContainer"/>. /// </summary> public interface IDataGridPrintable { IEnumerable Items { get; } object CreatePage(IEnumerable items, int pageIndex, int pageCount); } }
mit
C#
7986670ddb7ab2c262fc77a97c0d11038647f523
Remove HttpClient E2E tests
duracellko/planningpoker4azure,duracellko/planningpoker4azure,duracellko/planningpoker4azure
test/Duracellko.PlanningPoker.E2ETest/EnvironmentDataSourceAttribute.cs
test/Duracellko.PlanningPoker.E2ETest/EnvironmentDataSourceAttribute.cs
using System; using System.Collections.Generic; using System.Reflection; using Duracellko.PlanningPoker.E2ETest.Browser; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Duracellko.PlanningPoker.E2ETest { [AttributeUsage(AttributeTargets.Method)] public sealed class EnvironmentDataSourceAttribute : Attribute, ITestDataSource { public IEnumerable<object[]> GetData(MethodInfo methodInfo) { yield return new object[] { false, BrowserType.Chrome, false }; yield return new object[] { true, BrowserType.Chrome, false }; } public string GetDisplayName(MethodInfo methodInfo, object[] data) { if (data == null) { throw new ArgumentNullException(nameof(data)); } var blazorType = ((bool)data[0]) ? "Server-side" : "Client-side"; var browserType = data[1].ToString(); var connectionType = ((bool)data[2]) ? "HttpClient" : "SignalR"; return $"{blazorType} {browserType} {connectionType}"; } } }
using System; using System.Collections.Generic; using System.Reflection; using Duracellko.PlanningPoker.E2ETest.Browser; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Duracellko.PlanningPoker.E2ETest { [AttributeUsage(AttributeTargets.Method)] public sealed class EnvironmentDataSourceAttribute : Attribute, ITestDataSource { public IEnumerable<object[]> GetData(MethodInfo methodInfo) { yield return new object[] { false, BrowserType.Chrome, false }; yield return new object[] { true, BrowserType.Chrome, false }; yield return new object[] { false, BrowserType.Chrome, true }; yield return new object[] { true, BrowserType.Chrome, true }; } public string GetDisplayName(MethodInfo methodInfo, object[] data) { if (data == null) { throw new ArgumentNullException(nameof(data)); } var blazorType = ((bool)data[0]) ? "Server-side" : "Client-side"; var browserType = data[1].ToString(); var connectionType = ((bool)data[2]) ? "HttpClient" : "SignalR"; return $"{blazorType} {browserType} {connectionType}"; } } }
mit
C#
58de51a646e645e964d0ff34d46c94ef38dc1318
Add a list of path element types to Resolver
Domysee/Pather.CSharp
src/Pather.CSharp/Resolver.cs
src/Pather.CSharp/Resolver.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Reflection; using Pather.CSharp.PathElements; namespace Pather.CSharp { public class Resolver { private IList<Type> pathElementTypes; public Resolver() { pathElementTypes = new List<Type>(); pathElementTypes.Add(typeof(Property)); } public object Resolve(object target, string path) { var pathElements = path.Split('.'); var tempResult = target; foreach(var pathElement in pathElements) { PropertyInfo p = tempResult.GetType().GetProperty(pathElement); if (p == null) throw new ArgumentException($"The property {pathElement} could not be found."); tempResult = p.GetValue(tempResult); } var result = tempResult; return result; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Reflection; namespace Pather.CSharp { public class Resolver { public object Resolve(object target, string path) { var pathElements = path.Split('.'); var tempResult = target; foreach(var pathElement in pathElements) { PropertyInfo p = tempResult.GetType().GetProperty(pathElement); if (p == null) throw new ArgumentException($"The property {pathElement} could not be found."); tempResult = p.GetValue(tempResult); } var result = tempResult; return result; } } }
mit
C#
9449a980d6176bf4699ca124b2a5233d9ed78ca7
write null for JTokenType.Null
JSONAPIdotNET/JSONAPI.NET,danshapir/JSONAPI.NET,SathishN/JSONAPI.NET,SphtKr/JSONAPI.NET
JSONAPI/Core/DecimalAttributeValueConverter.cs
JSONAPI/Core/DecimalAttributeValueConverter.cs
using System; using System.Globalization; using System.Reflection; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace JSONAPI.Core { /// <summary> /// Implementation of <see cref="IAttributeValueConverter" /> suitable for /// use converting between decimal CLR properties and string attributes. /// </summary> public class DecimalAttributeValueConverter : IAttributeValueConverter { private readonly PropertyInfo _property; /// <summary> /// Creates a new DecimalAttributeValueConverter /// </summary> /// <param name="property"></param> public DecimalAttributeValueConverter(PropertyInfo property) { _property = property; } public JToken GetValue(object resource) { var value = _property.GetValue(resource); if (value == null) return null; try { return ((Decimal)value).ToString(CultureInfo.InvariantCulture); } catch (InvalidCastException e) { throw new JsonSerializationException("Could not serialize decimal value.", e); } } public void SetValue(object resource, JToken value) { if (value == null || value.Type == JTokenType.Null) _property.SetValue(resource, null); else { var stringTokenValue = value.Value<string>(); Decimal d; if (!Decimal.TryParse(stringTokenValue, NumberStyles.Any, CultureInfo.InvariantCulture, out d)) throw new JsonSerializationException("Could not parse decimal value."); _property.SetValue(resource, d); } } } }
using System; using System.Globalization; using System.Reflection; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace JSONAPI.Core { /// <summary> /// Implementation of <see cref="IAttributeValueConverter" /> suitable for /// use converting between decimal CLR properties and string attributes. /// </summary> public class DecimalAttributeValueConverter : IAttributeValueConverter { private readonly PropertyInfo _property; /// <summary> /// Creates a new DecimalAttributeValueConverter /// </summary> /// <param name="property"></param> public DecimalAttributeValueConverter(PropertyInfo property) { _property = property; } public JToken GetValue(object resource) { var value = _property.GetValue(resource); if (value == null) return null; try { return ((Decimal)value).ToString(CultureInfo.InvariantCulture); } catch (InvalidCastException e) { throw new JsonSerializationException("Could not serialize decimal value.", e); } } public void SetValue(object resource, JToken value) { if (value == null) _property.SetValue(resource, null); else { var stringTokenValue = value.Value<string>(); Decimal d; if (!Decimal.TryParse(stringTokenValue, NumberStyles.Any, CultureInfo.InvariantCulture, out d)) throw new JsonSerializationException("Could not parse decimal value."); _property.SetValue(resource, d); } } } }
mit
C#
b04c298c2c49ec05a57984d8422370aa74e1f2b9
Fix null reference exception in CommandStore.cs
Lohikar/XenoBot2
XenoBot2/CommandStore.cs
XenoBot2/CommandStore.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using XenoBot2.Shared; namespace XenoBot2 { internal class CommandStore : IEnumerable<KeyValuePair<string,Command>> { public static CommandStore Commands; private readonly IDictionary<string, Command> _commands; public Command this[string id] => _commands[id.ToLower()]; public void AddMany(IDictionary<string, Command> source) => source.ToList().ForEach(x => _commands.Add(x.Key, x.Value)); public void Add(string id, Command cmd) => _commands.Add(id, cmd); public bool Contains(string id) => _commands.ContainsKey(id.ToLower()); public CommandStore() { _commands = new Dictionary<string, Command>(); } public IEnumerator<KeyValuePair<string, Command>> GetEnumerator() { return _commands.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using XenoBot2.Shared; namespace XenoBot2 { internal class CommandStore : IEnumerable<KeyValuePair<string,Command>> { public static CommandStore Commands; private IDictionary<string, Command> _commands; public Command this[string id] => _commands[id.ToLower()]; public void AddMany(IDictionary<string, Command> source) => source.ToList().ForEach(x => _commands.Add(x.Key, x.Value)); public void Add(string id, Command cmd) => _commands.Add(id, cmd); public bool Contains(string id) => _commands.ContainsKey(id.ToLower()); public IEnumerator<KeyValuePair<string, Command>> GetEnumerator() { return _commands.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }
mit
C#
65629c1fab875acfc1b2d035ec9b2c919f6d1f30
Update procfile fixture sample
cloudfoundry-community/.net-buildpack,Hitakashi/.net-buildpack,aidothebrit/dotnet-buildpack,Hitakashi/.net-buildpack,cloudfoundry-community/.net-buildpack,cloudfoundry-community/.net-buildpack,Hitakashi/.net-buildpack,aidothebrit/dotnet-buildpack
spec/fixtures/procfile/myapp-web/Program.cs
spec/fixtures/procfile/myapp-web/Program.cs
using System; using System.Linq; using System.Collections.Generic; using System.Threading; using Nancy.Hosting.Self; using Nancy; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Nancy.Diagnostics; namespace NancyFXSample { class MainClass { public static void Main (string[] args) { var nancyHost = CreateCFNancyHost (); nancyHost.Start (); Console.WriteLine ("Nancy is listening for requests..."); while (1==1) { Thread.Sleep (300); } } public static NancyHost CreateCFNancyHost() { var port = System.Environment.GetEnvironmentVariable ("PORT"); var cf_settings = System.Environment.GetEnvironmentVariable ("VCAP_APPLICATION"); var uris = new List<Uri> () { new Uri (String.Format ("http://0.0.0.0:{0}", port)) }; if (!String.IsNullOrEmpty(cf_settings)) { var settings = JsonConvert.DeserializeObject<JObject> (cf_settings); foreach (var uri_string in settings["uris"]) { uris.Add(new Uri(String.Format ("http://{0}:{1}", uri_string, port))); } } return new NancyHost(uris.ToArray()); } public class HelloModule : NancyModule { public HelloModule() { Get["/"] = parameters => "Hello World"; } } } }
using System; using System.Linq; using System.Collections.Generic; using System.Threading; using Nancy.Hosting.Self; using Nancy; namespace NancyFXSample { class MainClass { public static void Main (string[] args) { var baseUri = new Uri (String.Format("http://0.0.0.0:{0}", System.Environment.GetEnvironmentVariable("PORT"))); var nancyHost = new NancyHost (baseUri); nancyHost.Start (); Console.WriteLine ("Nancy Listening on {0}", baseUri.AbsoluteUri); while (1==1) { Thread.Sleep (10); } } public class HelloModule : NancyModule { public HelloModule() { Get["/"] = parameters => "Hello World"; } } } }
apache-2.0
C#
fada84927d96bda795329f5d2d1d2a599d4a95f7
Add GetString overload
thefactory/datastore,thefactory/datastore,thefactory/datastore,thefactory/datastore
csharp/TheFactory.Datastore/src/IDatabase.cs
csharp/TheFactory.Datastore/src/IDatabase.cs
using System; using System.Collections.Generic; using System.IO; using System.Text; namespace TheFactory.Datastore { public interface IDatabase : IDisposable { IEnumerable<IKeyValuePair> Find(Slice term); Slice Get(Slice key); void Put(Slice key, Slice val); void Delete(Slice key); event EventHandler<KeyValueChangedEventArgs> KeyValueChangedEvent; void Close(); } internal interface ITablet { void Close(); IEnumerable<IKeyValuePair> Find(Slice term); string Filename { get; } } public static class IDatabaseExtensions { public static IEnumerable<IKeyValuePair> FindByPrefix(this IDatabase db, Slice term) { foreach (var kv in db.Find(term)) { if (!Slice.IsPrefix(kv.Key, term)) { break; } yield return kv; } yield break; } public static IEnumerable<IKeyValuePair> FindByPrefix(this IDatabase db, string term) { return db.FindByPrefix((Slice)Encoding.UTF8.GetBytes(term)); } public static Slice Get(this IDatabase db, string key) { return db.Get((Slice)Encoding.UTF8.GetBytes(key)); } public static string GetString(this IDatabase This, string key) { try { var slice = This.Get((Slice)Encoding.UTF8.GetBytes(key)); return Encoding.UTF8.GetString(slice.Array, slice.Offset, slice.Length); } catch (KeyNotFoundException) { return null; } } public static void Put(this IDatabase db, string key, Slice val) { db.Put((Slice)Encoding.UTF8.GetBytes(key), val); } public static void Put(this IDatabase db, string key, string val) { db.Put((Slice)Encoding.UTF8.GetBytes(key), (Slice)Encoding.UTF8.GetBytes(val)); } public static void Delete(this IDatabase db, string key) { db.Delete((Slice)Encoding.UTF8.GetBytes(key)); } } }
using System; using System.Collections.Generic; using System.IO; using System.Text; namespace TheFactory.Datastore { public interface IDatabase : IDisposable { IEnumerable<IKeyValuePair> Find(Slice term); Slice Get(Slice key); void Put(Slice key, Slice val); void Delete(Slice key); event EventHandler<KeyValueChangedEventArgs> KeyValueChangedEvent; void Close(); } internal interface ITablet { void Close(); IEnumerable<IKeyValuePair> Find(Slice term); string Filename { get; } } public static class IDatabaseExtensions { public static IEnumerable<IKeyValuePair> FindByPrefix(this IDatabase db, Slice term) { foreach (var kv in db.Find(term)) { if (!Slice.IsPrefix(kv.Key, term)) { break; } yield return kv; } yield break; } public static IEnumerable<IKeyValuePair> FindByPrefix(this IDatabase db, string term) { return db.FindByPrefix((Slice)Encoding.UTF8.GetBytes(term)); } public static Slice Get(this IDatabase db, string key) { return db.Get((Slice)Encoding.UTF8.GetBytes(key)); } public static void Put(this IDatabase db, string key, Slice val) { db.Put((Slice)Encoding.UTF8.GetBytes(key), val); } public static void Put(this IDatabase db, string key, string val) { db.Put((Slice)Encoding.UTF8.GetBytes(key), (Slice)Encoding.UTF8.GetBytes(val)); } public static void Delete(this IDatabase db, string key) { db.Delete((Slice)Encoding.UTF8.GetBytes(key)); } } }
mit
C#
834ff63b9bb9197cd5bfb8497312e88c9824dc4b
Fix typo
k-t/SharpHaven
SharpHaven/Client/BuffCollection.cs
SharpHaven/Client/BuffCollection.cs
using System; using System.Collections; using System.Collections.Generic; namespace SharpHaven.Client { public class BuffCollection : IEnumerable<Buff> { private readonly Dictionary<int, Buff> dict; public BuffCollection() { dict = new Dictionary<int, Buff>(); } public event Action Changed; public void AddOrUpdate(Buff buff) { dict[buff.Id] = buff; Changed.Raise(); } public void Remove(int buffId) { if (dict.Remove(buffId)) Changed.Raise(); } public void Clear() { dict.Clear(); Changed.Raise(); } public IEnumerator<Buff> GetEnumerator() { return dict.Values.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }
using System; using System.Collections; using System.Collections.Generic; namespace SharpHaven.Client { public class BuffCollection : IEnumerable<Buff> { private readonly Dictionary<int, Buff> dict; public BuffCollection() { dict = new Dictionary<int, Buff>(); } public event Action Changed; public void AddOrUpdate(Buff buff) { dict[buff.Id] = buff; Changed.Raise(); } public void Remove(int buffId) { if (dict.Remove(buffId)); Changed.Raise(); } public void Clear() { dict.Clear(); Changed.Raise(); } public IEnumerator<Buff> GetEnumerator() { return dict.Values.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }
mit
C#
0fe6494f4c700ea463f2c92c4fc8f10eb7fbab2a
Make T covariant
smarkets/IronSmarkets
IronSmarkets/Events/IPayloadEvents.cs
IronSmarkets/Events/IPayloadEvents.cs
// Copyright (c) 2011 Smarkets Limited // // 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 IronSmarkets.Events { public class PayloadReceivedEventArgs<T> : EventArgs { public ulong Sequence { get; private set; } public T Payload { get; private set; } internal PayloadReceivedEventArgs(ulong sequence, T payload) { Sequence = sequence; Payload = payload; } } public interface IPayloadEvents<T> { event EventHandler<PayloadReceivedEventArgs<T>> PayloadReceived; } public interface IPayloadEndpoint<out T> { void AddPayloadHandler(Predicate<T> handler); void RemovePayloadHandler(Predicate<T> handler); } }
// Copyright (c) 2011 Smarkets Limited // // 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 IronSmarkets.Events { public class PayloadReceivedEventArgs<T> : EventArgs { public ulong Sequence { get; private set; } public T Payload { get; private set; } internal PayloadReceivedEventArgs(ulong sequence, T payload) { Sequence = sequence; Payload = payload; } } public interface IPayloadEvents<T> { event EventHandler<PayloadReceivedEventArgs<T>> PayloadReceived; } public interface IPayloadEndpoint<T> { void AddPayloadHandler(Predicate<T> handler); void RemovePayloadHandler(Predicate<T> handler); } }
mit
C#
393af5d05d9b5e032a57a4998d1472d202a42ae6
Update version info
ExtremeGTX/Androidx86-Installer-for-Windows
source/Android_UEFIInstaller/Properties/AssemblyInfo.cs
source/Android_UEFIInstaller/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; 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("Android_UEFIInstaller")] [assembly: AssemblyDescription("Android x86 Installer for Windows [UEFI Version]")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ExtremeGTX")] [assembly: AssemblyProduct("Android_UEFIInstaller")] [assembly: AssemblyCopyright("Copyright © ExtremeGTX 2015")] [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.2.6000.0")] [assembly: AssemblyFileVersion("2.2.0.0")]
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; 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("Android_UEFIInstaller")] [assembly: AssemblyDescription("Android x86 Installer for Windows [UEFI Version]")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ExtremeGTX")] [assembly: AssemblyProduct("Android_UEFIInstaller")] [assembly: AssemblyCopyright("Copyright © ExtremeGTX 2015")] [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.1.5500")] [assembly: AssemblyFileVersion("2.1.0.0")]
mit
C#