Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Refactor logic for thousands (M, MM, MMM). | using System;
using System.Collections.Generic;
using System.Text;
namespace VasysRomanNumeralsKata
{
public class RomanNumeral
{
private int? _baseTenRepresentation = null;
public RomanNumeral(int baseTenNumber)
{
_baseTenRepresentation = baseTenNumber;
}
... | using System;
using System.Collections.Generic;
using System.Text;
namespace VasysRomanNumeralsKata
{
public class RomanNumeral
{
private int? _baseTenRepresentation = null;
public RomanNumeral(int baseTenNumber)
{
_baseTenRepresentation = baseTenNumber;
}
... |
Add braces for the 'if (name.Substring(... ' | using System;
using System.Reflection;
namespace AssemblyInfo
{
class Program
{
static void Main(string[] args)
{
if (args != null && args.Length > 0)
{
Assembly asm = null;
var name = args[0];
try
{
... | using System;
using System.Reflection;
namespace AssemblyInfo
{
class Program
{
static void Main(string[] args)
{
if (args != null && args.Length > 0)
{
Assembly asm = null;
var name = args[0];
try
{
... |
Print filename with each error | using System;
using System.Linq;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Validation;
// Adapted from
// https://blogs.msdn.microsoft.com/ericwhite/2010/03/04/validate-open-xml-documents-using-the-open-xml-sdk-2-0/
namespace XlsxValidator
{
class MainClass
{
public static void Main(st... | using System;
using System.Linq;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Validation;
// Adapted from
// https://blogs.msdn.microsoft.com/ericwhite/2010/03/04/validate-open-xml-documents-using-the-open-xml-sdk-2-0/
namespace XlsxValidator
{
class MainClass
{
public static void Main(st... |
Add extra check on result type | using Microsoft.AspNetCore.Mvc;
using Xunit;
using DiceApi.WebApi.Controllers;
namespace DiceApi.WebApi.Tests
{
/// <summary>
/// Test class for <see cref="DieController" />.
/// </summary>
public class DieControllerTest
{
/// <summary>
/// Verifies that Get() returns a BadRequest... | using Microsoft.AspNetCore.Mvc;
using Xunit;
using DiceApi.WebApi.Controllers;
namespace DiceApi.WebApi.Tests
{
/// <summary>
/// Test class for <see cref="DieController" />.
/// </summary>
public class DieControllerTest
{
/// <summary>
/// Verifies that Get() returns a BadRequest... |
Update sample app to use newer config API | using System;
using Serilog;
using Serilog.Events;
using SerilogWeb.Classic;
namespace SerilogWeb.Test
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
ApplicationLifecycleModule.FormDataLoggingLevel = LogEventLevel... | using System;
using Serilog;
using Serilog.Events;
using SerilogWeb.Classic;
namespace SerilogWeb.Test
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
// ReSharper disable once PossibleNullReferenceException
... |
Fix path to internal test data location | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BrightstarDB.InternalTests
{
internal static class TestConfiguration
{
public static string DataLocation = "..\\..\\Data\\";
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BrightstarDB.InternalTests
{
internal static class TestConfiguration
{
public static string DataLocation = "..\\..\\..\\Data\\";
}
}
|
Fix cherry pick, spaces not tabs and remove unused delegate | // Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
namespace CefSharp
{
/// <summary>
/// Event arguments to the IsBrowserInitializedChanged event handler.
/// </summary>
public ... | // Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
namespace CefSharp
{
/// <summary>
/// Event arguments to the IsBrowserInitializedChanged event handler.
/// </summary>... |
Fix tableName not correctly saved | using Evolve.Migration;
using System.Collections.Generic;
using Evolve.Utilities;
using Evolve.Connection;
namespace Evolve.Metadata
{
public abstract class MetadataTable : IEvolveMetadata
{
protected IWrappedConnection _wrappedConnection;
public MetadataTable(string schema, string tableName,... | using Evolve.Migration;
using System.Collections.Generic;
using Evolve.Utilities;
using Evolve.Connection;
namespace Evolve.Metadata
{
public abstract class MetadataTable : IEvolveMetadata
{
protected IWrappedConnection _wrappedConnection;
public MetadataTable(string schema, string tableName,... |
Add tests for `kernel32!SetHandleInformation` and `kernel32!GetHandleInformation` | // Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using System.Runtime.InteropServices;
using PInvoke;
using Xunit;
using static PInvoke.Kernel32;
public partial class Kernel32Fa... | // Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using PInvoke;
using Xunit;
using static PInvoke.Kernel32;
public ... |
Add the Material Manager to the context for injection. | using UnityEngine;
using System.Collections;
using strange.extensions.context.impl;
using strange.extensions.context.api;
public class RootContext : MVCSContext, IRootContext
{
public RootContext(MonoBehaviour view) : base(view)
{
}
public RootContext(MonoBehaviour view, ContextStartupFlags flags) ... | using UnityEngine;
using System.Collections;
using strange.extensions.context.impl;
using strange.extensions.context.api;
public class RootContext : MVCSContext, IRootContext
{
public RootContext(MonoBehaviour view) : base(view)
{
}
public RootContext(MonoBehaviour view, ContextStartupFlags flags) ... |
Put body data type check into switch statement | using System;
using System.Net;
using Arango.fastJSON;
namespace Arango.Client.Protocol
{
internal class Response
{
internal int StatusCode { get; set; }
internal WebHeaderCollection Headers { get; set; }
internal string Body { get; set; }
internal DataType DataType ... | using System;
using System.Net;
using Arango.fastJSON;
namespace Arango.Client.Protocol
{
internal class Response
{
internal int StatusCode { get; set; }
internal WebHeaderCollection Headers { get; set; }
internal string Body { get; set; }
internal DataType DataType ... |
Format date with user culture | using AutoMapper;
using SnittListan.Models;
using SnittListan.ViewModels;
namespace SnittListan.Infrastructure
{
public class MatchProfile : Profile
{
protected override void Configure()
{
Mapper.CreateMap<Match, MatchViewModel>()
.ForMember(x => x.Date, o => o.MapFrom(y => y.Date.ToShortDateS... | using System.Threading;
using AutoMapper;
using SnittListan.Models;
using SnittListan.ViewModels;
namespace SnittListan.Infrastructure
{
public class MatchProfile : Profile
{
protected override void Configure()
{
Mapper.CreateMap<Match, MatchViewModel>()
.ForMember(x => x.Date, o => o.MapFrom... |
Revert back to old signature (transpilers get confused with multiple version); add opcode=Call | using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace Harmony
{
public static class Transpilers
{
public static IEnumerable<CodeInstruction> MethodReplacer(this IEnumerable<CodeInstruction> instructions, MethodBase from, MethodBase to, OpCode? callOpcode =... | using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace Harmony
{
public static class Transpilers
{
public static IEnumerable<CodeInstruction> MethodReplacer(this IEnumerable<CodeInstruction> instructions, MethodBase from, MethodBase to)
{
if (from == n... |
Convert Main to be async | // Copyright (c) Martin Costello, 2016. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
namespace MartinCostello.Website
{
using System;
using Extensions;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting... | // Copyright (c) Martin Costello, 2016. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
namespace MartinCostello.Website
{
using System;
using System.Threading.Tasks;
using Extensions;
using Microsoft.AspNetCore;
... |
Fix for saving window state while minimized on closing | using System.Windows;
namespace MilitaryPlanner.Views
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
//InitializeComponent();
}
}
}
| using System.Windows;
namespace MilitaryPlanner.Views
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
//InitializeComponent();
}
protected override void OnClosing(... |
Make precedence test public to be discoverable by test runner. | using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ExprOpt = Microsoft.FSharp.Core.FSharpOption<AST.Expression>;
using Expr = AST.Expression;
namespace ParcelTest
{
[TestClass]
class PrecedenceTests
{
[TestMethod]
public void MultiplicationVsAdditionPrecedenceTest()
... | using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ExprOpt = Microsoft.FSharp.Core.FSharpOption<AST.Expression>;
using Expr = AST.Expression;
namespace ParcelTest
{
[TestClass]
public class PrecedenceTests
{
[TestMethod]
public void MultiplicationVsAdditionPrecedenceTe... |
Fix post filter test after boost/descriptor refactoring | using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Nest.Resolvers.Converters;
using Newtonsoft.Json;
namespace Nest
{
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
[JsonConverter(typeof(ReadAsTypeConverter<MatchAllQuery>))]
public interface IMat... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Nest.Resolvers.Converters;
using Newtonsoft.Json;
namespace Nest
{
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
[JsonConverter(typeof(ReadAsTypeConverter<MatchAllQuery>))]
public interface IMat... |
Disable exception throwing when ModelState is not valid | using Abp.AspNetCore.Mvc.Controllers;
using Abp.IdentityFramework;
using Microsoft.AspNetCore.Identity;
namespace Repairis.Controllers
{
public abstract class RepairisControllerBase: AbpController
{
protected RepairisControllerBase()
{
LocalizationSourceName = RepairisConsts.Localiz... | using Abp.AspNetCore.Mvc.Controllers;
using Abp.IdentityFramework;
using Abp.Runtime.Validation;
using Microsoft.AspNetCore.Identity;
namespace Repairis.Controllers
{
[DisableValidation]
public abstract class RepairisControllerBase: AbpController
{
protected RepairisControllerBase()
{
... |
Use ReactiveUI Events for Loaded and SelectionChanged | using ReactiveUI;
using Windows.UI.Xaml;
namespace Ets.Mobile.Pages.Main
{
public sealed partial class MainPage
{
partial void PartialInitialize()
{
// Ensure to hide the status bar
var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
... | using System;
using Windows.UI.Xaml;
using EventsMixin = Windows.UI.Xaml.Controls.EventsMixin;
namespace Ets.Mobile.Pages.Main
{
public sealed partial class MainPage
{
partial void PartialInitialize()
{
// Ensure to hide the status bar
var statusBar = Windows... |
Add GetTititleEstimate that accepts data from URI. | using System.Collections.Generic;
using System.Web.Http;
using System.Web.Http.Cors;
namespace CORS.Controllers
{
public class ValuesController : ApiController
{
// GET api/values
public IEnumerable<string> Get()
{
return new string[] { "This is a CORS request.",... | using System.Collections.Generic;
using System.Web.Http;
using System.Web.Http.Cors;
namespace CORS.Controllers
{
public class ValuesController : ApiController
{
// GET api/values
public IEnumerable<string> Get()
{
return new string[] { "This is a CORS request.",... |
Stop Equinox complaining about session download patch not being static | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Sandbox.Game.World;
using Torch.Managers.PatchManager;
using Torch.Mod;
using VRage.Game;
namespace Torch.Patches
{
[PatchShim]
internal class SessionDownloadPatch... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Sandbox.Game.World;
using Torch.Managers.PatchManager;
using Torch.Mod;
using VRage.Game;
namespace Torch.Patches
{
[PatchShim]
internal static class SessionDownlo... |
Fix ColoreException test performing wrong comparison. | namespace Colore.Tests
{
using System;
using NUnit.Framework;
[TestFixture]
public class ColoreExceptionTests
{
[Test]
public void ShouldSetMessage()
{
const string Expected = "Test message.";
Assert.AreEqual(Expected, new ColoreException("Test mess... | namespace Colore.Tests
{
using System;
using NUnit.Framework;
[TestFixture]
public class ColoreExceptionTests
{
[Test]
public void ShouldSetMessage()
{
const string Expected = "Test message.";
Assert.AreEqual(Expected, new ColoreException("Test mess... |
Move details to first in list | @model IEnumerable<Soldier>
<h2>Soldiers @Html.ActionLink("Add New", "New", "Soldiers", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th>@Html.DisplayNameFor(_ => _.FirstOrDefault().Rank)</th>
<th>@Html.DisplayNameFor(_ => _.First... | @model IEnumerable<Soldier>
<h2>Soldiers @Html.ActionLink("Add New", "New", "Soldiers", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>@Html.DisplayNameFor(_ => _.FirstOrDefault().Rank)</th>
<th>@Html.Displ... |
Add thread-safe random number instance | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Faker
{
public static class NumberFaker
{
private static Random _random = new Random();
public static int Number()
{
return _random.Next();
}
public static int Number(int maxValue)
{
return _random.Ne... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Faker
{
public static class NumberFaker
{
private static readonly RNGCryptoServiceProvider Global = new RNGCryptoServiceProvider();
[ThreadStatic]
privat... |
Use Url instead of UrlPath. | @model IEnumerable<(GommeHDnetForumAPI.Models.Entities.UserInfo UserInfo, Discord.WebSocket.SocketGuild Guild)>
<h4>Verifizierungen</h4>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.UserInfo.Username)
</th>
<th>
@... | @model IEnumerable<(GommeHDnetForumAPI.Models.Entities.UserInfo UserInfo, Discord.WebSocket.SocketGuild Guild)>
<h4>Verifizierungen</h4>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.UserInfo.Username)
</th>
<th>
@... |
Revert "Changed generic object to a system object" | using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using DomainCore;
using DomainCore.Interfaces;
namespace Application.Interfaces
{
/// <summary>
/// Primary application interface
/// </summary>
public interface IInventoryService
{
/* ReadModel */
// ... | using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using DomainCore;
namespace Application.Interfaces
{
public interface IInventoryService
{
/* ReadModel */
// Get all
Task<IEnumerable<InventoryItemDto>> InventoryAsync();
// Get one
Task<I... |
Add documentation for movie images. | namespace TraktApiSharp.Objects.Get.Movies
{
using Basic;
using Newtonsoft.Json;
public class TraktMovieImages
{
[JsonProperty(PropertyName = "fanart")]
public TraktImageSet FanArt { get; set; }
[JsonProperty(PropertyName = "poster")]
public TraktImageSet Poster { get;... | namespace TraktApiSharp.Objects.Get.Movies
{
using Basic;
using Newtonsoft.Json;
/// <summary>A collection of images and image sets for a Trakt movie.</summary>
public class TraktMovieImages
{
/// <summary>Gets or sets the fan art image set.</summary>
[JsonProperty(PropertyName = "... |
Create the repository only when it's needed for deployment. | using System;
using System.Collections.Generic;
using System.Linq;
using Kudu.Core.SourceControl;
namespace Kudu.Core.Deployment {
public class DeploymentManager : IDeploymentManager {
private readonly IRepository _repository;
private readonly IDeployerFactory _deployerFactory;
public Dep... | using System;
using System.Collections.Generic;
using System.Linq;
using Kudu.Core.SourceControl;
namespace Kudu.Core.Deployment {
public class DeploymentManager : IDeploymentManager {
private readonly IRepositoryManager _repositoryManager;
private readonly IDeployerFactory _deployerFactory;
... |
Sort languages by ascending order. | using System.Collections.ObjectModel;
using CoCo.UI.Data;
namespace CoCo.UI.ViewModels
{
public class OptionViewModel : BaseViewModel
{
public OptionViewModel(Option option, IResetValuesProvider resetValuesProvider)
{
// TODO: it will invoke one event at invocation of clear and by ... | using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Data;
using CoCo.UI.Data;
namespace CoCo.UI.ViewModels
{
public class OptionViewModel : BaseViewModel
{
private readonly ObservableCollection<LanguageViewModel> _languages = new ObservableCollection<LanguageViewMod... |
Add the licence header and remove unused usings | using osu.Framework.Allocation;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Textures;
using System;
using System.Collections.Generic;
using osuTK;
namespace osu.Framework.Tests.Visual.Sprites
{
public class TestSceneTexturedTriangle : FrameworkTestScene
{
... | // 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.Shapes;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Textures;
using osuTK;
namespace osu.Fra... |
Allow skipping publish of package when fixing docs. | public sealed class AppVeyorSettings
{
public bool IsLocal { get; set; }
public bool IsRunningOnAppVeyor { get; set; }
public bool IsPullRequest { get; set; }
public bool IsDevelopBranch { get; set; }
public bool IsMasterBranch { get; set; }
public bool IsTaggedBuild { get; set; }
public boo... | public sealed class AppVeyorSettings
{
public bool IsLocal { get; set; }
public bool IsRunningOnAppVeyor { get; set; }
public bool IsPullRequest { get; set; }
public bool IsDevelopBranch { get; set; }
public bool IsMasterBranch { get; set; }
public bool IsTaggedBuild { get; set; }
public boo... |
Increase the version to 1.1.1. | using System.Reflection;
using System.Resources;
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("BindableApplicati... | using System.Reflection;
using System.Resources;
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("BindableApplicati... |
Change release manager zip file name | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ReleaseManager
{
class Program
{
static void Main(string[] args)
{
tr... | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ReleaseManager
{
class Program
{
static void Main(string[] args)
{
tr... |
Fix nullref when exiting the last screen. | // 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.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Screens;
namespace osu.Game.Graphics.UserInterface
{
/// <summary>
... | // 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.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Screens;
namespace osu.Game.Graphics.UserInterface
{
/// <summary>
... |
Improve console menu for "visual" tests | using System;
using R7.University.Core.Templates;
namespace R7.University.Core.Tests
{
class Program
{
static void Main (string [] args)
{
Console.WriteLine ("Please enter test number and press [Enter]:");
Console.WriteLine ("1. Workbook to CSV");
Console.Wri... | using System;
using R7.University.Core.Templates;
namespace R7.University.Core.Tests
{
class Program
{
static void Main (string [] args)
{
while (true) {
Console.WriteLine ("> Please enter test number and press [Enter]:");
Console.WriteLine ("---");
... |
Introduce variable to make code more readable | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using ActiproSoftware.Text.Implementation;
namespace NQueryViewerActiproWpf
{
[Export(typeof(ILanguageServiceRegistrar))]
internal sealed class ComposableLanguageServiceRegistrar : ILanguageServiceRegistrar
{
[... | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using ActiproSoftware.Text.Implementation;
namespace NQueryViewerActiproWpf
{
[Export(typeof(ILanguageServiceRegistrar))]
internal sealed class ComposableLanguageServiceRegistrar : ILanguageServiceRegistrar
{
[... |
Format code like a civilized man | using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LRU.Net
{
public class LruCache<TKey, TValue>
{
private readonly int _maxObjects;
private OrderedDictionary _data;
public... | using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LRU.Net
{
public class LruCache<TKey, TValue>
{
private readonly int _maxObjects;
private OrderedDictionary _data;
public... |
Fix path building for plugins views | namespace Nubot.Core.Nancy
{
using System.Linq;
using Abstractions;
using global::Nancy;
using global::Nancy.Conventions;
using global::Nancy.TinyIoc;
public class Bootstrapper : DefaultNancyBootstrapper
{
private readonly IRobot _robot;
public Bootstrapper(IRobot robot)
... | namespace Nubot.Core.Nancy
{
using System.Linq;
using Abstractions;
using global::Nancy;
using global::Nancy.Conventions;
using global::Nancy.TinyIoc;
public class Bootstrapper : DefaultNancyBootstrapper
{
private readonly IRobot _robot;
public Bootstrapper(IRobot robot)
... |
Remove wrong parameter from FFMPEG audio example | private async Task SendAsync(IAudioClient client, string path)
{
// Create FFmpeg using the previous example
var ffmpeg = CreateStream(path);
var output = ffmpeg.StandardOutput.BaseStream;
var discord = client.CreatePCMStream(AudioApplication.Mixed, 1920);
await output.CopyToAsync(discord);
awai... | private async Task SendAsync(IAudioClient client, string path)
{
// Create FFmpeg using the previous example
var ffmpeg = CreateStream(path);
var output = ffmpeg.StandardOutput.BaseStream;
var discord = client.CreatePCMStream(AudioApplication.Mixed);
await output.CopyToAsync(discord);
await disc... |
Add missing documentation for `SourceChanged` | // 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 JetBrains.Annotations;
namespace osu.Game.Skinning
{
/// <summary>
/// Provides access to skinnable elemen... | // 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 JetBrains.Annotations;
namespace osu.Game.Skinning
{
/// <summary>
/// Provides access to skinnable elemen... |
Use assembly version from NugetCracker assembly to print headline | using System;
using NugetCracker.Persistence;
namespace NugetCracker
{
class Program
{
private static MetaProjectPersistence _metaProjectPersistence;
static void Main(string[] args)
{
Console.WriteLine("NugetCracker 0.1\nSee https://github.com/monoman/NugetCracker\n");
_metaProjectPersist... | using System;
using NugetCracker.Persistence;
namespace NugetCracker
{
class Program
{
private static MetaProjectPersistence _metaProjectPersistence;
static Version Version
{
get {
return new System.Reflection.AssemblyName(System.Reflection.Assembly.GetCallingAssembly().FullName).Versio... |
Remove unnecessary HttpClient registration in Unity | using System.Net.Http;
using Microsoft.Practices.Unity;
using Moq;
using MyGetConnector.Repositories;
namespace MyGetConnector.Tests
{
public static class TestUnityConfig
{
public static IUnityContainer GetMockedContainer()
{
var container = new UnityContainer();
contai... | using System.Net.Http;
using Microsoft.Practices.Unity;
using Moq;
using MyGetConnector.Repositories;
namespace MyGetConnector.Tests
{
public static class TestUnityConfig
{
public static IUnityContainer GetMockedContainer()
{
var container = new UnityContainer();
contai... |
Fix already closed connection and 'kak go napravi tova' exception | using System;
using System.Collections.Concurrent;
using RabbitMQ.Client;
namespace Elders.Cronus.Transport.RabbitMQ
{
public class PublisherChannelResolver
{
private readonly ConcurrentDictionary<string, IModel> channelPerBoundedContext;
private readonly ConnectionResolver connectionResolver;... | using System.Collections.Generic;
using RabbitMQ.Client;
namespace Elders.Cronus.Transport.RabbitMQ
{
public class PublisherChannelResolver
{
private readonly Dictionary<string, IModel> channelPerBoundedContext;
private readonly ConnectionResolver connectionResolver;
private static rea... |
Handle long values when writing version variables | using System.Buffers;
using System.Buffers.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using GitVersion.Extensions;
namespace GitVersion.OutputVariables;
public class VersionVariablesJsonNumberConverter : JsonConverter<string>
{
public override bool CanConvert(Type typeToConvert)
=... | using System.Buffers;
using System.Buffers.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using GitVersion.Extensions;
namespace GitVersion.OutputVariables;
public class VersionVariablesJsonNumberConverter : JsonConverter<string>
{
public override bool CanConvert(Type typeToConvert)
=... |
Correct behaviour of Lazy ORM implementation | using System;
using System.Linq;
using DataAccessExamples.Core.Data;
using DataAccessExamples.Core.ViewModels;
namespace DataAccessExamples.Core.Services
{
public class LazyOrmDepartmentService : IDepartmentService
{
private readonly EmployeesContext context;
public LazyOrmDepartme... | using System;
using System.Linq;
using DataAccessExamples.Core.Data;
using DataAccessExamples.Core.ViewModels;
namespace DataAccessExamples.Core.Services
{
public class LazyOrmDepartmentService : IDepartmentService
{
private readonly EmployeesContext context;
public LazyOrmDepartme... |
Add zoom into rasterlayer data in the sample | using System;
using Mapsui.Layers;
using Mapsui.Providers;
using Mapsui.Styles;
using Mapsui.UI;
using Mapsui.Utilities;
namespace Mapsui.Samples.Common.Maps
{
public class RasterizingLayerSample : ISample
{
public string Name => "Rasterizing Layer";
public string Category => "Special";
... | using System;
using Mapsui.Layers;
using Mapsui.Providers;
using Mapsui.Styles;
using Mapsui.UI;
using Mapsui.Utilities;
namespace Mapsui.Samples.Common.Maps
{
public class RasterizingLayerSample : ISample
{
public string Name => "Rasterizing Layer";
public string Category => "Special";
... |
Increment version for new 'skip' querystring support | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XeroApi")]
[assembly: AssemblyDescription... | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XeroApi")]
[assembly: AssemblyDescription... |
Change access of Write() to internal | using System.IO;
namespace Leaf.Nodes
{
/// <summary>
/// Base class for all node types.
/// </summary>
public abstract class Node
{
/// <summary>
/// Writes the data of the node to a stream.
/// </summary>
/// <param name="writer">Writer to use for putting data in ... | using System.IO;
namespace Leaf.Nodes
{
/// <summary>
/// Base class for all node types.
/// </summary>
public abstract class Node
{
/// <summary>
/// Writes the data of the node to a stream.
/// </summary>
/// <param name="writer">Writer to use for putting data in ... |
Update fb-usertoken grant to reuser Facebook id | // 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.Linq;
using System.Threading.Tasks;
namespace Nether.Data.Identity
{
public static class LoginProvide... | // 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.Linq;
using System.Threading.Tasks;
namespace Nether.Data.Identity
{
public static class LoginProvide... |
Create a temporary library file and rename it to reduce the chance of library corruption | using Rareform.Validation;
using System.Collections.Generic;
using System.IO;
namespace Espera.Core.Management
{
public class LibraryFileWriter : ILibraryWriter
{
private readonly string targetPath;
public LibraryFileWriter(string targetPath)
{
if (targetPath == null)
... | using Rareform.Validation;
using System;
using System.Collections.Generic;
using System.IO;
namespace Espera.Core.Management
{
public class LibraryFileWriter : ILibraryWriter
{
private readonly string targetPath;
public LibraryFileWriter(string targetPath)
{
if (targetPath... |
Change Teamupdate time interval to 180s. | namespace Mitternacht.Common
{
public class TimeConstants
{
public const int WaitForForum = 500;
public const int TeamUpdate = 60 * 1000;
public const int Birthday = 60 * 1000;
}
}
| namespace Mitternacht.Common
{
public class TimeConstants
{
public const int WaitForForum = 500;
public const int TeamUpdate = 3 * 60 * 1000;
public const int Birthday = 60 * 1000;
}
}
|
Call GetBaseException instead of manually unwrapping exception types. | using System;
using System.Reflection;
namespace NuGet {
public static class ExceptionUtility {
public static Exception Unwrap(Exception exception) {
if (exception == null) {
throw new ArgumentNullException("exception");
}
if (exception.InnerE... | using System;
using System.Reflection;
namespace NuGet {
public static class ExceptionUtility {
public static Exception Unwrap(Exception exception) {
if (exception == null) {
throw new ArgumentNullException("exception");
}
if (exception.InnerE... |
Add comment to demo teamcity | namespace Fixie.Behaviors
{
public interface CaseBehavior
{
void Execute(Case @case, object instance);
}
} | namespace Fixie.Behaviors
{
public interface CaseBehavior
{
void Execute(Case @case, object instance); //comment to demo teamcity
}
}
|
Make default value of SignedPetitions as array. | using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Infopulse.EDemocracy.Model.BusinessEntities
{
public class UserDetailInfo : BaseEntity
{
[JsonIgnore]
public int UserID { get; set; }
[Required]
public string FirstName { get; set; }... | using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Infopulse.EDemocracy.Model.BusinessEntities
{
public class UserDetailInfo : BaseEntity
{
[JsonIgnore]
public int UserID { get; set; }
[Required]
public string FirstName { get; set; }... |
Update tests with new specifications of Mapping | using System;
using EntityFramework.Mapping;
using Xunit;
using Tracker.SqlServer.CodeFirst;
using Tracker.SqlServer.CodeFirst.Entities;
using Tracker.SqlServer.Entities;
using EntityFramework.Extensions;
using Task = Tracker.SqlServer.Entities.Task;
namespace Tracker.SqlServer.Test
{
/// <summary>
/// Summar... | using System;
using EntityFramework.Mapping;
using Xunit;
using Tracker.SqlServer.CodeFirst;
using Tracker.SqlServer.CodeFirst.Entities;
using Tracker.SqlServer.Entities;
using EntityFramework.Extensions;
using Task = Tracker.SqlServer.Entities.Task;
namespace Tracker.SqlServer.Test
{
/// <summary>
/// Summar... |
Remove in-code resharper disable statement | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEngine;
namespace HoloToolkit.Unity
{
/// <summary>
/// The purpose of this class is to provide a cached reference to the main camera. Calling Ca... | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using UnityEngine;
namespace HoloToolkit.Unity
{
/// <summary>
/// The purpose of this class is to provide a cached reference to the main camera. Calling Ca... |
Adjust collection editor to list by milestone | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MicrogameCollection))]
public class MicrogameCollectionEditor : Editor
{
public override void OnInspectorGUI()
{
MicrogameCollection collection = (MicrogameCollection)target;
if (GUILayout.Butt... | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Linq;
[CustomEditor(typeof(MicrogameCollection))]
public class MicrogameCollectionEditor : Editor
{
MicrogameCollection collection;
private List<MicrogameList> microgames;
private ... |
Simplify MethodReplacer and keep backwards compatibility | using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace Harmony
{
public static class Transpilers
{
private static IEnumerable<CodeInstruction> Replacer(IEnumerable<CodeInstruction> instructions, MethodBase from, MethodBase to, OpCode opcode)
{
if (from... | using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace Harmony
{
public static class Transpilers
{
public static IEnumerable<CodeInstruction> MethodReplacer(this IEnumerable<CodeInstruction> instructions, MethodBase from, MethodBase to)
{
if (from == n... |
Check for int.MaxValue when incrementing retry counter | using System;
using Polly.Utilities;
namespace Polly.Retry
{
internal partial class RetryPolicyStateWithSleepDurationProvider : IRetryPolicyState
{
private int _errorCount;
private readonly Func<int, TimeSpan> _sleepDurationProvider;
private readonly Action<Exception, TimeSpan, Context... | using System;
using Polly.Utilities;
namespace Polly.Retry
{
internal partial class RetryPolicyStateWithSleepDurationProvider : IRetryPolicyState
{
private int _errorCount;
private readonly Func<int, TimeSpan> _sleepDurationProvider;
private readonly Action<Exception, TimeSpan, Context... |
Remove the reading of the response... extra overhead not needed | using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace Glimpse.Agent
{
public class HttpChannelSender : IChannelSender, IDisposable
{
private readonly HttpClient _httpClient;
private readonly HttpClientHandler _httpHandler;
public HttpChannelSender()
{
... | using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace Glimpse.Agent
{
public class HttpChannelSender : IChannelSender, IDisposable
{
private readonly HttpClient _httpClient;
private readonly HttpClientHandler _httpHandler;
public HttpChannelSender()
{
... |
Hide a defintion for internal use | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
namespace DotNetKit.Windows.Media
{
public static class VisualTreeModule
{
pub... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
namespace DotNetKit.Windows.Media
{
static class VisualTreeModule
{
public sta... |
Put AMEE Ribbon Panel under Analyze tab | using System;
using System.IO;
using System.Windows.Forms;
using System.Windows.Media.Imaging;
using Autodesk.Revit.UI;
namespace AMEE_in_Revit.Addin
{
public class AMEEPanel : IExternalApplication
{
// ExternalCommands assembly path
static string AddInPath = typeof(AMEEPanel).Assembly.Locatio... | using System;
using System.IO;
using System.Windows.Forms;
using System.Windows.Media.Imaging;
using Autodesk.Revit.UI;
namespace AMEE_in_Revit.Addin
{
public class AMEEPanel : IExternalApplication
{
// ExternalCommands assembly path
static string AddInPath = typeof(AMEEPanel).Assembly.Locatio... |
Update on hourglass script. Still not in action | using UnityEngine;
using System.Collections;
public class Hourglass : Trigger {
public Animator cutScene;
public override void Activate() {
UtilControls.Freeze();
cutScene.Play("cutscene");
GameObject.FindGameObjectWithTag("ThingsController").GetComponent<ThingsController>().ClearCu... | using UnityEngine;
using System.Collections;
public class Hourglass : Trigger {
public GameObject cutsceneObject;
public Animator cutScene;
void Start() {
//cutScene = cutsceneObject.GetComponent<Animator>();
}
public override void Activate() {
UtilControls.Freeze();
cut... |
Save files as UTF-8 for consistency. | namespace Fixie.Execution.Listeners
{
using System;
using System.IO;
using System.Xml.Linq;
public class ReportListener<TXmlFormat> :
Handler<AssemblyStarted>,
Handler<ClassStarted>,
Handler<CaseCompleted>,
Handler<ClassCompleted>,
Handler<AssemblyCompleted>
... | namespace Fixie.Execution.Listeners
{
using System;
using System.IO;
using System.Xml.Linq;
public class ReportListener<TXmlFormat> :
Handler<AssemblyStarted>,
Handler<ClassStarted>,
Handler<CaseCompleted>,
Handler<ClassCompleted>,
Handler<AssemblyCompleted>
... |
Fix default color temperature values | using System.Collections.Generic;
namespace Common.Data
{
public class TemperatureOverlayState
{
public bool CustomRangesEnabled { get; set; } = true;
public List<float> Temperatures => new List<float>
{
Aqua, Turquoise, Blue, Green, Lime, Orange, RedOrange, Red
};... | using System.Collections.Generic;
namespace Common.Data
{
public class TemperatureOverlayState
{
public bool CustomRangesEnabled { get; set; } = true;
public List<float> Temperatures => new List<float>
{
Aqua, Turquoise, Blue, Green, Lime, Orange, RedOrange, Red
};... |
Add description to service resource | using Digirati.IIIF.Model.JsonLD;
using Newtonsoft.Json;
namespace Digirati.IIIF.Model.Types
{
public class Service : JSONLDBase, IService
{
[JsonProperty(Order = 10, PropertyName = "profile")]
public dynamic Profile { get; set; }
[JsonProperty(Order = 11, PropertyName = "label")]
... | using Digirati.IIIF.Model.JsonLD;
using Newtonsoft.Json;
namespace Digirati.IIIF.Model.Types
{
public class Service : JSONLDBase, IService
{
[JsonProperty(Order = 10, PropertyName = "profile")]
public dynamic Profile { get; set; }
[JsonProperty(Order = 11, PropertyName = "label")]
... |
Fix exception caused by getting directory name from empty string in runner config editor | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SSMScripter.Runner;
namespace SSMScripter.Config
{
public partial class Runne... | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SSMScripter.Runner;
namespace SSMScripter.Config
{
public partial class Runne... |
Set env vars in GitHub Actions | namespace NerdBank.GitVersioning.CloudBuildServices
{
using System;
using System.Collections.Generic;
using System.IO;
using Nerdbank.GitVersioning;
internal class GitHubActions : ICloudBuild
{
public bool IsApplicable => Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true";
... | namespace NerdBank.GitVersioning.CloudBuildServices
{
using System;
using System.Collections.Generic;
using System.IO;
using Nerdbank.GitVersioning;
internal class GitHubActions : ICloudBuild
{
public bool IsApplicable => Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true";
... |
Change uow to default to IsolationLevel.RepeatableRead | using System;
using System.Data;
using Dapper.FastCrud;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data
{
public class UnitOfWork : DbTransaction, IUnitOfWork
{
public SqlDialect SqlDialect { get; }
private readonly Guid _guid = Guid.NewGuid();
public UnitOfWork(IDbFac... | using System;
using System.Data;
using Dapper.FastCrud;
namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Data
{
public class UnitOfWork : DbTransaction, IUnitOfWork
{
public SqlDialect SqlDialect { get; }
private readonly Guid _guid = Guid.NewGuid();
public UnitOfWork(IDbFac... |
Revert to main menu on 0 balls left. | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Zenject;
public class ScoreCounter : MonoBehaviour
{
[Inject]
public StageStats Stats { get; private set; }
void Start() {
Stats.BallsTotal = Stats.BallsLeft = GetComponentsInChildren<Rigidbody>().Length;
... | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using Zenject;
public class ScoreCounter : MonoBehaviour
{
[Inject]
public StageStats Stats { get; private set; }
void Start() {
Stats.BallsTotal = Stats.BallsLeft = GetComponentsInCh... |
Add delay for ReloadActiveScene to prevent stuck button | using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class ReloadScene : MonoBehaviour {
GlobalControl globalController;
bool allowLevelLoad = true;
void OnEnable()
{
allowLevelLoad = true;
}
// Use this for initialization
public void ReloadActi... | using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class ReloadScene : MonoBehaviour {
GlobalControl globalController;
bool allowLevelLoad = true;
void OnEnable()
{
allowLevelLoad = true;
}
// Use this for initialization
public void ReloadActi... |
Use the options when connecting to GitHub | using Nito.AsyncEx;
using Octokit;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Alteridem.GetChanges
{
class Program
{
static int Main(string[] args)
{
var options = new Options();
if (!CommandLine.Parser.Default.ParseArguments(args, opti... | using Nito.AsyncEx;
using Octokit;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Alteridem.GetChanges
{
class Program
{
static int Main(string[] args)
{
var options = new Options();
if (!CommandLine.Parser.Default.ParseArguments(args, opti... |
Allow setting grouping hash and context | using System.Collections.Generic;
using System.Linq;
namespace Bugsnag
{
public class Event : Dictionary<string, object>
{
public Event(IConfiguration configuration, System.Exception exception, Severity severity)
{
this["payloadVersion"] = 2;
this["exceptions"] = new Exceptions(exception).ToArr... | using System.Collections.Generic;
using System.Linq;
namespace Bugsnag
{
public class Event : Dictionary<string, object>
{
public Event(IConfiguration configuration, System.Exception exception, Severity severity)
{
this["payloadVersion"] = 4;
this["exceptions"] = new Exceptions(exception).ToArr... |
Add ToHashSet extension methods on IEnumerable. | /*
* John.Hall <john.hall@camtechconsultants.com>
* Copyright (c) Cambridge Technology Consultants Ltd. All rights reserved.
*/
using System;
using System.Collections.Generic;
namespace CTC.CvsntGitImporter.Utils
{
/// <summary>
/// Extension methods for IEnumerable.
/// </summary>
static class IE... | /*
* John.Hall <john.hall@camtechconsultants.com>
* Copyright (c) Cambridge Technology Consultants Ltd. All rights reserved.
*/
using System;
using System.Collections.Generic;
namespace CTC.CvsntGitImporter.Utils
{
/// <summary>
/// Extension methods for IEnumerable.
/// </summary>
static class IE... |
Add missing final validation pass (bytes read == 0) | //-----------------------------------------------------------------------
// <copyright file="ValidatingReceiver.cs" company="Brian Rogers">
// Copyright (c) Brian Rogers. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CommSample
{
... | //-----------------------------------------------------------------------
// <copyright file="ValidatingReceiver.cs" company="Brian Rogers">
// Copyright (c) Brian Rogers. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CommSample
{
... |
Implement code making the previously failing unit test pass. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ploeh.AutoFixture
{
public static class IFixtureExtensions
{
public static IEnumerable<T> Repeat<T>(this IFixture fixture, Func<T> function)
{
throw new NotImplementedException();
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ploeh.AutoFixture
{
public static class IFixtureExtensions
{
public static IEnumerable<T> Repeat<T>(this IFixture fixture, Func<T> function)
{
if (fixture == null)
{
... |
Allow a zone and version to be specified in the tzvalidate controller | // Copyright 2016 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 Microsoft.AspNetCore.Mvc;
using NodaTime.TimeZones;
using NodaTime.TzValidate.NodaDump;
using System.IO;
using System.Net;
namespace NodaTime.Web.C... | // Copyright 2016 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 Microsoft.AspNetCore.Mvc;
using NodaTime.TimeZones;
using NodaTime.TzValidate.NodaDump;
using NodaTime.Web.Models;
using System.IO;
using System.Lin... |
Change default for DetailedAppointments to 'false' | using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace CalSync.Infrastructure
{
class Config
{
public int SyncRangeDays { get; private set; }
public string TargetEmailAddress { get; private set; }
public b... | using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace CalSync.Infrastructure
{
class Config
{
public int SyncRangeDays { get; private set; }
public string TargetEmailAddress { get; private set; }
public b... |
Fix to work with Anonymous Roles | using System;
using System.Linq;
using System.Web.Mvc;
using FujiyBlog.Core.DomainObjects;
namespace FujiyBlog.Web.Infrastructure
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
public class AuthorizePermissionAttribute : AuthorizeAttribute
... | using System;
using System.Linq;
using System.Security.Principal;
using System.Web;
using System.Web.Mvc;
using FujiyBlog.Core.DomainObjects;
using FujiyBlog.Core.Extensions;
namespace FujiyBlog.Web.Infrastructure
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, Allo... |
Rename finished, Bumped version to 0.9 | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NowinWebServer")]
[assembly: AssemblyDesc... | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Nowin")]
[assembly: AssemblyDescription("... |
Update key-only querystring comparisons to use "" rather than null to make it more compatible with form data | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RichardSzalay.MockHttp.Matchers
{
public class QueryStringMatcher : IMockedRequestMatcher
{
readonly IEnumerable<KeyValuePair<string, string>> values;
public QueryStringMatcher(string queryString)
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RichardSzalay.MockHttp.Matchers
{
public class QueryStringMatcher : IMockedRequestMatcher
{
readonly IEnumerable<KeyValuePair<string, string>> values;
public QueryStringMatcher(string queryString)
... |
Add offsite types for installment citi | using System.Runtime.Serialization;
namespace Omise.Models
{
public enum OffsiteTypes
{
[EnumMember(Value = null)]
None,
[EnumMember(Value = "internet_banking_scb")]
InternetBankingSCB,
[EnumMember(Value = "internet_banking_bbl")]
InternetBankingBBL,
[En... | using System.Runtime.Serialization;
namespace Omise.Models
{
public enum OffsiteTypes
{
[EnumMember(Value = null)]
None,
[EnumMember(Value = "internet_banking_scb")]
InternetBankingSCB,
[EnumMember(Value = "internet_banking_bbl")]
InternetBankingBBL,
[En... |
Normalize line endings in text viewer | using System.IO;
using System.Linq;
using System.Windows.Forms;
using GUI.Utils;
namespace GUI.Types.Viewers
{
public class ByteViewer : IViewer
{
public static bool IsAccepted() => true;
public TabPage Create(VrfGuiContext vrfGuiContext, byte[] input)
{
var tab = new TabPa... | using System.IO;
using System.Linq;
using System.Windows.Forms;
using GUI.Utils;
namespace GUI.Types.Viewers
{
public class ByteViewer : IViewer
{
public static bool IsAccepted() => true;
public TabPage Create(VrfGuiContext vrfGuiContext, byte[] input)
{
var tab = new TabPa... |
Move default Dashboard API base address to constant | using System;
using Microsoft.Extensions.Options;
namespace Meraki
{
/// <summary>
/// Initialize a <see cref="MerakiDashboardClientSettings"/> object.
/// </summary>
internal class MerakiDashboardClientSettingsSetup : ConfigureOptions<MerakiDashboardClientSettings>
{
/// <summary>
... | using System;
using Microsoft.Extensions.Options;
namespace Meraki
{
/// <summary>
/// Initialize a <see cref="MerakiDashboardClientSettings"/> object.
/// </summary>
internal class MerakiDashboardClientSettingsSetup : ConfigureOptions<MerakiDashboardClientSettings>
{
public static readonl... |
Change user.config format to app.confg schema | using System.Linq;
using System.Xml.Linq;
namespace Tests.Daterpillar.Helpers
{
public static class ConnectionString
{
private static readonly string _configFile = "database.config.xml";
public static string GetMySQLServerConnectionString()
{
return GetConnectionString("my... | using System.Configuration;
namespace Tests.Daterpillar.Helpers
{
public static class ConnectionString
{
public static string GetMySQLServerConnectionString()
{
return GetConnectionString("mysql");
}
public static string GetSQLServerConnectionString()
{
... |
Tweak google analytics detection to work on twitter.com | using CefSharp;
namespace TweetDuck.Core.Handling{
class RequestHandlerBrowser : RequestHandler{
public override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status){
browser.Reload();
}
public override CefReturnValue OnBefo... | using CefSharp;
namespace TweetDuck.Core.Handling{
class RequestHandlerBrowser : RequestHandler{
public override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status){
browser.Reload();
}
public override CefReturnValue OnBefo... |
Add back combo colours for osu!classic | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Audio;
using osu.Framework.IO.Stores;
using osuTK.Graphics;
namespace osu.Game.Skinning
{
public class DefaultLegacySkin : LegacySkin
{
... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Audio;
using osu.Framework.IO.Stores;
using osuTK.Graphics;
namespace osu.Game.Skinning
{
public class DefaultLegacySkin : LegacySkin
{
... |
Update tạm fix lỗi Home/Index | using MomWorld.DataContexts;
using MomWorld.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MomWorld.Controllers
{
public class HomeController : Controller
{
private ArticleDb articleDb = new ArticleDb();
private I... | using MomWorld.DataContexts;
using MomWorld.Entities;
using MomWorld.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MomWorld.Controllers
{
public class HomeController : Controller
{
private ArticleDb articleDb = new ... |
Refactor Add Doubles Operation to use GetValues and CloneWithValues | namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class AddDoubleDoubleOperation : IBinaryOperation<double, double, double>
{
public Tensor<double> Evaluate(Tensor<double> tensor1, Tensor<double> ten... | namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class AddDoubleDoubleOperation : IBinaryOperation<double, double, double>
{
public Tensor<double> Evaluate(Tensor<double> tensor1, Tensor<double> ten... |
Remove Obselete ViewModel Property for SendGrid Password | using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Portal.CMS.Web.Areas.Admin.ViewModels.SettingManager
{
public class SetupViewModel
{
[Required]
[DisplayName("Website Name")]
public string WebsiteName { get; set; }
[Required]
[Display... | using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Portal.CMS.Web.Areas.Admin.ViewModels.SettingManager
{
public class SetupViewModel
{
[Required]
[DisplayName("Website Name")]
public string WebsiteName { get; set; }
[Required]
[Display... |
Fix whitespace bug with dictionary support | using System;
using System.IO;
using System.Linq;
using System.Text;
namespace HandlebarsDotNet.Compiler.Lexer
{
internal class WordParser : Parser
{
private const string validWordStartCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$.@";
public override Token Parse(TextRea... | using System;
using System.IO;
using System.Linq;
using System.Text;
namespace HandlebarsDotNet.Compiler.Lexer
{
internal class WordParser : Parser
{
private const string validWordStartCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$.@[]";
public override Token Parse(TextR... |
Enable Mongo entity auto-create and auto-ID | using System;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.IdGenerators;
using MongoDB.Bson.Serialization.Serializers;
using MongoDB.Driver;
using RightpointLabs.ConferenceRoom.Domain.Models;
using RightpointLabs.ConferenceRoom.Infrastructure.Persistence.Models;
namespace Rig... | using System;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.IdGenerators;
using MongoDB.Bson.Serialization.Serializers;
using MongoDB.Driver;
using RightpointLabs.ConferenceRoom.Domain.Models;
using RightpointLabs.ConferenceRoom.Infrastructure.Persistence.Models;
namespace Rig... |
Add damage capabilities to the enemy | using UnityEngine;
public class AttackHandler : MonoBehaviour {
[HideInInspector] public float damage;
[HideInInspector] public float duration;
[HideInInspector] public BoxCollider hitBox;
private float timer = 0f;
void Start() {
hitBox = gameObject.GetComponent<BoxCollider>();
}
void Update()
{
timer... | using UnityEngine;
public class AttackHandler : MonoBehaviour {
[HideInInspector] public float damage;
[HideInInspector] public float duration;
[HideInInspector] public BoxCollider hitBox;
private float timer = 0f;
void Start() {
hitBox = gameObject.GetComponent<BoxCollider>();
}
void Update()
{
timer... |
Split CheckBox test into two, give better name. | using NUnit.Framework;
using tungsten.core.Elements;
using tungsten.core.Search;
using tungsten.nunit;
namespace tungsten.sampletest
{
[TestFixture]
public class CheckBoxTest : TestBase
{
[Test]
public void Hupp()
{
var window = Desktop.FindFirstChild<WpfWi... | using NUnit.Framework;
using tungsten.core.Elements;
using tungsten.core.Search;
using tungsten.nunit;
namespace tungsten.sampletest
{
[TestFixture]
public class CheckBoxTest : TestBase
{
[Test]
public void CheckBoxIsChecked()
{
var window = Desktop.FindFir... |
Revert Strip large data values out of events | using System;
using System.Collections.Generic;
using Exceptionless.Core.Pipeline;
using Exceptionless.Core.Extensions;
using Exceptionless.Core.Models;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System.IO;
using Newtonsoft.Json.Linq;
using Microsoft.Extensions.Logging;
namespace Exceptionless.C... | using System;
using System.Collections.Generic;
using Exceptionless.Core.Pipeline;
using Exceptionless.Core.Extensions;
using Exceptionless.Core.Models;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
namespace Exceptionless.Core.Plugins.EventParser {
[Priority(0)]
public class JsonEventParserPlugi... |
Update the mask check in the Bit() extension method | namespace elbsms_core
{
internal static class Extensions
{
internal static bool Bit(this byte v, int bit)
{
int mask = 1 << bit;
return (v & mask) == mask;
}
internal static bool Bit(this int v, int bit)
{
int mask = 1 << bit;
... | namespace elbsms_core
{
internal static class Extensions
{
internal static bool Bit(this byte v, int bit)
{
int mask = 1 << bit;
return (v & mask) != 0;
}
internal static bool Bit(this int v, int bit)
{
int mask = 1 << bit;
... |
Move to .NET Standard - cleanup | using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using SoundCloud.Api;
using SoundCloud.Api.Entities;
using SoundCloud.Api.Entities.Enums;
using SoundCloud.Api.QueryBuilders;
namespace ConsoleApp
{
internal static class Program
{
private st... | using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using SoundCloud.Api;
using SoundCloud.Api.Entities;
using SoundCloud.Api.Entities.Enums;
using SoundCloud.Api.QueryBuilders;
namespace ConsoleApp
{
internal static class Program
{
private static async Task Mai... |
Add some settings to bugsnag | using Bugsnag;
using Bugsnag.Clients;
using EarTrumpet.Extensions;
using System;
using System.Diagnostics;
using System.IO;
using Windows.ApplicationModel;
namespace EarTrumpet.Services
{
class ErrorReportingService
{
internal static void Initialize()
{
try
{
#if DEBUG
... | using Bugsnag;
using Bugsnag.Clients;
using EarTrumpet.Extensions;
using EarTrumpet.Misc;
using System;
using System.Diagnostics;
using System.IO;
using Windows.ApplicationModel;
namespace EarTrumpet.Services
{
class ErrorReportingService
{
internal static void Initialize()
{
try
... |
Change type of MaximumBytesPerSec to long | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using MetroTrilithon.Serialization;
namespace TirkxDownloader.Models.Settings
{
public class DownloadingSetting
{
public static SerializablePropert... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using MetroTrilithon.Serialization;
namespace TirkxDownloader.Models.Settings
{
public class DownloadingSetting
{
public static SerializablePropert... |
Add timeout to decoration etl-run | using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
using NBi.Core.Etl;
using NBi.Xml.Items;
namespace NBi.Xml.Decoration.Command
{
public class EtlRunXml : DecorationCommandXml, IEtlRunCommand
{
[XmlAttribute("server")]
public string ... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
using NBi.Core.Etl;
using NBi.Xml.Items;
namespace NBi.Xml.Decoration.Command
{
public class EtlRunXml : DecorationCommandXml, IEtlRunCommand
{
[XmlAttribute("server")]
public string ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.