commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
280e34b253f5edbfedbcc3139c3c579516d554de
Basics.Algorithms.Tests/SortingPerformanceTests.cs
Basics.Algorithms.Tests/SortingPerformanceTests.cs
using System; using System.Diagnostics; using Basics.Algorithms.Sorts; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Basics.Algorithms.Tests { [TestClass] public class SortingPerformanceTests { private const int size = 10000; private class SortInfo { public string Name { get; set; } public Action<int[]> Act { get; set; } } [TestMethod] public void SortingPerformanceTest() { var stopwatch = new Stopwatch(); var sortedArray = new int[size]; for (int i = 0; i < size; i++) { sortedArray[i] = i; } var sorts = new SortInfo[] { new SortInfo { Name = "Selection Sort", Act = array => Selection.Sort(array) }, new SortInfo { Name = "Insertion Sort", Act = array => Insertion.Sort(array) }, new SortInfo { Name = "Shell Sort", Act = array => Shell.Sort(array) }, new SortInfo { Name = "Mergesort", Act = array => Merge.Sort(array) }, new SortInfo { Name = "Quicksort", Act = array => Quick.Sort(array) } }; foreach (var sort in sorts) { sortedArray.Shuffle(); stopwatch.Restart(); sort.Act(sortedArray); stopwatch.Stop(); Console.WriteLine("{0}:\t{1}", sort.Name, stopwatch.ElapsedTicks); } } } }
using System; using System.Diagnostics; using System.Linq; using Basics.Algorithms.Sorts; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Basics.Algorithms.Tests { [TestClass] public class SortingPerformanceTests { private const int size = 1000000; private class SortInfo { public string Name { get; set; } public Action<int[]> Act { get; set; } public bool Enabled { get; set; } } [TestMethod] public void SortingPerformanceTest() { var stopwatch = new Stopwatch(); var sortedArray = new int[size]; for (int i = 0; i < size; i++) { sortedArray[i] = i; } var sorts = new SortInfo[] { new SortInfo { Name = "Selection Sort", Act = array => Selection.Sort(array), Enabled = false }, new SortInfo { Name = "Insertion Sort", Act = array => Insertion.Sort(array), Enabled = false }, new SortInfo { Name = "Shell Sort", Act = array => Shell.Sort(array), Enabled = false }, new SortInfo { Name = "Mergesort", Act = array => Merge.Sort(array), Enabled = true }, new SortInfo { Name = "Quicksort", Act = array => Quick.Sort(array), Enabled = true } }; foreach (var sort in sorts.Where(s => s.Enabled)) { sortedArray.Shuffle(); stopwatch.Restart(); sort.Act(sortedArray); stopwatch.Stop(); Console.WriteLine("{0}:\t{1}", sort.Name, stopwatch.ElapsedTicks); } } } }
Implement Enabled flag to be able to run sorts separately
Implement Enabled flag to be able to run sorts separately
C#
mit
MSayfullin/Basics
fcf37ab8e16aad5dda94834a029534b393cd0242
Joey/UI/Fragments/RecentTimeEntriesListFragment.cs
Joey/UI/Fragments/RecentTimeEntriesListFragment.cs
using System; using System.Linq; using Android.App; using Android.OS; using Android.Views; using Toggl.Joey.UI.Adapters; namespace Toggl.Joey.UI.Fragments { public class RecentTimeEntriesListFragment : ListFragment { public override void OnViewCreated (View view, Bundle savedInstanceState) { base.OnViewCreated (view, savedInstanceState); ListAdapter = new RecentTimeEntriesAdapter (); } } }
using System; using System.Linq; using Android.App; using Android.OS; using Android.Views; using Android.Widget; using Toggl.Joey.UI.Adapters; namespace Toggl.Joey.UI.Fragments { public class RecentTimeEntriesListFragment : ListFragment { public override void OnViewCreated (View view, Bundle savedInstanceState) { base.OnViewCreated (view, savedInstanceState); ListAdapter = new RecentTimeEntriesAdapter (); } public override void OnListItemClick (ListView l, View v, int position, long id) { var adapter = l.Adapter as RecentTimeEntriesAdapter; if (adapter == null) return; var model = adapter.GetModel (position); if (model == null) return; model.Continue (); } } }
Add continue time entry on recent list view click.
Add continue time entry on recent list view click.
C#
bsd-3-clause
ZhangLeiCharles/mobile,eatskolnikov/mobile,masterrr/mobile,eatskolnikov/mobile,peeedge/mobile,peeedge/mobile,masterrr/mobile,eatskolnikov/mobile,ZhangLeiCharles/mobile
037485289b79281c9c3c5b626b1eb27f0b383541
src/Filters/ITileFilter.cs
src/Filters/ITileFilter.cs
using System; using System.Collections.Generic; namespace PrepareLanding.Filters { public enum FilterHeaviness { Light = 0, Medium = 1, Heavy = 2 } public interface ITileFilter { string SubjectThingDef { get; } string RunningDescription { get; } string AttachedProperty { get; } Action<PrepareLandingUserData, List<int>> FilterAction { get; } FilterHeaviness Heaviness { get; } List<int> FilteredTiles { get; } void Filter(PrepareLandingUserData userData, List<int> inputList); } }
using System; using System.Collections.Generic; namespace PrepareLanding.Filters { public enum FilterHeaviness { Light = 0, Medium = 1, Heavy = 2 } public interface ITileFilter { string SubjectThingDef { get; } string RunningDescription { get; } string AttachedProperty { get; } Action<List<int>> FilterAction { get; } FilterHeaviness Heaviness { get; } List<int> FilteredTiles { get; } void Filter(List<int> inputList); bool IsFilterActive { get; } } }
Add IsFilterActive; remove unneeded parameters to filter (pass it on ctor)
Add IsFilterActive; remove unneeded parameters to filter (pass it on ctor)
C#
mit
neitsa/PrepareLanding,neitsa/PrepareLanding
b68198c987754b8d1b6a20654b4855f67ffbb701
tests/SoCreate.ServiceFabric.PubSub.Tests/GivenDefaultBrokerEventsManager.cs
tests/SoCreate.ServiceFabric.PubSub.Tests/GivenDefaultBrokerEventsManager.cs
using Microsoft.ServiceFabric.Actors; using Microsoft.VisualStudio.TestTools.UnitTesting; using SoCreate.ServiceFabric.PubSub.Events; using SoCreate.ServiceFabric.PubSub.State; using System.Collections.Generic; using System.Threading.Tasks; namespace SoCreate.ServiceFabric.PubSub.Tests { [TestClass] public class GivenDefaultBrokerEventsManager { [TestMethod] public async Task WhenInsertingConcurrently_ThenAllCallbacksAreMadeCorrectly() { int callCount = 0; var manager = new DefaultBrokerEventsManager(); manager.Subscribed += (s, e, t) => { lock (manager) { callCount++; } return Task.CompletedTask; }; const int attempts = 20; var tasks = new List<Task>(attempts); for (int i = 0; i < attempts; i++) { var actorReference = new ActorReference{ ActorId = ActorId.CreateRandom() }; tasks.Add(manager.OnSubscribedAsync("Key", new ActorReferenceWrapper(actorReference), "MessageType")); } await Task.WhenAll(tasks); Assert.AreEqual(attempts, callCount); } } }
using Microsoft.ServiceFabric.Actors; using Microsoft.VisualStudio.TestTools.UnitTesting; using SoCreate.ServiceFabric.PubSub.Events; using SoCreate.ServiceFabric.PubSub.State; using System; using System.Threading; using System.Threading.Tasks; namespace SoCreate.ServiceFabric.PubSub.Tests { [TestClass] public class GivenDefaultBrokerEventsManager { [TestMethod] public void WhenInsertingConcurrently_ThenAllCallbacksAreMadeCorrectly() { bool hasCrashed = false; var manager = new DefaultBrokerEventsManager(); ManualResetEvent mr = new ManualResetEvent(false); ManualResetEvent mr2 = new ManualResetEvent(false); manager.Subscribed += (s, e, t) => { mr.WaitOne(); return Task.CompletedTask; }; const int attempts = 2000; for (int i = 0; i < attempts; i++) { ThreadPool.QueueUserWorkItem(async j => { var actorReference = new ActorReference { ActorId = ActorId.CreateRandom() }; try { await manager.OnSubscribedAsync("Key" + (int) j % 5, new ActorReferenceWrapper(actorReference), "MessageType"); } catch (NullReferenceException) { hasCrashed = true; } catch (IndexOutOfRangeException) { hasCrashed = true; } finally { if ((int)j == attempts - 1) { mr2.Set(); } } }, i); } mr.Set(); Assert.IsTrue(mr2.WaitOne(TimeSpan.FromSeconds(10)), "Failed to run within time limits."); Assert.IsFalse(hasCrashed, "Should not crash."); } } }
Change test code to repro issue in old code and prove new code doesn't crash
Change test code to repro issue in old code and prove new code doesn't crash
C#
mit
loekd/ServiceFabric.PubSubActors
5d0628f1079426c50ec5681924207d4b2e939685
src/NHibernate/Cfg/EmptyInterceptor.cs
src/NHibernate/Cfg/EmptyInterceptor.cs
using System; using System.Collections; using NHibernate.Type; namespace NHibernate.Cfg { [Serializable] internal class EmptyInterceptor : IInterceptor { public EmptyInterceptor() { } public void OnDelete( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) { } public bool OnFlushDirty( object entity, object id, object[ ] currentState, object[ ] previousState, string[ ] propertyNames, IType[ ] types ) { return false; } public bool OnLoad( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) { return false; } public bool OnSave( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) { return false; } public void OnPostFlush( object entity, object id, object[ ] currentState, string[ ] propertyNames, IType[ ] types ) { } public void PostFlush( ICollection entities ) { } public void PreFlush( ICollection entitites ) { } public object IsUnsaved( object entity ) { return null; } public object Instantiate( System.Type clazz, object id ) { return null; } public int[ ] FindDirty( object entity, object id, object[ ] currentState, object[ ] previousState, string[ ] propertyNames, IType[ ] types ) { return null; } } }
using System; using System.Collections; using NHibernate.Type; namespace NHibernate.Cfg { [Serializable] public class EmptyInterceptor : IInterceptor { public virtual void OnDelete( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) { } public virtual bool OnFlushDirty( object entity, object id, object[ ] currentState, object[ ] previousState, string[ ] propertyNames, IType[ ] types ) { return false; } public virtual bool OnLoad( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) { return false; } public virtual bool OnSave( object entity, object id, object[ ] state, string[ ] propertyNames, IType[ ] types ) { return false; } public virtual void PostFlush( ICollection entities ) { } public virtual void PreFlush( ICollection entitites ) { } public virtual object IsUnsaved( object entity ) { return null; } public virtual object Instantiate( System.Type clazz, object id ) { return null; } public virtual int[] FindDirty( object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types ) { return null; } } }
Make class public and all methods virtual so that it can be used as a base class for interceptors.
Make class public and all methods virtual so that it can be used as a base class for interceptors. SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@2077
C#
lgpl-2.1
alobakov/nhibernate-core,gliljas/nhibernate-core,hazzik/nhibernate-core,ngbrown/nhibernate-core,fredericDelaporte/nhibernate-core,RogerKratz/nhibernate-core,nhibernate/nhibernate-core,RogerKratz/nhibernate-core,ManufacturingIntelligence/nhibernate-core,nkreipke/nhibernate-core,ngbrown/nhibernate-core,lnu/nhibernate-core,hazzik/nhibernate-core,RogerKratz/nhibernate-core,livioc/nhibernate-core,nkreipke/nhibernate-core,lnu/nhibernate-core,alobakov/nhibernate-core,hazzik/nhibernate-core,nhibernate/nhibernate-core,gliljas/nhibernate-core,hazzik/nhibernate-core,RogerKratz/nhibernate-core,gliljas/nhibernate-core,lnu/nhibernate-core,nkreipke/nhibernate-core,livioc/nhibernate-core,ManufacturingIntelligence/nhibernate-core,nhibernate/nhibernate-core,fredericDelaporte/nhibernate-core,fredericDelaporte/nhibernate-core,gliljas/nhibernate-core,ManufacturingIntelligence/nhibernate-core,nhibernate/nhibernate-core,fredericDelaporte/nhibernate-core,alobakov/nhibernate-core,livioc/nhibernate-core,ngbrown/nhibernate-core
f9c8200b2b6f4ca140f99a336eb8ff86706f9f24
VotingApplication/VotingApplication.Web/Views/Routes/ConfirmRegistration.cshtml
VotingApplication/VotingApplication.Web/Views/Routes/ConfirmRegistration.cshtml
<div ng-app="GVA.Manage" ng-controller="ConfirmRegistrationController"> <div class="manage-area centered"> <h2> Thank you for registering! </h2> <p class="text-centered"> You should receive an Email confirmation shortly. </p> <p class="text-centered"> If not, ensure you check any spam filters you may have running. </p> <div class="flexbox"> <button class="centered active-btn" ng-click="resendConfirmation()">Resend Confirmation Email"</button> </div> </div> </div>
<div ng-app="GVA.Manage" ng-controller="ConfirmRegistrationController"> <div class="manage-area centered"> <h2> Thank you for registering! </h2> <p class="text-centered"> You should receive an Email confirmation shortly. </p> <p class="text-centered"> If not, ensure you check any spam filters you may have running. </p> <div class="flexbox"> <button class="centered active-btn" ng-click="resendConfirmation()">Resend Confirmation Email</button> </div> </div> </div>
Fix for resend confirmation button
Fix for resend confirmation button
C#
apache-2.0
tpkelly/voting-application,JDawes-ScottLogic/voting-application,tpkelly/voting-application,Generic-Voting-Application/voting-application,JDawes-ScottLogic/voting-application,Generic-Voting-Application/voting-application,stevenhillcox/voting-application,tpkelly/voting-application,JDawes-ScottLogic/voting-application,stevenhillcox/voting-application,stevenhillcox/voting-application,Generic-Voting-Application/voting-application
ecf768b90d96195b4574016a214e68d7cd69158e
src/Glimpse.Agent.AspNet.Mvc/Messages/BeforeActionMessage.cs
src/Glimpse.Agent.AspNet.Mvc/Messages/BeforeActionMessage.cs
 namespace Glimpse.Agent.AspNet.Mvc.Messages { public class BeforeActionMessage : IActionRouteFoundMessage { public string ActionId { get; set; } public string DisplayName { get; set; } public RouteData RouteData { get; set; } public string ActionName { get; set; } public string ControllerName { get; set; } } }
 namespace Glimpse.Agent.AspNet.Mvc.Messages { public class BeforeActionMessage : IActionRouteFoundMessage { public string ActionId { get; set; } public string DisplayName { get; set; } public string ActionName { get; set; } public string ControllerName { get; set; } public RouteData RouteData { get; set; } } }
Move ordering if types around
Move ordering if types around
C#
mit
zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype
87c4d3c53ec0404b240a6195487f9783fd3fa4ff
test/testapps/BasicTestApp/CounterComponentUsingChild.cshtml
test/testapps/BasicTestApp/CounterComponentUsingChild.cshtml
<h1>Counter</h1> <p>Current count: <MessageComponent Message=@currentCount.ToString() /></p> <button @onclick(IncrementCount)>Click me</button> @functions { int currentCount = 0; void IncrementCount() { currentCount++; } }
<h1>Counter</h1> <!-- Note: passing 'Message' parameter with lowercase name to show it's case insensitive --> <p>Current count: <MessageComponent message=@currentCount.ToString() /></p> <button @onclick(IncrementCount)>Click me</button> @functions { int currentCount = 0; void IncrementCount() { currentCount++; } }
Cover case-insensitive child component parameter names in E2E test
Cover case-insensitive child component parameter names in E2E test
C#
apache-2.0
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
81dac383d3100b4b59cae580a2c6a668ba40a7be
src/SFA.DAS.EAS.Transactions.AcceptanceTests/Steps/CommonSteps/GlobalTestSteps.cs
src/SFA.DAS.EAS.Transactions.AcceptanceTests/Steps/CommonSteps/GlobalTestSteps.cs
using Moq; using SFA.DAS.EAS.TestCommon.DbCleanup; using SFA.DAS.EAS.TestCommon.DependencyResolution; using SFA.DAS.EAS.Web; using SFA.DAS.EAS.Web.Authentication; using SFA.DAS.Messaging; using StructureMap; using TechTalk.SpecFlow; namespace SFA.DAS.EAS.Transactions.AcceptanceTests.Steps.CommonSteps { [Binding] public static class GlobalTestSteps { private static Mock<IMessagePublisher> _messagePublisher; private static Mock<IOwinWrapper> _owinWrapper; private static Container _container; private static Mock<ICookieService> _cookieService; [AfterTestRun()] public static void Arrange() { _messagePublisher = new Mock<IMessagePublisher>(); _owinWrapper = new Mock<IOwinWrapper>(); _cookieService = new Mock<ICookieService>(); _container = IoC.CreateContainer(_messagePublisher, _owinWrapper, _cookieService); var cleanDownDb = _container.GetInstance<ICleanDatabase>(); cleanDownDb.Execute().Wait(); } } }
using Moq; using SFA.DAS.EAS.TestCommon.DbCleanup; using SFA.DAS.EAS.TestCommon.DependencyResolution; using SFA.DAS.EAS.Web; using SFA.DAS.EAS.Web.Authentication; using SFA.DAS.Messaging; using StructureMap; using TechTalk.SpecFlow; namespace SFA.DAS.EAS.Transactions.AcceptanceTests.Steps.CommonSteps { [Binding] public static class GlobalTestSteps { private static Mock<IMessagePublisher> _messagePublisher; private static Mock<IOwinWrapper> _owinWrapper; private static Container _container; private static Mock<ICookieService> _cookieService; [AfterTestRun()] public static void Arrange() { _messagePublisher = new Mock<IMessagePublisher>(); _owinWrapper = new Mock<IOwinWrapper>(); _cookieService = new Mock<ICookieService>(); _container = IoC.CreateContainer(_messagePublisher, _owinWrapper, _cookieService); var cleanDownDb = _container.GetInstance<ICleanDatabase>(); cleanDownDb.Execute().Wait(); var cleanDownTransactionDb = _container.GetInstance<ICleanTransactionsDatabase>(); cleanDownTransactionDb.Execute().Wait(); } } }
Add cleandatabase call in global steps
Add cleandatabase call in global steps Added call to clean the levy database after running the tests for transactions.
C#
mit
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
2e44bd076d3b325ba477a680c2929672740d40b8
src/SEEK.AdPostingApi.Client/Models/AdditionalPropertyType.cs
src/SEEK.AdPostingApi.Client/Models/AdditionalPropertyType.cs
namespace SEEK.AdPostingApi.Client.Models { public enum AdditionalPropertyType { ResidentsOnly = 1 } }
namespace SEEK.AdPostingApi.Client.Models { public enum AdditionalPropertyType { ResidentsOnly = 1, Graduate } }
Add graduate flag as additional property
FLAPI-216: Add graduate flag as additional property
C#
mit
seekasia-oss/jobstreet-ad-posting-api-client
c8aac76aaea92bb7d4c41053611ab4b62a1c8e11
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Autofac.Integration.Mef")] [assembly: AssemblyDescription("Autofac MEF Integration")] [assembly: InternalsVisibleTo("Autofac.Tests.Integration.Mef, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")] [assembly: ComVisible(false)]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Autofac.Integration.Mef")] [assembly: InternalsVisibleTo("Autofac.Tests.Integration.Mef, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")] [assembly: ComVisible(false)]
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
C#
mit
autofac/Autofac.Mef
9184ad4112cf9bdd070469e289428828ae27e1a7
Zermelo.App.UWP/Services/SettingsService.cs
Zermelo.App.UWP/Services/SettingsService.cs
using Template10.Mvvm; using Template10.Services.SettingsService; namespace Zermelo.App.UWP.Services { public class SettingsService : BindableBase, ISettingsService { ISettingsHelper _helper; public SettingsService(ISettingsHelper settingsHelper) { _helper = settingsHelper; } private T Read<T>(string key, T otherwise = default(T)) => _helper.Read<T>(key, otherwise, SettingsStrategies.Roam); private void Write<T>(string key, T value) => _helper.Write(key, value, SettingsStrategies.Roam); //Account public string School { get => Read<string>("Host"); set { Write("Host", value); RaisePropertyChanged(); } } public string Token { get => Read<string>("Token"); set { Write("Token", value); RaisePropertyChanged(); } } } }
using Template10.Mvvm; using Template10.Services.SettingsService; using Windows.Storage; namespace Zermelo.App.UWP.Services { public class SettingsService : BindableBase, ISettingsService { ApplicationDataContainer _settings; public SettingsService() { _settings = ApplicationData.Current.RoamingSettings; } private T Read<T>(string key) => (T)_settings.Values[key]; private void Write<T>(string key, T value) => _settings.Values[key] = value; //Account public string School { get => Read<string>("Host"); set { Write("Host", value); RaisePropertyChanged(); } } public string Token { get => Read<string>("Token"); set { Write("Token", value); RaisePropertyChanged(); } } } }
Store settings as plain strings, without SettingsHelper
Store settings as plain strings, without SettingsHelper Fix #23
C#
mit
arthurrump/Zermelo.App.UWP
8e3cb5dceb86d9671f9bf07e2b2d2856ccb34868
src/ServiceStack.IntroSpec/ServiceStack.IntroSpec/Services/ApiSpecMetadataService.cs
src/ServiceStack.IntroSpec/ServiceStack.IntroSpec/Services/ApiSpecMetadataService.cs
// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. namespace ServiceStack.IntroSpec.Services { using System.Linq; using DTO; public class ApiSpecMetadataService : IService { private readonly IApiDocumentationProvider documentationProvider; public ApiSpecMetadataService(IApiDocumentationProvider documentationProvider) { documentationProvider.ThrowIfNull(nameof(documentationProvider)); this.documentationProvider = documentationProvider; } public object Get(SpecMetadataRequest request) { var documentation = documentationProvider.GetApiDocumentation(); return SpecMetadataResponse.Create( documentation.Resources.Select(r => r.TypeName).Distinct().ToArray(), documentation.Resources.Select(r => r.Category).Distinct().ToArray(), documentation.Resources.SelectMany(r => r.Tags).Distinct().ToArray() ); } } }
// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. namespace ServiceStack.IntroSpec.Services { using System.Linq; using DTO; public class ApiSpecMetadataService : IService { private readonly IApiDocumentationProvider documentationProvider; public ApiSpecMetadataService(IApiDocumentationProvider documentationProvider) { documentationProvider.ThrowIfNull(nameof(documentationProvider)); this.documentationProvider = documentationProvider; } public object Get(SpecMetadataRequest request) { var documentation = documentationProvider.GetApiDocumentation(); return SpecMetadataResponse.Create( documentation.Resources.Select(r => r.TypeName).Distinct().ToArray(), documentation.Resources.Select(r => r.Category).Where(c => !string.IsNullOrEmpty(c)).Distinct().ToArray(), documentation.Resources.SelectMany(r => r.Tags ?? new string[0]).Distinct().ToArray() ); } } }
Handle null/missing category and tags
Handle null/missing category and tags
C#
mpl-2.0
MacLeanElectrical/servicestack-introspec
3a09b93ef91b4567370c0fdd855a5d87a7f33f76
src/Utils/RandomValueGenerator.cs
src/Utils/RandomValueGenerator.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace StrangerData.Utils { internal static class RandomValues { public static object ForColumn(TableColumnInfo columnInfo) { switch (columnInfo.ColumnType) { case ColumnType.String: // generates a random string return Any.String(columnInfo.MaxLength); case ColumnType.Int: // generates a random integer long maxValue = 10 ^ columnInfo.Precision - 1; if (maxValue > int.MaxValue) { return Any.Long(1, columnInfo.Precision - 1); } return Any.Int(1, 10 ^ columnInfo.Precision - 1); case ColumnType.Decimal: // generates a random decimal return Any.Double(columnInfo.Precision, columnInfo.Scale); case ColumnType.Double: // generates a random double return Any.Double(columnInfo.Precision, columnInfo.Scale); case ColumnType.Long: // generates a random long return Any.Long(1, 10 ^ columnInfo.Precision - 1); case ColumnType.Boolean: // generates a random boolean return Any.Boolean(); case ColumnType.Guid: // generates a random guid return Guid.NewGuid(); case ColumnType.Date: // generates a random date return Any.DateTime().Date; case ColumnType.Datetime: // generates a random DateTime return Any.DateTime(); default: return null; } } } }
using System; namespace StrangerData.Utils { internal static class RandomValues { public static object ForColumn(TableColumnInfo columnInfo) { switch (columnInfo.ColumnType) { case ColumnType.String: // generates a random string return Any.String(columnInfo.MaxLength); case ColumnType.Int: // generates a random integer long maxValue = (int)Math.Pow(10, columnInfo.Precision - 1); if (maxValue > int.MaxValue) { return Any.Long(1, maxValue); } return Any.Int(1, (int)maxValue); case ColumnType.Decimal: // generates a random decimal return Any.Double(columnInfo.Precision, columnInfo.Scale); case ColumnType.Double: // generates a random double return Any.Double(columnInfo.Precision, columnInfo.Scale); case ColumnType.Long: // generates a random long return Any.Long(1, (int)Math.Pow(10, columnInfo.Precision - 1)); case ColumnType.Boolean: // generates a random boolean return Any.Boolean(); case ColumnType.Guid: // generates a random guid return Guid.NewGuid(); case ColumnType.Date: // generates a random date return Any.DateTime().Date; case ColumnType.Datetime: // generates a random DateTime return Any.DateTime(); default: return null; } } } }
Fix evaluation of max values for random int and long
:bug: Fix evaluation of max values for random int and long Use Math.Pow instead of logical XOR to evaluate max values
C#
mit
stone-pagamentos/StrangerData
5326f504cc2dbcd5485fc27fd106bd17452c1103
src/LessMsi.Cli/OpenGuiCommand.cs
src/LessMsi.Cli/OpenGuiCommand.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using NDesk.Options; namespace LessMsi.Cli { internal class OpenGuiCommand : LessMsiCommand { public override void Run(List<string> args) { if (args.Count < 2) throw new OptionException("You must specify the name of the msi file to open when using the o command.", "o"); ShowGui(args); } public static void ShowGui(List<string> args) { var guiExe = Path.Combine(AppPath, "lessmsi-gui.exe"); if (File.Exists(guiExe)) { //should we wait for exit? if (args.Count > 0) Process.Start(guiExe, args[1]); else Process.Start(guiExe); } } private static string AppPath { get { var codeBase = new Uri(typeof(OpenGuiCommand).Assembly.CodeBase); var local = Path.GetDirectoryName(codeBase.LocalPath); return local; } } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using NDesk.Options; namespace LessMsi.Cli { internal class OpenGuiCommand : LessMsiCommand { public override void Run(List<string> args) { if (args.Count < 2) throw new OptionException("You must specify the name of the msi file to open when using the o command.", "o"); ShowGui(args); } public static void ShowGui(List<string> args) { var guiExe = Path.Combine(AppPath, "lessmsi-gui.exe"); if (File.Exists(guiExe)) { var p = new Process(); p.StartInfo.FileName = guiExe; if (args.Count > 0) { // We add double quotes to support paths with spaces, for ex: "E:\Downloads and Sofware\potato.msi". p.StartInfo.Arguments = string.Format("\"{0}\"", args[1]); p.Start(); } else p.Start(); } } private static string AppPath { get { var codeBase = new Uri(typeof(OpenGuiCommand).Assembly.CodeBase); var local = Path.GetDirectoryName(codeBase.LocalPath); return local; } } } }
Make CLI work with paths containing spaces.
Make CLI work with paths containing spaces.
C#
mit
activescott/lessmsi,activescott/lessmsi,activescott/lessmsi
ea23b4a831a9b5886ce781f8cc45870377083fad
source/Nuke.Common/Execution/HandleShellCompletionAttribute.cs
source/Nuke.Common/Execution/HandleShellCompletionAttribute.cs
// Copyright 2019 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Collections.Generic; using System.Linq; using Nuke.Common.IO; namespace Nuke.Common.Execution { [AttributeUsage(AttributeTargets.Class)] internal class HandleShellCompletionAttribute : Attribute, IOnBeforeLogo { public void OnBeforeLogo( NukeBuild build, IReadOnlyCollection<ExecutableTarget> executableTargets) { var completionItems = new SortedDictionary<string, string[]>(); var targetNames = build.ExecutableTargets.Select(x => x.Name).OrderBy(x => x).ToList(); completionItems[Constants.InvokedTargetsParameterName] = targetNames.ToArray(); completionItems[Constants.SkippedTargetsParameterName] = targetNames.ToArray(); var parameters = InjectionUtility.GetParameterMembers(build.GetType(), includeUnlisted: false); foreach (var parameter in parameters) { var parameterName = ParameterService.GetParameterMemberName(parameter); if (completionItems.ContainsKey(parameterName)) continue; var subItems = ParameterService.GetParameterValueSet(parameter, build)?.Select(x => x.Text); completionItems[parameterName] = subItems?.ToArray(); } SerializationTasks.YamlSerializeToFile(completionItems, Constants.GetCompletionFile(NukeBuild.RootDirectory)); if (EnvironmentInfo.GetParameter<bool>(Constants.CompletionParameterName)) Environment.Exit(exitCode: 0); } } }
// Copyright 2019 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Collections.Generic; using System.Linq; using Nuke.Common.IO; using static Nuke.Common.Constants; namespace Nuke.Common.Execution { [AttributeUsage(AttributeTargets.Class)] internal class HandleShellCompletionAttribute : Attribute, IOnBeforeLogo { public void OnBeforeLogo( NukeBuild build, IReadOnlyCollection<ExecutableTarget> executableTargets) { var completionItems = new SortedDictionary<string, string[]>(); var targets = build.ExecutableTargets.OrderBy(x => x.Name).ToList(); completionItems[InvokedTargetsParameterName] = targets.Where(x => x.Listed).Select(x => x.Name).ToArray(); completionItems[SkippedTargetsParameterName] = targets.Select(x => x.Name).ToArray(); var parameters = InjectionUtility.GetParameterMembers(build.GetType(), includeUnlisted: false); foreach (var parameter in parameters) { var parameterName = ParameterService.GetParameterMemberName(parameter); if (completionItems.ContainsKey(parameterName)) continue; var subItems = ParameterService.GetParameterValueSet(parameter, build)?.Select(x => x.Text); completionItems[parameterName] = subItems?.ToArray(); } SerializationTasks.YamlSerializeToFile(completionItems, GetCompletionFile(NukeBuild.RootDirectory)); if (EnvironmentInfo.GetParameter<bool>(CompletionParameterName)) Environment.Exit(exitCode: 0); } } }
Fix shell-completion.yml to exclude unlisted targets for invocation
Fix shell-completion.yml to exclude unlisted targets for invocation
C#
mit
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
ac11de7efb5d71125d07eb0efc9ce230e88e841a
src/Shouldly.Tests/InternalTests/StringDiffHighlighterTests.cs
src/Shouldly.Tests/InternalTests/StringDiffHighlighterTests.cs
using NUnit.Framework; using Shouldly.DifferenceHighlighting2; using System; namespace Shouldly.Tests.InternalTests { [TestFixture] public static class StringDiffHighlighterTests { private static IStringDifferenceHighlighter _sut; [SetUp] public static void Setup() { _sut = new StringDifferenceHighlighter(null, 0); } [Test] [ExpectedException(typeof(ArgumentNullException))] public static void Should_throw_exception_when_expected_arg_is_null() { _sut.HighlightDifferences("not null", null); } [Test] [ExpectedException(typeof(ArgumentNullException))] public static void Should_throw_exception_when_actual_arg_is_null() { _sut.HighlightDifferences(null, "not null"); } } }
using NUnit.Framework; using Shouldly.DifferenceHighlighting2; using System; namespace Shouldly.Tests.InternalTests { [TestFixture] public static class StringDiffHighlighterTests { private static IStringDifferenceHighlighter _sut; [SetUp] public static void Setup() { _sut = new StringDifferenceHighlighter(null, 0); } [Test] [ExpectedException(typeof(ArgumentNullException))] public static void Should_throw_exception_when_expected_arg_is_null() { _sut.HighlightDifferences(null, "not null"); } [Test] [ExpectedException(typeof(ArgumentNullException))] public static void Should_throw_exception_when_actual_arg_is_null() { _sut.HighlightDifferences("not null", null); } } }
Correct order of params in diff highlighter tests
Correct order of params in diff highlighter tests
C#
bsd-3-clause
chaitanyagurrapu/shouldly,JoeMighty/shouldly,AmadeusW/shouldly,ankurMalhotra/shouldly
edb057d115e3590418d35d8db4b7e162bcf44f21
Tracer/Tester/SingleThreadTest.cs
Tracer/Tester/SingleThreadTest.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tracer; namespace Tester { class SingleThreadTest : ITest { private ITracer tracer = new Tracer.Tracer(); public void Run() { tracer.StartTrace(); RunCycle(204800000); tracer.StopTrace(); TraceResult result = tracer.GetTraceResult(); result.PrintToConsole(); } private void RunCycle(int repeatAmount) { ITracer tracer = new Tracer.Tracer(); tracer.StartTrace(); for (int i = 0; i < repeatAmount; i++) { int a = 1; a += i; } tracer.StopTrace(); TraceResult result = tracer.GetTraceResult(); result.PrintToConsole(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tracer; using System.Threading; namespace Tester { class SingleThreadTest : ITest { private ITracer tracer = new Tracer.Tracer(); public void Run() { tracer.StartTrace(); Thread.Sleep(500); RunCycle(500); tracer.StopTrace(); PrintTestResults(); } private void RunCycle(int sleepTime) { tracer.StartTrace(); Thread.Sleep(sleepTime); tracer.StopTrace(); } private void PrintTestResults() { var traceResult = tracer.GetTraceResult(); foreach (TraceResultItem analyzedItem in traceResult) { analyzedItem.PrintToConsole(); } } } }
Update Tester class implementation due to the recent changes in Tester implementation
Update Tester class implementation due to the recent changes in Tester implementation
C#
mit
JonesTwink/MPP.Tracer
32068e2dba00bb63f78d28c8c932d14004c3a8e7
src/Taxjar.Tests/Infrastructure/TaxjarFixture.cs
src/Taxjar.Tests/Infrastructure/TaxjarFixture.cs
using System.IO; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Taxjar.Tests { public class TaxjarFixture { public static string GetJSON(string fixturePath) { using (StreamReader file = File.OpenText(Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "../../../", "Fixtures", fixturePath))) using (JsonTextReader reader = new JsonTextReader(file)) { JObject response = (JObject)JToken.ReadFrom(reader); var resString = response.ToString(Formatting.None).Replace(@"\", ""); return response.ToString(Formatting.None).Replace(@"\", ""); } } } }
using System.IO; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Taxjar.Tests { public class TaxjarFixture { public static string GetJSON(string fixturePath) { using (StreamReader file = File.OpenText(Path.Combine("../../../", "Fixtures", fixturePath))) using (JsonTextReader reader = new JsonTextReader(file)) { JObject response = (JObject)JToken.ReadFrom(reader); var resString = response.ToString(Formatting.None).Replace(@"\", ""); return response.ToString(Formatting.None).Replace(@"\", ""); } } } }
Update fixture path for specs
Update fixture path for specs
C#
mit
taxjar/taxjar.net
b57b6cead8f5ad04fab49ea0088a92761c1fa0e1
ForecastPCL.Test/LanguageTests.cs
ForecastPCL.Test/LanguageTests.cs
using System.Threading.Tasks; namespace ForecastPCL.Test { using System; using System.Configuration; using ForecastIOPortable; using NUnit.Framework; [TestFixture] public class LanguageTests { // These coordinates came from the Forecast API documentation, // and should return forecasts with all blocks. private const double AlcatrazLatitude = 37.8267; private const double AlcatrazLongitude = -122.423; private const double MumbaiLatitude = 18.975; private const double MumbaiLongitude = 72.825833; /// <summary> /// API key to be used for testing. This should be specified in the /// test project's app.config file. /// </summary> private string apiKey; /// <summary> /// Sets up all tests by retrieving the API key from app.config. /// </summary> [TestFixtureSetUp] public void SetUp() { this.apiKey = ConfigurationManager.AppSettings["ApiKey"]; } [Test] public void AllLanguagesHaveValues() { foreach (Language language in Enum.GetValues(typeof(Language))) { Assert.That(() => language.ToValue(), Throws.Nothing); } } [Test] public async Task UnicodeLanguageIsSupported() { var client = new ForecastApi(this.apiKey); var result = await client.GetWeatherDataAsync(AlcatrazLatitude, AlcatrazLongitude, Unit.Auto, Language.Chinese); Assert.That(result, Is.Not.Null); } } }
using System.Threading.Tasks; namespace ForecastPCL.Test { using System; using System.Configuration; using ForecastIOPortable; using NUnit.Framework; [TestFixture] public class LanguageTests { // These coordinates came from the Forecast API documentation, // and should return forecasts with all blocks. private const double AlcatrazLatitude = 37.8267; private const double AlcatrazLongitude = -122.423; /// <summary> /// API key to be used for testing. This should be specified in the /// test project's app.config file. /// </summary> private string apiKey; /// <summary> /// Sets up all tests by retrieving the API key from app.config. /// </summary> [TestFixtureSetUp] public void SetUp() { this.apiKey = ConfigurationManager.AppSettings["ApiKey"]; } [Test] public void AllLanguagesHaveValues() { foreach (Language language in Enum.GetValues(typeof(Language))) { Assert.That(() => language.ToValue(), Throws.Nothing); } } [Test] public async Task UnicodeLanguageIsSupported() { var client = new ForecastApi(this.apiKey); var result = await client.GetWeatherDataAsync(AlcatrazLatitude, AlcatrazLongitude, Unit.Auto, Language.Chinese); Assert.That(result, Is.Not.Null); } } }
Clean up unused lat/long coordinates in language tests.
Clean up unused lat/long coordinates in language tests.
C#
mit
jcheng31/DarkSkyApi,jcheng31/ForecastPCL
d13ddca8f763833e9254f826d1600000e20bc5ea
src/Api/DependencyInjectionConfiguration.cs
src/Api/DependencyInjectionConfiguration.cs
using Microsoft.Extensions.DependencyInjection; using ISTS.Application.Rooms; using ISTS.Application.Studios; using ISTS.Domain.Rooms; using ISTS.Domain.Studios; using ISTS.Infrastructure.Repository; namespace ISTS.Api { public static class DependencyInjectionConfiguration { public static void Configure(IServiceCollection services) { services.AddSingleton<IStudioRepository, StudioRepository>(); services.AddSingleton<IRoomRepository, RoomRepository>(); services.AddSingleton<IStudioService, StudioService>(); services.AddSingleton<IRoomService, RoomService>(); } } }
using Microsoft.Extensions.DependencyInjection; using ISTS.Application.Rooms; using ISTS.Application.Schedules; using ISTS.Application.Studios; using ISTS.Domain.Rooms; using ISTS.Domain.Schedules; using ISTS.Domain.Studios; using ISTS.Infrastructure.Repository; namespace ISTS.Api { public static class DependencyInjectionConfiguration { public static void Configure(IServiceCollection services) { services.AddSingleton<ISessionScheduleValidator, SessionScheduleValidator>(); services.AddSingleton<IStudioRepository, StudioRepository>(); services.AddSingleton<IRoomRepository, RoomRepository>(); services.AddSingleton<IStudioService, StudioService>(); services.AddSingleton<IRoomService, RoomService>(); } } }
Fix stackoverflow error caused by navigation property in Session model
Fix stackoverflow error caused by navigation property in Session model
C#
mit
meutley/ISTS
93229a8c35fdbec67ed73dbbf37258e16d3468b9
Assets/Editor/Alensia/Core/UI/ComponentFactory.cs
Assets/Editor/Alensia/Core/UI/ComponentFactory.cs
using UnityEditor; using UnityEngine; namespace Alensia.Core.UI { public static class ComponentFactory { [MenuItem("GameObject/UI/Alensia/Button", false, 10)] public static Button CreateButton(MenuCommand command) { var button = Button.CreateInstance(); GameObjectUtility.SetParentAndAlign(button.gameObject, command.context as GameObject); Undo.RegisterCreatedObjectUndo(button, "Create " + button.name); Selection.activeObject = button; return button; } [MenuItem("GameObject/UI/Alensia/Label", false, 10)] public static Label CreateLabel(MenuCommand command) { var label = Label.CreateInstance(); GameObjectUtility.SetParentAndAlign(label.gameObject, command.context as GameObject); Undo.RegisterCreatedObjectUndo(label, "Create " + label.name); Selection.activeObject = label; return label; } [MenuItem("GameObject/UI/Alensia/Panel", false, 10)] public static Panel CreatePanel(MenuCommand command) { var panel = Panel.CreateInstance(); GameObjectUtility.SetParentAndAlign(panel.gameObject, command.context as GameObject); Undo.RegisterCreatedObjectUndo(panel, "Create " + panel.name); Selection.activeObject = panel; return panel; } } }
using System; using UnityEditor; using UnityEngine; namespace Alensia.Core.UI { public static class ComponentFactory { [MenuItem("GameObject/UI/Alensia/Button", false, 10)] public static Button CreateButton(MenuCommand command) => CreateComponent(command, Button.CreateInstance); [MenuItem("GameObject/UI/Alensia/Label", false, 10)] public static Label CreateLabel(MenuCommand command) => CreateComponent(command, Label.CreateInstance); [MenuItem("GameObject/UI/Alensia/Panel", false, 10)] public static Panel CreatePanel(MenuCommand command) => CreateComponent(command, Panel.CreateInstance); private static T CreateComponent<T>( MenuCommand command, Func<T> factory) where T : UIComponent { var component = factory.Invoke(); GameObjectUtility.SetParentAndAlign( component.gameObject, command.context as GameObject); Undo.RegisterCreatedObjectUndo(component, "Create " + component.name); Selection.activeObject = component; return component; } } }
Simplify component factory with generics
Simplify component factory with generics
C#
apache-2.0
mysticfall/Alensia
ff29118539d22d5067faac3ba73e84a3f5dfce59
src/ENode/Properties/AssemblyInfo.cs
src/ENode/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("ENode")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ENode")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("bdf470ac-90a3-47cf-9032-a3f7a298a688")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ENode")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ENode")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("bdf470ac-90a3-47cf-9032-a3f7a298a688")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.2.1.0")] [assembly: AssemblyFileVersion("1.2.1.0")]
Modify the enode project assembly.cs file
Modify the enode project assembly.cs file
C#
mit
Aaron-Liu/enode,tangxuehua/enode
5a6a011ef45e44c5f8663bf581505a1c7730a648
mvcWebApp/Views/Home/_Jumbotron.cshtml
mvcWebApp/Views/Home/_Jumbotron.cshtml
<section class="container"> <div id="our-jumbotron" class="jumbotron"> <h1>Welcome!</h1> <p>We are Sweet Water Revolver. This is our website. Please look around and check out our...</p> <p><a class="btn btn-primary btn-lg" role="button">... showtimes.</a></p> </div> </section>
<section class="container"> <div id="our-jumbotron" class="jumbotron"> <h1>Welcome!</h1> <p>We are Sweet Water Revolver. This is our website. Please look around.</p> </div> </section>
Remove the non-active button from the jumbotron.
Remove the non-active button from the jumbotron.
C#
mit
bigfont/sweet-water-revolver
009b973234c9923d66c5f2975b03cd5f19188bfd
Google.PowerShell/Dns/GcdCmdlet.cs
Google.PowerShell/Dns/GcdCmdlet.cs
 // Copyright 2016 Google Inc. All Rights Reserved. // Licensed under the Apache License Version 2.0. using Google.Apis.Dns.v1; using Google.PowerShell.Common; namespace Google.PowerShell.Dns { /// <summary> /// Base class for Google DNS-based cmdlets. /// </summary> public abstract class GcdCmdlet : GCloudCmdlet { // The Service for the Google DNS API public DnsService Service { get; } protected GcdCmdlet() : this(null) { } protected GcdCmdlet(DnsService service) { Service = service ?? new DnsService(GetBaseClientServiceInitializer()); } } }
 // Copyright 2016 Google Inc. All Rights Reserved. // Licensed under the Apache License Version 2.0. using Google.Apis.Dns.v1; using Google.PowerShell.Common; namespace Google.PowerShell.Dns { /// <summary> /// Base class for Google DNS-based cmdlets. /// </summary> public abstract class GcdCmdlet : GCloudCmdlet { // The Service for the Google DNS API public DnsService Service { get; } protected GcdCmdlet() : this(null) { } protected GcdCmdlet(DnsService service) { Service = service ?? new DnsService(GetBaseClientServiceInitializer()); } } }
Revert "Newline at end of file missing, added."
Revert "Newline at end of file missing, added." This reverts commit 4a444ccadc24dc37a2255a33f0dc1f762f13079b. Undo newline.
C#
apache-2.0
marceloyuela/google-cloud-powershell,GoogleCloudPlatform/google-cloud-powershell,marceloyuela/google-cloud-powershell,ILMTitan/google-cloud-powershell,marceloyuela/google-cloud-powershell,chrsmith/google-cloud-powershell
deb6c052bdfecb1dd1471650db5d35aa6801d64b
Plugins/Drift/Source/RapidJson/RapidJson.Build.cs
Plugins/Drift/Source/RapidJson/RapidJson.Build.cs
// Copyright 2015-2017 Directive Games Limited - All Rights Reserved using UnrealBuildTool; public class RapidJson : ModuleRules { public RapidJson(TargetInfo Target) { bFasterWithoutUnity = true; PCHUsage = PCHUsageMode.NoSharedPCHs; PublicIncludePaths.AddRange( new string[] { // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { // ... add other private include paths required here ... } ); PublicDependencyModuleNames.AddRange( new string[] { // ... add other public dependencies that you statically link with here ... "Core", "HTTP", } ); PrivateDependencyModuleNames.AddRange( new string[] { // ... add private dependencies that you statically link with here ... } ); } }
// Copyright 2015-2017 Directive Games Limited - All Rights Reserved using UnrealBuildTool; public class RapidJson : ModuleRules { public RapidJson(TargetInfo Target) { bFasterWithoutUnity = true; PCHUsage = PCHUsageMode.NoSharedPCHs; PublicIncludePaths.AddRange( new string[] { // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { // ... add other private include paths required here ... } ); PublicDependencyModuleNames.AddRange( new string[] { // ... add other public dependencies that you statically link with here ... "Core", "HTTP", } ); PrivateDependencyModuleNames.AddRange( new string[] { // ... add private dependencies that you statically link with here ... } ); if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.PS4)) { Definitions.Add("RAPIDJSON_HAS_CXX11_RVALUE_REFS=1"); } } }
Fix build error in VS2015
Fix build error in VS2015
C#
mit
dgnorth/DriftUe4Plugin,dgnorth/DriftUe4Plugin,dgnorth/DriftUe4Plugin,dgnorth/DriftUe4Plugin
5aee92f855a33912b6c30648e9517d1fde58917e
HaveIBeenPwned/PwEntryExtension.cs
HaveIBeenPwned/PwEntryExtension.cs
using KeePassLib; using System; using System.Linq; namespace HaveIBeenPwned { public static class PwEntryExtension { public static DateTime GetPasswordLastModified(this PwEntry entry) { if(entry.History != null && entry.History.Any()) { var sortedEntries = entry.History.OrderByDescending(h => h.LastModificationTime); foreach(var historyEntry in sortedEntries) { if(entry.Strings.GetSafe(PwDefs.PasswordField).ReadString() != historyEntry.Strings.GetSafe(PwDefs.PasswordField).ReadString()) { return historyEntry.LastModificationTime; } } return sortedEntries.Last().LastModificationTime; } return entry.LastModificationTime; } } }
using KeePass.Plugins; using KeePassLib; using System; using System.Linq; namespace HaveIBeenPwned { public static class PwEntryExtension { public static DateTime GetPasswordLastModified(this PwEntry entry) { if(entry.History != null && entry.History.Any()) { var sortedEntries = entry.History.OrderByDescending(h => h.LastModificationTime); foreach(var historyEntry in sortedEntries) { if(entry.Strings.GetSafe(PwDefs.PasswordField).ReadString() != historyEntry.Strings.GetSafe(PwDefs.PasswordField).ReadString()) { return historyEntry.LastModificationTime; } } return sortedEntries.Last().LastModificationTime; } return entry.LastModificationTime; } public static bool IsDeleted(this PwEntry entry, IPluginHost pluginHost) { return entry.ParentGroup.Uuid.CompareTo(pluginHost.Database.RecycleBinUuid) == 0; } } }
Add extension method for working out if an entry is deleted or not.
Add extension method for working out if an entry is deleted or not.
C#
mit
andrew-schofield/keepass2-haveibeenpwned
bc850d72037ccf5621d5edf462a87ada9d82c434
src/SqlPersistence/ScriptLocation.cs
src/SqlPersistence/ScriptLocation.cs
using System; using System.IO; using System.Reflection; using NServiceBus; using NServiceBus.Settings; static class ScriptLocation { public static string FindScriptDirectory(ReadOnlySettings settings) { var currentDirectory = GetCurrentDirectory(settings); return Path.Combine(currentDirectory, "NServiceBus.Persistence.Sql", settings.GetSqlDialect().Name); } static string GetCurrentDirectory(ReadOnlySettings settings) { if (settings.TryGet("SqlPersistence.ScriptDirectory", out string scriptDirectory)) { return scriptDirectory; } var entryAssembly = Assembly.GetEntryAssembly(); if (entryAssembly == null) { return AppDomain.CurrentDomain.BaseDirectory; } var codeBase = entryAssembly.CodeBase; return Directory.GetParent(new Uri(codeBase).LocalPath).FullName; } public static void ValidateScriptExists(string createScript) { if (!File.Exists(createScript)) { throw new Exception($"Expected '{createScript}' to exist. It is possible it was not deployed with the endpoint or NServiceBus.Persistence.Sql.MsBuild nuget was not included in the project."); } } }
using System; using System.IO; using System.Reflection; using NServiceBus; using NServiceBus.Settings; static class ScriptLocation { const string ScriptFolder = "NServiceBus.Persistence.Sql"; public static string FindScriptDirectory(ReadOnlySettings settings) { var currentDirectory = GetCurrentDirectory(settings); return Path.Combine(currentDirectory, ScriptFolder, settings.GetSqlDialect().Name); } static string GetCurrentDirectory(ReadOnlySettings settings) { if (settings.TryGet("SqlPersistence.ScriptDirectory", out string scriptDirectory)) { return scriptDirectory; } var entryAssembly = Assembly.GetEntryAssembly(); if (entryAssembly == null) { var baseDir = AppDomain.CurrentDomain.BaseDirectory; var scriptDir = Path.Combine(baseDir, ScriptFolder); //if the app domain base dir contains the scripts folder, return it. Otherwise add "bin" to the base dir so that web apps work correctly if (Directory.Exists(scriptDir)) { return baseDir; } return Path.Combine(baseDir, "bin"); } var codeBase = entryAssembly.CodeBase; return Directory.GetParent(new Uri(codeBase).LocalPath).FullName; } public static void ValidateScriptExists(string createScript) { if (!File.Exists(createScript)) { throw new Exception($"Expected '{createScript}' to exist. It is possible it was not deployed with the endpoint or NServiceBus.Persistence.Sql.MsBuild nuget was not included in the project."); } } }
Fix script location via AppDomain base dir for web applications
Fix script location via AppDomain base dir for web applications
C#
mit
NServiceBusSqlPersistence/NServiceBus.SqlPersistence
213bd6f4540e9844fd9503c2635cd9a3f00ceb0b
Sources/Rhaeo.Mvvm/Rhaeo.Mvvm/ObservableObject.cs
Sources/Rhaeo.Mvvm/Rhaeo.Mvvm/ObservableObject.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Rhaeo.Mvvm { public class ObservableObject { } }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="ObservableObject.cs" company="Rhaeo"> // Licenced under the MIT licence. // </copyright> // <summary> // Defines the ObservableObject type. // </summary> // -------------------------------------------------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Linq.Expressions; namespace Rhaeo.Mvvm { /// <summary> /// Serves as a back class for object instances obserable through the <see cref="INotifyPropertyChanged"/> interface. /// </summary> public class ObservableObject : INotifyPropertyChanged { #region Events /// <summary> /// Occurs when a property value changes. /// </summary> public event PropertyChangedEventHandler PropertyChanged; #endregion #region Methods /// <summary> /// Raises the <see cref="PropertyChanged"/> event with a property name extracted from the property expression. /// </summary> /// <typeparam name="TViewModel"> /// The view model type. /// </typeparam> /// <typeparam name="TValue"> /// The property value type. /// </typeparam> /// <param name="propertyExpression"> /// The property expression. /// </param> protected void RaisePropertyChanged<TViewModel, TValue>(Expression<Func<TViewModel, TValue>> propertyExpression) where TViewModel : ObservableObject { var propertyName = (propertyExpression.Body as MemberExpression).Member.Name; var propertyChangedHandler = this.PropertyChanged; if (propertyChangedHandler != null) { propertyChangedHandler(this, new PropertyChangedEventArgs(propertyName)); } } #endregion } }
Implement extracting the property name
Implement extracting the property name
C#
mit
Rhaeo/Rhaeo.Mvvm
7692a31d4a329eaa0c6256b21307ab9a37f45041
ProgrammingPraxis/red_squiggles.cs
ProgrammingPraxis/red_squiggles.cs
// https://www.reddit.com/r/dailyprogrammer/comments/3n55f3/20150930_challenge_234_intermediate_red_squiggles/ // // Your challenge today is to implement a real time spell checker and indicate where you would throw the red squiggle. For your dictionary use /usr/share/dict/words // using System; using System.Collections.Generic; using System.IO; using System.Linq; class Trie { private class Node { internal Dictionary<char, Node> Next = new Dictionary<char, Node>(); bool IsWord = false; } } class Program { static void Main() { Trie trie = new Trie(); using (StreamReader reader = new StreamReader("/usr/share/dict/words")) { String line; while ((line = reader.ReadLine()) != null) { Console.WriteLine(line); } } } }
// https://www.reddit.com/r/dailyprogrammer/comments/3n55f3/20150930_challenge_234_intermediate_red_squiggles/ // // Your challenge today is to implement a real time spell checker and indicate where you would throw the red squiggle. For your dictionary use /usr/share/dict/words // using System; using System.Collections.Generic; using System.IO; using System.Linq; class Trie { private class Node { internal Dictionary<char, Node> Next = new Dictionary<char, Node>(); internal bool IsWord = false; public override String ToString() { return String.Format("[Node.IsWord:{0} {1}]", IsWord, String.Join(", ", Next.Select(x => String.Format("{0} => {1}", x.Key, x.Value.ToString())))); } } private readonly Node Root = new Node(); public void Add(String s) { Node current = Root; for (int i = 0; i < s.Length; i++) { Node next; if (!current.Next.TryGetValue(s[i], out next)) { next = new Node(); current.Next[s[i]] = next; } next.IsWord = i == s.Length - 1; current = next; } } public override String ToString() { return Root.ToString(); } } class Program { static void Main() { Trie trie = new Trie(); using (StreamReader reader = new StreamReader("/usr/share/dict/words")) { String line; while ((line = reader.ReadLine()) != null) { trie.Add(line); } } Console.WriteLine(trie); } }
Build and print the trie
Build and print the trie
C#
mit
Gerula/interviews,Gerula/interviews,Gerula/interviews,Gerula/interviews,Gerula/interviews
e1cce88ae5d587b3bd625e4e812e66259b379a19
SampleGame.Android/MainActivity.cs
SampleGame.Android/MainActivity.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using Android.App; using Android.OS; using Android.Content.PM; using Android.Views; namespace SampleGame.Android { [Activity(Label = "SampleGame", MainLauncher = true, ScreenOrientation = ScreenOrientation.Landscape, Theme = "@android:style/Theme.NoTitleBar")] public class MainActivity : Activity { protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.AddFlags(WindowManagerFlags.Fullscreen); Window.AddFlags(WindowManagerFlags.KeepScreenOn); SetContentView(new SampleGameView(this)); } } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using Android.App; using Android.OS; using Android.Content.PM; using Android.Views; using System; using Android.Runtime; using Android.Content.Res; namespace SampleGame.Android { [Activity(Label = "SampleGame", ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize, MainLauncher = true, Theme = "@android:style/Theme.NoTitleBar")] public class MainActivity : Activity { private SampleGameView sampleGameView; protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.AddFlags(WindowManagerFlags.Fullscreen); Window.AddFlags(WindowManagerFlags.KeepScreenOn); SetContentView(sampleGameView = new SampleGameView(this)); } } }
Allow rotating the screen without crashing by overriding the Configuration changes.
Allow rotating the screen without crashing by overriding the Configuration changes. Restarting the activity is not a choice on orientation changes.
C#
mit
ZLima12/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,peppy/osu-framework,ppy/osu-framework,DrabWeb/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,ppy/osu-framework,DrabWeb/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,peppy/osu-framework
f48e1d8ec163e8dc786100a0d842c36010510c7b
PinWin/Properties/AssemblyInfo.cs
PinWin/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("PinWin")] [assembly: AssemblyDescription("Allows user to make desktop windows top most")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PinWin")] [assembly: AssemblyCopyright("Copyright © Victor Zakharov 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("7ae6966c-0686-4ac4-afbb-9ffd7bf7b81c")] // 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.4")] [assembly: AssemblyFileVersion("0.2.4")]
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("PinWin")] [assembly: AssemblyDescription("Allows user to make desktop windows top most")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PinWin")] [assembly: AssemblyCopyright("Copyright © Victor Zakharov 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("7ae6966c-0686-4ac4-afbb-9ffd7bf7b81c")] // 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.5")] [assembly: AssemblyFileVersion("0.2.5")]
Increment version before creating release (0.2.5).
Increment version before creating release (0.2.5).
C#
mit
VictorZakharov/pinwin
4be287a8bbc742bb4b0758adb32a7be78bd6a09c
src/Markdig.Wpf/Renderers/Wpf/Inlines/AutoLinkInlineRenderer.cs
src/Markdig.Wpf/Renderers/Wpf/Inlines/AutoLinkInlineRenderer.cs
// Copyright (c) 2016-2017 Nicolas Musset. All rights reserved. // This file is licensed under the MIT license. // See the LICENSE.md file in the project root for more information. using System; using System.Windows.Documents; using Markdig.Annotations; using Markdig.Syntax.Inlines; using Markdig.Wpf; namespace Markdig.Renderers.Wpf.Inlines { /// <summary> /// A WPF renderer for a <see cref="AutolinkInline"/>. /// </summary> /// <seealso cref="Markdig.Renderers.Wpf.WpfObjectRenderer{Markdig.Syntax.Inlines.AutolinkInline}" /> public class AutolinkInlineRenderer : WpfObjectRenderer<AutolinkInline> { /// <inheritdoc/> protected override void Write([NotNull] WpfRenderer renderer, [NotNull] AutolinkInline link) { var url = link.Url; if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)) { url = "#"; } var hyperlink = new Hyperlink { Command = Commands.Hyperlink, CommandParameter = url, NavigateUri = new Uri(url, UriKind.RelativeOrAbsolute), ToolTip = url, }; renderer.WriteInline(hyperlink); } } }
// Copyright (c) 2016-2017 Nicolas Musset. All rights reserved. // This file is licensed under the MIT license. // See the LICENSE.md file in the project root for more information. using System; using System.Windows.Documents; using Markdig.Annotations; using Markdig.Syntax.Inlines; using Markdig.Wpf; namespace Markdig.Renderers.Wpf.Inlines { /// <summary> /// A WPF renderer for a <see cref="AutolinkInline"/>. /// </summary> /// <seealso cref="Markdig.Renderers.Wpf.WpfObjectRenderer{Markdig.Syntax.Inlines.AutolinkInline}" /> public class AutolinkInlineRenderer : WpfObjectRenderer<AutolinkInline> { /// <inheritdoc/> protected override void Write([NotNull] WpfRenderer renderer, [NotNull] AutolinkInline link) { var url = link.Url; if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)) { url = "#"; } var hyperlink = new Hyperlink { Command = Commands.Hyperlink, CommandParameter = url, NavigateUri = new Uri(url, UriKind.RelativeOrAbsolute), ToolTip = url, }; renderer.Push(hyperlink); renderer.WriteText(link.Url); renderer.Pop(); } } }
Write the autolink's URL so we can see the autolink.
Write the autolink's URL so we can see the autolink.
C#
mit
Kryptos-FR/markdig.wpf,Kryptos-FR/markdig-wpf
d381494ef083440506f85fb542d363497b3e723a
src/Swashbuckle.Swagger/Application/SwaggerSerializerFactory.cs
src/Swashbuckle.Swagger/Application/SwaggerSerializerFactory.cs
using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Newtonsoft.Json; namespace Swashbuckle.Swagger.Application { public class SwaggerSerializerFactory { internal static JsonSerializer Create(IOptions<MvcJsonOptions> mvcJsonOptions) { // TODO: Should this handle case where mvcJsonOptions.Value == null? return new JsonSerializer { NullValueHandling = NullValueHandling.Ignore, ContractResolver = new SwaggerContractResolver(mvcJsonOptions.Value.SerializerSettings) }; } } }
using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Newtonsoft.Json; namespace Swashbuckle.Swagger.Application { public class SwaggerSerializerFactory { internal static JsonSerializer Create(IOptions<MvcJsonOptions> mvcJsonOptions) { // TODO: Should this handle case where mvcJsonOptions.Value == null? return new JsonSerializer { NullValueHandling = NullValueHandling.Ignore, Formatting = mvcJsonOptions.Value.SerializerSettings.Formatting, ContractResolver = new SwaggerContractResolver(mvcJsonOptions.Value.SerializerSettings) }; } } }
Use MvcJsonOptions json serializer formatting when generating swagger.json
Use MvcJsonOptions json serializer formatting when generating swagger.json
C#
mit
domaindrivendev/Swashbuckle.AspNetCore,domaindrivendev/Swashbuckle.AspNetCore,domaindrivendev/Ahoy,oconics/Ahoy,domaindrivendev/Ahoy,domaindrivendev/Swashbuckle.AspNetCore,oconics/Ahoy,domaindrivendev/Ahoy
e0f0d102bbbd40400965cca6e37bdd72b4eadecb
src/CGO.Web/NinjectModules/RavenModule.cs
src/CGO.Web/NinjectModules/RavenModule.cs
using Ninject; using Ninject.Modules; using Ninject.Web.Common; using Raven.Client; using Raven.Client.Embedded; namespace CGO.Web.NinjectModules { public class RavenModule : NinjectModule { public override void Load() { Kernel.Bind<IDocumentStore>().ToMethod(_ => InitialiseDocumentStore()).InSingletonScope(); Kernel.Bind<IDocumentSession>().ToMethod(_ => Kernel.Get<IDocumentStore>().OpenSession()).InRequestScope(); } private static IDocumentStore InitialiseDocumentStore() { var documentStore = new EmbeddableDocumentStore { DataDirectory = "CGO.raven", UseEmbeddedHttpServer = true, Configuration = { Port = 28645 } }; documentStore.Initialize(); documentStore.InitializeProfiling(); return documentStore; } } }
using Ninject; using Ninject.Modules; using Ninject.Web.Common; using Raven.Client; using Raven.Client.Embedded; namespace CGO.Web.NinjectModules { public class RavenModule : NinjectModule { public override void Load() { Kernel.Bind<IDocumentStore>().ToMethod(_ => InitialiseDocumentStore()).InSingletonScope(); Kernel.Bind<IDocumentSession>().ToMethod(_ => Kernel.Get<IDocumentStore>().OpenSession()).InRequestScope(); } private static IDocumentStore InitialiseDocumentStore() { var documentStore = new EmbeddableDocumentStore { DataDirectory = "CGO.raven", Configuration = { Port = 28645 } }; documentStore.Initialize(); documentStore.InitializeProfiling(); return documentStore; } } }
Disable Raven's Embedded HTTP server
Disable Raven's Embedded HTTP server I'm not really making use of this, and it's preventing successful deployment in Azure.
C#
mit
alastairs/cgowebsite,alastairs/cgowebsite
b207594a6c954506e5d745ca492907c30638bfb0
src/Pirac/Conventions/ViewConvention.cs
src/Pirac/Conventions/ViewConvention.cs
using Conventional.Conventions; namespace Pirac.Conventions { internal class ViewConvention : Convention { public ViewConvention() { Must.HaveNameEndWith("View").BeAClass(); Should.BeAConcreteClass(); BaseName = t => t.Name.Substring(0, t.Name.Length - 4); Variants.HaveBaseNameAndEndWith("View"); } } }
using System; using Conventional.Conventions; namespace Pirac.Conventions { internal class ViewConvention : Convention { public ViewConvention() { Must.Pass(t => t.IsClass && (t.Name.EndsWith("View") || t.Name == "MainWindow"), "Name ends with View or is named MainWindow"); Should.BeAConcreteClass(); BaseName = t => t.Name == "MainWindow" ? t.Name : t.Name.Substring(0, t.Name.Length - 4); Variants.Add(new DelegateBaseFilter((t, b) => { if (t.Name == "MainWindow" && b == "MainWindow") return true; return t.Name == b + "View"; })); } class DelegateBaseFilter : IBaseFilter { private readonly Func<Type, string, bool> predicate; public DelegateBaseFilter(Func<Type, string, bool> predicate) { this.predicate = predicate; } public bool Matches(Type t, string baseName) { return predicate(t, baseName); } } } }
Update View convention to recognize MainWindow
Update View convention to recognize MainWindow
C#
mit
distantcam/Pirac
10c20edee1427615d04447b2ffa7cd9fb0cd58b9
Build/Program.cs
Build/Program.cs
using System; using System.Collections.Generic; using System.IO; using Cake.Core; using Cake.Core.Configuration; using Cake.Frosting; using Cake.NuGet; public class Program : IFrostingStartup { public static int Main(string[] args) { // Create the host. var host = new CakeHostBuilder() .WithArguments(args) .UseStartup<Program>() .Build(); // Run the host. return host.Run(); } public void Configure(ICakeServices services) { services.UseContext<Context>(); services.UseLifetime<Lifetime>(); services.UseWorkingDirectory(".."); // from https://github.com/cake-build/cake/discussions/2931 var module = new NuGetModule(new CakeConfiguration(new Dictionary<string, string>())); module.Register(services); services.UseTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.0.1")); services.UseTool(new Uri("nuget:?package=Microsoft.TestPlatform&version=16.8.0")); services.UseTool(new Uri("nuget:?package=NUnitTestAdapter&version=2.3.0")); } }
using System; using System.Collections.Generic; using System.IO; using Cake.Core; using Cake.Core.Configuration; using Cake.Frosting; using Cake.NuGet; public class Program : IFrostingStartup { public static int Main(string[] args) { // Create the host. var host = new CakeHostBuilder() .WithArguments(args) .UseStartup<Program>() .Build(); // Run the host. return host.Run(); } public void Configure(ICakeServices services) { services.UseContext<Context>(); services.UseLifetime<Lifetime>(); services.UseWorkingDirectory(".."); // from https://github.com/cake-build/cake/discussions/2931 var module = new NuGetModule(new CakeConfiguration(new Dictionary<string, string>())); module.Register(services); services.UseTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.0.1")); services.UseTool(new Uri("nuget:?package=Microsoft.TestPlatform&version=16.8.0")); services.UseTool(new Uri("nuget:?package=NUnitTestAdapter&version=2.3.0")); services.UseTool(new Uri("nuget:?package=NuGet.CommandLine&version=5.8.0")); } }
Install NuGet as a tool
Install NuGet as a tool
C#
mit
mitchelsellers/Dnn.Platform,mitchelsellers/Dnn.Platform,valadas/Dnn.Platform,mitchelsellers/Dnn.Platform,bdukes/Dnn.Platform,valadas/Dnn.Platform,dnnsoftware/Dnn.Platform,nvisionative/Dnn.Platform,mitchelsellers/Dnn.Platform,valadas/Dnn.Platform,dnnsoftware/Dnn.Platform,nvisionative/Dnn.Platform,dnnsoftware/Dnn.Platform,valadas/Dnn.Platform,valadas/Dnn.Platform,bdukes/Dnn.Platform,mitchelsellers/Dnn.Platform,dnnsoftware/Dnn.Platform,bdukes/Dnn.Platform,nvisionative/Dnn.Platform,dnnsoftware/Dnn.Platform,bdukes/Dnn.Platform
784cec48fad09535dd2202c9cbf4a388612ba23d
Common/Constants.cs
Common/Constants.cs
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using QuantConnect.Configuration; namespace QuantConnect { /// <summary> /// Provides application level constant values /// </summary> public static class Constants { /// <summary> /// The root directory of the data folder for this application /// </summary> public static string DataFolder { get { return Config.Get("data-folder", @"../../../Data/"); } } /// <summary> /// The directory used for storing downloaded remote files /// </summary> public const string Cache = "./cache/data"; /// <summary> /// The version of lean /// </summary> public static readonly string Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); } }
/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ using QuantConnect.Configuration; namespace QuantConnect { /// <summary> /// Provides application level constant values /// </summary> public static class Constants { private static readonly string DataFolderPath = Config.Get("data-folder", @"../../../Data/"); /// <summary> /// The root directory of the data folder for this application /// </summary> public static string DataFolder { get { return DataFolderPath; } } /// <summary> /// The directory used for storing downloaded remote files /// </summary> public const string Cache = "./cache/data"; /// <summary> /// The version of lean /// </summary> public static readonly string Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); } }
Move DataFolder config get to static member initializer
Move DataFolder config get to static member initializer
C#
apache-2.0
AnshulYADAV007/Lean,AlexCatarino/Lean,jameschch/Lean,AnshulYADAV007/Lean,kaffeebrauer/Lean,desimonk/Lean,wowgeeker/Lean,exhau/Lean,bizcad/LeanAbhi,rchien/Lean,dalebrubaker/Lean,bizcad/LeanITrend,Phoenix1271/Lean,tzaavi/Lean,Mendelone/forex_trading,mabeale/Lean,devalkeralia/Lean,bizcad/LeanJJN,andrewhart098/Lean,QuantConnect/Lean,redmeros/Lean,Jay-Jay-D/LeanSTP,iamkingmaker/Lean,rchien/Lean,florentchandelier/Lean,Phoenix1271/Lean,squideyes/Lean,dalebrubaker/Lean,dpavlenkov/Lean,AnObfuscator/Lean,StefanoRaggi/Lean,devalkeralia/Lean,Phoenix1271/Lean,bdilber/Lean,racksen/Lean,bdilber/Lean,rchien/Lean,AlexCatarino/Lean,Neoracle/Lean,bizcad/LeanITrend,tomhunter-gh/Lean,bizcad/Lean,bizcad/LeanITrend,kaffeebrauer/Lean,squideyes/Lean,AnshulYADAV007/Lean,Mendelone/forex_trading,Neoracle/Lean,florentchandelier/Lean,Obawoba/Lean,JKarathiya/Lean,young-zhang/Lean,bizcad/LeanJJN,QuantConnect/Lean,tomhunter-gh/Lean,squideyes/Lean,bizcad/LeanJJN,jameschch/Lean,bizcad/Lean,JKarathiya/Lean,Mendelone/forex_trading,andrewhart098/Lean,dpavlenkov/Lean,desimonk/Lean,racksen/Lean,JKarathiya/Lean,tomhunter-gh/Lean,Obawoba/Lean,florentchandelier/Lean,devalkeralia/Lean,FrancisGauthier/Lean,wowgeeker/Lean,FrancisGauthier/Lean,young-zhang/Lean,andrewhart098/Lean,StefanoRaggi/Lean,StefanoRaggi/Lean,racksen/Lean,iamkingmaker/Lean,bdilber/Lean,Jay-Jay-D/LeanSTP,desimonk/Lean,dalebrubaker/Lean,young-zhang/Lean,Jay-Jay-D/LeanSTP,bizcad/Lean,kaffeebrauer/Lean,redmeros/Lean,AnshulYADAV007/Lean,mabeale/Lean,dpavlenkov/Lean,kaffeebrauer/Lean,mabeale/Lean,young-zhang/Lean,jameschch/Lean,QuantConnect/Lean,tomhunter-gh/Lean,Neoracle/Lean,tzaavi/Lean,jameschch/Lean,iamkingmaker/Lean,AnshulYADAV007/Lean,bizcad/Lean,mabeale/Lean,StefanoRaggi/Lean,AnObfuscator/Lean,Jay-Jay-D/LeanSTP,AnObfuscator/Lean,StefanoRaggi/Lean,exhau/Lean,desimonk/Lean,redmeros/Lean,tzaavi/Lean,AlexCatarino/Lean,Neoracle/Lean,exhau/Lean,exhau/Lean,iamkingmaker/Lean,redmeros/Lean,bizcad/LeanITrend,JKarathiya/Lean,andrewhart098/Lean,jameschch/Lean,AnObfuscator/Lean,florentchandelier/Lean,devalkeralia/Lean,wowgeeker/Lean,squideyes/Lean,Jay-Jay-D/LeanSTP,bizcad/LeanAbhi,Mendelone/forex_trading,kaffeebrauer/Lean,dalebrubaker/Lean,FrancisGauthier/Lean,Obawoba/Lean,QuantConnect/Lean,Phoenix1271/Lean,Obawoba/Lean,dpavlenkov/Lean,racksen/Lean,AlexCatarino/Lean,wowgeeker/Lean,bizcad/LeanAbhi,FrancisGauthier/Lean,bizcad/LeanJJN,tzaavi/Lean,bdilber/Lean,bizcad/LeanAbhi,rchien/Lean
4afafc9784a6ef8c60634fcf68c864c69fdf6285
Kyru/Core/Config.cs
Kyru/Core/Config.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace Kyru.Core { class Config { internal readonly string storeDirectory; internal Config() { storeDirectory = Path.Combine(System.Windows.Forms.Application.UserAppDataPath); } } }
using System; using System.IO; namespace Kyru.Core { internal sealed class Config { internal string storeDirectory; internal Config() { storeDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Kyru", "objects"); } } }
Use a path for storage that doesn't include version and company name
Use a path for storage that doesn't include version and company name
C#
bsd-3-clause
zr40/kyru-dotnet,zr40/kyru-dotnet
5cc8ab4d9c1fb82d31c981bf54023a24fbc35b08
data/mango-tool/layouts/default/StaticContentModule.cs
data/mango-tool/layouts/default/StaticContentModule.cs
using System; using System.IO; using Mango; // // This the default StaticContentModule that comes with all Mango apps // if you do not wish to serve any static content with Mango you can // remove its route handler from <YourApp>.cs's constructor and delete // this file. // // All Content placed on the Content/ folder should be handled by this // module. // namespace $APPNAME { public class StaticContentModule : MangoModule { public StaticContentModule () { Get ("*", Content); } public static void Content (MangoContext ctx) { string path = ctx.Request.LocalPath; if (path.StartsWith ("/")) path = path.Substring (1); if (File.Exists (path)) { ctx.Response.SendFile (path); } else ctx.Response.StatusCode = 404; } } }
using System; using System.IO; using Mango; // // This the default StaticContentModule that comes with all Mango apps // if you do not wish to serve any static content with Mango you can // remove its route handler from <YourApp>.cs's constructor and delete // this file. // // All Content placed on the Content/ folder should be handled by this // module. // namespace AppNameFoo { public class StaticContentModule : MangoModule { public StaticContentModule () { Get ("*", Content); } public static void Content (IMangoContext ctx) { string path = ctx.Request.LocalPath; if (path.StartsWith ("/")) path = path.Substring (1); if (File.Exists (path)) { ctx.Response.SendFile (path); } else ctx.Response.StatusCode = 404; } } }
Update the static content module to fit the new API.
Update the static content module to fit the new API.
C#
mit
jmptrader/manos,mdavid/manos-spdy,jacksonh/manos,mdavid/manos-spdy,mdavid/manos-spdy,jmptrader/manos,jacksonh/manos,jmptrader/manos,jmptrader/manos,mdavid/manos-spdy,jacksonh/manos,jmptrader/manos,jmptrader/manos,jacksonh/manos,jacksonh/manos,jmptrader/manos,jacksonh/manos,jmptrader/manos,jacksonh/manos,jacksonh/manos,mdavid/manos-spdy,mdavid/manos-spdy,mdavid/manos-spdy
e24ffd611b8c4f0bd266d974db5a7879eba38158
Templates/Properties/AddinInfo.cs
Templates/Properties/AddinInfo.cs
using System; using Mono.Addins; using Mono.Addins.Description; [assembly:Addin ( "${ProjectName}", Namespace = "${ProjectName}", Version = "1.0" )] [assembly:AddinName ("${ProjectName}")] [assembly:AddinCategory ("${ProjectName}")] [assembly:AddinDescription ("${ProjectName}")] [assembly:AddinAuthor ("${AuthorName}")]
using System; using Mono.Addins; using Mono.Addins.Description; [assembly:Addin ( "${ProjectName}", Namespace = "${ProjectName}", Version = "1.0" )] [assembly:AddinName ("${ProjectName}")] [assembly:AddinCategory ("IDE extensions")] [assembly:AddinDescription ("${ProjectName}")] [assembly:AddinAuthor ("${AuthorName}")]
Fix default category for new addins
Fix default category for new addins
C#
mit
mhutch/MonoDevelop.AddinMaker,mhutch/MonoDevelop.AddinMaker
0361cc70a18cb4df41c92e0bfcc1d8e3ee390de3
Bbl.KnockoutJs/Bbl.KnockoutJs/Startup.cs
Bbl.KnockoutJs/Bbl.KnockoutJs/Startup.cs
using Nancy; using Owin; namespace Bbl.KnockoutJs { public class Startup { public void Configuration(IAppBuilder app) { app.UseNancy(); } } public class IndexModule : NancyModule { public IndexModule() { Get["/"] = parameters => View["index"]; } } }
using System.IO; using System.Linq; using System.Web.Hosting; using Nancy; using Owin; namespace Bbl.KnockoutJs { public class Startup { public void Configuration(IAppBuilder app) { app.UseNancy(); } } public class IndexModule : NancyModule { private const string UnicornsPath = "/Content/Unicorn/"; public IndexModule() { Get["/"] = parameters => View["index"]; Get["/api/unicorns"] = parameters => { var imagesDirectory = HostingEnvironment.MapPath("~" + UnicornsPath); return new DirectoryInfo(imagesDirectory) .EnumerateFiles() .Select(ConvertToDto); }; } private dynamic ConvertToDto(FileInfo file) { var name = Path.GetFileNameWithoutExtension(file.Name); return new { Key = name, ImagePath = UnicornsPath + file.Name, Name = name.Replace('_', ' '), Keywords = name.Split('_'), CreationDate = file.CreationTime }; } } }
Add url to get unicorns
Add url to get unicorns
C#
mit
fpellet/Bbl.KnockoutJs,fpellet/Bbl.KnockoutJs,fpellet/Bbl.KnockoutJs
c575d66480eabec51f44ee4a6f8873b32578ad30
src/dotnet-new2/ProjectCreator.cs
src/dotnet-new2/ProjectCreator.cs
using System; using System.Diagnostics; using System.IO; namespace dotnet_new2 { public class ProjectCreator { public bool CreateProject(string name, string path, Template template) { Directory.CreateDirectory(path); foreach (var file in template.Files) { var dest = Path.Combine(path, file.DestPath); File.Copy(file.SourcePath, dest); ProcessFile(dest, name); } Console.WriteLine(); Console.WriteLine($"Created \"{name}\" in {path}"); return true; } private void ProcessFile(string destPath, string name) { // TODO: Make this good var contents = File.ReadAllText(destPath); File.WriteAllText(destPath, contents.Replace("$DefaultNamespace$", name)); } } }
using System; using System.Diagnostics; using System.IO; namespace dotnet_new2 { public class ProjectCreator { public bool CreateProject(string name, string path, Template template) { Directory.CreateDirectory(path); if (Directory.GetFileSystemEntries(path).Length > 0) { // Files already exist in the directory Console.WriteLine($"Directory {path} already contains files. Please specify a different project name."); return false; } foreach (var file in template.Files) { var dest = Path.Combine(path, file.DestPath); File.Copy(file.SourcePath, dest); ProcessFile(dest, name); } Console.WriteLine(); Console.WriteLine($"Created \"{name}\" in {path}"); Console.WriteLine(); return true; } private void ProcessFile(string destPath, string name) { // TODO: Make this good var contents = File.ReadAllText(destPath); File.WriteAllText(destPath, contents.Replace("$DefaultNamespace$", name)); } } }
Fix case when project directory already exists
Fix case when project directory already exists
C#
mit
DamianEdwards/dotnet-new2
3cd6e55e2af8cfdd2b415dffe8dff444872bfee5
SteamIrcBot/Service/ServiceDispatcher.cs
SteamIrcBot/Service/ServiceDispatcher.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; namespace SteamIrcBot { class ServiceDispatcher { static ServiceDispatcher _instance = new ServiceDispatcher(); public static ServiceDispatcher Instance { get { return _instance; } } Task dispatcher; CancellationTokenSource cancelToken; ServiceDispatcher() { cancelToken = new CancellationTokenSource(); dispatcher = new Task( ServiceTick, cancelToken.Token, TaskCreationOptions.LongRunning ); } void ServiceTick() { while ( true ) { if ( cancelToken.IsCancellationRequested ) break; Steam.Instance.Tick(); IRC.Instance.Tick(); RSS.Instance.Tick(); } } public void Start() { dispatcher.Start(); } public void Stop() { cancelToken.Cancel(); } public void Wait() { try { dispatcher.Wait(); } catch ( AggregateException ) { // we'll ignore any cancelled/failed tasks } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; namespace SteamIrcBot { class ServiceDispatcher { static ServiceDispatcher _instance = new ServiceDispatcher(); public static ServiceDispatcher Instance { get { return _instance; } } Task dispatcher; CancellationTokenSource cancelToken; ServiceDispatcher() { cancelToken = new CancellationTokenSource(); dispatcher = new Task( ServiceTick, cancelToken.Token, TaskCreationOptions.LongRunning ); } void ServiceTick() { while ( true ) { if ( cancelToken.IsCancellationRequested ) break; Steam.Instance.Tick(); IRC.Instance.Tick(); RSS.Instance.Tick(); } } public void Start() { dispatcher.Start(); } public void Stop() { cancelToken.Cancel(); } public void Wait() { dispatcher.Wait(); } } }
Throw all dispatcher exceptions on the non-service build.
Throw all dispatcher exceptions on the non-service build.
C#
mit
VoiDeD/steam-irc-bot
b252a9106bebe19a7ae7b85654c46ac5aa44f750
Monacs.Core/Unit/Result.Unit.Extensions.cs
Monacs.Core/Unit/Result.Unit.Extensions.cs
using System; using System.Collections.Generic; using System.Linq; namespace Monacs.Core.Unit { ///<summary> /// Extensions for <see cref="Result<Unit>" /> type. ///</summary> public static class Result { ///<summary> /// Creates successful <see cref="Result<Unit>" />. ///</summary> public static Result<Unit> Ok() => Core.Result.Ok(Unit.Default); ///<summary> /// Creates failed <see cref="Result<Unit>" /> with provided error details. ///</summary> public static Result<Unit> Error(ErrorDetails error) => Core.Result.Error<Unit>(error); ///<summary> /// Rejects the value of the <see cref="Result<T>" /> and returns <see cref="Result<Unit>" /> instead. /// If the input <see cref="Result<T>" /> is Error then the error details are preserved. ///</summary> public static Result<Unit> Ignore<T>(this Result<T> result) => result.Map(_ => Unit.Default); } }
using System; using System.Collections.Generic; using System.Linq; namespace Monacs.Core.Unit { ///<summary> /// Extensions for <see cref="Result{Unit}" /> type. ///</summary> public static class Result { ///<summary> /// Creates successful <see cref="Result{Unit}" />. ///</summary> public static Result<Unit> Ok() => Core.Result.Ok(Unit.Default); ///<summary> /// Creates failed <see cref="Result{Unit}" /> with provided error details. ///</summary> public static Result<Unit> Error(ErrorDetails error) => Core.Result.Error<Unit>(error); ///<summary> /// Rejects the value of the <see cref="Result{T}" /> and returns <see cref="Result{Unit}" /> instead. /// If the input <see cref="Result{T}" /> is Error then the error details are preserved. ///</summary> public static Result<Unit> Ignore<T>(this Result<T> result) => result.Map(_ => Unit.Default); } }
Fix the XML docs generic class references
Fix the XML docs generic class references
C#
mit
bartsokol/Monacs
1e97f935c48cb55e9889dc039e002b2635fb47ec
src/ProviderModel/Properties/AssemblyInfo.cs
src/ProviderModel/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("ProviderModel")] [assembly: AssemblyDescription("An improvment over the bundled .NET provider model")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Enrique Alejandro Allegretta")] [assembly: AssemblyProduct("ProviderModel")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("en-US")] [assembly: ComVisible(false)] [assembly: Guid("9d02304c-cda1-4d3b-afbc-725731a794b5")] [assembly: AssemblyVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("ProviderModel")] [assembly: AssemblyDescription("An improvment over the bundled .NET provider model")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Enrique Alejandro Allegretta")] [assembly: AssemblyProduct("ProviderModel")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("9d02304c-cda1-4d3b-afbc-725731a794b5")] [assembly: AssemblyVersion("1.0.1")] [assembly: AssemblyFileVersion("1.0.1")] [assembly: AssemblyInformationalVersion("1.0.1")]
Set assembly culture to neutral
Set assembly culture to neutral
C#
mit
eallegretta/providermodel
91c5188281f1bab2d2d1e84a700df3b18b1eac0f
SOVND.Server/ServerMqttSettings.cs
SOVND.Server/ServerMqttSettings.cs
using SOVND.Lib; using System.IO; namespace SOVND.Server { public class ServerMqttSettings : IMQTTSettings { public string Broker { get { return "104.131.87.42"; } } public int Port { get { return 8883; } } public string Username { get { return File.ReadAllText("username.key"); } } public string Password { get { return File.ReadAllText("password.key"); } } } }
using SOVND.Lib; using System.IO; namespace SOVND.Server { public class ServerMqttSettings : IMQTTSettings { public string Broker { get { return "104.131.87.42"; } } public int Port { get { return 2883; } } public string Username { get { return File.ReadAllText("username.key"); } } public string Password { get { return File.ReadAllText("password.key"); } } } }
Change port for new RabbitMQ-MQTT server
Change port for new RabbitMQ-MQTT server
C#
epl-1.0
GeorgeHahn/SOVND
e0e7e474f15c4f0c2e01c2fd66b077bd02250075
src/Utils/SidecarXmpExtensions.cs
src/Utils/SidecarXmpExtensions.cs
using System; using System.IO; using GLib; using Hyena; using TagLib.Image; using TagLib.Xmp; namespace FSpot.Utils { public static class SidecarXmpExtensions { /// <summary> /// Parses the XMP file identified by resource and replaces the XMP /// tag of file by the parsed data. /// </summary> public static void ParseXmpSidecar (this TagLib.Image.File file, TagLib.File.IFileAbstraction resource) { string xmp; using (var stream = resource.ReadStream) { using (var reader = new StreamReader (stream)) { xmp = reader.ReadToEnd (); } } var tag = new XmpTag (xmp); var xmp_tag = file.GetTag (TagLib.TagTypes.XMP, true) as XmpTag; xmp_tag.ReplaceFrom (tag); } public static void SaveXmpSidecar (this TagLib.Image.File file, TagLib.File.IFileAbstraction resource) { var xmp_tag = file.GetTag (TagLib.TagTypes.XMP, false) as XmpTag; if (xmp_tag == null) return; var xmp = xmp_tag.Render (); using (var stream = resource.WriteStream) { using (var writer = new StreamWriter (stream)) { writer.Write (xmp); } resource.CloseStream (stream); } } } }
using System; using System.IO; using GLib; using Hyena; using TagLib.Image; using TagLib.Xmp; namespace FSpot.Utils { public static class SidecarXmpExtensions { /// <summary> /// Parses the XMP file identified by resource and replaces the XMP /// tag of file by the parsed data. /// </summary> public static void ParseXmpSidecar (this TagLib.Image.File file, TagLib.File.IFileAbstraction resource) { string xmp; using (var stream = resource.ReadStream) { using (var reader = new StreamReader (stream)) { xmp = reader.ReadToEnd (); } } var tag = new XmpTag (xmp); var xmp_tag = file.GetTag (TagLib.TagTypes.XMP, true) as XmpTag; xmp_tag.ReplaceFrom (tag); } public static void SaveXmpSidecar (this TagLib.Image.File file, TagLib.File.IFileAbstraction resource) { var xmp_tag = file.GetTag (TagLib.TagTypes.XMP, false) as XmpTag; if (xmp_tag == null) return; var xmp = xmp_tag.Render (); using (var stream = resource.WriteStream) { stream.SetLength (0); using (var writer = new StreamWriter (stream)) { writer.Write (xmp); } resource.CloseStream (stream); } } } }
Truncate stream when writing sidecar XMP files.
Truncate stream when writing sidecar XMP files.
C#
mit
GNOME/f-spot,dkoeb/f-spot,mono/f-spot,NguyenMatthieu/f-spot,Yetangitu/f-spot,dkoeb/f-spot,NguyenMatthieu/f-spot,GNOME/f-spot,GNOME/f-spot,mans0954/f-spot,mono/f-spot,mans0954/f-spot,nathansamson/F-Spot-Album-Exporter,Sanva/f-spot,dkoeb/f-spot,GNOME/f-spot,dkoeb/f-spot,Yetangitu/f-spot,Sanva/f-spot,mono/f-spot,Sanva/f-spot,Yetangitu/f-spot,nathansamson/F-Spot-Album-Exporter,Yetangitu/f-spot,NguyenMatthieu/f-spot,nathansamson/F-Spot-Album-Exporter,Yetangitu/f-spot,mans0954/f-spot,mans0954/f-spot,mono/f-spot,Sanva/f-spot,mans0954/f-spot,nathansamson/F-Spot-Album-Exporter,GNOME/f-spot,NguyenMatthieu/f-spot,mono/f-spot,dkoeb/f-spot,mono/f-spot,Sanva/f-spot,mans0954/f-spot,dkoeb/f-spot,NguyenMatthieu/f-spot
618455f7ba3496591bc8ea2e8859e7ae74de3328
osu.Game.Tests/Visual/TestCaseMultiScreen.cs
osu.Game.Tests/Visual/TestCaseMultiScreen.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using NUnit.Framework; using osu.Framework.Screens; using osu.Game.Screens.Multi; using osu.Game.Screens.Multi.Lounge; using osu.Game.Screens.Multi.Lounge.Components; namespace osu.Game.Tests.Visual { [TestFixture] public class TestCaseMultiScreen : ScreenTestCase { public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(Multiplayer), typeof(LoungeSubScreen), typeof(FilterControl) }; public TestCaseMultiScreen() { Multiplayer multi = new Multiplayer(); AddStep(@"show", () => LoadScreen(multi)); AddUntilStep(() => multi.IsCurrentScreen(), "wait until current"); AddStep(@"exit", multi.Exit); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using NUnit.Framework; using osu.Framework.Screens; using osu.Game.Screens.Multi; using osu.Game.Screens.Multi.Lounge; using osu.Game.Screens.Multi.Lounge.Components; namespace osu.Game.Tests.Visual { [TestFixture] public class TestCaseMultiScreen : ScreenTestCase { public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(Multiplayer), typeof(LoungeSubScreen), typeof(FilterControl) }; public TestCaseMultiScreen() { Multiplayer multi = new Multiplayer(); AddStep(@"show", () => LoadScreen(multi)); } } }
Remove exit step (needs login to show properly)
Remove exit step (needs login to show properly)
C#
mit
2yangk23/osu,ppy/osu,johnneijzen/osu,naoey/osu,smoogipoo/osu,DrabWeb/osu,DrabWeb/osu,ppy/osu,EVAST9919/osu,UselessToucan/osu,2yangk23/osu,NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,johnneijzen/osu,NeoAdonis/osu,EVAST9919/osu,peppy/osu-new,naoey/osu,smoogipooo/osu,peppy/osu,smoogipoo/osu,peppy/osu,ZLima12/osu,naoey/osu,NeoAdonis/osu,UselessToucan/osu,ZLima12/osu,DrabWeb/osu,ppy/osu
31e9b21d3bdbe32f5236e546e56e8c702fbdab1d
DocumentFormat.OpenXml.Tests/Common/TestContext.cs
DocumentFormat.OpenXml.Tests/Common/TestContext.cs
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace DocumentFormat.OpenXml.Tests { public class TestContext { public TestContext(string currentTest) { this.TestName = currentTest; this.FullyQualifiedTestClassName = currentTest; } public string TestName { get; set; } public string FullyQualifiedTestClassName { get; set; } [MethodImpl(MethodImplOptions.NoInlining)] public static string GetCurrentMethod() { StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(1); return sf.GetMethod().Name; } } }
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace DocumentFormat.OpenXml.Tests { public class TestContext { public TestContext(string currentTest) { this.TestName = currentTest; this.FullyQualifiedTestClassName = currentTest; } public string TestName { get; set; } public string FullyQualifiedTestClassName { get; set; } public static string GetCurrentMethod([CallerMemberName]string name = null) => name; } }
Replace StackTrace with CallerMemberName attribute
Replace StackTrace with CallerMemberName attribute
C#
mit
OfficeDev/Open-XML-SDK,ThomasBarnekow/Open-XML-SDK,tomjebo/Open-XML-SDK,tarunchopra/Open-XML-SDK,ClareMSYanGit/Open-XML-SDK
42c94a73deacab8417c33b56de43646404030b01
Joey/UI/Fragments/RecentTimeEntriesListFragment.cs
Joey/UI/Fragments/RecentTimeEntriesListFragment.cs
using System; using System.Linq; using Android.OS; using Android.Util; using Android.Views; using Android.Widget; using Toggl.Joey.UI.Adapters; using ListFragment = Android.Support.V4.App.ListFragment; namespace Toggl.Joey.UI.Fragments { public class RecentTimeEntriesListFragment : ListFragment { public override void OnViewCreated (View view, Bundle savedInstanceState) { base.OnViewCreated (view, savedInstanceState); var headerView = new View (Activity); int headerWidth = (int) TypedValue.ApplyDimension (ComplexUnitType.Dip, 6, Resources.DisplayMetrics); headerView.SetMinimumHeight (headerWidth); ListView.AddHeaderView (headerView); ListAdapter = new RecentTimeEntriesAdapter (); } public override void OnListItemClick (ListView l, View v, int position, long id) { RecentTimeEntriesAdapter adapter = null; if (l.Adapter is HeaderViewListAdapter) { var headerAdapter = (HeaderViewListAdapter)l.Adapter; adapter = headerAdapter.WrappedAdapter as RecentTimeEntriesAdapter; // Adjust the position by taking into account the fact that we've got headers position -= headerAdapter.HeadersCount; } else if (l.Adapter is RecentTimeEntriesAdapter) { adapter = (RecentTimeEntriesAdapter)l.Adapter; } if (adapter == null) return; var model = adapter.GetModel (position); if (model == null) return; model.Continue (); } } }
using System; using System.Linq; using Android.OS; using Android.Util; using Android.Views; using Android.Widget; using Toggl.Joey.UI.Adapters; using ListFragment = Android.Support.V4.App.ListFragment; namespace Toggl.Joey.UI.Fragments { public class RecentTimeEntriesListFragment : ListFragment { public override void OnViewCreated (View view, Bundle savedInstanceState) { base.OnViewCreated (view, savedInstanceState); var headerView = new View (Activity); int headerWidth = (int) TypedValue.ApplyDimension (ComplexUnitType.Dip, 6, Resources.DisplayMetrics); headerView.SetMinimumHeight (headerWidth); ListView.AddHeaderView (headerView); ListAdapter = new RecentTimeEntriesAdapter (); } public override void OnListItemClick (ListView l, View v, int position, long id) { RecentTimeEntriesAdapter adapter = null; if (l.Adapter is HeaderViewListAdapter) { var headerAdapter = (HeaderViewListAdapter)l.Adapter; adapter = headerAdapter.WrappedAdapter as RecentTimeEntriesAdapter; // Adjust the position by taking into account the fact that we've got headers position -= headerAdapter.HeadersCount; } else if (l.Adapter is RecentTimeEntriesAdapter) { adapter = (RecentTimeEntriesAdapter)l.Adapter; } if (adapter == null || position < 0 || position >= adapter.Count) return; var model = adapter.GetModel (position); if (model == null) return; model.Continue (); } } }
Fix potential crash when clicking on header/footer in recent list.
Fix potential crash when clicking on header/footer in recent list.
C#
bsd-3-clause
masterrr/mobile,ZhangLeiCharles/mobile,masterrr/mobile,eatskolnikov/mobile,peeedge/mobile,peeedge/mobile,eatskolnikov/mobile,eatskolnikov/mobile,ZhangLeiCharles/mobile
ebee9393f1e011d25cdffb36345005a90af74864
src/Orchard.Web/Program.cs
src/Orchard.Web/Program.cs
using System.IO; using Microsoft.AspNetCore.Hosting; using Orchard.Hosting; using Orchard.Web; namespace Orchard.Console { public class Program { public static void Main(string[] args) { var host = new WebHostBuilder() .UseIISIntegration() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseWebRoot(Directory.GetCurrentDirectory()) .UseStartup<Startup>() .Build(); using (host) { host.Run(); var orchardHost = new OrchardHost(host.Services, System.Console.In, System.Console.Out, args); orchardHost.Run(); } } } }
using System.IO; using Microsoft.AspNetCore.Hosting; using Orchard.Hosting; using Orchard.Web; namespace Orchard.Console { public class Program { public static void Main(string[] args) { var currentDirectory = Directory.GetCurrentDirectory(); var host = new WebHostBuilder() .UseIISIntegration() .UseKestrel() .UseContentRoot(currentDirectory) .UseWebRoot(currentDirectory) .UseStartup<Startup>() .Build(); using (host) { host.Run(); var orchardHost = new OrchardHost(host.Services, System.Console.In, System.Console.Out, args); orchardHost.Run(); } } } }
Stop double call of Directory.GetCurrentDirectory on startup, as 20% slower on linux
Stop double call of Directory.GetCurrentDirectory on startup, as 20% slower on linux
C#
bsd-3-clause
jtkech/Orchard2,alexbocharov/Orchard2,OrchardCMS/Brochard,xkproject/Orchard2,GVX111/Orchard2,petedavis/Orchard2,petedavis/Orchard2,yiji/Orchard2,stevetayloruk/Orchard2,lukaskabrt/Orchard2,xkproject/Orchard2,jtkech/Orchard2,xkproject/Orchard2,OrchardCMS/Brochard,yiji/Orchard2,petedavis/Orchard2,stevetayloruk/Orchard2,jtkech/Orchard2,lukaskabrt/Orchard2,petedavis/Orchard2,xkproject/Orchard2,GVX111/Orchard2,OrchardCMS/Brochard,xkproject/Orchard2,lukaskabrt/Orchard2,jtkech/Orchard2,yiji/Orchard2,stevetayloruk/Orchard2,lukaskabrt/Orchard2,alexbocharov/Orchard2,stevetayloruk/Orchard2,GVX111/Orchard2,alexbocharov/Orchard2,stevetayloruk/Orchard2
75fd91e15035d84551ba6ccf3278dbc146ad5ab9
Src/TensorSharp/Operations/AddIntegerIntegerOperation.cs
Src/TensorSharp/Operations/AddIntegerIntegerOperation.cs
namespace TensorSharp.Operations { using System; using System.Collections.Generic; using System.Linq; using System.Text; public class AddIntegerIntegerOperation : IBinaryOperation<int, int, int> { public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2) { Tensor<int> result = new Tensor<int>(); result.SetValue(tensor1.GetValue() + tensor2.GetValue()); return result; return result; } } }
namespace TensorSharp.Operations { using System; using System.Collections.Generic; using System.Linq; using System.Text; public class AddIntegerIntegerOperation : IBinaryOperation<int, int, int> { public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2) { int[] values1 = tensor1.GetValues(); int l = values1.Length; int[] values2 = tensor2.GetValues(); int[] newvalues = new int[l]; for (int k = 0; k < l; k++) newvalues[k] = values1[k] + values2[k]; return tensor1.CloneWithNewValues(newvalues); } } }
Refactor Add Integers Operation to use GetValues and CloneWithValues
Refactor Add Integers Operation to use GetValues and CloneWithValues
C#
mit
ajlopez/TensorSharp
25e297f5bf0fcb44ba6666953548ec72d71f566c
SharpMath/Geometry/VectorExtensions.cs
SharpMath/Geometry/VectorExtensions.cs
namespace SharpMath.Geometry { public static class VectorExtensions { public static T Negate<T>(this Vector vector) where T : Vector, new() { var resultVector = new T(); for (uint i = 0; i < vector.Dimension; ++i) resultVector[i] = -vector[i]; return resultVector; } /// <summary> /// Calculates the normalized <see cref="Vector"/> of this <see cref="Vector"/>. /// </summary> /// <returns>The normalized <see cref="Vector"/>.</returns> public static T Normalize<T>(this Vector vector) where T : Vector, new() { var resultVector = new T(); for (uint i = 0; i < vector.Dimension; ++i) resultVector[i] /= vector.Magnitude; return resultVector; } } }
using SharpMath.Geometry.Exceptions; namespace SharpMath.Geometry { public static class VectorExtensions { public static T Negate<T>(this Vector vector) where T : Vector, new() { var resultVector = new T(); if (vector.Dimension != resultVector.Dimension) throw new DimensionException("The dimensions of the vectors do not equal each other."); for (uint i = 0; i < vector.Dimension; ++i) resultVector[i] = -vector[i]; return resultVector; } /// <summary> /// Calculates the normalized <see cref="Vector"/> of this <see cref="Vector"/>. /// </summary> /// <returns>The normalized <see cref="Vector"/>.</returns> public static T Normalize<T>(this Vector vector) where T : Vector, new() { var resultVector = new T(); if (vector.Dimension != resultVector.Dimension) throw new DimensionException("The dimensions of the vectors do not equal each other."); for (uint i = 0; i < vector.Dimension; ++i) resultVector[i] = vector[i] / vector.Magnitude; return resultVector; } } }
Fix normalizing a vector results in a zero vector
Fix normalizing a vector results in a zero vector
C#
mit
ProgTrade/SharpMath
1b3d37984c702b753e3dcec26a4ced7f17708c36
tests/SignatureTest.cs
tests/SignatureTest.cs
// Copyright 2009 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; using NUnit.Framework; using NDesk.DBus; namespace NDesk.DBus.Tests { [TestFixture] public class SignatureTest { [Test] public void Parse () { string sigText = "as"; Signature sig = new Signature (sigText); Assert.IsTrue (sig.IsArray); Assert.IsFalse (sig.IsDict); Assert.IsFalse (sig.IsPrimitive); } } }
// Copyright 2009 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; using NUnit.Framework; using NDesk.DBus; namespace NDesk.DBus.Tests { [TestFixture] public class SignatureTest { [Test] public void Parse () { string sigText = "as"; Signature sig = new Signature (sigText); Assert.IsTrue (sig.IsArray); Assert.IsFalse (sig.IsDict); Assert.IsFalse (sig.IsPrimitive); } [Test] public void Equality () { string sigText = "as"; Signature a = new Signature (sigText); Signature b = new Signature (sigText); Assert.IsTrue (a == b); } } }
Add test for Signature equality
Add test for Signature equality
C#
mit
mono/dbus-sharp,Tragetaschen/dbus-sharp,mono/dbus-sharp,arfbtwn/dbus-sharp,Tragetaschen/dbus-sharp,arfbtwn/dbus-sharp,openmedicus/dbus-sharp,openmedicus/dbus-sharp
9497f97c4f076daa8d09b1d155b492ced6698861
src/Stories/Views/Home/Guidelines.cshtml
src/Stories/Views/Home/Guidelines.cshtml
<h2>What is dotnet signals?</h2> .NET Signals is a community driven link aggregator for the sharing of knowledge in the .NET community. Our focus is to give the .NET community a place to post ideas and knowledge as voted by the community while avoiding the clutter found in traditional sources. <h2>Posts</h2> <ul> <li>Try to keep the title of the post the same as the article except to add information on vague titles,</li> <li>Posts should be related to the .Net ecosystem or to information regarding technologies that the .Net community would find helpful or interesting,</li> <li>Meta posts and bugs should be created on the github issues page as either discussion or bug,</li> <li>Posts seeking help (homework, how do I do X, etc) are not suited for .NET Signals. Consider asking your questions on the .NET subreddit or stackoverflow.</li> </ul> <h2>Comments</h2> <ul> <li>Do not spam,</li> <li>Avoid Me toos, thanks, "awesome post" comments,</li> <li>Be professional, be polite.</li> </ul>
@{ ViewData["Title"] = "Guidelines"; Layout = "~/Views/Shared/_Layout.cshtml"; } <section> <h2>What is dotnet signals?</h2> .NET Signals is a community driven link aggregator for the sharing of knowledge in the .NET community. Our focus is to give the .NET community a place to post ideas and knowledge as voted by the community while avoiding the clutter found in traditional sources. <h2>Posts</h2> <ul> <li>Try to keep the title of the post the same as the article except to add information on vague titles,</li> <li>Posts should be related to the .Net ecosystem or to information regarding technologies that the .Net community would find helpful or interesting,</li> <li>Meta posts and bugs should be created on the github issues page as either discussion or bug,</li> <li>Posts seeking help (homework, how do I do X, etc) are not suited for .NET Signals. Consider asking your questions on the .NET subreddit or stackoverflow.</li> </ul> <h2>Comments</h2> <ul> <li>Do not spam,</li> <li>Avoid Me toos, thanks, "awesome post" comments,</li> <li>Be professional, be polite.</li> </ul> </section>
Add layout to guidelines page.
Add layout to guidelines page.
C#
mit
mattrobineau/dotnetsignals,mattrobineau/dotnetsignals,mattrobineau/dotnetsignals,mattrobineau/dotnetsignals,mattrobineau/dotnetsignals
b84da2ca026c57645208b581a7f298a4295425ca
src/AssemblyInfo.cs
src/AssemblyInfo.cs
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System.Reflection; using System.Runtime.CompilerServices; //[assembly: AssemblyVersion("0.0.0.*")] [assembly: AssemblyTitle ("NDesk.DBus")] [assembly: AssemblyDescription ("D-Bus IPC protocol library and CLR binding")] [assembly: AssemblyCopyright ("Copyright (C) Alp Toker")] [assembly: AssemblyCompany ("NDesk")]
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System.Reflection; using System.Runtime.CompilerServices; //[assembly: AssemblyVersion("0.0.0.*")] [assembly: AssemblyTitle ("NDesk.DBus")] [assembly: AssemblyDescription ("D-Bus IPC protocol library and CLR binding")] [assembly: AssemblyCopyright ("Copyright (C) Alp Toker")] [assembly: AssemblyCompany ("NDesk")] [assembly: InternalsVisibleTo ("dbus-monitor")] [assembly: InternalsVisibleTo ("dbus-daemon")]
Add a couple of friend assemblies
Add a couple of friend assemblies
C#
mit
arfbtwn/dbus-sharp,arfbtwn/dbus-sharp,Tragetaschen/dbus-sharp,mono/dbus-sharp,Tragetaschen/dbus-sharp,openmedicus/dbus-sharp,openmedicus/dbus-sharp,mono/dbus-sharp
6f3c8e9f8bf1f6190777ab513dadd20b0d5c30c0
osu.Game/Online/API/Requests/GetUpdatesResponse.cs
osu.Game/Online/API/Requests/GetUpdatesResponse.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using osu.Game.Online.Chat; namespace osu.Game.Online.API.Requests { public class GetUpdatesResponse { public List<Channel> Presence; public List<Message> Messages; } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using Newtonsoft.Json; using osu.Game.Online.Chat; namespace osu.Game.Online.API.Requests { public class GetUpdatesResponse { [JsonProperty] public List<Channel> Presence; [JsonProperty] public List<Message> Messages; } }
Add explicit usage via attribute
Add explicit usage via attribute
C#
mit
EVAST9919/osu,DrabWeb/osu,johnneijzen/osu,naoey/osu,ZLima12/osu,DrabWeb/osu,naoey/osu,smoogipoo/osu,EVAST9919/osu,ppy/osu,ZLima12/osu,smoogipoo/osu,johnneijzen/osu,NeoAdonis/osu,peppy/osu,naoey/osu,peppy/osu-new,peppy/osu,UselessToucan/osu,smoogipooo/osu,ppy/osu,ppy/osu,NeoAdonis/osu,2yangk23/osu,2yangk23/osu,UselessToucan/osu,UselessToucan/osu,peppy/osu,DrabWeb/osu,NeoAdonis/osu,smoogipoo/osu
2a93bc84998395347341901a6df9fc0df5a265f5
Debugger/ModToolsMod.cs
Debugger/ModToolsMod.cs
using System; using ColossalFramework; using ColossalFramework.Plugins; using ICities; using ModTools.Utils; using UnityEngine; namespace ModTools { public sealed class ModToolsMod : IUserMod { public const string ModToolsName = "ModTools"; public static GameObject MainWindowObject; private static GameObject mainObject; public static string Version { get; } = GitVersion.GetAssemblyVersion(typeof(ModToolsMod).Assembly); public string Name => ModToolsName; public string Description => "Debugging toolkit for modders, version " + Version; public void OnEnabled() { try { if (MainWindowObject != null) { return; } CODebugBase<LogChannel>.verbose = true; CODebugBase<LogChannel>.EnableChannels(LogChannel.All); mainObject = new GameObject(ModToolsName); UnityEngine.Object.DontDestroyOnLoad(mainObject); MainWindowObject = new GameObject(ModToolsName + nameof(MainWindow)); UnityEngine.Object.DontDestroyOnLoad(MainWindowObject); var modTools = MainWindowObject.AddComponent<MainWindow>(); modTools.Initialize(); } catch (Exception e) { DebugOutputPanel.AddMessage(PluginManager.MessageType.Error, e.Message); } } public void OnDisabled() { if (MainWindowObject != null) { CODebugBase<LogChannel>.verbose = false; UnityEngine.Object.Destroy(MainWindowObject); MainWindowObject = null; } if (mainObject != null) { CODebugBase<LogChannel>.verbose = false; UnityEngine.Object.Destroy(mainObject); mainObject = null; } } } }
using System; using ColossalFramework; using ColossalFramework.Plugins; using ICities; using ModTools.Utils; using UnityEngine; namespace ModTools { public sealed class ModToolsMod : IUserMod { public const string ModToolsName = "ModTools"; public static GameObject MainWindowObject; private GameObject mainObject; public static string Version { get; } = GitVersion.GetAssemblyVersion(typeof(ModToolsMod).Assembly); public string Name => ModToolsName; public string Description => "Debugging toolkit for modders, version " + Version; public void OnEnabled() { try { if (MainWindowObject != null) { return; } CODebugBase<LogChannel>.verbose = true; CODebugBase<LogChannel>.EnableChannels(LogChannel.All); mainObject = new GameObject(ModToolsName); UnityEngine.Object.DontDestroyOnLoad(mainObject); MainWindowObject = new GameObject(ModToolsName + nameof(MainWindow)); UnityEngine.Object.DontDestroyOnLoad(MainWindowObject); var modTools = MainWindowObject.AddComponent<MainWindow>(); modTools.Initialize(); } catch (Exception e) { DebugOutputPanel.AddMessage(PluginManager.MessageType.Error, e.Message); } } public void OnDisabled() { if (MainWindowObject != null) { CODebugBase<LogChannel>.verbose = false; UnityEngine.Object.Destroy(MainWindowObject); MainWindowObject = null; } if (mainObject != null) { CODebugBase<LogChannel>.verbose = false; UnityEngine.Object.Destroy(mainObject); mainObject = null; } } } }
Make mainObject an instance field
Make mainObject an instance field
C#
mit
earalov/Skylines-ModTools
b226a5b8f8bbcc61a21425c261042fd1814c7982
Helpers.cs
Helpers.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NTST.ScriptLinkService.Objects; namespace ScriptLinkCore { public partial class ScriptLink { /// <summary> /// Used set required fields /// </summary> /// <param name="optionObject"></param> /// <param name="fieldNumber"></param> /// <returns></returns> public static OptionObject SetRequiredField(OptionObject optionObject, string fieldNumber) { OptionObject returnOptionObject = optionObject; Boolean updated = false; foreach (var form in returnOptionObject.Forms) { foreach (var currentField in form.CurrentRow.Fields) { if (currentField.FieldNumber == fieldNumber) { currentField.Required = "1"; updated = true; } } } if (updated == true) { foreach (var form in returnOptionObject.Forms) { form.CurrentRow.RowAction = "EDIT"; } return returnOptionObject; } else { return optionObject; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ScriptLinkCore.Objects; namespace ScriptLinkCore { public partial class ScriptLink { /// <summary> /// Used set required fields /// </summary> /// <param name="optionObject"></param> /// <param name="fieldNumber"></param> /// <returns></returns> public static OptionObject SetRequiredField(OptionObject optionObject, string fieldNumber) { OptionObject returnOptionObject = optionObject; Boolean updated = false; foreach (var form in returnOptionObject.Forms) { foreach (var currentField in form.CurrentRow.Fields) { if (currentField.FieldNumber == fieldNumber) { currentField.Required = "1"; updated = true; } } } if (updated == true) { foreach (var form in returnOptionObject.Forms) { form.CurrentRow.RowAction = "EDIT"; } return returnOptionObject; } else { return optionObject; } } } }
Change to use ScriptLinkCore.Objects namespace
Change to use ScriptLinkCore.Objects namespace
C#
mit
scottolsonjr/scriptlink-core
ac7f8baf33be900e24ec0960faca1ce29494376e
InfluxDB.Net.Collector.Console/Program.cs
InfluxDB.Net.Collector.Console/Program.cs
using System; namespace InfluxDB.Net.Collector.Console { static class Program { private static InfluxDb _client; static void Main(string[] args) { if (args.Length != 3) { //url: http://128.199.43.107:8086 //username: root //Password: ????? throw new InvalidOperationException("Three parameters needs to be provided to this application. url, username and password for the InfluxDB database."); } var url = args[0]; var username = args[1]; var password = args[2]; _client = new InfluxDb(url, username, password); var pong = _client.PingAsync().Result; System.Console.WriteLine("Ping: {0} ({1} ms)", pong.Status, pong.ResponseTime); var version = _client.VersionAsync().Result; System.Console.WriteLine("Version: {0}", version); System.Console.WriteLine("Press any key to exit..."); System.Console.ReadKey(); } } }
using System; using System.Diagnostics; using InfluxDB.Net.Models; namespace InfluxDB.Net.Collector.Console { static class Program { private static InfluxDb _client; static void Main(string[] args) { if (args.Length != 3) { //url: http://128.199.43.107:8086 //username: root //Password: ????? throw new InvalidOperationException("Three parameters needs to be provided to this application. url, username and password for the InfluxDB database."); } var url = args[0]; var username = args[1]; var password = args[2]; _client = new InfluxDb(url, username, password); var pong = _client.PingAsync().Result; System.Console.WriteLine("Ping: {0} ({1} ms)", pong.Status, pong.ResponseTime); var version = _client.VersionAsync().Result; System.Console.WriteLine("Version: {0}", version); var processorCounter = GetPerformanceCounter(); System.Threading.Thread.Sleep(100); var result = RegisterCounterValue(processorCounter); System.Console.WriteLine(result.StatusCode); System.Console.WriteLine("Press enter to exit..."); System.Console.ReadKey(); } private static InfluxDbApiResponse RegisterCounterValue(PerformanceCounter processorCounter) { var data = processorCounter.NextValue(); System.Console.WriteLine("Processor value: {0}%", data); var serie = new Serie.Builder("Processor") .Columns("Total") .Values(data) .Build(); var result = _client.WriteAsync("QTest", TimeUnit.Milliseconds, serie); return result.Result; } private static PerformanceCounter GetPerformanceCounter() { var processorCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total"); processorCounter.NextValue(); return processorCounter; } } }
Send single sample of processor performance counter to the InfluxDB.Net.
Send single sample of processor performance counter to the InfluxDB.Net. Also confirmed that the values can be read using grafana.
C#
mit
poxet/influxdb-collector,poxet/Influx-Capacitor
45348ae4071f7d519f4e4d7ca881d3ce64897461
source/Nuke.Common/Tools/Unity/UnityBaseSettings.cs
source/Nuke.Common/Tools/Unity/UnityBaseSettings.cs
// Copyright 2021 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; using Nuke.Common.Tooling; namespace Nuke.Common.Tools.Unity { public partial class UnityBaseSettings { public override Action<OutputType, string> ProcessCustomLogger => UnityTasks.UnityLogger; public string GetProcessToolPath() { return UnityTasks.GetToolPath(HubVersion); } public string GetLogFile() { // TODO SK return LogFile ?? NukeBuild.RootDirectory / "unity.log"; } } }
// Copyright 2021 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; using Nuke.Common.Tooling; using Nuke.Common.Utilities; namespace Nuke.Common.Tools.Unity { public partial class UnityBaseSettings { public override Action<OutputType, string> ProcessCustomLogger => UnityTasks.UnityLogger; public string GetProcessToolPath() { return UnityTasks.GetToolPath(HubVersion); } public string GetLogFile() { return (LogFile ?? NukeBuild.RootDirectory / "unity.log").DoubleQuoteIfNeeded(); } } }
Fix quoting for Unity log file
Fix quoting for Unity log file
C#
mit
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
8c16df83b21db42d0d7babcf2f80291960e43bb3
Assets/Nanobot.cs
Assets/Nanobot.cs
using UnityEngine; using System.Collections; public class Nanobot : MonoBehaviour, TimestepManager.TimestepListener { BulletGridGenerator currentLevel; public NanobotSchematic schematic; public int price; public string id; // Use this for initialization void Start() { currentLevel = FindObjectOfType<BulletGridGenerator>(); GameObject.FindObjectOfType<TimestepManager>().addListener(this); schematic = GameObject.Instantiate(schematic); } public void notifyTimestep() { currentLevel.getCellAt(gameObject.GetComponent<GridPositionComponent>().position).Cell.GetComponent<Cell>().Eat(1, false); for (int x = 0; x < schematic.getTransformation().Length; x++) { if (schematic.getTransformation()[x] != null) { for (int y = 0; y < schematic.getTransformation()[x].Length; y++) { if (schematic.getTransformation()[x][y] != null) { currentLevel.moveBotAnimated(gameObject.GetComponent<GridPositionComponent>().position, schematic.getTransformation()[x][y], new GridPosition(x - 1, y - 1), 5, false); } } } } } }
using UnityEngine; using System.Collections; public class Nanobot : MonoBehaviour, TimestepManager.TimestepListener { BulletGridGenerator currentLevel; public NanobotSchematic schematic; public int price; public string id; // Use this for initialization void Start() { currentLevel = FindObjectOfType<BulletGridGenerator>(); GameObject.FindObjectOfType<TimestepManager>().addListener(this); schematic = GameObject.Instantiate(schematic); } public void notifyTimestep() { GridPosition position = gameObject.GetComponent<GridPositionComponent>().position; BulletGridGenerator.GameCell cell = currentLevel.getCellAt(position); cell.Cell.GetComponent<Cell>().Eat(1, false); if (cell.Nanobot == null) { // TODO: Trigger animation for nanobot death. return; } for (int x = 0; x < schematic.getTransformation().Length; x++) { if (schematic.getTransformation()[x] != null) { for (int y = 0; y < schematic.getTransformation()[x].Length; y++) { if (schematic.getTransformation()[x][y] != null) { currentLevel.moveBotAnimated(position, schematic.getTransformation()[x][y], new GridPosition(x - 1, y - 1), 5, false); } } } } } }
Handle exiting if bot is destroyed by consuming resources.
Handle exiting if bot is destroyed by consuming resources.
C#
mit
MarjieVolk/Backfire
346778a112d401fb780e729b917fd2a728300918
SimpleLogger/Logging/Formatters/DefaultLoggerFormatter.cs
SimpleLogger/Logging/Formatters/DefaultLoggerFormatter.cs
namespace SimpleLogger.Logging.Formatters { internal class DefaultLoggerFormatter : ILoggerFormatter { public string ApplyFormat(LogMessage logMessage) { return string.Format("{0:dd.MM.yyyy HH:mm}: {1} ln: {2} [{3} -> {4}()]: {5}", logMessage.DateTime, logMessage.Level, logMessage.LineNumber, logMessage.CallingClass, logMessage.CallingMethod, logMessage.Text); } } }
namespace SimpleLogger.Logging.Formatters { internal class DefaultLoggerFormatter : ILoggerFormatter { public string ApplyFormat(LogMessage logMessage) { return string.Format("{0:dd.MM.yyyy HH:mm}: {1} [line: {2} {3} -> {4}()]: {5}", logMessage.DateTime, logMessage.Level, logMessage.LineNumber, logMessage.CallingClass, logMessage.CallingMethod, logMessage.Text); } } }
Change format on default logger formatter.
Change format on default logger formatter.
C#
mit
jirkapenzes/SimpleLogger,Maxwolf/SimpleLogger,Maxwolf/Lumberjack
bf67c6bfeaace152644b0b2e5dcdb3812645a789
src/ScriptBuilder/ResourceReader.cs
src/ScriptBuilder/ResourceReader.cs
using System.IO; using System.Reflection; using NServiceBus.Persistence.Sql.ScriptBuilder; static class ResourceReader { static Assembly assembly = typeof(ResourceReader).GetTypeInfo().Assembly; public static string ReadResource(BuildSqlDialect sqlDialect, string prefix) { var text = $"NServiceBus.Persistence.Sql.{prefix}_{sqlDialect}.sql"; using (var stream = assembly.GetManifestResourceStream(text)) using (var streamReader = new StreamReader(stream)) { return streamReader.ReadToEnd(); } } }
using System.IO; using System.Reflection; using NServiceBus.Persistence.Sql.ScriptBuilder; static class ResourceReader { static Assembly assembly = typeof(ResourceReader).GetTypeInfo().Assembly; public static string ReadResource(BuildSqlDialect sqlDialect, string prefix) { var text = $"NServiceBus.Persistence.Sql.ScriptBuilder.{prefix}_{sqlDialect}.sql"; using (var stream = assembly.GetManifestResourceStream(text)) using (var streamReader = new StreamReader(stream)) { return streamReader.ReadToEnd(); } } }
Revise expected resource name after fixing default namespace
Revise expected resource name after fixing default namespace
C#
mit
NServiceBusSqlPersistence/NServiceBus.SqlPersistence
e83f6afdcf6d67a75efb12e2d178ae8fae989a58
src/FavRocks.Site/Views/Shared/_Layout.cshtml
src/FavRocks.Site/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"]–FAV Rocks</title> <link rel="shortcut icon" href="~/favicon.ico" /> <environment names="Development"> <link rel="stylesheet" href="~/css/site.css" /> </environment> <environment names="Staging,Production"> <link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" /> </environment> @RenderSection("styles", required: false) </head> <body> <header> <div id="title-container"> <a id="title" asp-controller="Home" asp-action="Index">FAV \m/</a> <a id="about" asp-controller="About">About</a> </div> <h3 id="tagline">The most accessible and efficient favicon editor</h3> </header> <hr /> @RenderBody() <hr /> <footer> <p>&copy; @DateTimeOffset.Now.Year, <a href="https://www.billboga.com/">Bill Boga</a>. </footer> @RenderSection("scripts", required: false) </body> </html>
<!DOCTYPE html> <html lang="en-us"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>@ViewData["Title"]–FAV Rocks</title> <link rel="shortcut icon" href="~/favicon.ico" /> <environment names="Development"> <link rel="stylesheet" href="~/css/site.css" /> </environment> <environment names="Staging,Production"> <link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" /> </environment> @RenderSection("styles", required: false) </head> <body> <header> <div id="title-container"> <a id="title" asp-controller="Home" asp-action="Index">FAV \m/</a> <a id="about" asp-controller="About">About</a> </div> <h3 id="tagline">The most accessible and efficient favicon editor</h3> </header> <hr /> @RenderBody() <hr /> <footer> <p>&copy; @DateTimeOffset.Now.Year, <a href="https://www.billboga.com/">Bill Boga</a>. </footer> @RenderSection("scripts", required: false) </body> </html>
Add language declaration to layout
Add language declaration to layout
C#
mit
billboga/fav-rocks
f33c71b0824f8a329442f7272acce95a2c3f3963
src/Neo4jManager/Neo4jManager.Host/Program.cs
src/Neo4jManager/Neo4jManager.Host/Program.cs
using System.IO; using Autofac.Extensions.DependencyInjection; using Microsoft.AspNetCore.Hosting; namespace Neo4jManager.Host { public class Program { public static void Main(string[] args) { var host = new WebHostBuilder() .UseKestrel() .ConfigureServices(services => services.AddAutofac()) .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup<Startup>() .Build(); host.Run(); } } }
using System.IO; using System.Net; using Autofac.Extensions.DependencyInjection; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; namespace Neo4jManager.Host { public class Program { public static void Main(string[] args) { var host = WebHost.CreateDefaultBuilder(args) .UseKestrel(options => options.Listen(IPAddress.Loopback, 7400)) .ConfigureServices(services => services.AddAutofac()) .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup<Startup>() .Build(); host.Run(); } } }
Set port 7400 and use default WebHost builder
Set port 7400 and use default WebHost builder
C#
mit
barnardos-au/Neo4jManager
2c1e9b4d0fa5a0b49a7a9b97b07292f2f1fb4117
XamarinStripe/StripeEvent.cs
XamarinStripe/StripeEvent.cs
/* * Copyright 2012 Xamarin, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Dynamic; using Newtonsoft.Json.Linq; namespace Xamarin.Payments.Stripe { public class StripeEvent : StripeObject { [JsonProperty (PropertyName = "livemode")] bool LiveMode { get; set; } [JsonProperty (PropertyName = "created")] [JsonConverter (typeof (UnixDateTimeConverter))] public DateTime? Created { get; set; } [JsonProperty (PropertyName = "type")] public string type { get; set; } [JsonProperty (PropertyName= "data")] public EventData Data { get; set; } public class EventData { [JsonProperty (PropertyName = "object")] [JsonConverter (typeof (StripeObjectConverter))] public StripeObject Object { get; set; } } } }
/* * Copyright 2012 Xamarin, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; namespace Xamarin.Payments.Stripe { public class StripeEvent : StripeObject { [JsonProperty (PropertyName = "livemode")] public bool LiveMode { get; set; } [JsonProperty (PropertyName = "created")] [JsonConverter (typeof (UnixDateTimeConverter))] public DateTime? Created { get; set; } [JsonProperty (PropertyName = "type")] public string Type { get; set; } [JsonProperty (PropertyName= "data")] public EventData Data { get; set; } public class EventData { [JsonProperty (PropertyName = "object")] [JsonConverter (typeof (StripeObjectConverter))] public StripeObject Object { get; set; } [JsonProperty (PropertyName = "previous_attributes")] public JObject PreviousAttributes { get; set; } } } }
Fix some details of the event object
Fix some details of the event object
C#
apache-2.0
haithemaraissia/XamarinStripe,xamarin/XamarinStripe
9cebf31541c54789aac436d2990659569bb458b6
ChamberLib.OpenTK/ShaderStage.cs
ChamberLib.OpenTK/ShaderStage.cs
using System; using OpenTK.Graphics.OpenGL; using System.Diagnostics; using ChamberLib.Content; namespace ChamberLib.OpenTK { public class ShaderStage : IShaderStage { public ShaderStage(ShaderContent content) : this(content.Source, content.Type, content.Name) { } public ShaderStage(string source, ShaderType shaderType, string name) { Source = source; ShaderType = shaderType; Name = name; } public string Name { get; protected set; } public int ShaderID { get; protected set; } public string Source { get; protected set; } public ShaderType ShaderType { get; protected set; } public void MakeReady() { if (ShaderID != 0) return; GLHelper.CheckError(); ShaderID = GL.CreateShader(ShaderType.ToOpenTK()); GLHelper.CheckError(); GL.ShaderSource(ShaderID, Source); GLHelper.CheckError(); GL.CompileShader(ShaderID); GLHelper.CheckError(); int result; GL.GetShader(ShaderID, ShaderParameter.CompileStatus, out result); Debug.WriteLine("{1} compile status: {0}", result, ShaderType); GLHelper.CheckError(); Debug.WriteLine("{0} info:", ShaderType); Debug.WriteLine(GL.GetShaderInfoLog(ShaderID)); GLHelper.CheckError(); } } }
using System; using OpenTK.Graphics.OpenGL; using System.Diagnostics; using ChamberLib.Content; using _OpenTK = global::OpenTK; namespace ChamberLib.OpenTK { public class ShaderStage : IShaderStage { public ShaderStage(ShaderContent content) : this(content.Source, content.Type, content.Name) { } public ShaderStage(string source, ShaderType shaderType, string name) { Source = source; ShaderType = shaderType; Name = name; } public string Name { get; protected set; } public int ShaderID { get; protected set; } public string Source { get; protected set; } public ShaderType ShaderType { get; protected set; } public bool IsCompiled { get; protected set; } public void MakeReady() { GLHelper.CheckError(); if (ShaderID == 0) { ShaderID = GL.CreateShader(ShaderType.ToOpenTK()); GLHelper.CheckError(); IsCompiled = false; } if (!IsCompiled) { GL.ShaderSource(ShaderID, Source); GLHelper.CheckError(); GL.CompileShader(ShaderID); GLHelper.CheckError(); int result; GL.GetShader(ShaderID, ShaderParameter.CompileStatus, out result); Debug.WriteLine("{1} compile status: {0}", result, ShaderType); GLHelper.CheckError(); Debug.WriteLine("{0} info:", ShaderType); Debug.WriteLine(GL.GetShaderInfoLog(ShaderID)); GLHelper.CheckError(); IsCompiled = (result == 1); } } } }
Use a flag to indicate if the shader stage has been successfully compiled.
Use a flag to indicate if the shader stage has been successfully compiled.
C#
lgpl-2.1
izrik/ChamberLib,izrik/ChamberLib,izrik/ChamberLib
9b03fe59f4bf87e46416d7e05c7f5ed670753503
Espera.Network/ResponseStatus.cs
Espera.Network/ResponseStatus.cs
namespace Espera.Network { public enum ResponseStatus { Success, PlaylistEntryNotFound, Unauthorized, MalformedRequest, NotFound, NotSupported, Rejected, Fatal } }
namespace Espera.Network { public enum ResponseStatus { Success, PlaylistEntryNotFound, Unauthorized, MalformedRequest, NotFound, NotSupported, Rejected, Fatal, WrongPassword } }
Add a wrong password status
Add a wrong password status
C#
mit
flagbug/Espera.Network
d7282980de54748392f694b4d0951032d94b13b5
Quiz/Quiz.Web/App_Start/BundleConfig.cs
Quiz/Quiz.Web/App_Start/BundleConfig.cs
using System.Web; using System.Web.Optimization; namespace Quiz.Web { public class BundleConfig { // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.validate*")); bundles.Add(new ScriptBundle("~/bundles/jquery.pietimer").Include( "~/Scripts/jquery.pietimer.js")); // Use the development version of Modernizr to develop with and learn from. Then, when you're // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); bundles.Add(new ScriptBundle("~/bundles/style").Include( "~/Scripts/style.css")); bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( "~/Scripts/bootstrap.js", "~/Scripts/respond.js")); bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css", "~/Content/site.css")); } } }
using System.Web; using System.Web.Optimization; namespace Quiz.Web { public class BundleConfig { // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.validate*")); bundles.Add(new ScriptBundle("~/bundles/jquery.pietimer").Include( "~/Scripts/jquery.pietimer.js")); // Use the development version of Modernizr to develop with and learn from. Then, when you're // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); bundles.Add(new ScriptBundle("~/bundles/style").Include( "~/Scripts/style.css")); bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( "~/Scripts/bootstrap.js", "~/Scripts/respond.js")); bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css", "~/Content/site.css")); BundleTable.EnableOptimizations = false; } } }
Fix Otimização desabilitada para teste
Fix Otimização desabilitada para teste
C#
mit
Arionildo/Quiz-CWI,Arionildo/Quiz-CWI,Arionildo/Quiz-CWI
4ed080e822168a87a0140fb8f0f28132bc0b6d96
100_Doors_Problem/C#/Davipb/HundredDoors.cs
100_Doors_Problem/C#/Davipb/HundredDoors.cs
using System.Linq; namespace HundredDoors { public static class HundredDoors { /// <summary> /// Solves the 100 Doors problem /// </summary> /// <returns>An array with 101 values, each representing a door (except 0). True = open</returns> public static bool[] Solve() { // Create our array with 101 values, all of them false. We'll only use 1~100 to simplify it bool[] doors = Enumerable.Repeat(false, 101).ToArray(); // We'll pass 100 times, each pass we'll start at door #pass and increment by pass, toggling the current door for (int pass = 1; pass <= 100; pass++) for (int i = pass; i < doors.Length; i += pass) doors[i] = !doors[i]; return doors; //final door count } } }
using System.Linq; namespace HundredDoors { public static class HundredDoors { /// <summary> /// Solves the 100 Doors problem /// </summary> /// <returns>An array with 101 values, each representing a door (except 0). True = open</returns> public static bool[] Solve() { // Create our array with 101 values, all of them false. We'll only use 1~100 to simplify it bool[] doors = Enumerable.Repeat(false, 101).ToArray(); // We'll pass 100 times, each pass we'll start at door #pass and increment by pass, toggling the current door for (int pass = 1; pass <= 100; pass++) for (int i = pass; i < doors.Length; i += pass) doors[i] = !doors[i]; return doors; } } }
Revert "Added "final door count" comment at return value."
Revert "Added "final door count" comment at return value." This reverts commit 51f7b5f62af24188a05afa5a78284b9b0197c39d.
C#
mit
pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,kennyledet/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations,n1ghtmare/Algorithm-Implementations,kennyledet/Algorithm-Implementations,pravsingh/Algorithm-Implementations,pravsingh/Algorithm-Implementations
5e60d6be222266b254026b61994e450bde61b4c5
Espera.Network/NetworkSongSource.cs
Espera.Network/NetworkSongSource.cs
namespace Espera.Network { public enum NetworkSongSource { Local = 0, Youtube = 1, Remote = 2 } }
namespace Espera.Network { public enum NetworkSongSource { Local = 0, Youtube = 1, Mobile = 2 } }
Rename that to avoid confusion
Rename that to avoid confusion
C#
mit
flagbug/Espera.Network
755b84826a6e6d828c800c4070668873b3de74e9
src/GiveCRM.Web/Views/Member/AjaxSearch.cshtml
src/GiveCRM.Web/Views/Member/AjaxSearch.cshtml
@model IEnumerable<GiveCRM.Models.Member> @foreach (var member in Model) { <a href="javascript:AddDonation(@member.Id);">@member.FirstName @member.LastName @member.PostalCode</a><br /> }
@model IEnumerable<GiveCRM.Models.Member> @{ Layout = null; } @foreach (var member in Model) { <p style="margin:0; padding:0;"><a href="javascript:AddDonation(@member.Id);">@member.FirstName @member.LastName @member.PostalCode</a></p> }
Remove page styling from Ajax search results.
Remove page styling from Ajax search results.
C#
mit
GiveCampUK/GiveCRM,GiveCampUK/GiveCRM
d8c68b61f034ed7531c9609b3c3e46b2b6a56c43
samples/KWebStartup/Startup.cs
samples/KWebStartup/Startup.cs
using Microsoft.AspNet.Abstractions; namespace KWebStartup { public class Startup { public void Configuration(IBuilder app) { app.Run(async context => { context.Response.ContentType = "text/plain"; await context.Response.WriteAsync("Hello world"); }); } } }
using Microsoft.AspNet; using Microsoft.AspNet.Abstractions; namespace KWebStartup { public class Startup { public void Configuration(IBuilder app) { app.Run(async context => { context.Response.ContentType = "text/plain"; await context.Response.WriteAsync("Hello world"); }); } } }
Add missing namespace to the sample.
Add missing namespace to the sample.
C#
apache-2.0
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
8debb2d45e53de4273ad19339f98448b933cd035
src/Pablo.Gallery/App_Start/WebApiConfig.cs
src/Pablo.Gallery/App_Start/WebApiConfig.cs
using System.Net.Http.Formatting; using System.Web.Http; using System.Web.Http.Dispatcher; using Pablo.Gallery.Logic; using Pablo.Gallery.Logic.Filters; using System.Web.Http.Controllers; using Pablo.Gallery.Logic.Selectors; namespace Pablo.Gallery { public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Filters.Add(new LoggingApiExceptionFilter()); config.Routes.MapHttpRoute( name: "api", routeTemplate: "api/{version}/{controller}/{id}/{*path}", defaults: new { version = "v0", id = RouteParameter.Optional, path = RouteParameter.Optional } ); config.Services.Replace(typeof(IHttpControllerSelector), new NamespaceHttpControllerSelector(config, 1)); config.Formatters.JsonFormatter.AddQueryStringMapping("type", "json", "application/json"); config.Formatters.XmlFormatter.AddQueryStringMapping("type", "xml", "application/xml"); //config.MessageHandlers.Add(new CorsHandler()); config.Services.Replace(typeof(IHttpActionSelector), new CorsPreflightActionSelector()); } } }
using System.Net.Http.Formatting; using System.Web.Http; using System.Web.Http.Dispatcher; using Pablo.Gallery.Logic; using Pablo.Gallery.Logic.Filters; using System.Web.Http.Controllers; using Pablo.Gallery.Logic.Selectors; namespace Pablo.Gallery { public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Filters.Add(new LoggingApiExceptionFilter()); config.Routes.MapHttpRoute( name: "api", routeTemplate: "api/{version}/{controller}/{id}", defaults: new { version = "v0", id = RouteParameter.Optional } ); // need this separate as Url.RouteUrl does not work with a wildcard in the route // this is used to allow files in subfolders of a pack to be retrieved. config.Routes.MapHttpRoute( name: "apipath", routeTemplate: "api/{version}/{controller}/{id}/{*path}", defaults: new { version = "v0", id = RouteParameter.Optional, path = RouteParameter.Optional } ); config.Services.Replace(typeof(IHttpControllerSelector), new NamespaceHttpControllerSelector(config, 1)); config.Formatters.JsonFormatter.AddQueryStringMapping("type", "json", "application/json"); config.Formatters.XmlFormatter.AddQueryStringMapping("type", "xml", "application/xml"); //config.MessageHandlers.Add(new CorsHandler()); config.Services.Replace(typeof(IHttpActionSelector), new CorsPreflightActionSelector()); } } }
Fix issue with ms asp.net getting httproute paths with a wildcard
Fix issue with ms asp.net getting httproute paths with a wildcard
C#
mit
cwensley/Pablo.Gallery,cwensley/Pablo.Gallery,sixteencolors/Pablo.Gallery,cwensley/Pablo.Gallery,sixteencolors/Pablo.Gallery,sixteencolors/Pablo.Gallery,sixteencolors/Pablo.Gallery
63ebc31bf4fd73852cf594543ba01709ae1a9fb4
JefBot/Commands/CoinPluginCommand.cs
JefBot/Commands/CoinPluginCommand.cs
using System; using System.Collections.Generic; using System.IO; using TwitchLib; using TwitchLib.TwitchClientClasses; using System.Net; namespace JefBot.Commands { internal class CoinPluginCommand : IPluginCommand { public string PluginName => "Coin"; public string Command => "coin"; public IEnumerable<string> Aliases => new[] { "c", "flip" }; public bool Loaded { get; set; } = true; public bool OffWhileLive { get; set; } = true; Random rng = new Random(); public void Execute(ChatCommand command, TwitchClient client) { if (rng.Next(1000) > 1) { var result = rng.Next(0, 1) == 1 ? "heads" : "tails"; client.SendMessage(command.ChatMessage.Channel, $"{command.ChatMessage.Username} flipped a coin, it was {result}"); } else { client.SendMessage(command.ChatMessage.Channel, $"{command.ChatMessage.Username} flipped a coin, it landed on it's side..."); } } } }
using System; using System.Collections.Generic; using System.IO; using TwitchLib; using TwitchLib.TwitchClientClasses; using System.Net; namespace JefBot.Commands { internal class CoinPluginCommand : IPluginCommand { public string PluginName => "Coin"; public string Command => "coin"; public IEnumerable<string> Aliases => new[] { "c", "flip" }; public bool Loaded { get; set; } = true; public bool OffWhileLive { get; set; } = true; Random rng = new Random(); public void Execute(ChatCommand command, TwitchClient client) { if (rng.Next(1000) > 1) { var result = rng.Next(0, 2) == 1 ? "heads" : "tails"; client.SendMessage(command.ChatMessage.Channel, $"{command.ChatMessage.Username} flipped a coin, it was {result}"); } else { client.SendMessage(command.ChatMessage.Channel, $"{command.ChatMessage.Username} flipped a coin, it landed on it's side..."); } } } }
Allow coin flip to be heads.
Allow coin flip to be heads.
C#
mit
mikaelssen/FruitBowlBot
9f44e634a4995c611ab8d10e5aece9158b67d258
osu.Desktop.VisualTests/Program.cs
osu.Desktop.VisualTests/Program.cs
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using osu.Framework.Desktop; using osu.Framework.Desktop.Platform; using osu.Framework.Platform; using osu.Game.Modes; using osu.Game.Modes.Catch; using osu.Game.Modes.Mania; using osu.Game.Modes.Osu; using osu.Game.Modes.Taiko; namespace osu.Desktop.VisualTests { public static class Program { [STAThread] public static void Main(string[] args) { using (BasicGameHost host = Host.GetSuitableHost(@"osu-visual-tests")) { Ruleset.Register(new OsuRuleset()); Ruleset.Register(new TaikoRuleset()); Ruleset.Register(new ManiaRuleset()); Ruleset.Register(new CatchRuleset()); host.Add(new VisualTestGame()); host.Run(); } } } }
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using osu.Framework.Desktop; using osu.Framework.Desktop.Platform; using osu.Framework.Platform; using osu.Game.Modes; using osu.Game.Modes.Catch; using osu.Game.Modes.Mania; using osu.Game.Modes.Osu; using osu.Game.Modes.Taiko; namespace osu.Desktop.VisualTests { public static class Program { [STAThread] public static void Main(string[] args) { using (BasicGameHost host = Host.GetSuitableHost(@"osu")) { Ruleset.Register(new OsuRuleset()); Ruleset.Register(new TaikoRuleset()); Ruleset.Register(new ManiaRuleset()); Ruleset.Register(new CatchRuleset()); host.Add(new VisualTestGame()); host.Run(); } } } }
Allow visualtests to share config etc. with osu!.
Allow visualtests to share config etc. with osu!.
C#
mit
nyaamara/osu,UselessToucan/osu,Damnae/osu,NeoAdonis/osu,NeoAdonis/osu,theguii/osu,Frontear/osuKyzer,smoogipoo/osu,RedNesto/osu,peppy/osu,peppy/osu-new,ppy/osu,UselessToucan/osu,peppy/osu,DrabWeb/osu,naoey/osu,smoogipoo/osu,osu-RP/osu-RP,NeoAdonis/osu,EVAST9919/osu,default0/osu,DrabWeb/osu,johnneijzen/osu,naoey/osu,ppy/osu,ZLima12/osu,smoogipooo/osu,peppy/osu,NotKyon/lolisu,naoey/osu,UselessToucan/osu,2yangk23/osu,2yangk23/osu,smoogipoo/osu,EVAST9919/osu,johnneijzen/osu,ppy/osu,tacchinotacchi/osu,Nabile-Rahmani/osu,ZLima12/osu,DrabWeb/osu,Drezi126/osu
094bb7058c754b885fe2348108cc7a61bfc2b3cb
Contentful.Core/Models/Management/SystemFieldTypes.cs
Contentful.Core/Models/Management/SystemFieldTypes.cs
using System; using System.Collections.Generic; using System.Text; namespace Contentful.Core.Models.Management { /// <summary> /// Represents the different types available for a <see cref="Field"/>. /// </summary> public class SystemFieldTypes { /// <summary> /// Short text. /// </summary> public const string Symbol = "Symbol"; /// <summary> /// Long text. /// </summary> public const string Text = "Text"; /// <summary> /// An integer. /// </summary> public const string Integer = "Integer"; /// <summary> /// A floating point number. /// </summary> public const string Number = "Number"; /// <summary> /// A datetime. /// </summary> public const string Date = "Date"; /// <summary> /// A boolean value. /// </summary> public const string Boolean = "Boolean"; /// <summary> /// A location field. /// </summary> public const string Location = "Location"; /// <summary> /// A link to another asset or entry. /// </summary> public const string Link = "Link"; /// <summary> /// An array of objects. /// </summary> public const string Array = "Array"; /// <summary> /// An arbitrary json object. /// </summary> public const string Object = "Object"; } }
using System; using System.Collections.Generic; using System.Text; namespace Contentful.Core.Models.Management { /// <summary> /// Represents the different types available for a <see cref="Field"/>. /// </summary> public class SystemFieldTypes { /// <summary> /// Short text. /// </summary> public const string Symbol = "Symbol"; /// <summary> /// Long text. /// </summary> public const string Text = "Text"; /// <summary> /// An integer. /// </summary> public const string Integer = "Integer"; /// <summary> /// A floating point number. /// </summary> public const string Number = "Number"; /// <summary> /// A datetime. /// </summary> public const string Date = "Date"; /// <summary> /// A boolean value. /// </summary> public const string Boolean = "Boolean"; /// <summary> /// A location field. /// </summary> public const string Location = "Location"; /// <summary> /// A link to another asset or entry. /// </summary> public const string Link = "Link"; /// <summary> /// An array of objects. /// </summary> public const string Array = "Array"; /// <summary> /// An arbitrary json object. /// </summary> public const string Object = "Object"; /// <summary> /// An rich text document. /// </summary> public const string RichText = "RichText"; } }
Add rich text to system field types
Add rich text to system field types
C#
mit
contentful/contentful.net
5366e7dd5e6e780ed2096fd6f4944d38e90689ff
Battery-Commander.Web/Views/APFT/List.cshtml
Battery-Commander.Web/Views/APFT/List.cshtml
@model IEnumerable<APFT> <h2>Units @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h2> <table class="table table-striped"> <thead> <tr> <th></th> <th></th> </tr> </thead> <tbody> @foreach (var model in Model) { <tr> <td></td> </tr> } </tbody> </table>
@model IEnumerable<APFT> <h2>Units @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h2> <table class="table table-striped"> <thead> <tr> <th></th> </tr> </thead> <tbody> @foreach (var model in Model) { <tr> <td>@Html.DisplayFor(_ => model.Soldier)</td> <td>@Html.DisplayFor(_ => model.Date)</td> <td>@Html.DisplayFor(_ => model.PushUps)</td> <td>@Html.DisplayFor(_ => model.SitUps)</td> <td>@Html.DisplayFor(_ => model.Run)</td> <td>@Html.DisplayFor(_ => model.TotalScore)</td> <td>@Html.DisplayFor(_ => model.IsPassing)</td> </tr> } </tbody> </table>
Add stub for APFT list
Add stub for APFT list
C#
mit
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
93131b43953231617ac5ea50123e4a26a3437dd0
Mindscape.Raygun4Net/ProfilingSupport/APM.cs
Mindscape.Raygun4Net/ProfilingSupport/APM.cs
using System; using System.Runtime.CompilerServices; namespace Mindscape.Raygun4Net { public static class APM { [ThreadStatic] private static bool _enabled = false; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Enable() { _enabled = true; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Disable() { _enabled = false; } public static bool IsEnabled { get { return _enabled; } } public static bool ProfilerAttached { get { #if NETSTANDARD1_6 || NETSTANDARD2_0 // Look for .NET CORE compatible Environment Variables return Environment.GetEnvironmentVariable("CORECLR_PROFILER") == "{e2338988-38cc-48cd-a6b6-b441c31f34f1}" && Environment.GetEnvironmentVariable("CORECLR_ENABLE_PROFILING") == "1"; #else // Look for .NET FRAMEWORK compatible Environment Variables return Environment.GetEnvironmentVariable("COR_PROFILER") == "{e2338988-38cc-48cd-a6b6-b441c31f34f1}" && Environment.GetEnvironmentVariable("COR_PROFILER") == "1"; #endif } } } }
using System; using System.Runtime.CompilerServices; namespace Mindscape.Raygun4Net { public static class APM { [ThreadStatic] private static bool _enabled = false; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Enable() { _enabled = true; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void Disable() { _enabled = false; } public static bool IsEnabled { get { return _enabled; } } public static bool ProfilerAttached { get { #if NETSTANDARD1_6 || NETSTANDARD2_0 // Look for .NET CORE compatible Environment Variables return Environment.GetEnvironmentVariable("CORECLR_PROFILER") == "{e2338988-38cc-48cd-a6b6-b441c31f34f1}" && Environment.GetEnvironmentVariable("CORECLR_ENABLE_PROFILING") == "1"; #else // Look for .NET FRAMEWORK compatible Environment Variables return Environment.GetEnvironmentVariable("COR_PROFILER") == "{e2338988-38cc-48cd-a6b6-b441c31f34f1}" && Environment.GetEnvironmentVariable("COR_ENABLE_PROFILING") == "1"; #endif } } } }
Fix incorrect profiler environment variable name for .NET framework support
Fix incorrect profiler environment variable name for .NET framework support
C#
mit
MindscapeHQ/raygun4net,MindscapeHQ/raygun4net,MindscapeHQ/raygun4net
c309d98914aaaf3c8647eb12e7d54fb43abbaef3
src/Tgstation.Server.Api/Rights/ConfigurationRights.cs
src/Tgstation.Server.Api/Rights/ConfigurationRights.cs
using System; namespace Tgstation.Server.Api.Rights { /// <summary> /// Rights for <see cref="Models.ConfigurationFile"/> /// </summary> [Flags] public enum ConfigurationRights : ulong { /// <summary> /// User has no rights /// </summary> None = 0, /// <summary> /// User may read files /// </summary> Read = 1, /// <summary> /// User may write files /// </summary> Write = 2, /// <summary> /// User may list files /// </summary> List = 3 } }
using System; namespace Tgstation.Server.Api.Rights { /// <summary> /// Rights for <see cref="Models.ConfigurationFile"/> /// </summary> [Flags] public enum ConfigurationRights : ulong { /// <summary> /// User has no rights /// </summary> None = 0, /// <summary> /// User may read files /// </summary> Read = 1, /// <summary> /// User may write files /// </summary> Write = 2, /// <summary> /// User may list files /// </summary> List = 4 } }
Fix ConfigurationsRights.List not being a power of 2
Fix ConfigurationsRights.List not being a power of 2
C#
agpl-3.0
tgstation/tgstation-server-tools,Cyberboss/tgstation-server,tgstation/tgstation-server,tgstation/tgstation-server,Cyberboss/tgstation-server
b202eb49132201a34a11d28080ef91813f1080d8
src/DotVVM.Compiler/Program.cs
src/DotVVM.Compiler/Program.cs
using System; using System.IO; using System.Linq; namespace DotVVM.Compiler { public static class Program { private static readonly string[] HelpOptions = new string[] { "--help", "-h", "-?", "/help", "/h", "/?" }; public static bool TryRun(FileInfo assembly, DirectoryInfo? projectDir) { var executor = ProjectLoader.GetExecutor(assembly.FullName); return executor.ExecuteCompile(assembly, projectDir, null); } public static int Main(string[] args) { if (args.Length != 2 || (args.Length == 1 && HelpOptions.Contains(args[0]))) { Console.Error.Write( @"Usage: DotVVM.Compiler <ASSEMBLY> <PROJECT_DIR> Arguments: <ASSEMBLY> Path to a DotVVM project assembly. <PROJECT_DIR> Path to a DotVVM project directory."); return 1; } var success = TryRun(new FileInfo(args[0]), new DirectoryInfo(args[1])); return success ? 0 : 1; } } }
using System; using System.IO; using System.Linq; namespace DotVVM.Compiler { public static class Program { private static readonly string[] HelpOptions = new string[] { "--help", "-h", "-?", "/help", "/h", "/?" }; public static bool TryRun(FileInfo assembly, DirectoryInfo? projectDir) { var executor = ProjectLoader.GetExecutor(assembly.FullName); return executor.ExecuteCompile(assembly, projectDir, null); } public static int Main(string[] args) { // To minimize dependencies, this tool deliberately reinvents the wheel instead of using System.CommandLine. if (args.Length != 2 || (args.Length == 1 && HelpOptions.Contains(args[0]))) { Console.Error.Write( @"Usage: DotVVM.Compiler <ASSEMBLY> <PROJECT_DIR> Arguments: <ASSEMBLY> Path to a DotVVM project assembly. <PROJECT_DIR> Path to a DotVVM project directory."); return 1; } var assemblyFile = new FileInfo(args[0]); if (!assemblyFile.Exists) { Console.Error.Write($"Assembly '{assemblyFile}' does not exist."); return 1; } var projectDir = new DirectoryInfo(args[1]); if (!projectDir.Exists) { Console.Error.Write($"Project directory '{projectDir}' does not exist."); return 1; } var success = TryRun(assemblyFile, projectDir); return success ? 0 : 1; } } }
Add a check for argument existence to the Compiler
Add a check for argument existence to the Compiler
C#
apache-2.0
riganti/dotvvm,riganti/dotvvm,riganti/dotvvm,riganti/dotvvm
490e9dbfd67d5961e7fb33d63985504c8700b308
FALMHousekeeping/Constants/HKConstants.cs
FALMHousekeeping/Constants/HKConstants.cs
namespace FALM.Housekeeping.Constants { /// <summary> /// HkConstants /// </summary> public class HkConstants { /// <summary> /// Application /// </summary> public class Application { /// <summary>Name of the Application</summary> public const string Name = "F.A.L.M."; /// <summary>Alias of the Application</summary> public const string Alias = "FALM"; /// <summary>Icon of the Application</summary> public const string Icon = "icon-speed-gauge color-yellow"; /// <summary>Title of the Application</summary> public const string Title = "F.A.L.M. Housekeeping"; } /// <summary> /// Tree /// </summary> public class Tree { /// <summary>Name of the Tree</summary> public const string Name = "Housekeeping Tools"; /// <summary>Alias of the Tree</summary> public const string Alias = "housekeeping"; /// <summary>Icon of the Tree</summary> public const string Icon = "icon-umb-deploy"; /// <summary>Title of the Tree</summary> public const string Title = "Menu"; } /// <summary> /// Controller /// </summary> public class Controller { /// <summary>Alias of the Controller</summary> public const string Alias = "FALM"; } } }
namespace FALM.Housekeeping.Constants { /// <summary> /// HkConstants /// </summary> public class HkConstants { /// <summary> /// Application /// </summary> public class Application { /// <summary>Name of the Application</summary> public const string Name = "F.A.L.M."; /// <summary>Alias of the Application</summary> public const string Alias = "FALM"; /// <summary>Icon of the Application</summary> public const string Icon = "icon-speed-gauge"; /// <summary>Title of the Application</summary> public const string Title = "F.A.L.M. Housekeeping"; } /// <summary> /// Tree /// </summary> public class Tree { /// <summary>Name of the Tree</summary> public const string Name = "Housekeeping Tools"; /// <summary>Alias of the Tree</summary> public const string Alias = "housekeeping"; /// <summary>Icon of the Tree</summary> public const string Icon = "icon-umb-deploy"; /// <summary>Title of the Tree</summary> public const string Title = "Menu"; } /// <summary> /// Controller /// </summary> public class Controller { /// <summary>Alias of the Controller</summary> public const string Alias = "FALM"; } } }
Change icon color to be consistent with other section icon colors
Change icon color to be consistent with other section icon colors
C#
mit
FALM-Umbraco-Projects/FALM-Housekeeping-v7,FALM-Umbraco-Projects/FALM-Housekeeping-v7,FALM-Umbraco-Projects/FALM-Housekeeping-v7
8ce4704ffd6b0ff95c61d198e34e7bad308bf5a8
Web/Areas/Hub/Views/Shared/DisplayHub.cshtml
Web/Areas/Hub/Views/Shared/DisplayHub.cshtml
@using Cats.Models.Hubs @using Cats.Web.Hub.Helpers @using Telerik.Web.Mvc.UI @{ var usr = @Html.GetCurrentUser(); var mdl = new CurrentUserModel(usr); } <div align="right"> @{ string title = ""; if(ViewBag.Title != null) { title = ViewBag.Title; } } </div> <div class="row-fluid form-inline"> <h4 class="page-header">@Html.Translate(title) @Html.Label("Owner", mdl.Owner) - @Html.Label("WH", mdl.Name) @Html.Translate(" Hub ") @{ if(usr.UserAllowedHubs.Count > 1) { @Html.HubSelectionLink(Html.Translate("Change Warehouse"), Url.Action("HubList", "CurrentHub"), Html.Translate("Change Hub")) } } </h4> </div>
@using Cats.Models.Hubs @using Cats.Web.Hub.Helpers @using Telerik.Web.Mvc.UI @{ var usr = @Html.GetCurrentUser(); var mdl = new CurrentUserModel(usr); } <div align="right"> @{ string title = ""; if(ViewBag.Title != null) { title = ViewBag.Title; } } </div> <div class="row-fluid form-inline"> <h4 class="page-header">@Html.Translate(title) @Html.Label("Owner", mdl.Owner) - @Html.Label("WH", mdl.Name) @Html.Translate(" Hub ") @*@{ if(usr.UserAllowedHubs.Count > 1) { @Html.HubSelectionLink(Html.Translate("Change Warehouse"), Url.Action("HubList", "CurrentHub"), Html.Translate("Change Hub")) } }*@ </h4> </div>
FIX CIT-785 Hide EDIT button for all users in hub
FIX CIT-785 Hide EDIT button for all users in hub
C#
apache-2.0
ndrmc/cats,ndrmc/cats,ndrmc/cats
4058e1e0a26e66b7ce88b217f938faa6227e37ad
MoreDakka/Views/Forums/Index.cshtml
MoreDakka/Views/Forums/Index.cshtml
@{ Layout = null; } <div class="container" style="padding-top: 50px;"> <div class="container"> <div class="panel panel-default"> <div class="panel-body"> <table class="table table-striped table-bordered table-hover"> <thead> <tr> <th></th> <th>Forum Name</th> <th>Topics</th> <th>Posts</th> <th>Last Post</th> </tr> </thead> <tbody> <tr class="board-row" data-ng-repeat="board in boards"> <td></td> <td data-ng-click="openBoard(board.id)"><a data-ng-href="/#/forums/{{board.id}}">{{ board.name }}</a></td> <td>{{ board.totalTopics }}</td> <td>{{ board.totalPosts }}</td> <td> <div data-ng-show="board.lastTopicTitle != null"> <a href="/#/forums/{{ board.id }}/{{ board.lastTopicId }}">{{ board.lastTopicTitle }}</a> <div class="last-post-author">by {{ board.lastPostAuthor }}</div> </div> <div data-ng-show="board.lastTopicTitle == null"> <em>None</em> </div> </td> </tr> </tbody> </table> </div> </div> </div> </div>
@{ Layout = null; } <div class="container" style="padding-top: 50px;"> <div class="container"> <table class="table table-striped table-bordered table-hover"> <thead> <tr> <th></th> <th>Forum Name</th> <th>Topics</th> <th>Posts</th> <th>Last Post</th> </tr> </thead> <tbody> <tr class="board-row" data-ng-repeat="board in boards"> <td></td> <td data-ng-click="openBoard(board.id)"><a data-ng-href="/#/forums/{{board.id}}">{{ board.name }}</a></td> <td>{{ board.totalTopics }}</td> <td>{{ board.totalPosts }}</td> <td> <div data-ng-show="board.lastTopicTitle != null"> <a href="/#/forums/{{ board.id }}/{{ board.lastTopicId }}">{{ board.lastTopicTitle }}</a> <div class="last-post-author">by {{ board.lastPostAuthor }}</div> </div> <div data-ng-show="board.lastTopicTitle == null"> <em>None</em> </div> </td> </tr> </tbody> </table> </div> </div>
Remove panel from index forum page for mobile devices
Remove panel from index forum page for mobile devices
C#
apache-2.0
James226/more-dakka,James226/more-dakka,James226/more-dakka,James226/more-dakka
68a102f30f4959c6a26fef72383c660fe4b0dea7
UnityProject/Assets/Scripts/Messages/GameMessageBase.cs
UnityProject/Assets/Scripts/Messages/GameMessageBase.cs
using System.Collections; using UnityEngine; using UnityEngine.Networking; public abstract class GameMessageBase : MessageBase { public GameObject NetworkObject; public GameObject[] NetworkObjects; protected IEnumerator WaitFor(NetworkInstanceId id) { int tries = 0; while ((NetworkObject = ClientScene.FindLocalObject(id)) == null) { if (tries++ > 10) { Debug.LogWarning($"{this} could not find object with id {id}"); yield break; } yield return YieldHelper.EndOfFrame; } } protected IEnumerator WaitFor(params NetworkInstanceId[] ids) { NetworkObjects = new GameObject[ids.Length]; while (!AllLoaded(ids)) { yield return YieldHelper.EndOfFrame; } } private bool AllLoaded(NetworkInstanceId[] ids) { for (int i = 0; i < ids.Length; i++) { GameObject obj = ClientScene.FindLocalObject(ids[i]); if (obj == null) { return false; } NetworkObjects[i] = obj; } return true; } }
using System.Collections; using UnityEngine; using UnityEngine.Networking; public abstract class GameMessageBase : MessageBase { public GameObject NetworkObject; public GameObject[] NetworkObjects; protected IEnumerator WaitFor(NetworkInstanceId id) { if (id.IsEmpty()) { Debug.LogError($"{this} tried to wait on an empty (0) id"); yield break; } int tries = 0; while ((NetworkObject = ClientScene.FindLocalObject(id)) == null) { if (tries++ > 10) { Debug.LogWarning($"{this} could not find object with id {id}"); yield break; } yield return YieldHelper.EndOfFrame; } } protected IEnumerator WaitFor(params NetworkInstanceId[] ids) { NetworkObjects = new GameObject[ids.Length]; while (!AllLoaded(ids)) { yield return YieldHelper.EndOfFrame; } } private bool AllLoaded(NetworkInstanceId[] ids) { for (int i = 0; i < ids.Length; i++) { GameObject obj = ClientScene.FindLocalObject(ids[i]); if (obj == null) { return false; } NetworkObjects[i] = obj; } return true; } }
Add case for waiting on an empty id
Add case for waiting on an empty id
C#
agpl-3.0
Necromunger/unitystation,fomalsd/unitystation,Lancemaker/unitystation,fomalsd/unitystation,Necromunger/unitystation,MrLeebo/unitystation,krille90/unitystation,MrLeebo/unitystation,Lancemaker/unitystation,MrLeebo/unitystation,Necromunger/unitystation,fomalsd/unitystation,fomalsd/unitystation,krille90/unitystation,MrLeebo/unitystation,krille90/unitystation,fomalsd/unitystation,Necromunger/unitystation,MrLeebo/unitystation,fomalsd/unitystation,fomalsd/unitystation,MrLeebo/unitystation,Necromunger/unitystation,Necromunger/unitystation
9a1ff4092cd4d6cd0e070cf127f28f2f33f26a73
DancingGoat/Startup.cs
DancingGoat/Startup.cs
using Microsoft.Owin; using Owin; [assembly: OwinStartupAttribute(typeof(DancingGoat.Startup))] namespace DancingGoat { public partial class Startup { public void Configuration(IAppBuilder app) { } } }
using Microsoft.Owin; using Owin; using System.Net; [assembly: OwinStartupAttribute(typeof(DancingGoat.Startup))] namespace DancingGoat { public partial class Startup { public void Configuration(IAppBuilder app) { // .NET Framework 4.6.1 and lower does not support TLS 1.2 as the default protocol, but Delivery API requires it. ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; } } }
Set TLS 1.2 as the default potocol
Set TLS 1.2 as the default potocol
C#
mit
Kentico/Deliver-Dancing-Goat-.NET-MVC,Kentico/cloud-sample-app-net,Kentico/cloud-sample-app-net,Kentico/Deliver-Dancing-Goat-.NET-MVC,Kentico/cloud-sample-app-net
d78c1c03fb46aabd8d77e988b5a2197e58007b75
Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs
Tests/Cosmos.TestRunner.Full/DefaultEngineConfiguration.cs
using System; using System.Collections.Generic; using Cosmos.Build.Common; using Cosmos.TestRunner.Core; namespace Cosmos.TestRunner.Full { public class DefaultEngineConfiguration : IEngineConfiguration { public virtual int AllowedSecondsInKernel => 6000; public virtual IEnumerable<RunTargetEnum> RunTargets { get { yield return RunTargetEnum.Bochs; //yield return RunTargetEnum.VMware; //yield return RunTargetEnum.HyperV; //yield return RunTargetEnum.Qemu; } } public virtual bool RunWithGDB => true; public virtual bool StartBochsDebugGUI => true; public virtual bool DebugIL2CPU => false; public virtual string KernelPkg => String.Empty; public virtual TraceAssemblies TraceAssembliesLevel => TraceAssemblies.User; public virtual bool EnableStackCorruptionChecks => true; public virtual StackCorruptionDetectionLevel StackCorruptionDetectionLevel => StackCorruptionDetectionLevel.MethodFooters; public virtual DebugMode DebugMode => DebugMode.Source; public virtual IEnumerable<string> KernelAssembliesToRun { get { foreach (var xKernelType in TestKernelSets.GetKernelTypesToRun()) { yield return xKernelType.Assembly.Location; } } } } }
using System; using System.Collections.Generic; using Cosmos.Build.Common; using Cosmos.TestRunner.Core; namespace Cosmos.TestRunner.Full { public class DefaultEngineConfiguration : IEngineConfiguration { public virtual int AllowedSecondsInKernel => 6000; public virtual IEnumerable<RunTargetEnum> RunTargets { get { yield return RunTargetEnum.Bochs; //yield return RunTargetEnum.VMware; //yield return RunTargetEnum.HyperV; //yield return RunTargetEnum.Qemu; } } public virtual bool RunWithGDB => false; public virtual bool StartBochsDebugGUI => false; public virtual bool DebugIL2CPU => false; public virtual string KernelPkg => String.Empty; public virtual TraceAssemblies TraceAssembliesLevel => TraceAssemblies.User; public virtual bool EnableStackCorruptionChecks => true; public virtual StackCorruptionDetectionLevel StackCorruptionDetectionLevel => StackCorruptionDetectionLevel.MethodFooters; public virtual DebugMode DebugMode => DebugMode.Source; public virtual IEnumerable<string> KernelAssembliesToRun { get { foreach (var xKernelType in TestKernelSets.GetKernelTypesToRun()) { yield return xKernelType.Assembly.Location; } } } } }
Disable GDB + Bochs GUI
Disable GDB + Bochs GUI
C#
bsd-3-clause
zarlo/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos
311a08cfd2a50efb214c7028be97a3d51de8803b
TestMoya/Extensions/StringExtensionsTests.cs
TestMoya/Extensions/StringExtensionsTests.cs
using Moya.Extensions; using Xunit; namespace TestMoya.Extensions { public class StringExtensionsTests { [Fact] public void StringExtensionsFormatWithWorksWithWorksWithStrings() { const string Expected = "Hello world!"; var actual = "{0} {1}".FormatWith("Hello", "world!"); Assert.Equal(Expected, actual); } [Fact] public void StringExtensionsFormatWithWorksWithWorksWithIntegers() { const string Expected = "1 2 3 4"; var actual = "{0} {1} {2} {3}".FormatWith(1, 2, 3, 4); Assert.Equal(Expected, actual); } [Fact] public void StringExtensionsFormatWithWorksWithWorksWithIntegersAndStrings() { const string Expected = "1 2 Hello World!"; var actual = "{0} {1} {2} {3}".FormatWith(1, 2, "Hello", "World!"); Assert.Equal(Expected, actual); } } }
namespace TestMoya.Extensions { using Moya.Extensions; using Xunit; public class StringExtensionsTests { [Fact] public void StringExtensionsFormatWithWorksWithWorksWithStrings() { const string Expected = "Hello world!"; var actual = "{0} {1}".FormatWith("Hello", "world!"); Assert.Equal(Expected, actual); } [Fact] public void StringExtensionsFormatWithWorksWithWorksWithIntegers() { const string Expected = "1 2 3 4"; var actual = "{0} {1} {2} {3}".FormatWith(1, 2, 3, 4); Assert.Equal(Expected, actual); } [Fact] public void StringExtensionsFormatWithWorksWithWorksWithIntegersAndStrings() { const string Expected = "1 2 Hello World!"; var actual = "{0} {1} {2} {3}".FormatWith(1, 2, "Hello", "World!"); Assert.Equal(Expected, actual); } } }
Move usings inside namespace in stringextensionstests
Move usings inside namespace in stringextensionstests
C#
mit
Hammerstad/Moya
d9c96406ad7a05ecd53fbd41b5ef7f9ad0a6d1bf
NTumbleBit/BouncyCastle/security/SecureRandom.cs
NTumbleBit/BouncyCastle/security/SecureRandom.cs
using NBitcoin; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NTumbleBit.BouncyCastle.Security { internal class SecureRandom : Random { public SecureRandom() { } public override int Next() { return RandomUtils.GetInt32(); } public override int Next(int maxValue) { throw new NotImplementedException(); } public override int Next(int minValue, int maxValue) { throw new NotImplementedException(); } public override void NextBytes(byte[] buffer) { RandomUtils.GetBytes(buffer); } } }
using NBitcoin; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NTumbleBit.BouncyCastle.Security { internal class SecureRandom : Random { public SecureRandom() { } public override int Next() { return RandomUtils.GetInt32(); } public override int Next(int maxValue) { return (int)(RandomUtils.GetUInt32() % maxValue); } public override int Next(int minValue, int maxValue) { throw new NotImplementedException(); } public override void NextBytes(byte[] buffer) { RandomUtils.GetBytes(buffer); } } }
Fix crash caused by previous commit
Fix crash caused by previous commit
C#
mit
NTumbleBit/NTumbleBit,DanGould/NTumbleBit
a90ce74775ae462ed7db89b363483d54d2b8a629
Oogstplanner.Web/Views/Account/_LoginForm.cshtml
Oogstplanner.Web/Views/Account/_LoginForm.cshtml
@model LoginOrRegisterViewModel @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class="form-signin", @role="form"})) { <div class="form-group"> @Html.ValidationSummary(true) </div> <h2 class="form-signin-heading dark">Meld u alstublieft aan</h2> @Html.LabelFor(vm => vm.Login.UserName, new { @class="sr-only" }) @Html.TextBoxFor(vm => vm.Login.UserName, new { @class = "form-control", @type="email", @placeholder = "Gebruikersnaam of e-mailadres" }) @Html.LabelFor(vm => vm.Login.Password, new { @class="sr-only" }) @Html.PasswordFor(vm => vm.Login.Password, new { @class = "form-control", @placeholder = "Wachtwoord" }) <div class="checkbox dark"> <label class="pull-left"> @Html.CheckBoxFor(vm => vm.Login.RememberMe) Onthoud mij. </label> @Html.ActionLink("Wachtwoord vergeten?", "LostPassword", null, new { @class = "pull-right" }) <br/> </div> <button class="btn btn-lg btn-primary btn-block" type="submit">Inloggen</button> if(ViewData.ModelState.ContainsKey("registration")) { @ViewData.ModelState["registration"].Errors.First().ErrorMessage; } }
@model LoginOrRegisterViewModel @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class="form-signin", @role="form"})) { <div class="form-group"> @Html.ValidationSummary(true) </div> <h2 class="form-signin-heading dark">Meld u alstublieft aan</h2> @Html.LabelFor(vm => vm.Login.UserName, new { @class="sr-only" }) @Html.TextBoxFor(vm => vm.Login.UserName, new { @class = "form-control", @placeholder = "Gebruikersnaam of e-mailadres" }) @Html.LabelFor(vm => vm.Login.Password, new { @class="sr-only" }) @Html.PasswordFor(vm => vm.Login.Password, new { @class = "form-control", @placeholder = "Wachtwoord" }) <div class="checkbox dark"> <label class="pull-left"> @Html.CheckBoxFor(vm => vm.Login.RememberMe) Onthoud mij. </label> @Html.ActionLink("Wachtwoord vergeten?", "LostPassword", null, new { @class = "pull-right" }) <br/> </div> <button class="btn btn-lg btn-primary btn-block" type="submit">Inloggen</button> if(ViewData.ModelState.ContainsKey("registration")) { @ViewData.ModelState["registration"].Errors.First().ErrorMessage; } }
Remove wrong type for username and e-mail field
Remove wrong type for username and e-mail field
C#
mit
erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner
89389514bef196d433983f1f101dc307a661b0af
osu.Framework.Benchmarks/BenchmarkBindableInstantiation.cs
osu.Framework.Benchmarks/BenchmarkBindableInstantiation.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 BenchmarkDotNet.Attributes; using osu.Framework.Bindables; namespace osu.Framework.Benchmarks { public class BenchmarkBindableInstantiation { private Bindable<int> bindable; [GlobalSetup] public void GlobalSetup() => bindable = new Bindable<int>(); /// <summary> /// Creates an instance of the bindable directly by construction. /// </summary> [Benchmark(Baseline = true)] public Bindable<int> CreateInstanceViaConstruction() => new Bindable<int>(); /// <summary> /// Creates an instance of the bindable via <see cref="Activator.CreateInstance(Type, object[])"/>. /// This used to be how <see cref="Bindable{T}.GetBoundCopy"/> creates an instance before binding, which has turned out to be inefficient in performance. /// </summary> [Benchmark] public Bindable<int> CreateInstanceViaActivatorWithParams() => (Bindable<int>)Activator.CreateInstance(typeof(Bindable<int>), 0); /// <summary> /// Creates an instance of the bindable via <see cref="Activator.CreateInstance(Type)"/>. /// More performant than <see cref="CreateInstanceViaActivatorWithParams"/>, due to not passing parameters to <see cref="Activator"/> during instance creation. /// </summary> [Benchmark] public Bindable<int> CreateInstanceViaActivatorWithoutParams() => (Bindable<int>)Activator.CreateInstance(typeof(Bindable<int>), true); /// <summary> /// Creates an instance of the bindable via <see cref="IBindable.CreateInstance"/>. /// This is the current and most performant version used for <see cref="IBindable.GetBoundCopy"/>, as equally performant as <see cref="CreateInstanceViaConstruction"/>. /// </summary> [Benchmark] public Bindable<int> CreateInstanceViaBindableCreateInstance() => bindable.CreateInstance(); } }
// 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 BenchmarkDotNet.Attributes; using osu.Framework.Bindables; namespace osu.Framework.Benchmarks { public class BenchmarkBindableInstantiation { [Benchmark(Baseline = true)] public Bindable<int> GetBoundCopyOld() => new BindableOld<int>().GetBoundCopy(); [Benchmark] public Bindable<int> GetBoundCopy() => new Bindable<int>().GetBoundCopy(); private class BindableOld<T> : Bindable<T> { public BindableOld(T defaultValue = default) : base(defaultValue) { } protected internal override Bindable<T> CreateInstance() => (BindableOld<T>)Activator.CreateInstance(GetType(), Value); } } }
Refactor benchmarks to only demonstrate what's needed
Refactor benchmarks to only demonstrate what's needed
C#
mit
peppy/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,ppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,peppy/osu-framework
162010bc5e05ae4f1c3fbe93b196ee49635d64fb
src/SyncTrayzor/Syncthing/ApiClient/EventType.cs
src/SyncTrayzor/Syncthing/ApiClient/EventType.cs
using Newtonsoft.Json; namespace SyncTrayzor.Syncthing.ApiClient { [JsonConverter(typeof(DefaultingStringEnumConverter))] public enum EventType { Unknown, Starting, StartupComplete, Ping, DeviceDiscovered, DeviceConnected, DeviceDisconnected, RemoteIndexUpdated, LocalIndexUpdated, ItemStarted, ItemFinished, // Not quite sure which it's going to be, so play it safe... MetadataChanged, ItemMetadataChanged, StateChanged, FolderRejected, DeviceRejected, ConfigSaved, DownloadProgress, FolderSummary, FolderCompletion, FolderErrors, FolderScanProgress, DevicePaused, DeviceResumed, LoginAttempt, ListenAddressChanged, } }
using Newtonsoft.Json; namespace SyncTrayzor.Syncthing.ApiClient { [JsonConverter(typeof(DefaultingStringEnumConverter))] public enum EventType { Unknown, Starting, StartupComplete, Ping, DeviceDiscovered, DeviceConnected, DeviceDisconnected, RemoteIndexUpdated, LocalIndexUpdated, ItemStarted, ItemFinished, // Not quite sure which it's going to be, so play it safe... MetadataChanged, ItemMetadataChanged, StateChanged, FolderRejected, DeviceRejected, ConfigSaved, DownloadProgress, FolderSummary, FolderCompletion, FolderErrors, FolderScanProgress, DevicePaused, DeviceResumed, LoginAttempt, ListenAddressChanged, RelayStateChanged, ExternalPortMappingChanged, } }
Add a couple of apparently missing events
Add a couple of apparently missing events
C#
mit
canton7/SyncTrayzor,canton7/SyncTrayzor,canton7/SyncTrayzor
2f5de263a1c824c89a78e0ead926c9ae9d6b0772
src/MICore/Transports/LocalTransport.cs
src/MICore/Transports/LocalTransport.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Diagnostics; using System.IO; using System.Collections.Specialized; using System.Collections; namespace MICore { public class LocalTransport : PipeTransport { public LocalTransport() { } public override void InitStreams(LaunchOptions options, out StreamReader reader, out StreamWriter writer) { LocalLaunchOptions localOptions = (LocalLaunchOptions)options; Process proc = new Process(); proc.StartInfo.FileName = localOptions.MIDebuggerPath; proc.StartInfo.Arguments = "--interpreter=mi"; proc.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(localOptions.MIDebuggerPath); InitProcess(proc, out reader, out writer); } protected override string GetThreadName() { return "MI.LocalTransport"; } } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Diagnostics; using System.IO; using System.Collections.Specialized; using System.Collections; namespace MICore { public class LocalTransport : PipeTransport { public LocalTransport() { } public override void InitStreams(LaunchOptions options, out StreamReader reader, out StreamWriter writer) { LocalLaunchOptions localOptions = (LocalLaunchOptions)options; string miDebuggerDir = System.IO.Path.GetDirectoryName(localOptions.MIDebuggerPath); Process proc = new Process(); proc.StartInfo.FileName = localOptions.MIDebuggerPath; proc.StartInfo.Arguments = "--interpreter=mi"; proc.StartInfo.WorkingDirectory = miDebuggerDir; //GDB locally requires that the directory be on the PATH, being the working directory isn't good enough if (proc.StartInfo.EnvironmentVariables.ContainsKey("PATH")) { proc.StartInfo.EnvironmentVariables["PATH"] = proc.StartInfo.EnvironmentVariables["PATH"] + ";" + miDebuggerDir; } InitProcess(proc, out reader, out writer); } protected override string GetThreadName() { return "MI.LocalTransport"; } } }
Add MI debugger working directory to PATH
Add MI debugger working directory to PATH
C#
mit
yazeng/MIEngine,wesrupert/MIEngine,rajkumar42/MIEngine,xincun/MIEngine,chuckries/MIEngine,caslan/MIEngine,enginekit/MIEngine,devilman3d/MIEngine,pieandcakes/MIEngine,wesrupert/MIEngine,caslan/MIEngine,csiusers/MIEngine,devilman3d/MIEngine,yacoder/MIEngine,Microsoft/MIEngine,edumunoz/MIEngine,edumunoz/MIEngine,pieandcakes/MIEngine,orbitcowboy/MIEngine,jacdavis/MIEngine,chuckries/MIEngine,chuckries/MIEngine,enginekit/MIEngine,Microsoft/MIEngine,orbitcowboy/MIEngine,enginekit/MIEngine,phofman/MIEngine,yacoder/MIEngine,gregg-miskelly/MIEngine,conniey/MIEngine,yazeng/MIEngine,wiktork/MIEngine,gregg-miskelly/MIEngine,faxue-msft/MIEngine,xincun/MIEngine,Microsoft/MIEngine,rajkumar42/MIEngine,faxue-msft/MIEngine,devilman3d/MIEngine,xingshenglu/MIEngine,xingshenglu/MIEngine,rajkumar42/MIEngine,yacoder/MIEngine,PistonDevelopers/MIEngine,conniey/MIEngine,rajkumar42/MIEngine,caslan/MIEngine,xincun/MIEngine,jacdavis/MIEngine,orbitcowboy/MIEngine,xingshenglu/MIEngine,wesrupert/MIEngine,chuckries/MIEngine,jacdavis/MIEngine,devilman3d/MIEngine,yazeng/MIEngine,csiusers/MIEngine,csiusers/MIEngine,edumunoz/MIEngine,conniey/MIEngine,wiktork/MIEngine,wesrupert/MIEngine,faxue-msft/MIEngine,upsoft/MIEngine,upsoft/MIEngine,edumunoz/MIEngine,faxue-msft/MIEngine,pieandcakes/MIEngine,wiktork/MIEngine,vosen/MIEngine,orbitcowboy/MIEngine,upsoft/MIEngine,gregg-miskelly/MIEngine,pieandcakes/MIEngine,csiusers/MIEngine,caslan/MIEngine,Microsoft/MIEngine,phofman/MIEngine,phofman/MIEngine
f4e21d24932bce181b8ea204a3aa3f609b9fa7b9
src/NQuery.UnitTests/SelectStarTests.cs
src/NQuery.UnitTests/SelectStarTests.cs
using System; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace NQuery.UnitTests { [TestClass] public class SelectStarTests { [TestMethod] public void Binder_DisallowsSelectStarWithoutTables() { var syntaxTree = SyntaxTree.ParseQuery("SELECT *"); var compilation = Compilation.Empty.WithSyntaxTree(syntaxTree).WithIdNameTable(); var semanticModel = compilation.GetSemanticModel(); var diagnostics = semanticModel.GetDiagnostics().ToArray(); Assert.AreEqual(1, diagnostics.Length); Assert.AreEqual(DiagnosticId.MustSpecifyTableToSelectFrom, diagnostics[0].DiagnosticId); } [TestMethod] public void Binder_DisallowsSelectStarWithoutTables_UnlessInExists() { var syntaxTree = SyntaxTree.ParseQuery("SELECT 'Test' WHERE EXISTS (SELECT *)"); var compilation = Compilation.Empty.WithSyntaxTree(syntaxTree).WithIdNameTable(); var semanticModel = compilation.GetSemanticModel(); var diagnostics = semanticModel.GetDiagnostics().ToArray(); Assert.AreEqual(0, diagnostics.Length); } } }
using System; using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace NQuery.UnitTests { [TestClass] public class SelectStarTests { [TestMethod] public void SelectStar_Disallowed_WhenNoTablesSpecified() { var syntaxTree = SyntaxTree.ParseQuery("SELECT *"); var compilation = Compilation.Empty.WithSyntaxTree(syntaxTree).WithIdNameTable(); var semanticModel = compilation.GetSemanticModel(); var diagnostics = semanticModel.GetDiagnostics().ToArray(); Assert.AreEqual(1, diagnostics.Length); Assert.AreEqual(DiagnosticId.MustSpecifyTableToSelectFrom, diagnostics[0].DiagnosticId); } [TestMethod] public void SelectStar_Disallowed_WhenNoTablesSpecified_UnlessInExists() { var syntaxTree = SyntaxTree.ParseQuery("SELECT 'Test' WHERE EXISTS (SELECT *)"); var compilation = Compilation.Empty.WithSyntaxTree(syntaxTree).WithIdNameTable(); var semanticModel = compilation.GetSemanticModel(); var diagnostics = semanticModel.GetDiagnostics().ToArray(); Assert.AreEqual(0, diagnostics.Length); } } }
Rename SELECT * test cases to match naming convention
Rename SELECT * test cases to match naming convention
C#
mit
terrajobst/nquery-vnext
afdb0f9d0fd3ff9e3fa651492a64976e2096a988
src/Okanshi.Dashboard/SettingsModule.cs
src/Okanshi.Dashboard/SettingsModule.cs
using System; using System.Linq; using Nancy; namespace Okanshi.Dashboard { public class SettingsModule : NancyModule { public SettingsModule(IConfiguration configuration) { Get["/settings"] = p => { var servers = configuration.GetAll().ToArray(); return View["settings.html", servers]; }; Post["/settings"] = p => { var name = Request.Form.Name; var url = Request.Form.url; var refreshRate = Convert.ToInt64(Request.Form.refreshRate.Value); var server = new OkanshiServer(name, url, refreshRate); configuration.Add(server); return Response.AsRedirect("/settings"); }; } } }
using System; using System.Linq; using Nancy; namespace Okanshi.Dashboard { public class SettingsModule : NancyModule { public SettingsModule(IConfiguration configuration) { Get["/settings"] = p => { var servers = configuration.GetAll().ToArray(); return View["settings.html", servers]; }; Post["/settings"] = p => { var name = Request.Form.Name; var url = Request.Form.url; var refreshRate = Convert.ToInt64(Request.Form.refreshRate.Value); var server = new OkanshiServer(name, url, refreshRate); configuration.Add(server); return Response.AsRedirect("/settings"); }; Post["/settings/delete"] = p => { var name = (string)Request.Form.InstanceName; configuration.Remove(name); return Response.AsRedirect("/settings"); }; } } }
Implement endpoint for remove instance
Implement endpoint for remove instance
C#
mit
mvno/Okanshi.Dashboard,mvno/Okanshi.Dashboard,mvno/Okanshi.Dashboard,mvno/Okanshi.Dashboard
1aba4d54e1444b9447757a5e9712157e61a3dc14
Views/Price.cshtml
Views/Price.cshtml
@if (Model.DiscountedPrice != Model.Price) { <b class="inactive-price" style="text-decoration:line-through" title="@T("Was ${0}", Model.Price)">$@Model.Price</b> <b class="discounted-price" title="@T("Now ${0}", Model.DiscountedPrice)">$@Model.DiscountedPrice</b> <span class="discount-comment">@Model.DiscountComment</span> } else { <b>$@Model.Price</b> }
@if (Model.DiscountedPrice != Model.Price) { <b class="inactive-price" style="text-decoration:line-through" title="@T("Was {0}", Model.Price.ToString("c"))">@Model.Price.ToString("c")</b> <b class="discounted-price" title="@T("Now {0}", Model.DiscountedPrice.ToString("c"))">@Model.DiscountedPrice.ToString("c")</b> <span class="discount-comment">@Model.DiscountComment</span> } else { <b>@Model.Price.ToString("c")</b> }
Remove hard coded USD dollar symbol and use currency string formatting instead.
Remove hard coded USD dollar symbol and use currency string formatting instead. TODO: Reflect currency format according to 'Default Site Culture' set within Orchard, not the culture settings of the server. --HG-- branch : currency_string_format
C#
bsd-3-clause
bleroy/Nwazet.Commerce,bleroy/Nwazet.Commerce
9097c10782843db55ab00d0000ac253910ee0210
Console/Program.cs
Console/Program.cs
using S22.Xmpp.Client; using S22.Xmpp; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using S22.Xmpp.Im; namespace XmppConsole { class Program { static void Main(string[] args) { try { using (var client = new XmppClient("something.com", "someone", "password")) { client.Connect(); client.Message += OnMessage; Console.WriteLine("Connected as " + client.Jid); string line; while ((line = Console.ReadLine()) != null) { Jid to = new Jid("something.com", "someone"); client.SendMessage(to, line, type: MessageType.Chat); } } } catch (Exception exc) { Console.WriteLine(exc.ToString()); } Console.WriteLine("Press any key to quit..."); Console.ReadLine(); } private static void OnMessage(object sender, MessageEventArgs e) { Console.WriteLine(e.Jid.Node + ": " + e.Message.Body); } } }
using S22.Xmpp.Client; using S22.Xmpp; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using S22.Xmpp.Im; namespace XmppConsole { class Program { static void Main(string[] args) { try { using (var client = new XmppClient(args[0], args[1], args[2])) { client.Connect(); client.SetStatus(Availability.Online); client.Message += OnMessage; Console.WriteLine("Connected as " + client.Jid); string line; while ((line = Console.ReadLine()) != null) { Jid to = new Jid("something.com", "someone"); client.SendMessage(to, line, type: MessageType.Chat); } client.SetStatus(Availability.Offline); } } catch (Exception exc) { Console.WriteLine(exc.ToString()); } Console.WriteLine("Press any key to quit..."); Console.ReadLine(); } private static void OnMessage(object sender, MessageEventArgs e) { Console.WriteLine(e.Jid.Node + ": " + e.Message.Body); } } }
Put passwords in startup args
Put passwords in startup args
C#
mit
Hitcents/S22.Xmpp
cecb7009a79120037b135ba9b730d24a95fd610e
mvcWebApp/Views/Home/_Header.cshtml
mvcWebApp/Views/Home/_Header.cshtml
 <div class="container"> <header class="container"> <h1>Sweet Water Revolver</h1> </header> </div>
 <div class="container"> <header> <h1>Sweet Water Revolver</h1> </header> </div>
Remove the container class from the header, because it was redundant with its containing div.
Remove the container class from the header, because it was redundant with its containing div.
C#
mit
bigfont/sweet-water-revolver