Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Remove unused method on DateTimeOffsetConvertrer and consolidated code | using System;
namespace AllReady.Providers
{
public interface IConvertDateTimeOffset
{
DateTimeOffset ConvertDateTimeOffsetTo(string timeZoneId, DateTimeOffset dateTimeOffset, int hour = 0, int minute = 0, int second = 0);
DateTimeOffset ConvertDateTimeOffsetTo(TimeZoneInfo timeZoneInfo, DateT... | using System;
namespace AllReady.Providers
{
public interface IConvertDateTimeOffset
{
DateTimeOffset ConvertDateTimeOffsetTo(string timeZoneId, DateTimeOffset dateTimeOffset, int hour = 0, int minute = 0, int second = 0);
}
public class DateTimeOffsetConverter : IConvertDateTimeOffset
{
... |
Add a placeholder cover URL for users. | // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using Newtonsoft.Json;
namespace osu.Game.Users
{
public class User
{
[JsonProperty(@"id")]
public long Id = 1;
[JsonPrope... | // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using Newtonsoft.Json;
namespace osu.Game.Users
{
public class User
{
[JsonProperty(@"id")]
public long Id = 1;
[JsonPrope... |
Write an additional line after creating application | using System;
using System.Linq;
namespace AppHarbor.Commands
{
public class CreateCommand : ICommand
{
private readonly IAppHarborClient _appHarborClient;
private readonly IApplicationConfiguration _applicationConfiguration;
public CreateCommand(IAppHarborClient appHarborClient, IApplicationConfiguration ap... | using System;
using System.Linq;
namespace AppHarbor.Commands
{
public class CreateCommand : ICommand
{
private readonly IAppHarborClient _appHarborClient;
private readonly IApplicationConfiguration _applicationConfiguration;
public CreateCommand(IAppHarborClient appHarborClient, IApplicationConfiguration ap... |
Add missing using statement in word-count | using System.Text.RegularExpressions;
using System.Collections.Generic;
public class Phrase
{
private readonly string _phrase;
public Phrase(string phrase)
{
if (phrase == null) throw new ArgumentNullException("phrase");
_phrase = phrase;
}
public IDictionary<string, int> Word... | using System;
using System.Text.RegularExpressions;
using System.Collections.Generic;
public class Phrase
{
private readonly string _phrase;
public Phrase(string phrase)
{
if (phrase == null) throw new ArgumentNullException("phrase");
_phrase = phrase;
}
public IDictionary<str... |
Enable tests parallelization for all build configurations | #if DEBUG
using NUnit.Framework;
[assembly: LevelOfParallelism(4)]
[assembly: Parallelizable(ParallelScope.Fixtures)]
#endif
| using NUnit.Framework;
[assembly: Parallelizable(ParallelScope.Fixtures)]
|
Allow OuterLoop on a class | // 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 Xunit.Sdk;
namespace Xunit
{
/// <summary>
/// Apply this attribute to your test method to specify a outer-loop category.
/// </summary... | // 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 Xunit.Sdk;
namespace Xunit
{
/// <summary>
/// Apply this attribute to your test method to specify a outer-loop category.
/// </summary... |
Test push for appveyor nuget restore | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CheckUp2 {
public partial class MainWindow : Form {
public MainWindow() {
... | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CheckUp2 {
public partial class MainWindow : Form {
public MainWindow() {
... |
Change interface parameter name to match it's type name | namespace KInspector.Core
{
/// <summary>
/// The interface to implement to add a functionality to this application.
/// Add DLL with implementation of this interface to the same folder as executing assembly to auto-load
/// all of them.
/// </summary>
public interface IModule
{
//... | namespace KInspector.Core
{
/// <summary>
/// The interface to implement to add a functionality to this application.
/// Add DLL with implementation of this interface to the same folder as executing assembly to auto-load
/// all of them.
/// </summary>
public interface IModule
{
//... |
Revert "Convert mapping async exceptions to Promise" | namespace Miruken.Map
{
using System;
using Callback;
using Concurrency;
public class MappingHandler : Handler, IMapping
{
public object Map(object source, object typeOrInstance,
object format = null)
{
if (source == null)
throw... | namespace Miruken.Map
{
using System;
using Callback;
using Concurrency;
public class MappingHandler : Handler, IMapping
{
public object Map(object source, object typeOrInstance,
object format = null)
{
if (source == null)
throw... |
Remove obsolete clip clear request code | using System;
namespace clipman.ViewModels
{
class SettingsPanelViewModel
{
public void ClearClips()
{
ClearRequested?.Invoke(this, EventArgs.Empty);
}
public event EventHandler ClearRequested;
}
}
| using System;
namespace clipman.ViewModels
{
class SettingsPanelViewModel
{
}
}
|
Use explicit operators, since they are no longer used implicitly | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
using System.Diagnostics.CodeAnalysis;
namespace Microsoft.CodeAnalysis.CodeStyle
{
internal... | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
using System.Diagnostics.CodeAnalysis;
namespace Microsoft.CodeAnalysis.CodeStyle
{
internal... |
Test for exception for now until we can get a proper test image. | // Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.
using System.IO;
using ImageMagick;
using Xunit;
namespace Magick.NET.Tests
{
public class TheAvifCoder
{
[Fact]
public void ShouldEncodeAndDecodeAlphaChannel()
{
... | // Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.
using System.IO;
using ImageMagick;
using Xunit;
namespace Magick.NET.Tests
{
public class TheAvifCoder
{
[Fact]
public void ShouldEncodeAndDecodeAlphaChannel()
{
... |
Support configuring an existing option value. | using System.Collections.Immutable;
using LanguageExt;
namespace ExRam.Gremlinq.Core
{
public struct GremlinqOptions
{
private readonly IImmutableDictionary<GremlinqOption, object> _options;
public GremlinqOptions(IImmutableDictionary<GremlinqOption, object> options)
{
_op... | using System;
using System.Collections.Immutable;
using LanguageExt;
namespace ExRam.Gremlinq.Core
{
public struct GremlinqOptions
{
private readonly IImmutableDictionary<GremlinqOption, object> _options;
public GremlinqOptions(IImmutableDictionary<GremlinqOption, object> options)
{
... |
Add default ctor to class. bugid: 417 | using System;
using Csla;
using Csla.Serialization;
namespace Csla.Security
{
/// <summary>
/// Criteria class for passing a
/// username/password pair to a
/// custom identity class.
/// </summary>
[Serializable]
public class UsernameCriteria : CriteriaBase
{
/// <summary>
/// ... | using System;
using Csla;
using Csla.Serialization;
namespace Csla.Security
{
/// <summary>
/// Criteria class for passing a
/// username/password pair to a
/// custom identity class.
/// </summary>
[Serializable]
public class UsernameCriteria : CriteriaBase
{
/// <summary>
/// ... |
Use AutoFixture for injecting argument string array | using AppHarbor.Commands;
using Moq;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.AutoMoq;
using Ploeh.AutoFixture.Xunit;
using Xunit.Extensions;
namespace AppHarbor.Tests.Commands
{
public class CreateCommandTest
{
private readonly IFixture _fixture;
public CreateCommandTest()
{
_fixture = new Fixtur... | using System.Linq;
using AppHarbor.Commands;
using Moq;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.AutoMoq;
using Ploeh.AutoFixture.Xunit;
using Xunit.Extensions;
namespace AppHarbor.Tests.Commands
{
public class CreateCommandTest
{
private readonly IFixture _fixture;
public CreateCommandTest()
{
_f... |
Return the highest supported version except where equal to the client version. | using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using Version = Msg.Core.Versioning;
namespace Msg.Core.Versioning
{
public static class VersionNegotiator
{
[System.Obsolete("This method is deprecated us VersionNegotiator.Select instead.")]
public static asyn... | using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using Version = Msg.Core.Versioning;
namespace Msg.Core.Versioning
{
public static class VersionNegotiator
{
[System.Obsolete("This method is deprecated us VersionNegotiator.Select instead.")]
public static asyn... |
Remove unused usings from a newly added file | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAna... | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.CodeAnalysis.PooledObjects;
namespace Microsoft.CodeAnalysis.CSharp.Simplification
{
/// <summ... |
Mark as obsolete for future removal | using System;
using System.Diagnostics;
using JetBrains.Annotations;
namespace EnsureThat
{
public static class Ensure
{
public static bool IsActive { get; private set; } = true;
public static void Off() => IsActive = false;
public static void On() => IsActive = true;
[Debugg... | using System;
using System.Diagnostics;
using JetBrains.Annotations;
namespace EnsureThat
{
public static class Ensure
{
public static bool IsActive { get; private set; } = true;
public static void Off() => IsActive = false;
public static void On() => IsActive = true;
[Debugg... |
Change version due to API Change | using System.Reflection;
[assembly: AssemblyTitle("Garlic")]
[assembly: AssemblyDescription("Google Analytics Client for .Net")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCompany("Dusty Burwell")]
[assembly: AssemblyProduct("Garlic Google Analytics Client")]
[assembly: AssemblyCopyright("Copyrig... | using System.Reflection;
[assembly: AssemblyTitle("Garlic")]
[assembly: AssemblyDescription("Google Analytics Client for .Net")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCompany("Dusty Burwell")]
[assembly: AssemblyProduct("Garlic Google Analytics Client")]
[assembly: AssemblyCopyright("Copyrig... |
Fix Coaction() for tau action | using System;
using System.Collections.Generic;
using System.Linq;
namespace CIV.Processes
{
public static class Extensions
{
/// <summary>
/// Coaction of the specified action.
/// </summary>
/// <returns>The coaction: 'action if action does not start
/// with ' and vice versa</returns>
/// <param... | using System;
using System.Collections.Generic;
using System.Linq;
namespace CIV.Processes
{
public static class Extensions
{
/// <summary>
/// Coaction of the specified action.
/// </summary>
/// <returns>The coaction: 'action if action does not start
/// with ' and vice versa</returns>
/// <param... |
Make sure code is jitted before perf test | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace Perf.DiffPlex
{
public class PerfTester
{
public void Run(Action action)
{
const double count = 5;
var times = new List<double>();
var timer =... | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace Perf.DiffPlex
{
public class PerfTester
{
public void Run(Action action)
{
const double count = 5;
var times = new List<double>();
var timer =... |
Make tests use console log handler | using NUnit.Framework;
using QuantConnect.Logging;
[SetUpFixture]
public class AssemblyInitialize
{
[SetUp]
public void SetLogHandler()
{
// save output to file as well
Log.LogHandler = new CompositeLogHandler();
}
}
| using NUnit.Framework;
using QuantConnect.Logging;
[SetUpFixture]
public class AssemblyInitialize
{
[SetUp]
public void SetLogHandler()
{
// save output to file as well
Log.LogHandler = new ConsoleLogHandler();
}
}
|
Fix for automapper castle component | namespace Hiperion.Infrastructure.Ioc
{
#region References
using System.Configuration;
using System.Web.Http;
using AutoMapper;
using Automapper;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using EF;
... | namespace Hiperion.Infrastructure.Ioc
{
#region References
using System.Configuration;
using System.Web.Http;
using AutoMapper;
using Automapper;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using EF;
... |
Make ConvertPath to allow this functionality to be modified to allow for slashes in path | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace SoapCore
{
/// <summary>
/// This tuner truncates the incoming http request to the last path-part. ie. /DynamicPath/Service.svc becomes /Service.svc
/// Regi... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace SoapCore
{
/// <summary>
/// This tuner truncates the incoming http request to the last path-part. ie. /DynamicPath/Service.svc becomes /Service.svc
/// Regi... |
Revert "Revert "Modified the Import class"" | namespace GiveCRM.ImportExport
{
public class ExcelImport
{
}
} | using NPOI;
namespace GiveCRM.ImportExport
{
public class ExcelImport
{
}
} |
Allow settings custom command line params. | using System;
using DSL;
namespace Revenj.Http
{
static class Program
{
static void Main(string[] args)
{
var server = Platform.Start<HttpServer>();
Console.WriteLine("Starting server");
server.Run();
}
}
}
| using System;
using System.Configuration;
using DSL;
namespace Revenj.Http
{
static class Program
{
static void Main(string[] args)
{
foreach (var arg in args)
{
var i = arg.IndexOf('=');
if (i != -1)
{
var name = arg.Substring(0, i);
var value = arg.Substring(i + 1);... |
Check that a particular replacement is working well | // <copyright file="ValSimpleTest.cs" company="Microsoft">Copyright Microsoft 2010</copyright>
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace LINQToTTreeLib.Variables
{
/// <summary>This class contains parameterized unit tests for ValSimple</summary>
[TestClass]
public... | // <copyright file="ValSimpleTest.cs" company="Microsoft">Copyright Microsoft 2010</copyright>
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace LINQToTTreeLib.Variables
{
/// <summary>This class contains parameterized unit tests for ValSimple</summary>
[TestClass]
public... |
Add extension to decode a string from an ArraySegment<byte>. | using System;
namespace MySql.Data
{
internal static class Utility
{
public static void Dispose<T>(ref T disposable)
where T : class, IDisposable
{
if (disposable != null)
{
disposable.Dispose();
disposable = null;
}
}
}
}
| using System;
using System.Text;
namespace MySql.Data
{
internal static class Utility
{
public static void Dispose<T>(ref T disposable)
where T : class, IDisposable
{
if (disposable != null)
{
disposable.Dispose();
disposable = null;
}
}
public static string GetString(this Encoding enco... |
Fix IRC Manager disconnect command | using System;
using System.Collections;
/// <summary>Commands for the IRC Connection Holdable.</summary>
public static class IRCConnectionManagerCommands
{
[Command(@"disconnect")]
public static IEnumerator Disconnect(IRCConnectionManagerHoldable holdable)
{
bool allowed = false;
yield return null;
yield ret... | using System;
using System.Collections;
/// <summary>Commands for the IRC Connection Holdable.</summary>
public static class IRCConnectionManagerCommands
{
[Command(@"disconnect")]
public static IEnumerator Disconnect(TwitchHoldable holdable, string user, bool isWhisper) =>
holdable.RespondToCommand(user, string... |
Remove redundant AddOptions which is now a default hosting service | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Text.Encodings.Web;
using Microsoft.AspNet.Routing;
using Microsoft.AspNet.Routing.Internal;
using Microsoft.Extensions.Depen... | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Text.Encodings.Web;
using Microsoft.AspNet.Routing;
using Microsoft.AspNet.Routing.Internal;
using Microsoft.Extensions.Depen... |
Fix timeline tick display test making two instances of the component | // 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 NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Screens.Edit.Compose.Components;
using osu.Game.Screens.Edit.Compose.C... | // 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 NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Screens.Edit.Compose.Components;
using osuTK;
namespace osu.Game.Test... |
Simplify the editor to work for any object | using System.Linq;
using UnityEngine;
using UnityEditor;
namespace EasyButtons
{
/// <summary>
/// Base class for making EasyButtons work
/// </summary>
public abstract class ButtonEditorBase : Editor
{
public override void OnInspectorGUI()
{
// Loop through all methods... | using System.Linq;
using UnityEngine;
using UnityEditor;
namespace EasyButtons
{
/// <summary>
/// Custom inspector for Object including derived classes.
/// </summary>
[CustomEditor(typeof(Object), true)]
public class ObjectEditor : Editor
{
public override void OnInspectorGUI()
... |
Fix error message building when no specific errors defined | using System;
using System.Collections.Generic;
using System.Linq;
namespace SFA.DAS.EmployerUsers.Application
{
public class InvalidRequestException : Exception
{
public Dictionary<string,string> ErrorMessages { get; private set; }
public InvalidRequestException(Dictionary<string,string> er... | using System;
using System.Collections.Generic;
using System.Linq;
namespace SFA.DAS.EmployerUsers.Application
{
public class InvalidRequestException : Exception
{
public Dictionary<string, string> ErrorMessages { get; private set; }
public InvalidRequestException(Dictionary<string, string> e... |
Change HTML table header generation to use the correct th HTML tag. | using System.Text;
namespace SnippetsToMarkdown.Commands
{
class WriteHeaderHtmlCommand : ICommand
{
private string directory;
public WriteHeaderHtmlCommand(string directory)
{
this.directory = directory;
}
public void WriteToOutput(StringBuild... | using System.Text;
namespace SnippetsToMarkdown.Commands
{
class WriteHeaderHtmlCommand : ICommand
{
private string directory;
public WriteHeaderHtmlCommand(string directory)
{
this.directory = directory;
}
public void WriteToOutput(StringBuild... |
Use random app name to avoid 409 conflict error | using System.Linq;
using Kudu.Core.Deployment;
using Kudu.FunctionalTests.Infrastructure;
using Kudu.TestHarness;
using Xunit;
namespace Kudu.FunctionalTests
{
public class GitStabilityTests
{
[Fact]
public void NSimpleDeployments()
{
string repositoryName = "HelloKudu";
... | using System.Linq;
using Kudu.Core.Deployment;
using Kudu.FunctionalTests.Infrastructure;
using Kudu.TestHarness;
using Xunit;
namespace Kudu.FunctionalTests
{
public class GitStabilityTests
{
[Fact]
public void NSimpleDeployments()
{
string repositoryName = "HelloKudu";
... |
Replace recursive file enumeration with a stack based approach | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Framework.Logging;
namespace OmniSharp.Utilities
{
public class DirectoryEnumerator
{
private ILogger _logger;
public DirectoryEnumerator(ILoggerFactory loggerFactory)
{
_lo... | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Framework.Logging;
namespace OmniSharp.Utilities
{
public class DirectoryEnumerator
{
private ILogger _logger;
public DirectoryEnumerator(ILoggerFactory loggerFactory)
{
_lo... |
Allow multiple rule instances in autofac activator | using System;
using System.Collections.Generic;
using Autofac;
using NRules.Fluent;
using NRules.Fluent.Dsl;
namespace NRules.Integration.Autofac
{
/// <summary>
/// Rule activator that uses Autofac DI container.
/// </summary>
public class AutofacRuleActivator : IRuleActivator
{
private r... | using System;
using System.Collections.Generic;
using Autofac;
using NRules.Fluent;
using NRules.Fluent.Dsl;
namespace NRules.Integration.Autofac
{
/// <summary>
/// Rule activator that uses Autofac DI container.
/// </summary>
public class AutofacRuleActivator : IRuleActivator
{
private r... |
Use nameof operator instead of magic string. | using System;
using System.Collections.Generic;
using System.IO;
namespace DupImage
{
/// <summary>
/// Structure for containing image information and hash values.
/// </summary>
public class ImageStruct
{
/// <summary>
/// Construct a new ImageStruct from FileInfo.
/// </s... | using System;
using System.Collections.Generic;
using System.IO;
namespace DupImage
{
/// <summary>
/// Structure for containing image information and hash values.
/// </summary>
public class ImageStruct
{
/// <summary>
/// Construct a new ImageStruct from FileInfo.
/// </s... |
Fix that check not null message didn't contain argument name | namespace Nett.Extensions
{
using System;
internal static class GenericExtensions
{
public static T CheckNotNull<T>(this T toCheck, string argName)
where T : class
{
if (toCheck == null) { throw new ArgumentNullException(nameof(argName)); }
return toChe... | namespace Nett.Extensions
{
using System;
internal static class GenericExtensions
{
public static T CheckNotNull<T>(this T toCheck, string argName)
where T : class
{
if (toCheck == null) { throw new ArgumentNullException(argName); }
return toCheck;
... |
Fix to the browse images coming up 404. | using ImageResizer.Plugins;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ImageResizer.Sitecore.Plugin
{
public class SitecoreVirtualImageProviderPlugin : IPlugin, IVirtualImageProvider
{
... | using ImageResizer.Plugins;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ImageResizer.Sitecore.Plugin
{
public class SitecoreVirtualImageProviderPlugin : IPlugin, IVirtualImageProvider
{
... |
Use type to find E I | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MemberProperty : MonoBehaviour {
public float E, I, length;
public int number;
}
| using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MemberProperty : MonoBehaviour {
public float length;
public int number,type;
float[] E = { 1 };
float[] I = { 1 };
public float GetI()
{
return I[type];
}
public float GetE()
{
... |
Add remind_on to insert statement | using System;
using Simpler;
using Schedules.API.Models;
using Dapper;
using System.Linq;
namespace Schedules.API.Tasks
{
public class CreateReminder: InOutTask<CreateReminder.Input, CreateReminder.Output>
{
public FetchReminderType FetchReminderType { get; set; }
public class Input
{
public Re... | using System;
using Simpler;
using Schedules.API.Models;
using Dapper;
using System.Linq;
namespace Schedules.API.Tasks
{
public class CreateReminder: InOutTask<CreateReminder.Input, CreateReminder.Output>
{
public FetchReminderType FetchReminderType { get; set; }
public class Input
{
public Re... |
Add ToString method to empty object | // Copyright (c) Alexandre Mutel. All rights reserved.
// Licensed under the BSD-Clause 2 license.
// See license.txt file in the project root for full license information.
using System.Collections.Generic;
using Scriban.Parsing;
using Scriban.Syntax;
namespace Scriban.Runtime
{
/// <summary>
/// The empty ob... | // Copyright (c) Alexandre Mutel. All rights reserved.
// Licensed under the BSD-Clause 2 license.
// See license.txt file in the project root for full license information.
using System.Collections.Generic;
using System.Diagnostics;
using Scriban.Parsing;
using Scriban.Syntax;
namespace Scriban.Runtime
{
/// <sum... |
Add String Argument Extension method | using System;
namespace THNETII.Common
{
public static class ArgumentExtensions
{
public static T ThrowIfNull<T>(this T instance, string name) where T : class
=> instance ?? throw new ArgumentNullException(name);
}
}
| using System;
namespace THNETII.Common
{
public static class ArgumentExtensions
{
public static T ThrowIfNull<T>(this T instance, string name) where T : class
=> instance ?? throw new ArgumentNullException(name);
/// <exception cref="ArgumentException" />
/// <exception cr... |
Remove unnecessary, and wrong, check | using System;
public static class ExtensionMethods
{
public static string Str(this TimeSpan duration)
{
var hours = Math.Abs((int)duration.TotalHours);
var minutes = Math.Abs(duration.Minutes);
int seconds = Math.Abs(duration.Seconds);
if (Math.Abs(duration.Milliseconds) >= 50... | using System;
public static class ExtensionMethods
{
public static string Str(this TimeSpan duration)
{
var hours = Math.Abs((int)duration.TotalHours);
var minutes = Math.Abs(duration.Minutes);
int seconds = Math.Abs(duration.Seconds);
if (duration >= TimeSpan.Zero)
... |
Add comments and debugger display | using System.Collections.Generic;
namespace Octokit
{
public class OauthToken
{
public string TokenType { get; set; }
public string AccessToken { get; set; }
public IReadOnlyCollection<string> Scope { get; set; }
}
}
| using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class OauthToken
{
/// <summary>
/// The type of OAuth token
/// </summary>
public string TokenType { g... |
Fix data bar for min/max | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Spreadsheet;
namespace ClosedXML.Excel
{
internal class XLCFDataBarConverter:IXLCFConverter
{
public ConditionalFormattingRule Convert(IXLConditionalFormat cf... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Spreadsheet;
namespace ClosedXML.Excel
{
internal class XLCFDataBarConverter : IXLCFConverter
{
public ConditionalFormattingRule Convert(IXLConditionalFormat ... |
Remove redundant code. bugid: 912 | @using Csla.Web.Mvc
@using ProjectTracker.Library
@model IEnumerable<ProjectTracker.Library.ProjectInfo>
@{
ViewBag.Title = "Project list";
}
<h2>@ViewBag.Message</h2>
<p>
@Html.HasPermission(Csla.Rules.AuthorizationActions.CreateObject, typeof(ProjectEdit), Html.ActionLink("Create New", ... | @using Csla.Web.Mvc
@using ProjectTracker.Library
@model IEnumerable<ProjectTracker.Library.ProjectInfo>
@{
ViewBag.Title = "Project list";
}
<h2>@ViewBag.Message</h2>
<p>
@Html.HasPermission(Csla.Rules.AuthorizationActions.CreateObject, typeof(ProjectEdit), Html.ActionLink("Create New", ... |
Fix newConnection window is sometimes not displayed | using System;
using System.Windows;
namespace CupCake.Client
{
public static class Dispatch
{
public static void Invoke(Action callback)
{
Application.Current.Dispatcher.BeginInvoke(callback);
}
}
} | using System;
using System.Windows;
namespace CupCake.Client
{
public static class Dispatch
{
public static void Invoke(Action callback)
{
Application.Current.Dispatcher.Invoke(callback);
}
}
} |
Make constructor of abstract class protected | using System.Linq;
using PicklesDoc.Pickles.ObjectModel;
namespace PicklesDoc.Pickles.TestFrameworks.XUnit
{
public abstract class XUnitResultsBase<TSingleResult> : MultipleTestResults
where TSingleResult : XUnitSingleResultsBase
{
public XUnitResultsBase(IConfiguration configuration, ISingleR... | using System.Linq;
using PicklesDoc.Pickles.ObjectModel;
namespace PicklesDoc.Pickles.TestFrameworks.XUnit
{
public abstract class XUnitResultsBase<TSingleResult> : MultipleTestResults
where TSingleResult : XUnitSingleResultsBase
{
protected XUnitResultsBase(IConfiguration configuration, ISing... |
Allow audio device selection in settings | //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Overlays.Options.Sections.Audio
{
public class AudioDevicesOptions : OptionsSubsection
{
protected override string Header => "Devices";... | //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;
namespace osu.Game.Ov... |
Fix linking of follow camera to hero | using UnityEngine;
using System.Collections;
public class FollowCamera : MonoBehaviour {
public GameObject global;
public GameObject objectToFollow;
// Use this for initialization
void Start () {
if (global == null)
{
return;
}
Global g = global.GetComponent<Global>();
if ... | using UnityEngine;
using System.Collections;
public class FollowCamera : MonoBehaviour {
public GameObject global;
public GameObject objectToFollow;
// Use this for initialization
void Start () {
if (global == null)
{
return;
}
Global g = global.GetComponent<Global>();
if ... |
Fix toolbar music button tooltip overflowing off-screen | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Toolbar
{
public class ToolbarMusic... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Toolbar
{... |
Handle callback directly if resolve bundle is empty | namespace Miruken.Callback
{
using System;
public class Resolving : Inquiry, IResolveCallback
{
private bool _handled;
public Resolving(object key, object callback)
: base(key, true)
{
if (callback == null)
throw new ArgumentNullException(na... | namespace Miruken.Callback
{
using System;
public class Resolving : Inquiry, IResolveCallback
{
private bool _handled;
public Resolving(object key, object callback)
: base(key, true)
{
if (callback == null)
throw new ArgumentNullException(na... |
Add positions to db on startup | using System;
using System.Linq;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Diploms.Core;
using System.Collections.Generic;
namespace Diploms.DataLayer
{
public static class DiplomContentSystemExtensions
{
public static void EnsureSeedData(... | using System;
using System.Linq;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Diploms.Core;
using System.Collections.Generic;
namespace Diploms.DataLayer
{
public static class DiplomContentSystemExtensions
{
public static void EnsureSeedData(... |
Remove contract count check for protobuf | #region (c) 2010-2011 Lokad CQRS - New BSD License
// Copyright (c) Lokad SAS 2010-2011 (http://www.lokad.com)
// This code is released as Open Source under the terms of the New BSD Licence
// Homepage: http://lokad.github.com/lokad-cqrs/
#endregion
using System;
using System.Collections.Generic;
using ProtoBuf.Me... | #region (c) 2010-2011 Lokad CQRS - New BSD License
// Copyright (c) Lokad SAS 2010-2011 (http://www.lokad.com)
// This code is released as Open Source under the terms of the New BSD Licence
// Homepage: http://lokad.github.com/lokad-cqrs/
#endregion
using System;
using System.Collections.Generic;
using ProtoBuf.Me... |
Remove private qualifier on version regexes | using NuGet;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Squirrel
{
public static class VersionExtensions
{
private static readonly Regex _suffixRegex = new Regex(@"(-full|-delta)?\.nupkg$", Rege... | using NuGet;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Squirrel
{
public static class VersionExtensions
{
static readonly Regex _suffixRegex = new Regex(@"(-full|-delta)?\.nupkg$", RegexOptions... |
Use AppContext.BaseDirectory for application path | using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Microsoft.Win32;
namespace EasySnippets.Utils
{
[SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Windows only app")]
public class StartUpManager
{
public static void A... | using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Microsoft.Win32;
namespace EasySnippets.Utils
{
[SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Windows only app")]
public class StartUpManager
{
public static void A... |
Remove confirmation for exit with no verification | using System;
using Abp;
using Abp.Collections.Extensions;
using Abp.Dependency;
using Castle.Facilities.Logging;
using Abp.Castle.Logging.Log4Net;
namespace AbpCompanyName.AbpProjectName.Migrator
{
public class Program
{
private static bool _skipConnVerification = false;
public static void M... | using System;
using Abp;
using Abp.Collections.Extensions;
using Abp.Dependency;
using Castle.Facilities.Logging;
using Abp.Castle.Logging.Log4Net;
namespace AbpCompanyName.AbpProjectName.Migrator
{
public class Program
{
private static bool _skipConnVerification = false;
public static void M... |
Update file version to 3.2.1.0 | using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
internal class ProductInformation
{
public const string Author = "amay077";
public const string Name = "Xamarin.Forms.GoogleMaps";
public const string Copyright = "Copyright © amay077. 2016 - 2019";
public const string... | using System;
namespace Xamarin.Forms.GoogleMaps.Internals
{
internal class ProductInformation
{
public const string Author = "amay077";
public const string Name = "Xamarin.Forms.GoogleMaps";
public const string Copyright = "Copyright © amay077. 2016 - 2019";
public const string... |
Replace literals in order of key length, e.g. most-specific first. | namespace StraightSql
{
using Npgsql;
using System;
public class CommandPreparer
: ICommandPreparer
{
public void Prepare(NpgsqlCommand npgsqlCommand, IQuery query)
{
if (npgsqlCommand == null)
throw new ArgumentNullException(nameof(npgsqlCommand));
if (query == null)
throw new ... | namespace StraightSql
{
using Npgsql;
using System;
using System.Linq;
public class CommandPreparer
: ICommandPreparer
{
public void Prepare(NpgsqlCommand npgsqlCommand, IQuery query)
{
if (npgsqlCommand == null)
throw new ArgumentNullException(nameof(npgsqlCommand));
i... |
Extend cookie timeout to 1 day | [assembly: Microsoft.Owin.OwinStartup(typeof(BatteryCommander.Web.Startup))]
namespace BatteryCommander.Web
{
using Microsoft.AspNet.Identity;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;
using System;
public partial class Startup
{
public void Configur... | [assembly: Microsoft.Owin.OwinStartup(typeof(BatteryCommander.Web.Startup))]
namespace BatteryCommander.Web
{
using Microsoft.AspNet.Identity;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;
using System;
public partial class Startup
{
public void Configur... |
Adjust max size of contents read from incoming request headers to be 1k | namespace Microsoft.ApplicationInsights.AspNetCore.Common
{
/// <summary>
/// These values are listed to guard against malicious injections by limiting the max size allowed in an HTTP Response.
/// These max limits are intentionally exaggerated to allow for unexpected responses, while still guarding agains... | namespace Microsoft.ApplicationInsights.AspNetCore.Common
{
/// <summary>
/// These values are listed to guard against malicious injections by limiting the max size allowed in an HTTP Response.
/// These max limits are intentionally exaggerated to allow for unexpected responses, while still guarding agains... |
Fix "Sequence contains no elements" error. | using System;
using System.Collections.Concurrent;
using System.Linq;
using ARSoft.Tools.Net.Dns;
namespace DNSAgent
{
internal class DnsCacheMessageEntry
{
public DnsCacheMessageEntry(DnsMessage message, int timeToLive)
{
Message = message;
timeToLive =
... | using System;
using System.Collections.Concurrent;
using System.Linq;
using ARSoft.Tools.Net.Dns;
namespace DNSAgent
{
internal class DnsCacheMessageEntry
{
public DnsCacheMessageEntry(DnsMessage message, int timeToLive)
{
Message = message;
var records = message.Answer... |
Add xmldoc and TODO comment | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using System;
namespace osu.Framework.Utils
{
public static class ThrowHelper
{
public static void ThrowInvalidOperationException(strin... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using System;
namespace osu.Framework.Utils
{
/// <summary>
/// Helper class for throwing exceptions in isolated methods, for cases where metho... |
Add sumary and remark to class header | using System;
namespace Avalonia.Metadata
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public sealed class XmlnsPrefixAttribute : Attribute
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="xmlNamespace">XML namespce</param>
/// ... | using System;
namespace Avalonia.Metadata
{
/// <summary>
/// Use to predefine the prefix associated to an xml namespace in a xaml file
/// </summary>
/// <remarks>
/// example:
/// [assembly: XmlnsPrefix("https://github.com/avaloniaui", "av")]
/// xaml:
/// xmlns:av="https://github.co... |
Update assembly version to 4.0.0 (+semver: major) | using System.Reflection;
using System.Resources;
[assembly: AssemblyCompany( "Carl Zeiss Innovationszentrum für Messtechnik GmbH" )]
[assembly: AssemblyProduct( "ZEISS PiWeb Api" )]
[assembly: AssemblyCopyright( "Copyright © 2019 Carl Zeiss Innovationszentrum für Messtechnik GmbH" )]
[assembly: AssemblyTrademark... | using System.Reflection;
using System.Resources;
[assembly: AssemblyCompany( "Carl Zeiss Innovationszentrum für Messtechnik GmbH" )]
[assembly: AssemblyProduct( "ZEISS PiWeb Api" )]
[assembly: AssemblyCopyright( "Copyright © 2019 Carl Zeiss Innovationszentrum für Messtechnik GmbH" )]
[assembly: AssemblyTrademark... |
Allow specifying metadata for skip reason. | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Xunit.Sdk;
namespace Xunit
{
/// <summary>
/// Apply this attribute to your test metho... | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Xunit.Sdk;
namespace Xunit
{
/// <summary>
/// Apply this attribute to your test metho... |
Fix link open in browsers | using UnityEngine;
public class LinkButton : MonoBehaviour {
public void OpenUrl (string url) {
Application.OpenURL(url);
}
}
| using UnityEngine;
public class LinkButton : MonoBehaviour {
public void OpenUrl (string url) {
if(Application.platform == RuntimePlatform.WebGLPlayer) {
Application.ExternalEval("window.open(\"" + url + "\",\"_blank\")");
} else {
Application.OpenURL(url);
}
}
}
|
Fix crash issue when user didn't install python. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Python.Runtime;
using Wox.Plugin;
namespace Wox.PluginLoader
{
public class PythonPluginLoader : BasePluginLoader
{
public override List<PluginPair> LoadPlugin()
{
List<PluginPair> plug... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Python.Runtime;
using Wox.Plugin;
using Wox.Helper;
namespace Wox.PluginLoader
{
public class PythonPluginLoader : BasePluginLoader
{
public override List<PluginPair> LoadPlugin()
{
if ... |
Fix test failure After consulting with search team, we can get results needed for this test by searching for "rock,pop" not "rock,pop,2000s" | using System.Linq;
using NUnit.Framework;
using SevenDigital.Api.Schema;
using SevenDigital.Api.Schema.Tags;
namespace SevenDigital.Api.Wrapper.Integration.Tests.EndpointTests.TagsEndpoint
{
[TestFixture]
public class ArtistByTagTopTests
{
[Test]
public void Can_hit_endpoint()
{
ArtistByTagTop tags = Api... | using System.Linq;
using NUnit.Framework;
using SevenDigital.Api.Schema;
using SevenDigital.Api.Schema.Tags;
namespace SevenDigital.Api.Wrapper.Integration.Tests.EndpointTests.TagsEndpoint
{
[TestFixture]
public class ArtistByTagTopTests
{
private const string Tags = "rock,pop";
[Test]
public v... |
Add filter property to most anticipated movies request. | namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common
{
using Base.Get;
using Objects.Basic;
using Objects.Get.Movies.Common;
internal class TraktMoviesMostAnticipatedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostAnticipatedMovie>, TraktMostAnticipatedMovie>
{
internal... | namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common
{
using Base;
using Base.Get;
using Objects.Basic;
using Objects.Get.Movies.Common;
internal class TraktMoviesMostAnticipatedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostAnticipatedMovie>, TraktMostAnticipatedMovie>
{
... |
Add DiscogRelease properties: lowest_price and num_for_sale | using System;
namespace DiscogsClient.Data.Result
{
public class DiscogsRelease : DiscogsReleaseBase
{
public DiscogsReleaseArtist[] extraartists { get; set; }
public DiscogsReleaseLabel[] labels { get; set; }
public DiscogsReleaseLabel[] companies { get; set; }
public DiscogsF... | using System;
namespace DiscogsClient.Data.Result
{
public class DiscogsRelease : DiscogsReleaseBase
{
public DiscogsReleaseArtist[] extraartists { get; set; }
public DiscogsReleaseLabel[] labels { get; set; }
public DiscogsReleaseLabel[] companies { get; set; }
public DiscogsF... |
Remove Culture since that causes issues for Workbooks | using System.Reflection;
[assembly: AssemblyTitle("Logo en español para Xamarin Workbooks")]
[assembly: AssemblyDescription("Aprende a programar con Xamarin Workbooks, C# y la legendaria Tortuga!")]
[assembly: AssemblyCulture("es")]
// NuGet package metadata
[assembly: AssemblyMetadata("id", "Logo.es")]
[assembly: A... | using System.Reflection;
[assembly: AssemblyTitle("Logo en español para Xamarin Workbooks")]
[assembly: AssemblyDescription("Aprende a programar con Xamarin Workbooks, C# y la legendaria Tortuga!")]
// NuGet package metadata
[assembly: AssemblyMetadata("id", "Logo.es")]
[assembly: AssemblyMetadata("authors", "Daniel... |
Update assembly version to 2.2 | using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Outercurve Foundation")]
[assembly: AssemblyProduct("NuGet")]
[assembly: AssemblyCopyright("\x00a9 Outercurve Foundation. All rights reserved.")]
[assembly: AssemblyConfiguration("")]
[assembly: A... | using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Outercurve Foundation")]
[assembly: AssemblyProduct("NuGet")]
[assembly: AssemblyCopyright("\x00a9 Outercurve Foundation. All rights reserved.")]
[assembly: AssemblyConfiguration("")]
[assembly: A... |
Update account balance check, account can have zero balance and still be valid. | using NUnit.Framework;
namespace InterFAX.Api.Test.Integration
{
[TestFixture]
public class AccountTests
{
[Test]
public void can_get_balance()
{
var interfax = new FaxClient();
var actual = interfax.Account.GetBalance().Result;
Assert.IsTrue(actu... | using NUnit.Framework;
namespace InterFAX.Api.Test.Integration
{
[TestFixture]
public class AccountTests
{
[Test]
public void can_get_balance()
{
var interfax = new FaxClient();
var actual = interfax.Account.GetBalance().Result;
//Assert.IsTrue(ac... |
Add additional code gen smoke test cases | using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using IntelliTect.Coalesce;
using IntelliTect.Coalesce.DataAnnotations;
using IntelliTect.Coalesce.Tests.TargetClasses.TestDbContext;
#nullable enable
namespace IntelliTect.Coalesce.Tests.Targe... | using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using IntelliTect.Coalesce;
using IntelliTect.Coalesce.DataAnnotations;
using IntelliTect.Coalesce.Tests.TargetClasses.TestDbContext;
#nullable enable
namespace IntelliTect.Coalesce.Tests.Targe... |
Update log controller for ow-server-enet | using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace HardwareSensorSystem.SensorTechnology.Controllers
{
public class OwServerEnet2LogController... | using HardwareSensorSystem.SensorTechnology.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Hardwa... |
Replace more hard-coded directory separators with "Path.DirectorySeparatorChar" | /*
* Copyright 2012-2015 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
*
* 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 Lice... | /*
* Copyright 2012-2015 Aerospike, Inc.
*
* Portions may be licensed to Aerospike, Inc. under one or more contributor
* license agreements.
*
* 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 Lice... |
Add missing field to config | using System.Collections.Generic;
using Newtonsoft.Json;
namespace TMDbLib.Objects.General
{
public class ConfigImageTypes
{
[JsonProperty("base_url")]
public string BaseUrl { get; set; }
[JsonProperty("secure_base_url")]
public string SecureBaseUrl { get; set; }
[Jso... | using System.Collections.Generic;
using Newtonsoft.Json;
namespace TMDbLib.Objects.General
{
public class ConfigImageTypes
{
[JsonProperty("base_url")]
public string BaseUrl { get; set; }
[JsonProperty("secure_base_url")]
public string SecureBaseUrl { get; set; }
[Jso... |
Make a picture unque for every next level | using System;
using System.Collections.Generic;
namespace MonsterClicker
{
using Interfaces;
using System.Numerics;
using System.Windows.Forms;
public class Monster : IMonster
{
private BigInteger health;
private static BigInteger startHealth = 10;
private BigIn... | using System;
using System.Collections.Generic;
namespace MonsterClicker
{
using Interfaces;
using System.Numerics;
using System.Windows.Forms;
public class Monster : IMonster
{
private BigInteger health;
private static BigInteger startHealth = 10;
private BigIn... |
Allow to run build even if git repo informations are not available | #tool "nuget:?package=GitVersion.CommandLine"
#addin "Cake.Yaml"
public class ContextInfo
{
public string NugetVersion { get; set; }
public string AssemblyVersion { get; set; }
public GitVersion Git { get; set; }
public string BuildVersion
{
get { return NugetVersion + "-" + Git.Sha; }
... | #tool "nuget:?package=GitVersion.CommandLine"
#addin "Cake.Yaml"
public class ContextInfo
{
public string NugetVersion { get; set; }
public string AssemblyVersion { get; set; }
public GitVersion Git { get; set; }
public string BuildVersion
{
get { return NugetVersion + "-" + Git.Sha; }
... |
Fix Mono 5.0 run under Unity 5.5+ | using System.Diagnostics;
using System.IO;
internal class Mono50Compiler : Compiler
{
public Mono50Compiler(Logger logger, string compilerPath) : base(logger, compilerPath, null) { }
public override string Name => "Mono C# 5.0";
protected override Process CreateCompilerProcess(Platform platform, string monoProfil... | using System.Diagnostics;
using System.IO;
using System.Linq;
internal class Mono50Compiler : Compiler
{
public Mono50Compiler(Logger logger, string compilerPath) : base(logger, compilerPath, null) { }
public override string Name => "Mono C# 5.0";
protected override Process CreateCompilerProcess(Platform platform... |
Fix for email obfuscator of Cloudflare | @model ElmahDashboardHostingApp.Areas.MvcElmahDashboard.Models.Logs.ItemsModel
@{
Layout = null;
var dateFormat = System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern.Replace("yyyy", "yy").ToUpperInvariant();
}
@foreach (var item in Model.Items)
{
<a id="i@(item.Sequence)" c... | @model ElmahDashboardHostingApp.Areas.MvcElmahDashboard.Models.Logs.ItemsModel
@{
Layout = null;
var dateFormat = System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern.Replace("yyyy", "yy").ToUpperInvariant();
}
@* Disable Email obfuscation by Cloudflare (which is not compatible ... |
Include a pepper in the hashing algorithm. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raven.Client.Contrib.MVC.Auth.Interfaces;
namespace Raven.Client.Contrib.MVC.Auth.Default
{
internal class BCryptSecurityEncoder : ISecurityEncoder
{
/// <summary>
/// Generates a unique token.
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raven.Client.Contrib.MVC.Auth.Interfaces;
namespace Raven.Client.Contrib.MVC.Auth.Default
{
internal class BCryptSecurityEncoder : ISecurityEncoder
{
/// <summary>
/// Generates a unique token.
... |
Decrease allocations in List Serializer | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Manatee.Json.Serialization.Internal.AutoRegistration
{
internal class ListSerializationDelegateProvider : SerializationDelegateProviderBase
{
public override bool CanHandle(Type type)
{
return type... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Manatee.Json.Serialization.Internal.AutoRegistration
{
internal class ListSerializationDelegateProvider : SerializationDelegateProviderBase
{
public override bool CanHandle(Type type)
{
return type... |
Add recently used items data | namespace MyStudio.ViewModels
{
using Catel;
using Catel.MVVM;
using MyStudio.Models;
using MyStudio.Services;
public class RibbonViewModel : ViewModelBase
{
private StudioStateModel model;
private ICommandsService commandsService;
public RibbonViewModel(StudioStateM... | namespace MyStudio.ViewModels
{
using System.Collections.Generic;
using Catel;
using Catel.MVVM;
using MyStudio.Models;
using MyStudio.Services;
using Orchestra.Models;
using Orchestra.Services;
public class RibbonViewModel : ViewModelBase
{
private StudioStateModel mode... |
Fix displayed version in built-in version command | using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using Spectre.Console;
namespace Spectre.Cli.Internal
{
[Description("Displays the CLI library version")]
[SuppressMessage("Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Injected")]
internal sealed class Versi... | using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Spectre.Console;
namespace Spectre.Cli.Internal
{
[Description("Displays the CLI library version")]
[SuppressMessage("Performance", "CA1812:AvoidUninstantiatedInternalClass... |
Set the version to 1.3 since we're releasing. | using System.Reflection;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [as... | using System.Reflection;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [as... |
Set StateId in DataTokens so ShieldDecode works because StateId was in the data when ShieldEncode was called | using System.Web.Mvc;
using System.Web.Routing;
namespace Navigation.Mvc
{
public class RouteConfig
{
public static void AddStateRoutes()
{
if (StateInfoConfig.Dialogs == null)
return;
string controller, action;
Route route;
using (RouteTable.Routes.GetWriteLock())
{
foreac... | using System.Web.Mvc;
using System.Web.Routing;
namespace Navigation.Mvc
{
public class RouteConfig
{
public static void AddStateRoutes()
{
if (StateInfoConfig.Dialogs == null)
return;
string controller, action;
Route route;
using (RouteTable.Routes.GetWriteLock())
{
foreac... |
Use auto-version for AssemblyFileVersion in develop builds to facilitate installers | using System.Reflection;
[assembly: AssemblyCompany("Picoe Software Solutions Inc.")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2010-2014 by Curtis Wensley, 2012-2014 by Vivek Jhaveri and contributors")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersi... | using System.Reflection;
[assembly: AssemblyCompany("Picoe Software Solutions Inc.")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2010-2014 by Curtis Wensley, 2012-2014 by Vivek Jhaveri and contributors")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersi... |
Include missing views AddNews and EditNews in project. | using System.Web;
using System.Web.Mvc;
namespace SvNaum.Web
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
//filters.Add(new HandleErrorAttribute());
}
}
}
| using System.Web;
using System.Web.Mvc;
namespace SvNaum.Web
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
|
Add support for building from the command line. | namespace C42A
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Xml.Serialization;
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
... | namespace C42A
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Xml.Serialization;
using C42A.CAB42;
internal static class Program
{
/// <summary>
/// The main entry point for the application.
... |
Update Main to print the graph | using System;
using compiler.frontend;
namespace Program
{
class Program
{
//TODO: adjust main to use the parser when it is complete
static void Main(string[] args)
{
using (Lexer l = new Lexer(@"../../testdata/big.txt"))
{
Token t;
... | using System;
using compiler.frontend;
namespace Program
{
class Program
{
//TODO: adjust main to use the parser when it is complete
static void Main(string[] args)
{
// using (Lexer l = new Lexer(@"../../testdata/big.txt"))
// {
// Token t;
// ... |
Add HttpResponseMessage.EnsureSuccess that include response content in the exception. | namespace System.Net.Http
{
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
static class HttpHelper
{
public static string ValidatePath(string path)
{
if (path == null) throw new ArgumentNullException(nameof(path));
... | namespace System.Net.Http
{
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
static class HttpHelper
{
public static string ValidatePath(string path)
{
if (path == null) throw new ArgumentNullExc... |
Add a footer navigation widget. | using System;
using System.Collections.Generic;
using System.Data;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;
using Orchard.Environment.Extensions;
namespace... | using System;
using System.Collections.Generic;
using System.Data;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.MetaData.Builders;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;
using Orchard.Environment.Extensions;
namespace... |
Tweak to use the fact that we now have nanosecond precision in Duration. | // Copyright 2009 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using System.Reflection;
namespace NodaTime.Benchmarks.Framework
{
/// <summary>
/// The results of running a single test.
/// </su... | // Copyright 2009 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.
using System.Reflection;
namespace NodaTime.Benchmarks.Framework
{
/// <summary>
/// The results of running a single test.
/// </su... |
Make enable method name consistent on TTL field | using Newtonsoft.Json;
namespace Nest
{
[JsonConverter(typeof(ReadAsTypeJsonConverter<TtlField>))]
public interface ITtlField : IFieldMapping
{
[JsonProperty("enabled")]
bool? Enabled { get; set; }
[JsonProperty("default")]
Time Default { get; set; }
}
public class TtlField : ITtlField
{
public bool... | using Newtonsoft.Json;
namespace Nest
{
[JsonConverter(typeof(ReadAsTypeJsonConverter<TtlField>))]
public interface ITtlField : IFieldMapping
{
[JsonProperty("enabled")]
bool? Enabled { get; set; }
[JsonProperty("default")]
Time Default { get; set; }
}
public class TtlField : ITtlField
{
public bool... |
Change test to use new subtract method | using Xunit;
namespace PlayerRank.UnitTests
{
public class PlayerTests
{
[Fact]
public void CanIncreasePlayersScore()
{
var player = new PlayerScore("Foo");
player.AddPoints(new Points(100));
Assert.Equal(new Points(100), player.Points);
... | using Xunit;
namespace PlayerRank.UnitTests
{
public class PlayerTests
{
[Fact]
public void CanIncreasePlayersScore()
{
var player = new PlayerScore("Foo");
player.AddPoints(new Points(100));
Assert.Equal(new Points(100), player.Points);
... |
Stop unwatch from failing on shutdown | using System;
using System.Reactive.Linq;
using static LanguageExt.Prelude;
using static LanguageExt.Process;
namespace LanguageExt
{
internal class ActorDispatchNotExist : IActorDispatch
{
public readonly ProcessId ProcessId;
public ActorDispatchNotExist(ProcessId pid)
{
... | using System;
using System.Reactive.Linq;
using static LanguageExt.Prelude;
using static LanguageExt.Process;
namespace LanguageExt
{
internal class ActorDispatchNotExist : IActorDispatch
{
public readonly ProcessId ProcessId;
public ActorDispatchNotExist(ProcessId pid)
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.