doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
2361459c-56e6-46d0-ac64-58a7d777801d
{ "language": "C#" }
```c# ``` Rename UpdateHUD lives to DisplayLives.
```c# using UnityEngine; using UnityEngine.UI; using System.Collections; using DG.Tweening; using Matcha.Game.Tweens; public class UpdateHUDLives : BaseBehaviour { public Sprite threeLives; public Sprite twoLives; public Sprite oneLife; private Image lives; private float timeToFade = 2f; void Start() { liv...
fa64d63a-e1b7-44d3-906c-7578950d6240
{ "language": "C#" }
```c# ``` Add more tests for surface
```c# using Microsoft.VisualStudio.TestTools.UnitTesting; using SadRogue.Primitives; namespace SadConsole.Tests { public partial class CellSurface { [TestMethod] public void Glyph_SetForeground() { var surface1 = new SadConsole.CellSurface(20, 20); surface1.Fill...
02960059-f02f-4639-82f0-49c347fd04cc
{ "language": "C#" }
```c# using Raven.Client; using Raven.Client.Document; using Raven.Client.Embedded; namespace qed { public static partial class Functions { public static IDocumentStore GetRavenStore() { var ravenStore = GetConfiguration<IDocumentStore>(Constants.Configuration.RavenStoreKey); ...
```c# using Raven.Client; using Raven.Client.Document; using Raven.Client.Embedded; namespace qed { public static partial class Functions { public static IDocumentStore GetRavenStore() { var ravenStore = GetConfiguration<IDocumentStore>(Constants.Configuration.RavenStoreKey); ...
94b0b8b4-42ae-42cf-b653-994404638fcd
{ "language": "C#" }
```c# ``` Add sample to illustrate lack of ordering of type compilation, for a future branch.
```c# using System; using System.Collections.Generic; using System.Text; using VCSFramework; namespace Samples { public static class Foo { [AlwaysInline] public static void Run() { } } // TODO - This is not supported yet. public static class TypeCompilationOrderTesting { private static byte TestB...
b97ea08c-1fff-41af-a6f7-685f6cac2266
{ "language": "C#" }
```c# ``` Add attribute to retry flaky tests on normal CI runs
```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. #nullable disable using System; using NUnit.Framework; namespace osu.Game.Tests { /// <summary> /// An attribute to mark any flaky tests. /// Will add ...
de9e9f0f-a263-4bca-8b79-c8f9edb782a3
{ "language": "C#" }
```c# ``` Add new bip 157 p2p message cfilter
```c# using System; using System.Collections.Generic; namespace NBitcoin.Protocol { /// <summary> /// Represents the p2p message payload used for sharing a block's compact filter. /// </summary> [Payload("cfilter")] public class CompactFilterPayload : Payload { private byte _FilterType = (byte)FilterType.Basic...
d3c0c590-eda8-4c80-8ad0-ff4820647704
{ "language": "C#" }
```c# ``` Define enumeration for supported list of predefined members
```c# using System; using System.Linq; using System.Xml.Serialization; namespace NBi.Core.Members { public enum PredefinedMembers { [XmlEnum(Name = "weekdays")] DaysOfWeek = 1, [XmlEnum(Name = "months")] MonthsOfYear = 2 } } ```
87f13294-d9dc-4a30-ae47-e7b5812e06a7
{ "language": "C#" }
```c# ``` Add support for 8 bit raw bitmap
```c# using System; using System.Drawing; using System.IO; using OpenKh.Imaging; namespace OpenKh.Kh2 { public class RawBitmap : IImageRead { private const int PaletteCount = 256; private const int BitsPerColor = 32; private readonly byte[] _data; private readonly byte[] _clut...
012f493e-5b35-4868-8253-e86ad418c0e9
{ "language": "C#" }
```c# ``` Add needed generated file for Live Preview.
```c# //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> ...
21d2f215-5635-4eea-8760-267cdb49dcba
{ "language": "C#" }
```c# ``` Add model class for realm skin
```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 System; using System.Collections.Generic; using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Testing; using osu.Game.Database; using osu.Gam...
1e4f4938-d152-4794-b27c-da9a26106740
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; namespace ExpressionToCodeLib { /// <summary> /// Intended to be used as a static import; i.e. via "using static ExpressionToCodeLib.ExpressionAssertions;" /// </summary> public ...
```c# using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; namespace ExpressionToCodeLib { /// <summary> /// Intended to be used as a static import; i.e. via "using static ExpressionToCodeLib.ExpressionAssertions;" /// </summary> public ...
ba207187-efdb-4309-8495-33b3fcf3d641
{ "language": "C#" }
```c# ``` Add a controller for authorized user s.t. they can retrieve their info and update password.
```c# using A2BBCommon; using A2BBCommon.Models; using A2BBIdentityServer.DTO; using A2BBIdentityServer.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Collections.Generic; using System.Threading.Task...
0019051b-4c90-4e77-bc47-ebe03fef3a29
{ "language": "C#" }
```c# using System; using System.IO; using System.Security.Cryptography; namespace Lidgren.Network { public class NetAESEncryption : NetCryptoProviderBase { public NetAESEncryption(NetPeer peer) : base(peer, new AesCryptoServiceProvider()) { } public NetAESEncryption(NetPeer peer, string key...
```c# using System; using System.IO; using System.Security.Cryptography; namespace Lidgren.Network { public class NetAESEncryption : NetCryptoProviderBase { public NetAESEncryption(NetPeer peer) #if UNITY_WEBPLAYER : base(peer, new RijndaelManaged()) #else : base(peer, new AesCryptoServiceProvide...
612653ea-5103-4959-90df-74a8bfde3e83
{ "language": "C#" }
```c# ``` Add THE IDOLM@STER CINDERELLA GIRLS ANIMATION PROJECTシリーズCD発売記念イベント
```c# @using System.Text @using CsQuery @RadioWhip.Feedify( "http://columbia.jp/idolmaster/cinderellaapevent/", "THE IDOLM@STER CINDERELLA GIRLS ANIMATION PROJECTシリーズCD発売記念イベント", (content, cq) => { return cq["#newsContent h3"] .Select(x => x.Cq()) .Select(x => ...
33457e9f-3579-4ccb-8246-34068a7812f7
{ "language": "C#" }
```c# ``` Add custom project exception type.
```c# // --------------------------------------------------------------------------------------- // <copyright file="ColoreException.cs" company=""> // Copyright © 2015 by Adam Hellberg and Brandon Scott. // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this softwar...
5e3d457f-ed45-492c-9d5e-fc4ff7b9955e
{ "language": "C#" }
```c# ``` Add missing file for 0188bf6b.
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using Newtonsoft.Json; namespace ElasticSearch.Client { [JsonObject] public class MultiHit<T> where T : class { [JsonProperty("docs")] public IEnumerable<Hit<T>> Hits { get; internal set; } } } ...
1511b29c-9b83-4899-830f-d048c9754fed
{ "language": "C#" }
```c# ``` Add ninject module for mvp
```c# using System; using System.Linq; using Ninject; using Ninject.Activation; using Ninject.Modules; using Ninject.Parameters; using WebFormsMvp; namespace ZobShop.Web.App_Start.NinjectModules { public class MvpNinjectModule : NinjectModule { private const string ViewConstructorArgumentName = "view"...
069aae09-db19-4478-9e1c-e7f865928cfc
{ "language": "C#" }
```c# ``` Revert "Revert "Privide equivalent to System.currentTimeMillis()""
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Adaptive.Arp.Impl.Util { public class TimeUtils { private static readonly DateTime Jan1st1970 = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); private Time...
0c20ce67-9459-4d68-b92c-5eb4fc63e868
{ "language": "C#" }
```c# ``` Add structure for path control points
```c# using System; using osu.Framework.Bindables; using osu.Game.Rulesets.Objects.Types; using osuTK; namespace osu.Game.Rulesets.Objects { public class PathControlPoint : IEquatable<PathControlPoint> { public readonly Bindable<Vector2> Position = new Bindable<Vector2>(); public readonly Bind...
2eee90ce-8a7d-4c17-a96b-dbfc0ce3c7de
{ "language": "C#" }
```c# ``` Add new Author: Victor Silva
```c# using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class VictorSilva : IAmAMicrosoftMVP, IFilterMyBlogPosts { public string FirstName => "Victor"; ...
d16febae-7afb-4891-a821-e1867688afad
{ "language": "C#" }
```c# ``` Add a test scene for textured triangles
```c# 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 ...
b294fb3c-ceee-460a-b42e-40bf40aa9a7e
{ "language": "C#" }
```c# ``` Add a realtime room manager
```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 System; using System.Diagnostics; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Logging; using osu.Game.Online.Multiplayer...
f6186f5c-a378-45d9-9c88-64750825e6dc
{ "language": "C#" }
```c# /* DOESN'T WORK YET! using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an ...
```c# /* DOESN'T WORK YET! using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an ...
7d41c472-fc82-4466-9e75-46ecb87e50ec
{ "language": "C#" }
```c# 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("ExpressionToCodeLib")] [as...
```c# using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: As...
efdd926b-d5e9-4674-90bb-61bdd59a2e48
{ "language": "C#" }
```c# // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using System; namespace Microsoft.PowerShell.EditorServices.Utility { internal static class ObjectExtensions { /// <summary> /// E...
```c# // // 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.Linq; using System.Collections.Generic; using System.Management.Automation.Language; namespace Microsoft.PowerShell.EditorServi...
54b3eaaa-adef-491d-9700-63dd36194192
{ "language": "C#" }
```c# ``` Add integration test for relative path
```c# using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Threading.Tasks; using FluentAssertions; using NuGet.Test.Helpers; using Sleet.Test; using Xunit; namespace Sleet.Integration.Test { public class LocalFeedTests { [Fact] public async Task Loca...
48087960-5acb-4f7c-9ed3-4e75af8f0fc6
{ "language": "C#" }
```c# ``` Add basic VirtualTrack retrieval test
```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 System.Threading.Tasks; using NUnit.Framework; using osu.Framework.Audio; using osu.Framework.IO.Stores; using osu.Framework.Threading; namespace osu.Framewo...
039976ea-94ef-40d6-881b-503934c6b0b0
{ "language": "C#" }
```c# ``` Add JS zone requirement to asmdef namespace
```c# using JetBrains.Application.BuildScript.Application.Zones; using JetBrains.ReSharper.Psi.JavaScript; namespace JetBrains.ReSharper.Plugins.Unity.Json { [ZoneMarker] public class ZoneMarker : IRequire<ILanguageJavaScriptZone> { } }```
c8284c24-437d-4caf-b35b-2e4285587f53
{ "language": "C#" }
```c# using System; using System.Reflection; namespace Umbraco.Core.Configuration { public class UmbracoVersion { private static readonly Version Version = new Version(6, 0, 0); /// <summary> /// Gets the current version of Umbraco. /// Version class with the specifi...
```c# using System; using System.Reflection; namespace Umbraco.Core.Configuration { public class UmbracoVersion { private static readonly Version Version = new Version(6, 0, 0); /// <summary> /// Gets the current version of Umbraco. /// Version class with the specifi...
3d0e0666-a040-46a3-b775-d665155e9e67
{ "language": "C#" }
```c# ``` Add support for mediapicker3 in mappers.
```c# using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Services; using Umbraco.Extensions; using uSync.Core.Dependency; using static Umbraco.Cms.Core.Constants; namespace uSync.Core.Mapping.Mappers ...
36128069-0489-4484-ab23-2e06d1657dfb
{ "language": "C#" }
```c# ``` Implement put and get api in binary search tree
```c# using System; using System.Collections.Generic; namespace Algorithms.DataStructures.TreeMap { internal class Node<K, V> where K : IComparable<K> { internal K key; internal V value; internal Node<K, V> left; internal Node<K, V> right; } public class BinarySearchTr...
15218b28-e799-4ab2-8df5-850818cd44c8
{ "language": "C#" }
```c# using System.Xml.Linq; using Hacknet; using Pathfinder.Util; using Pathfinder.Util.XML; namespace Pathfinder.Administrator; public abstract class BaseAdministrator : Hacknet.Administrator { protected Computer computer; protected OS opSystem; public BaseAdministrator(Computer computer, OS opSystem) ...
```c# using System.Xml.Linq; using Hacknet; using Pathfinder.Util; using Pathfinder.Util.XML; namespace Pathfinder.Administrator; public abstract class BaseAdministrator : Hacknet.Administrator, IXmlName { protected Computer computer; protected OS opSystem; public BaseAdministrator(Computer computer, OS ...
11e5f570-0a42-4af0-9ac5-341dfd3b866a
{ "language": "C#" }
```c# ``` Add a general game init script
```c# using DG.Tweening; using Matcha.Unity; public class GameInit : BaseBehaviour { void Start() { // initialize DOTween before first use. DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(2000, 2000); DOTween.showUnityEditorReport = false; DOTween.defaultAutoKill = false; // seed Rand with curr...
198a66c9-a4b6-4edf-b59a-528b76034317
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using System.Text; namespace Csla.Test.LazyLoad { [Serializable] public class AParent : Csla.BusinessBase<AParent> { private Guid _id; public Guid Id { get { return _id; } set { _id = value; PropertyHasChanged(); ...
```c# using System; using System.Collections.Generic; using System.Text; namespace Csla.Test.LazyLoad { [Serializable] public class AParent : Csla.BusinessBase<AParent> { private Guid _id; public Guid Id { get { return _id; } set { _id = value; PropertyHasChanged(); ...
eb7e1e70-4318-450f-bfc5-7eb57d2ccbec
{ "language": "C#" }
```c# ``` Add basic tests for pipeline
```c# using System; using System.Linq; using System.Threading.Tasks; using BulkWriter.Pipeline; using Xunit; namespace BulkWriter.Tests.Pipeline { public class EtlPipelineTests { private readonly string _connectionString = TestHelpers.ConnectionString; public class PipelineTestsMyTestClass ...
586b81da-c429-408e-bb69-9088c3cb0197
{ "language": "C#" }
```c# ``` Add test coverage ensuring unique acronyms
```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. #nullable disable using System.Collections.Generic; using System.Linq; using NUnit.Framework; using osu.Framework.Testing; namespace osu.Game.Tests.Visual.Gameplay...
9d46db07-1391-480c-a381-5d67000c9eed
{ "language": "C#" }
```c# using System.Reflection; // common assembly attributes [assembly: AssemblyDescription("Lean Engine is an open-source, plataform agnostic C# and Python algorithmic trading engine. " + "Allows strategy research, backtesting and live trading with Equities, FX, CFD, Crypto, Options an...
```c# using System.Reflection; // common assembly attributes [assembly: AssemblyDescription("Lean Engine is an open-source, plataform agnostic C# and Python algorithmic trading engine. " + "Allows strategy research, backtesting and live trading with Equities, FX, CFD, Crypto, Options an...
db4837b6-1693-4a28-8eda-0da6694ff0f4
{ "language": "C#" }
```c# ``` Add tablet information class to ferry information from OTD
```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 osuTK; namespace osu.Framework.Input.Handlers.Tablet { /// <summary> /// A class that carries the information we care about from the tablet provider....
79394c6a-4fff-48fe-9783-e908317fc5c2
{ "language": "C#" }
```c# ``` Add path element factory for selection access
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Pather.CSharp.PathElements { public class SelectionFactory : IPathElementFactory { private const string selectionIndicator = "[]"; public IPath...
fd3dbe9f-3d74-4a1a-a1d0-99abea49c9e0
{ "language": "C#" }
```c# namespace PlainElastic.Net.Builders { public interface IJsonConvertible { string ToJson(); } }``` Add Build and BuildBeautified extension methods to all query builders, so that it's possible to build single queries.
```c# namespace PlainElastic.Net.Builders { public interface IJsonConvertible { string ToJson(); } } namespace PlainElastic.Net { using PlainElastic.Net.Utils; public static class JsonConvertibleExtensions { /// <summary> /// Builds JSON query. /// </summary> ...
c5a29492-69f8-40e5-9e67-7111827e9b73
{ "language": "C#" }
```c# ``` Print pairs with difference k
```c# // http://careercup.com/question?id=5727804001878016 // // Given a sorted array of positive integers and a positive value // return all pairs which differ by k. using System; using System.Collections.Generic; using System.Linq; static class Program { static IEnumerable<Tuple<int, int>> Pairs(this int[] arra...
6c2973d0-af4a-4e23-8168-5afac439c9d9
{ "language": "C#" }
```c# ``` Add tests for Base64 encoding/decoding
```c# namespace Easy.Common.Tests.Unit.BaseEncoding { using NUnit.Framework; using Shouldly; [TestFixture] public class Base64Tests { [TestCase] public void When_encoding() => Base64.Encode(new byte[] {1, 15, 30, 40, 0, 13, 10, 43}).ShouldBe("AQ8eKAANCis"); [TestCase] ...
e37fa7ab-1c63-43c6-a5ac-0974fc8a9e7c
{ "language": "C#" }
```c# ``` Fix - Corretto bug notifica delete chiamata in corso Add - Gestito GeneratoreCodiciRichieste nel Fake Json Chg - TitoTerreno modificato in List Chg - Stato modificato in String (Era int)
```c# using System; using System.Collections.Generic; using System.Text; namespace SO115App.Models.Servizi.Infrastruttura.GestioneSoccorso { interface IGetRichiesteAssistenza { } } ```
9f9e2524-6994-4e0f-ac52-f370cfc1d9f6
{ "language": "C#" }
```c# ``` Add a switch test to cover Jit codegen.
```c# // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using System; class SwitchTest { const int Pass = 100; const int Fail = -1; public static int Main() { int sum =0; for(int i=2; i < 5; i++) { switc...
4e624de4-b079-454c-a923-aff577fda9b5
{ "language": "C#" }
```c# ``` Test using a disposed plugin
```c# namespace ServiceBus.AttachmentPlugin.Tests { using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.Azure.ServiceBus; using Microsoft.Azure.ServiceBus.Core; using Xunit; public class When_reusing_plugin { [Fac...
a80873f0-befd-4ab4-8c2c-4c264b2d0140
{ "language": "C#" }
```c# ``` Add class accidentally omitted from last commit
```c# // Copyright (c) 2017 SIL International // This software is licensed under the MIT license (http://opensource.org/licenses/MIT) using System; namespace LfMerge.Core.MongoConnector { /// Reimplementations of some PHP functions that turn out to be useful in the MongoConnector class public static class PseudoPhp ...
56c496e6-3b83-4b66-a5ce-4ece0dbf7018
{ "language": "C#" }
```c# ``` Add test scene for song bar component
```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.Graphics; using osu.Game.Beatmaps.Legacy; using osu.Game.Tests.Visual; using osu.Game.Tournament.Components; namespace o...
6bde7c17-b9bb-4eea-bd9b-3a83ce1c6636
{ "language": "C#" }
```c# ``` Add benchmark for stream extensions
```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 System; using System.IO; using BenchmarkDotNet.Attributes; using osu.Framework.Extensions; namespace osu.Framework.Benchmarks { [MemoryDiagnoser] pu...
59265129-eab1-4ce3-ad64-2dc4e89e13c8
{ "language": "C#" }
```c# using System; using System.IO; namespace LibGit2Sharp.Tests.TestHelpers { public class SelfCleaningDirectory : IDisposable { public SelfCleaningDirectory() : this(BuildTempPath()) { } public SelfCleaningDirectory(string path) { if (Directory.Exists(pa...
```c# using System; using System.IO; namespace LibGit2Sharp.Tests.TestHelpers { public class SelfCleaningDirectory : IDisposable { public SelfCleaningDirectory() : this(BuildTempPath()) { } public SelfCleaningDirectory(string path) { if (Directory.Exists(pa...
49dd73c4-b98e-40e9-954d-956baa96268c
{ "language": "C#" }
```c# ``` Add add Michelin wmts sample
```c# using System.Linq; using System.Net.Http; using BruTile.Wmts; using Mapsui.Layers; using Mapsui.UI; namespace Mapsui.Samples.Common.Maps { public class WmtsMichelinSample : ISample { public string Name => "5 WMTS Michelin"; public string Category => "Data"; public void Setup(IMa...
9d440eb9-8b58-45c7-bac7-6314ed875052
{ "language": "C#" }
```c# ``` Remove duplicates from sorted array II
```c# // https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/ // // Follow up for "Remove Duplicates": // What if duplicates are allowed at most twice? // // For example, // Given sorted array nums = [1,1,1,2,2,3], // // Your function should return length = 5, // with the first five elemen...
d15a756c-9e39-4b25-814c-0dd5b0d3849c
{ "language": "C#" }
```c# ``` Define common Complex dialog interface
```c# using System; using System.Collections.Generic; using System.Text; namespace IronAHK.Rusty { interface IComplexDialoge { string MainText { get; set; } string Subtext { get; set; } string Title { get; set; } #region Form //DialogResult ShowDialog(); void ...
87db54aa-eead-40cd-858a-64ae3dff13dc
{ "language": "C#" }
```c# ``` Add separate test for stateful multiplayer client
```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.Testing; using osu.Game.Tests.Visual.Multiplayer; using osu.Game.Users; namespace osu.Game.Tests.OnlinePlay { [Headl...
51c839d1-d205-4238-a61e-124e93cb48b4
{ "language": "C#" }
```c# ``` Implement tests for Commands interface, tests include lazy loading and "not supported command" -test.
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using Xunit; namespace SCPI.Tests { public class Commands_Tests { [Fact] public void HasSupportedCommands() { // Arrange var commands = new Commands(); // Ac...
46303a37-467a-4fce-948f-ef2fb59c8743
{ "language": "C#" }
```c# using MyShop.Views.Tablet; using System; using System.Collections.Generic; using Xamarin.Forms; namespace MyShop { public partial class HomePage : ContentPage { public HomePage () { InitializeComponent (); Xamarin.Insights.Track ("Home"); BindingContext = new HomeViewModel (this); ButtonFindS...
```c# using MyShop.Views.Tablet; using System; using System.Collections.Generic; using Xamarin.Forms; namespace MyShop { public partial class HomePage : ContentPage { public HomePage () { InitializeComponent (); Xamarin.Insights.Track ("Home"); BindingContext = new HomeViewModel (this); ButtonFindS...
6b3f1600-0cfc-4a62-ab4d-91b86d139b9c
{ "language": "C#" }
```c# ``` Add test coverage of TransactionalCommitComponent
```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 System; using NUnit.Framework; using osu.Game.Screens.Edit; namespace osu.Game.Tests.Editing { [TestFixture] public class TransactionalCommitComponen...
1eb2bae4-41e9-401e-89de-f733d06ad623
{ "language": "C#" }
```c# using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.Extensions.DependencyInjection; using IdentityServer3.Core.Configuration; using IdentityServer.Configuration; using System.Security.Cryptography.X509Certificates; using Microsoft.Extensions.PlatformAbstractions; using Microsoft.Exten...
```c# using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.Extensions.DependencyInjection; using IdentityServer3.Core.Configuration; using IdentityServer.Configuration; using System.Security.Cryptography.X509Certificates; using Microsoft.Extensions.PlatformAbstractions; using Microsoft.Exten...
4b1627e3-339f-413a-bf8d-4b0e5f3e5a46
{ "language": "C#" }
```c# ``` Add interface for a migration
```c# using System.Threading.Tasks; namespace RapidCore.Migration { /// <summary> /// Defines a migration /// </summary> public interface IMigration { /// <summary> /// Code that is run when upgrading the environment /// </summary> Task UpgradeAsync(IMigrationContex...
4967cfb4-c089-4cc9-9666-f6e7b81c5266
{ "language": "C#" }
```c# using System; using System.Collections.Generic; namespace Glimpse.Core2.Framework { public class GlimpseMetadata { public GlimpseMetadata() { plugins = new Dictionary<string, PluginMetadata>(); } public string version{ get; set; } public IDictionary<st...
```c# using System; using System.Collections.Generic; namespace Glimpse.Core2.Framework { public class GlimpseMetadata { public GlimpseMetadata() { plugins = new Dictionary<string, PluginMetadata>(); //TODO: this is really bad... Nik needs to work on how we want to do t...
bdaf3f88-afd5-4249-8ca9-a162481f7572
{ "language": "C#" }
```c# ``` Use this instead of LocaleType
```c# using System; using System.Data; using System.Globalization; namespace NHibernate.Type { /// <summary> /// CultureInfoType. /// </summary> public class CultureInfoType : ImmutableType, ILiteralType { public override object Get(IDataReader rs, string name) { string str = (string) NHibernate.String.Get(...
3ec9a522-f4f7-4839-9f92-f4665f0b0475
{ "language": "C#" }
```c# ``` Add support for UIViews in section headers and footers.
```c# using System; using System.Drawing; using System.Linq; using MonoTouch.UIKit; using MonoTouch.Dialog; namespace Sample { public partial class AppDelegate { public void DemoHeadersFooters () { var section = new Section () { HeaderView = new UIImageView (UIImage.FromFile ("caltemplate.png")), Fo...
6e80c3bc-0d74-4d0c-ba9a-2f0416366281
{ "language": "C#" }
```c# @using Orchard.Tags.Models <ul class="tag-cloud"> @foreach (TagCount tagCount in Model.TagCounts) { <li class="tag-cloud-tag tag-cloud-tag-@tagCount.Bucket"> @Html.ActionLink(tagCount.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = tagCount.TagName ...
```c# @using Orchard.Tags.Models <ul class="tag-cloud"> @if (((IEnumerable<object>)Model.TagCounts).Any()) { foreach (TagCount tagCount in Model.TagCounts) { <li class="tag-cloud-tag tag-cloud-tag-@tagCount.Bucket"> @Html.ActionLink(tagCount.TagName, "Search", "Home", new { ...
f755acc2-065b-4044-a2ad-56ca7acba048
{ "language": "C#" }
```c# ``` Fix the solution not building after a fresh clone.
```c# using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyCompany("The Git Development Community")] [assembly: AssemblyCopyright("Copyright © 2009 The GitSharp Team")] [assembly: ComVisible(false)] #if DEBUG [assembly: AssemblyConfiguratio...
c8c09597-deb4-4fbf-9770-75a3e310a7df
{ "language": "C#" }
```c# ``` Add class to relay progress reporting For use whenever directly implementing IReportProgress is impossible
```c# using System; using System.Collections.Generic; using System.Text; namespace SkyEditor.Core.Utilities { /// <summary> /// A basic implementation of <see cref="IReportProgress"/> that can be used to relay progress reporting when a function's parent class cannot implement this interface. /// </summary...
624f633f-5fc9-4e06-a127-701ff8a04dc3
{ "language": "C#" }
```c# // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; namespace osu.Framework.Grap...
```c# // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; namespace osu.Framework.Grap...
7436628a-8e84-40bb-bbb6-3fa5d1ce183e
{ "language": "C#" }
```c# ``` Add missing new test board target class
```c# using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using SignTestInterface; using winusbdotnet; namespace SignControl { class TargetTestBoard : ISignTarget { public TargetTestBoard() { Tes...
1c1452d9-a9d4-4bd5-a3e7-87f6b66cddf7
{ "language": "C#" }
```c# ``` Add new tests for Unified Label
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using CocosSharp; namespace tests { public class LabelFNTColorAndOpacity : AtlasDemoNew { float m_time; CCLabel label1, label2, label3; public LabelFNTColorAndOpacity() { m_time =...
e0004673-c881-427d-9e4a-7c531f8c1f55
{ "language": "C#" }
```c# ``` Add test for Ignore attribute
```c# using System.Collections.Generic; using System.Linq; using NUnit.Framework; using SQLite.Net.Attributes; #if __WIN32__ using SQLitePlatformTest = SQLite.Net.Platform.Win32.SQLitePlatformWin32; #elif WINDOWS_PHONE using SQLitePlatformTest = SQLite.Net.Platform.WindowsPhone8.SQLitePlatformWP8; #elif __WINRT__ usi...
dff26503-139c-485c-8fdc-9f13bd60f84b
{ "language": "C#" }
```c# ``` Add a docs module to the sample project.
```c# using Mango; using Mango.Templates.Minge; namespace MangoProject { public class Docs : MangoModule { public static void GettingStarted (MangoContext context) { } public static void Api (MangoContext context) { } } } ```
9bf8988b-88b0-4018-a165-965c8eb888bd
{ "language": "C#" }
```c# ``` Add example source code for Sense Hat connecting to Azure IoT Hub.
```c# using System; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 namespace DemoSenseHat { /// <summary> /// An empty page that can be used on its own or navigated to within a Frame. /// </...
9378854b-26ce-4302-8d4c-dc4f30ef62a1
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; namespace ExpressionToCodeLib { public static class PAssert { public static void IsTrue(Expression<Func<bool>> assertion) { That(assertion,"PAssert.IsTrue failed for:"); } pu...
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; namespace ExpressionToCodeLib { public static class PAssert { public static void IsTrue(Expression<Func<bool>> assertion) { That(assertion,"PAssert.IsTrue failed for:"); } pu...
776a8e8e-4118-4f3a-8615-5fa6805db7a8
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using System.Linq; namespace csmacnz.Coveralls { public class CoverageFileBuilder { private readonly string _filePath; private readonly Dictionary<int,int> _coverage = new Dictionary<int, int>(); public CoverageFileBuilder(string f...
```c# using System; using System.Collections.Generic; using System.Linq; namespace csmacnz.Coveralls { public class CoverageFileBuilder { private readonly string _filePath; private readonly Dictionary<int,int> _coverage = new Dictionary<int, int>(); public CoverageFileBuilder(string f...
a2d9f340-3b30-4cb7-b75c-263a8dc67dfa
{ "language": "C#" }
```c# ``` Add test to make sure the algorithm is passed down in time
```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 System.Linq; using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Testing; using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.M...
b9302126-e082-494e-95c6-b73219aa4513
{ "language": "C#" }
```c# ``` Add google-cloud-resource-prefix header for Datastore calls
```c# // Copyright 2016, Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by ap...
dae02fb5-d35d-4c2f-95d6-fa0226915151
{ "language": "C#" }
```c# ``` Add tool to display all external dependencies, with versions
```c# // Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
40ef0ebd-02f1-4c52-9843-3b1effcd4e9c
{ "language": "C#" }
```c# ``` Add proof of concept components list
```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 System; using System.Diagnostics; using System.Linq; using NUnit.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.G...
2376b253-4c17-487f-a127-25a314aea495
{ "language": "C#" }
```c# ``` Test case for store (no-GC) value type to static field
```c# // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using System; struct TestValue { public int a; public short b; public long c; } // This test stores a primitive (no-GC fields) value type to a static fi...
dc0870e3-82b6-41be-94d5-4c1fbe662703
{ "language": "C#" }
```c# ``` Define a math class in the standard library
```c# namespace System { /// <summary> /// Defines common mathematical functions and operations. /// </summary> public static class Math { public const double PI = 3.14159265358979; } }```
49e52f21-3a7b-4b4e-a922-a04ff48dd7d2
{ "language": "C#" }
```c# ``` Add models for User feedback.
```c# using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using CompetitionPlatform.Data.AzureRepositories.Users; namespace CompetitionPlatform.Models { public class FeedbackViewModel : IUserFeedbackData { public string Email { get; set; } [Required] ...
52aff874-6bd6-4d38-a0e6-1a05bcf22f01
{ "language": "C#" }
```c# // // Copyright (c) Microsoft. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applica...
```c# // // Copyright (c) Microsoft. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applica...
c3448c51-fe1b-40dd-9c67-9d3804f27c2f
{ "language": "C#" }
```c# ``` Add event args for product rating
```c# using System; namespace ZobShop.ModelViewPresenter.Product.Details.RateProduct { public class RateProductEventArgs : EventArgs { public RateProductEventArgs(int rating, string content, int productId, string authorId) { this.Rating = rating; this.Content = content;...
20dcb5e4-8e4d-4b24-8f85-742423f7e823
{ "language": "C#" }
```c# ``` Add a compilation root as a container for individual compilation units created by parsing each file.
```c# using System.Collections.Generic; namespace slang.Compilation { public class CompilationRoot { public CompilationRoot (CompilationMetadata metadata) { CompilationUnits = new List<CompilationUnit> (); Metadata = metadata; } public List<CompilationU...
4eb0afdb-c49e-43b0-8479-03431b568d8f
{ "language": "C#" }
```c# ``` Add some tests for KeyboardDevice.
```c# using Avalonia.Input.Raw; using Avalonia.Interactivity; using Moq; using Xunit; namespace Avalonia.Input.UnitTests { public class KeyboardDeviceTests { [Fact] public void Keypresses_Should_Be_Sent_To_Root_If_No_Focused_Element() { var target = new KeyboardDevice(); ...
ba029303-e2a3-4dab-ba7c-9fb9137e79db
{ "language": "C#" }
```c# ``` Add empty viewer for .so and .dylib files
```c# using System.Collections.Generic; using System.Windows.Controls; using NuGetPackageExplorer.Types; namespace PackageExplorer { [PackageContentViewerMetadata(100, ".so", ".dylib")] internal class NativeLibraryFileViewer : IPackageContentViewer { public object GetView(IPackageContent selectedF...
739e12aa-674b-480b-afe5-fdabb94dc8ba
{ "language": "C#" }
```c# ``` Add a lint rule that checks for correctness of view definitions.
```c# using System; using System.Collections.Generic; using System.Data; using System.Linq; using Dapper; using SJP.Schematic.Core; namespace SJP.Schematic.Lint.Rules { public class InvalidViewDefinitionRule : Rule { public InvalidViewDefinitionRule(IDbConnection connection, RuleLevel level) ...
6391f97a-1c6b-467f-a558-556b03ec7811
{ "language": "C#" }
```c# ``` Add some query unit test
```c# using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.IO; using System.Linq; using System.Threading.Tasks; using System.Collections; using System.Collections.Generic; using System.Text; using System.Reflection; using System.Text.RegularExpressions; using LiteDB.Engine; namespace LiteDB....
7cbf4e5d-081b-411f-887d-fa26a05b5303
{ "language": "C#" }
```c# ``` Fix the issues with the persistentId and vessels dissapearing, etc
```c# using Harmony; using LmpCommon.Enums; // ReSharper disable All namespace LmpClient.Harmony { /// <summary> /// This harmony patch is intended to always assign a persistentID and NEVER use the persistent id of the .craft file /// </summary> [HarmonyPatch(typeof(ShipConstruct))] [HarmonyPatch(...
7da51c17-aece-41ff-b0ce-a8b2f5765819
{ "language": "C#" }
```c# ``` Make movement better, still not the best
```c# namespace Engine { public class Vector { public readonly int _x; public readonly int _y; public Vector(int x, int y) { _x = x; _y = y; } } } ```
d1e49f31-033b-4aa4-8501-3f675f7489af
{ "language": "C#" }
```c# ``` Add tests for ITraktHttpRequest interface.
```c# namespace TraktApiSharp.Tests.Experimental.Requests.Interfaces { using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Linq; using System.Net.Http; using TraktApiSharp.Experimental.Requests.Interfaces; [TestClass] public class ITraktHttpRequestTests...
430ec582-c302-4517-8700-c93ab3d74094
{ "language": "C#" }
```c# ``` Add test coverage of editor sample playback
```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 System.Linq; using NUnit.Framework; using osu.Framework.Graphics.Audio; using osu.Framework.Testing; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu; usi...
1bc43e16-e9a8-4358-b101-762dca6445fb
{ "language": "C#" }
```c# ``` Copy of other project to get started.
```c# using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: Asse...
79ce1b28-acd5-4c03-afa3-eae753dd40e1
{ "language": "C#" }
```c# @model eShopWeb.ViewModels.PaginationInfo <div class="esh-pager"> <div class="container"> <article class="esh-pager-wrapper row"> <nav> <a class="esh-pager-item esh-pager-item--navigable @Model.Previous" id="Previous" href="@Url...
```c# @model eShopWeb.ViewModels.PaginationInfo <div class="esh-pager"> <div class="container"> <article class="esh-pager-wrapper row"> <nav> <a class="esh-pager-item esh-pager-item--navigable @Model.Previous" id="Previous" ...
48673411-a374-4bef-89ef-07e36ce01dc9
{ "language": "C#" }
```c# ``` Add Unit Test for Report Training Provider Command Handler
```c# using MediatR; using Moq; using NServiceBus; using NUnit.Framework; using SFA.DAS.EmployerAccounts.Commands.ReportTrainingProvider; using SFA.DAS.EmployerAccounts.Configuration; using SFA.DAS.NLog.Logger; using SFA.DAS.Notifications.Messages.Commands; using System; using System.Collections.Generic; using System....
15d257d8-a609-4907-bce1-b5ae67887915
{ "language": "C#" }
```c# ``` Add test checking incompatibility of multi mods
```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 System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; using osu.Game.Rulesets; using osu.Game.Rulesets.Catch; using osu.Game.Rul...
b71554ba-4e2e-4ec8-aa5a-703342de09b5
{ "language": "C#" }
```c# ``` Add example for storing a private key in a file
```c# using System; using NSec.Cryptography; using System.Collections.Generic; using Xunit; namespace NSec.Tests.Examples { public static class ExportImport { [Fact] public static void ExportImportNSecPrivateKey() { // fake System.IO.File var File = new Dictionar...
4bff7934-814d-4413-9324-fbbc6cd33ec7
{ "language": "C#" }
```c# ``` Add abstract hit object application test scene
```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 System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Testing; using osu.Framework.Timing; using osu.Game.Beatmaps; using ...
7b75ede7-ac4b-430e-a1ff-1f16c144de39
{ "language": "C#" }
```c# ``` Change color of components to highlight them.
```c# //ASynchronous template //----------------------------------------------------------------------------------- // PCB-Investigator Automation Script // Created on 01.03.2016 // Autor support@easylogix.de // www.pcb-investigator.com // SDK online reference http://www.pcb-investigator.com/sites/default/files/d...
cd0679fc-e25f-4a75-bd8e-167f48d12787
{ "language": "C#" }
```c# ``` Add NStoolbarItem.cs which now supports an Activated event
```c# // // NSToolbarItem.cs: Support for the NSToolbarItem class // // Author: // Johan Hammar // using System; using MonoMac.ObjCRuntime; using MonoMac.Foundation; namespace MonoMac.AppKit { public partial class NSToolbarItem { public event EventHandler Activated { add { Target = ActionDispatcher.Set...
77ff053c-8c88-47f7-b329-9af19ad3643a
{ "language": "C#" }
```c# ``` Fix missing files for release 3.7.4.2704
```c# namespace Patagames.Pdf.Net.Controls.WinForms { /// <summary> /// Represents the scaling options of the page for printing /// </summary> public enum PrintSizeMode { /// <summary> /// Fit page /// </summary> Fit, /// <summary> /// Actual size ...
2d47e0b1-7ecf-4675-a85c-81bd47cd5a2b
{ "language": "C#" }
```c# ``` Add base implementation for agent bus
```c# using System; using System.Collections.Generic; using System.Reactive.Linq; using System.Reactive.Subjects; using System.Reflection; namespace Glimpse.Agent { public class DefaultMessageAgentBus : IMessageAgentBus { private readonly ISubject<IMessage> _subject; // TODO: Review if we ca...