doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
eab62cc8-3292-4fd9-9049-83008b1ece16
{ "language": "C#" }
```c# ``` Add regression test for the pattern of using DHO proxy in `LifetimeManagementContainer`
```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.Collections.Generic; using NUnit.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Testing; using o...
3017fa49-30d0-4580-9851-a02829f0a18d
{ "language": "C#" }
```c# ``` Add a platform detection mechanism to use in tests
```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.Runtime.InteropServices; // TODO: This implementation is temporary until Environment.OSVersion is officially exposed, // at whic...
7f3d2e1a-b030-4ede-9899-cec29f3db0e2
{ "language": "C#" }
```c# using Serilog; namespace GitHub.Logging { public static class ILoggerExtensions { public static void Assert(this ILogger logger, bool condition, string messageTemplate) { if (!condition) { messageTemplate = "Assertion Failed: " + messageTemplate; #p...
```c# using System; using System.Globalization; using System.Threading.Tasks; using Serilog; namespace GitHub.Logging { public static class ILoggerExtensions { public static void Assert(this ILogger logger, bool condition, string messageTemplate) { if (!condition) { ...
4034e4d6-5af4-4484-930b-2f543e5e13ca
{ "language": "C#" }
```c# ``` Add a Task extension to handle timeouts
```c# using System; using System.Threading; using System.Threading.Tasks; namespace CircuitBreaker.Net { // The following code is taken from "Crafting a Task.TimeoutAfter Method" post by Joe Hoag // http://blogs.msdn.com/b/pfxteam/archive/2011/11/10/10235834.aspx public static class TaskExtensions { ...
603405ec-f7f0-4c78-a7c5-2c183ae5d725
{ "language": "C#" }
```c# ``` Add sample class with implementation of IComparable<>
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Recipe.ClassAndGeneric { /// <summary> /// Simple class that implements IComparable<> /// </summary> public class Square : IComparable<Square> { public Square...
f74bca60-697c-4372-9533-646d9b1803b7
{ "language": "C#" }
```c# ``` Add class to auto-activate touch controls.
```c# using UnityEngine; using UnityEngine.Assertions; [ExecuteInEditMode] public class AutoEnableTouchControls : BaseBehaviour { private GameObject canvasGo; private GameObject eventSystem; void Start() { canvasGo = gameObject.transform.Find("Canvas").gameObject; Assert.IsNotNull(canvasGo); eventSystem =...
e8982fa2-901c-425b-8440-5c14ed5feff9
{ "language": "C#" }
```c# ``` Add an extension method to the worksheet
```c# using OfficeOpenXml; public static class WorksheetExtensions { public static string[,] ToStringArray(this ExcelWorksheet sheet) { string[,] answer = new string[sheet.Dimension.Rows, sheet.Dimension.Columns]; for (var rowNumber = 1; rowNumber <= sheet.Dimension.Rows; rowNumber++) { ...
d7a32e3f-74c8-436d-9685-5be3a84726a2
{ "language": "C#" }
```c# ``` Add Console abstraction for test suites
```c# using Internal.ReadLine.Abstractions; using System; namespace ReadLine.Tests.Abstractions { internal class Console2 : IConsole { public int CursorLeft => _cursorLeft; public int CursorTop => _cursorTop; public int BufferWidth => _bufferWidth; public int BufferHeight =>...
30b18eb5-bde8-4c03-9fba-817c0a7b304e
{ "language": "C#" }
```c# ``` Add test for changing data type (Thanks @prankaty )
```c# using ClosedXML.Excel; using NUnit.Framework; using System; namespace ClosedXML_Tests.Excel.Cells { [TestFixture] public class DataTypeTests { [Test] public void ConvertNonNumericTextToNumberThrowsException() { using (var wb = new XLWorkbook()) { ...
31424a95-79f2-4d08-9d51-5252367e68cf
{ "language": "C#" }
```c# ``` Add basic benchmarks for Is and Class selectors.
```c# using Avalonia.Controls; using Avalonia.Styling; using BenchmarkDotNet.Attributes; namespace Avalonia.Benchmarks.Styling { [MemoryDiagnoser] public class SelectorBenchmark { private readonly Control _notMatchingControl; private readonly Calendar _matchingControl; private read...
b452e139-dbd0-41c3-b075-bf135ac84738
{ "language": "C#" }
```c# ``` Add type to represent range in a text file
```c# using System; namespace Microsoft.Windows.PowerShell.ScriptAnalyzer { public class Range { public Position Start { get; } public Position End { get; } public Range(Position start, Position end) { if (start > end) { throw new Argument...
1428c9ba-66fe-422b-8e54-97811d0e5d35
{ "language": "C#" }
```c# ``` Create audio source controller component
```c# using UnityEngine; using System.Collections; namespace ATP.AnimationPathTools.AudioSourceControllerComponent { public class AudioSourceController : MonoBehaviour { private void Start() { } private void Update() { } } } ```
0460fdbd-49f4-47c3-abde-0d993a73cedc
{ "language": "C#" }
```c# ``` Add `RulesetStore` for use where realm is not present (ie. other projects)
```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 osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Platform; #nullable enable ...
545cb08d-0cde-421c-8042-ddf02ac31e09
{ "language": "C#" }
```c# using System; using System.Data; using System.Data.Common; using System.IO; using System.Reflection; namespace Simple.Data.Mysql { public static class MysqlConnectorHelper { private static DbProviderFactory _dbFactory; private static DbProviderFactory DbFactory ...
```c# using System; using System.Data; using System.Data.Common; using System.IO; using System.Reflection; namespace Simple.Data.Mysql { public static class MysqlConnectorHelper { private static DbProviderFactory _dbFactory; private static DbProviderFactory DbFactory { ...
4949c555-bd2d-48ee-bc5b-5315da35cdbd
{ "language": "C#" }
```c# using System; using umbraco.DataLayer; namespace umbraco.editorControls { /// <summary> /// Summary description for cms.businesslogic.datatype.DefaultDataKeyValue. /// </summary> public class DefaultDataKeyValue : cms.businesslogic.datatype.DefaultData { public DefaultDataKeyValue(cms.busines...
```c# using System; using umbraco.DataLayer; namespace umbraco.editorControls { /// <summary> /// Summary description for cms.businesslogic.datatype.DefaultDataKeyValue. /// </summary> public class DefaultDataKeyValue : cms.businesslogic.datatype.DefaultData { public DefaultDataKeyValue(cms.busines...
9a8f0fcd-9cd1-4212-a3d4-b034e2daf469
{ "language": "C#" }
```c# ``` Add index only drawer node
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel.Composition; using SlimDX; using SlimDX.Direct3D11; using VVVV.PluginInterfaces.V2; using VVVV.PluginInterfaces.V1; using FeralTic.DX11; using FeralTic.DX11.Resources; namespace VVVV.DX11.Nodes {...
6c7fc668-a4cc-4954-ba02-d7ec48907d8b
{ "language": "C#" }
```c# ``` Add container for non-array results
```c# using Newtonsoft.Json; namespace TMDbLib.Objects.General { public class SingleResultContainer<T> { [JsonProperty("id")] public int Id { get; set; } [JsonProperty("results")] public T Results { get; set; } } }```
1388c276-b831-4794-bdcb-a77086ee015e
{ "language": "C#" }
```c# ``` Test invalid filter type handling.
```c# using System; using Xunit; using Pingu.Filters; namespace Pingu.Tests { public class FilterTests { [Fact] public void Get_filter_throws_for_invalid_filter_type() { var arex = Assert.Throws<ArgumentOutOfRangeException>(() => DefaultFilters.GetFilterForType((FilterType...
d082f547-1ae6-4512-a48f-85b22bdfba1e
{ "language": "C#" }
```c# ``` Add some basic tests for tags
```c# using FluentAssertions; using Xunit; namespace Okanshi.Test { public class TagTest { [Fact] public void Creating_a_new_tag_sets_the_correct_key() { var expectedKey = "key"; var tag = new Tag(expectedKey, "anything"); tag.Key.Should().Be(expect...
942cc64d-e5c7-4522-b292-f8f5140b39ca
{ "language": "C#" }
```c# ``` Mark Height Components with region transgression
```c# //----------------------------------------------------------------------------------- // PCB-Investigator Automation Script // Created on 16.06.2016 // Autor Fabio.Gruber // // Mark all components in max height regions of drc_comp layer. // This checks each cmp over the surfaces on relevant layer with drc_...
fa7b9eb2-bfce-4f1f-b21c-2be3ee6bd477
{ "language": "C#" }
```c# ``` Add IDisposable wrapper on GCHandle
```c# // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System; using System.Runtime.InteropServices; namespace osu.Framework.Allocation { /// <summary> /// Wrapper on <see cref="GCHandle" /> t...
6e289c1f-a951-49d4-8fd6-b5ade0e6fb5b
{ "language": "C#" }
```c# ``` Add new CoinView class for query coins
```c# using System; using System.Collections; using System.Collections.Generic; using System.Linq; using NBitcoin; using WalletWasabi.Helpers; using WalletWasabi.Models; namespace WalletWasabi.Gui.Models { public class CoinsView : IEnumerable<SmartCoin> { private IEnumerable<SmartCoin> _coins; public CoinsView(...
a2b4bbce-fb37-4808-bc14-7f2b4da03035
{ "language": "C#" }
```c# ``` Implement unit tests for the StringPattern class
```c# // Copyright 2015 Coinprism, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or...
0181a3d5-38c4-4aa5-967e-2c5df394edfc
{ "language": "C#" }
```c# ``` Convert to new Visual Studio project types
```c# // This file is used by Code Analysis to maintain SuppressMessage // attributes that are applied to this project. // Project-level suppressions either have no target or are given // a specific target and scoped to a namespace, type, member, etc. [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style"...
7412b3a2-c6a8-492e-b6e8-e5a7d99deccd
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Diagnostics; namespace MatterHackers.MatterControl.Testing { public class TestingDispatch { string errorLogFileName = null; public TestingDispatch() { e...
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Diagnostics; namespace MatterHackers.MatterControl.Testing { public class TestingDispatch { string errorLogFileName = null; public TestingDispatch() { s...
c0d5e9b3-56b2-4177-8d29-4f0d53875318
{ "language": "C#" }
```c# ``` Revert the Quickstart file which is deleted by mistake
```c# /* * Copyright (c) 2018 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
adb3c37b-dd5d-4750-a74b-144af115fa28
{ "language": "C#" }
```c# ``` Add code to allow azure functions to force async on
```c# #if NET45 || NET451 using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; namespace StackifyLib.Utils { public class AsyncTracer { private static bool _AsyncTracerEnabled = false; private static DateTime _...
ca493539-d8a9-4c73-8fe6-b0295cadcf32
{ "language": "C#" }
```c# @inherits UmbracoViewPage<BlockListModel> @using Umbraco.Core.Models.Blocks @{ if (Model?.Layout == null || !Model.Layout.Any()) { return; } } <div class="umb-block-list"> @foreach (var layout in Model.Layout) { if (layout?.Udi == null) { continue; } var data = layout.Data; ...
```c# @inherits UmbracoViewPage<BlockListModel> @using Umbraco.Core.Models.Blocks @{ if (Model?.Layout == null || !Model.Layout.Any()) { return; } } <div class="umb-block-list"> @foreach (var layout in Model.Layout) { if (layout?.Udi == null) { continue; } var data = layout.Data; ...
df6c3a2f-07a1-482b-ad9a-6b8a19681f4c
{ "language": "C#" }
```c# ``` Set the course directory as Content (for MSBuild)
```c# using System; using System.Collections.Generic; using System.Text; namespace DotvvmAcademy.CourseFormat { public class MarkdownStepInfo { public string Path { get; } public string Moniker { get; } public string Name { get; } public string CodeTaskPath { get; } } } ...
51b192ce-1555-42d7-858c-9f6068e834de
{ "language": "C#" }
```c# ``` Add file missed in bug fix 440109
```c# // *********************************************************************** // Copyright (c) 2009 Charlie Poole // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restri...
58937575-badd-4de7-bacf-a317d24e47c4
{ "language": "C#" }
```c# namespace Snow { using System; using System.Collections.Generic; using Nancy.Conventions; using Nancy.ViewEngines; public class SnowViewLocationConventions : IConvention { public static SnowSettings Settings { get; set; } public void Initialise(NancyConvention...
```c# namespace Snow { using System; using System.Collections.Generic; using Nancy.Conventions; using Nancy.ViewEngines; public class SnowViewLocationConventions : IConvention { public static SnowSettings Settings { get; set; } public void Initialise(NancyConvention...
89092f22-336e-4e90-881d-390917ace53f
{ "language": "C#" }
```c# ``` Add pushconsumer wrap to donet
```c# using System; using System.Runtime.InteropServices; namespace RocketMQ.Interop { public static class PushConsumerWrap { [DllImport(ConstValues.RocketMQDriverDllName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr CreatePushConsumer(string groupId); [Dl...
1036fac5-7589-4d6d-9246-b83a2434a786
{ "language": "C#" }
```c# ``` Add testing for auto-restart behaviour
```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.Containers; using osu.Framework.Testing; using osu.Game.Rulesets; using osu.Game.Rulesets.Osu...
434d258a-97c3-410c-8d4c-5f4ed218b07d
{ "language": "C#" }
```c# ``` Add visual-only execution mode toggle 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 NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Configuration; using osu.Framework.Platform; namespace os...
02b83a87-a2ed-4180-9291-b689fd665efe
{ "language": "C#" }
```c# ``` Create a new diagram example
```c# using Aspose.Diagram; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CSharp.ProgrammersGuide.Load_Save_Convert { public class CreateNewVisio { public static void Run() { //ExStart:CreateNewVisio // Th...
c27e07cd-fe77-4b8a-89c2-a71693990ae2
{ "language": "C#" }
```c# ``` Add test class with other attribute on method
```c# using System.ComponentModel; using System.Threading.Tasks; using Refit; interface IFooWithOtherAttribute { [Get("/")] Task GetRoot(); [DisplayName("/")] Task PostRoot(); } ```
4f11347f-927a-4d7e-a407-1052634cec3f
{ "language": "C#" }
```c# // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Xunit; namespace System.Data.SqlClient.Tests { public class SqlConnectionBasicTests { ...
```c# // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Xunit; namespace System.Data.SqlClient.Tests { public class SqlConnectionBasicTests { ...
0b6cca1d-0404-438b-bd1c-404da6f61d59
{ "language": "C#" }
```c# ``` Add class to load client in private load context.
```c# /* Copyright 2020 Jeffrey Sharp Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCL...
10a29b57-98ad-4e76-84f2-b10f779be129
{ "language": "C#" }
```c# //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.239 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-gener...
```c# //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.239 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-gener...
31e87994-5278-40f9-a005-db00116cb295
{ "language": "C#" }
```c# ``` Add ISerializer impl. that uses JSON.NET
```c# using System.IO; using System.Text; using log4net.ObjectRenderer; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; namespace log4net.Util.Serializer { public class JsonDotNetSerializer : ISerializer { public RendererMap Map { get; set; } public object Serialize(object obj) ...
2e5e08d7-fc48-4921-a605-3bdfcc08ad99
{ "language": "C#" }
```c# ``` Add employee and manager as user roles
```c# using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace PetAdoptionCRM.Models { public class EmployeeRole : IdentityRole { } } ```
be3d6337-cb79-416f-8045-989002736a3d
{ "language": "C#" }
```c# ``` Add unit test for GetSymmetricAlgorithm.
```c# // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.IdentityModel.Tokens; using System.Security.Cryptography; using Infrastructure.Common; using...
82b435fb-6d63-469a-8eab-9d9b3a76535d
{ "language": "C#" }
```c# ``` Implement a class to query supported commands and get their instances.
```c# using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; namespace SCPI { public class Commands { private Dictionary<string, ICommand> commands = new Dictionary<string, ICommand>(); /// <summary> /// Creates a list of support...
4a82cce6-407b-48b4-83a5-0e90a84ac9ae
{ "language": "C#" }
```c# ``` Print pattern without a loop
```c# // http://www.geeksforgeeks.org/print-a-pattern-without-using-any-loop/ // // // Print a pattern without using any loop // // Given a number n, print following pattern without using any loop. // // Input: n = 16 // Output: 16, 11, 6, 1, -4, 1, 6, 11, 16 // // Input: n = 10 // Output: 10, 5, 0, 5, 10 // using Syst...
b705e60e-6e64-4aaa-b99a-a2301f0da650
{ "language": "C#" }
```c# ``` Add tests for RazorCompile target
```c# // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using System.Threading.Tasks; using Xunit; namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests { public class Razo...
a34d3edd-dd3d-4111-a3ea-690a2eec671a
{ "language": "C#" }
```c# ``` Create positive tests for getting values from nested environments
```c# using Xunit; using Squirrel; using Squirrel.Nodes; namespace Tests { public class EnvironmentTests { private static readonly string TestVariableName = "x"; private static readonly INode TestVariableValue = new IntegerNode(1); [Fact] public void TestGetValueFromCurrentEnvi...
29dcd91b-5579-404b-8cd1-4c15670a36be
{ "language": "C#" }
```c# ``` Create a tool for importing Whitebox *.dep files
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DotSpatial.Tools { class ImportWhiteboxRaster { } } ```
88fccd93-12bb-4e22-b927-0ea7aa2625af
{ "language": "C#" }
```c# ``` Add tests for Sha512 class
```c# using System; using NSec.Cryptography; using Xunit; namespace NSec.Tests.Algorithms { public static class Sha512Tests { public static readonly string HashOfEmpty = "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"; ...
ec609ba9-b2d1-4a39-a0bc-233694bdc62f
{ "language": "C#" }
```c# ``` Add unit tests for PointND.
```c# namespace EOpt.Math.Tests { using Microsoft.VisualStudio.TestTools.UnitTesting; using EOpt.Math; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; [TestClass()] public class PointNDTests { [TestMet...
6ff25b94-71c7-4f22-ae4c-3fe212d41dc6
{ "language": "C#" }
```c# ``` Add smoke tests for settings.
```c# // Copyright Matthias Koch 2017. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.IO; using System.Linq; using FluentAssertions; using Nuke.Common.Tools.MSBuild; using Nuke.Common.Tools.OpenCover; using Nuke.Common.Tools.Xunit2; using Nuke...
7b5be280-37f0-4f63-abae-7478e37fb12c
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using System.Data; using System.Text; using ZocMonLib; namespace ZocMonLib { public class StorageCommandsSetupSqlServer : IStorageCommandsSetup { public virtual IEnumerable<ReduceLevel> SelectAllReduceLevels(IDbConnection conn) { ...
```c# using System; using System.Collections.Generic; using System.Data; using System.Text; using ZocMonLib; namespace ZocMonLib { public class StorageCommandsSetupSqlServer : IStorageCommandsSetup { public virtual IEnumerable<ReduceLevel> SelectAllReduceLevels(IDbConnection conn) { ...
e758b4e6-df63-4ccf-a477-7fdb26cd6934
{ "language": "C#" }
```c# ``` Add missing file for ping command test.
```c# using DiabloSpeech.Business.Twitch; using DiabloSpeech.Business.Twitch.Processors; using NUnit.Framework; using tests.Twitch.Mocks; namespace tests.Twitch { public class PingCommandProcessorTest { PingCommandProcessor processor; TwitchConnectionMock connection; TwitchMessageData...
1cba0899-c01a-4473-aa4f-579e0ba2192f
{ "language": "C#" }
```c# ``` Add test covering ThreadedTaskScheduler shutdown
```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; using System.Threading.Tasks; using NUnit.Framework; using osu.Framework.Threading; namespace osu.Framework.Tests.Threading { [TestFixt...
b1ad2bf9-e271-484b-a716-01ffb7cb170b
{ "language": "C#" }
```c# ``` Add debug utilities to sleep-wait and busy-wait for a given duration
```c# using System.Diagnostics; using System.Threading; static class DebugUtilities { public static void Burn(long ms) { Stopwatch stopwatch = Stopwatch.StartNew(); while (stopwatch.ElapsedMilliseconds < ms) { } } public static void Sleep(long ms) { Stopwatch stopwatch = Stopwatch.StartNew(); while (sto...
62da440d-48d8-44f7-b3f3-1fcc4c450035
{ "language": "C#" }
```c# // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.WindowsAzure.Storage.Blob; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace Microsoft.Azure.W...
```c# // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.WindowsAzure.Storage.Blob; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace Microsoft.Azure.W...
27a4cff9-ece3-4f94-96dc-fe69bba74929
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using NUnit.Framework; using System.Collections.ObjectModel; using OpenQA.Selenium.Environment; namespace OpenQA.Selenium { [TestFixture] public class ElementPropertyTest : DriverTestFixture { [Test] [IgnoreBrowser(Browser.Edge)] ...
```c# using System; using System.Collections.Generic; using NUnit.Framework; using System.Collections.ObjectModel; using OpenQA.Selenium.Environment; namespace OpenQA.Selenium { [TestFixture] public class ElementPropertyTest : DriverTestFixture { [Test] [IgnoreBrowser(Browser.Chrome, "Chrom...
ee24ca14-9602-4d37-88f2-d7f19cdf86ad
{ "language": "C#" }
```c# ``` Add osu!-specific enum for confine mouse mode
```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.ComponentModel; using osu.Framework.Input; namespace osu.Game.Input { /// <summary> /// Determines the situations in which the mouse cursor sh...
a9a39d16-8d03-45d3-8694-8228df654f22
{ "language": "C#" }
```c# using System.Threading.Tasks; using ContosoMoments.Models; using Xamarin.Forms; using System; namespace ContosoMoments { public class ResizeRequest { public string Id { get; set; } public string BlobName { get; set; } } public class ActivityIndicatorScope : IDisposable { ...
```c# using System.Threading.Tasks; using ContosoMoments.Models; using Xamarin.Forms; using System; namespace ContosoMoments { public class ResizeRequest { public string Id { get; set; } public string BlobName { get; set; } } public class ActivityIndicatorScope : IDisposable { ...
e4801604-6c09-4b88-b69b-d72dad02be69
{ "language": "C#" }
```c# ``` Add example to get the Log of a source field.
```c# using Code.Records; namespace Code.Custom { /// <summary> /// Record Updater that will calculate the log of the source field. /// </summary> /// <example> /// // handle the record changed event /// new Code.Custom.LogFieldRecordUpdater("Source Field", "Log Field").HandleRecor...
c72047ea-8d0a-4615-9bd7-dcf5d3d6acaa
{ "language": "C#" }
```c# ``` Implement unit test for boyer moore
```c# using System; namespace Algorithms.Strings.Search { public class BoyerMoore { private int[] right; private const int R = 256; private int M; private string pat; public BoyerMoore(string pat) { this.pat = pat; right = new int[R]; ...
221f565a-8481-4e34-82a4-2bfa0142ffa6
{ "language": "C#" }
```c# using System; using JSIL; public static class Program { public static void Main (string[] args) { var print = Builtins.Global["pr" + "int"]; if (print != null) print("printed"); if (Builtins.Local["print"] != null) Builtins.Local["print"]("printed again"); ...
```c# using System; using JSIL; public static class Program { public static void Main (string[] args) { const string pri = "pri"; string nt = "nt"; var p = Builtins.Global[pri + nt]; if (p != null) p("printed"); if (Builtins.Local["p"] != null) Bu...
6ad2065b-64fb-443b-8d40-d80f9b27cf03
{ "language": "C#" }
```c# ``` Reduce the size of the keys in the generics migrator. This finally fixes the long standing issue of it failing to create the table on linux sometimes. Thanks go to Hippo_Finesmith for helping find the issue with this :).
```c# /* * Copyright (c) Contributors, http://aurora-sim.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source co...
eba224fa-a1c8-42b8-9e6b-c5cf6319d158
{ "language": "C#" }
```c# ``` Add datatypes for OPNsense Objects
```c# using System; using System.Management.Automation; namespace OPNsense.Ftpproxy { public class Proxy { #region Parameters public uint debuglevel { get; set; } public string description { get; set; } public bool enabled { get; set; } public uint idletimeout { get; set; } public string listenaddress { ...
82e31985-9455-4fe6-a05f-e36e28ad39c7
{ "language": "C#" }
```c# ``` Test for code creation from generating polynomial was added
```c# namespace AppliedAlgebra.WaveletCodesTools.Tests { using CodesResearchTools.NoiseGenerator; using Decoding.ListDecoderForFixedDistanceCodes; using Decoding.StandartDecoderForFixedDistanceCodes; using FixedDistanceCodesFactory; using GeneratingPolynomialsBuilder; using GfAlgorithms.Combina...
8b26c46f-b5a6-4ff2-a86a-f13bc8584a55
{ "language": "C#" }
```c# ``` Add converter for old storable objects
```c# using System; using LazyStorage.Interfaces; namespace LazyStorage.Xml { internal class StorableConverter<T> : IConverter<T> where T : IStorable<T>, IEquatable<T>, new() { public StorableObject GetStorableObject(T item) { return new StorableObject(item.GetStorageInfo()); ...
6652ddda-a7e8-4e2e-b314-61d86059e4fe
{ "language": "C#" }
```c# ``` Add benchmark coverage of logger
```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 BenchmarkDotNet.Attributes; using osu.Framework.Logging; using osu.Framework.Testing; namespace osu.Framework.Benchmarks { [MemoryDiagnoser...
2aceaa18-1960-4e51-bc98-52031e467cca
{ "language": "C#" }
```c# ``` Add serviceable attribute to projects.
```c# // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; [assembly: AssemblyMetadata("Serviceable", "True")]```
20aa83c1-aebe-4ce0-943c-06c668e0e253
{ "language": "C#" }
```c# ``` Add a partial view with form to reply to comments.
```c# @using System.Threading.Tasks @using CompetitionPlatform.Helpers @model CompetitionPlatform.Models.ProjectViewModels.ProjectCommentPartialViewModel <form asp-controller="ProjectDetails" asp-action="AddComment" enctype="multipart/form-data"> @if (ClaimsHelper.GetUser(User.Identity).Email != null) { ...
18b65d59-1bfb-4351-aae9-e2bf3575a42d
{ "language": "C#" }
```c# ``` Drop cassette config in for less integration
```c# using Cassette; using Cassette.Scripts; using Cassette.Stylesheets; namespace Exceptional.Web { /// <summary> /// Configures the Cassette asset bundles for the web application. /// </summary> public class CassetteBundleConfiguration : IConfiguration<BundleCollection> { publ...
a31ea14b-e550-42a5-82ce-1315b596efc3
{ "language": "C#" }
```c# ``` Add file missed in build
```c# // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. namespace ILCompiler { /// <summary> /// Used to mark TypeDesc types that are not part of the core ty...
5e18c0a8-b577-4bf5-b591-69a1e3ba453c
{ "language": "C#" }
```c# ``` Add NeutralResourcesLanguageAttribute to Channels lib
```c# // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Resources; [assembly:NeutralResourcesLanguage("en")] ```
317ed05a-1f1c-402b-a9c3-fc695e555c43
{ "language": "C#" }
```c# ``` Add code for creating challenge from IdentityModel
```c# #region Copyright /* * * * * * * * * * * * * * * * * * * * * * * * * */ /* Carl Zeiss IMT (IZfM Dresden) */ /* Softwaresystem PiWeb */ /* (c) Carl Zeiss 2020 */ /* * * * * * * * * * * * * * * * * * * * * * * * * */ #endregion namespace Z...
82695e29-8584-4e3d-91c8-69d11ec116ce
{ "language": "C#" }
```c# ``` Add new class to facilitate multi-threaded onion generation
```c# using System; using System.ComponentModel; namespace Xpdm.PurpleOnion { class OnionGenerator { private readonly BackgroundWorker worker = new BackgroundWorker(); public OnionGenerator() { worker.DoWork += GenerateOnion; worker.RunWorkerCompleted += RunWorkerCompleted; } public event Event...
4298da45-fa9b-4502-aa80-cfb92f1bca8b
{ "language": "C#" }
```c# ``` Add test to ensure ClaimsPrincipal serializes via MobileFormatter
```c# //----------------------------------------------------------------------- // <copyright file="ClaimsPrincipalTests.cs" company="Marimer LLC"> // Copyright (c) Marimer LLC. All rights reserved. // Website: https://cslanet.com // </copyright> // <summary>no summary</summary> //-----------------------------...
828833d7-8be8-466b-bcda-aa8c2272c9b5
{ "language": "C#" }
```c# ``` Add test scene for thumbnail 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.Allocation; using osu.Framework.Graphics; using osu.Game.Beatmaps.Drawables.Cards; using osu.Game.Overlays; using osuTK; ...
db019f72-75a9-4c4b-a83f-2202df354349
{ "language": "C#" }
```c# ``` Add shader disposal test coverage
```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 NUnit.Framework; using osu.Framework.Graphics.Shaders; using osu.Framework.IO.Stores; using osu.Framework.Test...
4ab8af8f-8586-4ef6-bea0-3fb0317cb368
{ "language": "C#" }
```c# ``` Add test coverage of creating, saving and loading a new beatmap
```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.Input; using osu.Framework.Testing; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Edi...
62a4ff1e-4d23-4a16-9f66-648ebfd3fd62
{ "language": "C#" }
```c# /* * Copyright (c) 2013-2015, SteamDB. 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; using System.Threading; namespace SteamDatabaseBackend { public class Watchdog { public Watchdog() { ...
```c# /* * Copyright (c) 2013-2015, SteamDB. 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; using System.Threading; namespace SteamDatabaseBackend { class Watchdog { public Watchdog() { ...
5573e908-53c1-46bf-b986-91e73e1c430e
{ "language": "C#" }
```c# // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Runtime.Remoting.Messaging; using System.Security; using System.Threading; namespace System.Diag...
```c# // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Runtime.Remoting.Messaging; using System.Security; using System.Threading; namespace System.Diag...
2d2f4afc-d03f-4171-b149-8d7f6e60af9c
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Windows; using Avalonia; using Avalonia.Logging.Serilog; namespace Infusion.Desktop { /// <summary> /// Interaction logic f...
```c# using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Windows; using Avalonia; using Avalonia.Logging.Serilog; namespace Infusion.Desktop { /// <summary> /// Interaction logic f...
89a73812-30b1-4e73-9166-a74a8e7ae0f1
{ "language": "C#" }
```c# ``` Add methods to refresh desktop and file explorer.
```c# #region auto-generated FILE INFORMATION // ============================================== // This file is distributed under the MIT License // ============================================== // // Filename: Desktop.cs // Version: 2017-10-31 08:39 // // Copyright (c) 2017, Si13n7 Developments (r) // All rights...
9e781277-3b7f-408a-9093-ef80a721e795
{ "language": "C#" }
```c# ``` Fix GUIDs not being parsed from Strings
```c# using System; using GraphQL.Language.AST; using GraphQL.Types; namespace GraphQL.Types { public class GuidGraphType : ScalarGraphType { public GuidGraphType() { Name = "Guid"; Description = "Globally Unique Identifier."; } public override object P...
af66448d-ab52-46cb-8e83-0e0997bd9567
{ "language": "C#" }
```c# ``` Implement room exists data contract
```c# using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace Schedutalk.Logic.KTHPlaces { [DataContract] public class RoomDataContract { [DataMember(Name = "floorUid")] public string ...
95059b75-80f1-4722-8196-8a201deb77e6
{ "language": "C#" }
```c# ``` Add test coverage of nested game usage
```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.Framework.Testing; namespace osu.Framework.Tests.Visual.Testing { public class TestSceneNestedGame : FrameworkT...
0a774432-30cd-43e5-bd4f-2b513e9a1d96
{ "language": "C#" }
```c# ``` Add Scroll rect by children component
```c# using System; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class ScrollRectByChildren : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IScrollHandler { public ScrollRect scrollRect; private void Awake() { if (scrollRect...
c7c98fe0-3935-4752-99fe-1a9fab74979a
{ "language": "C#" }
```c# ``` Add rotation drag handle 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 osu.Framework.Allocation; using osu.Framework.Extensions.EnumExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osuTK; usin...
2653e734-aa97-4d3b-b432-c6b2882c73af
{ "language": "C#" }
```c# ``` Add unit tests that that does not add much value yet
```c# using NUnit.Framework; namespace Mapsui.Tests { [TestFixture] public class ViewportTests { [Test] public void SetCenterTest() { // Arrange var viewport = new Viewport(); // Act viewport.SetCenter(10, 20); // Assert...
d064c906-474d-4a3e-8bcd-8e42ff1bba33
{ "language": "C#" }
```c# ``` Test to verify compiled query error was addressed in v4 changes. Closes GH-784
```c# using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using Marten.Linq; using Marten.Testing.Documents; using Marten.Testing.Harness; using Shouldly; using Xunit; using Xunit.Abstractions; namespace Marten.Testing.Bugs { public class Bug_784_Collection_Contains_wi...
85f61e66-0203-4ddf-803e-317ea7b6785d
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using Xunit; using Xunit.Extensions; namespace AppHarbor.Tests { public class TypeNameMatcherTest { interface IFoo { } class Foo : IFoo { } private static Type FooType = typeof(Foo); [Fact] public void ShouldThrowIfInitializedWithUnnasignableTyp...
```c# using System; using System.Collections.Generic; using Xunit; using Xunit.Extensions; namespace AppHarbor.Tests { public class TypeNameMatcherTest { interface IFoo { } class Foo : IFoo { } private static Type FooType = typeof(Foo); [Fact] public void ShouldThrowIfInitializedWithUnnasignableTyp...
0f767a5f-21ac-4a29-a90b-8911c62924c7
{ "language": "C#" }
```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.IO; using osu.Framework.Audio; using osu.Framework.Audio.Track; using osu.Framework.Graphics.Textures; using osu.Game.Beatmaps; usi...
```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.IO; using osu.Framework.Audio; using osu.Framework.Audio.Track; using osu.Framework.Graphics.Textures; using osu.Game.Beatmaps; using osu.Game.Skinnin...
54747497-8979-46a1-8675-a3e242b4928d
{ "language": "C#" }
```c# ``` Add a level script that can trigger the ending cutscene
```c# using System.Collections; using System.Collections.Generic; using UnityEngine; public class BuilderLevel : MonoBehaviour { public CameraManager camera; public void doTakeoff() { double time = 1.5; Vector3 pos = camera.transform.position; pos.y += -10; //camera.scootTo (pos, time); camera.rotateTo ...
0bd8c7f5-83cd-4e69-9d1e-9295a2e6d629
{ "language": "C#" }
```c# ``` Add tracingheader for support Diagnostics
```c# // Copyright (c) .NET Core Community. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System.Collections; using System.Collections.Generic; using System.Linq; namespace DotNetCore.CAP.Diagnostics { public class TracingHeaders : IEnu...
747957f4-c700-4939-8ecc-fc42da6ad3fd
{ "language": "C#" }
```c# ``` Update the example to skip authentication
```c# namespace BasicExample { using System; using System.Collections.Generic; using Crest.Abstractions; /// <summary> /// Shows an example of how to disable JWT authentication. /// </summary> public sealed class DisableJwtAuthentication : IJwtSettings { /// <inheritdoc /> ...
91123981-0b18-44dd-b9f8-9571887f5928
{ "language": "C#" }
```c# ``` Create initial attributes for attribute-driven Worksheet.FromData
```c# using System; namespace Simplexcel.Cells { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] internal class XlsxColumnAttribute : Attribute { /// <summary> /// The name of the Column, used as the Header row /// </sum...
33675d84-dc8d-44bb-8b6d-0e656116ffe9
{ "language": "C#" }
```c# ``` Add Brandon Olin as author
```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 BrandonOlin : IFilterMyBlogPosts, IAmACommunityMember { public string FirstName => "Brandon"...
395b2c9e-0982-471d-a083-f98304827904
{ "language": "C#" }
```c# ``` Add benchmark coverage of `Scheduler`
```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 BenchmarkDotNet.Attributes; using osu.Framework.Threading; namespace osu.Framework.Benchmarks { public class BenchmarkScheduler : BenchmarkTest { ...
0504fb00-75d7-4b50-b8c9-37f95b2851f5
{ "language": "C#" }
```c# ``` Add dump PSI for file internal action
```c# using System.Diagnostics; using System.IO; using System.Text; using JetBrains.Application.DataContext; using JetBrains.Application.UI.Actions; using JetBrains.Application.UI.ActionsRevised.Menu; using JetBrains.Application.UI.ActionSystem.ActionsRevised.Menu; using JetBrains.ProjectModel; using JetBrains.ProjectM...
76083ba7-9ed3-4fd4-9365-6550886abfa3
{ "language": "C#" }
```c# ``` Create abstract base class for a HttpServer
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Net; using System.Threading; namespace Snowflake.Core.Server { public abstract class BaseHttpServer { HttpListener serverListener; Thread serverThread; ...
872513fa-b787-4db8-a666-5c3b76b09a80
{ "language": "C#" }
```c# ``` Fix build error for XCode
```c# using System; using System.IO; using UnityEngine; using UnityEditor; using UnityEditor.iOS.Xcode; using UnityEditor.Callbacks; using System.Collections; public class UpdateXcodeProject { [PostProcessBuildAttribute (0)] public static void OnPostprocessBuild (BuildTarget buildTarget, string pathToBuiltProject)...
b287bc46-7888-4deb-afb3-b647c976bcad
{ "language": "C#" }
```c# ``` Add helper extension methods for route data - Added RouteData.GetCurrentPage<T>() - Added RouteData.GetNavigationContext()
```c# using System.Web; using System.Web.Routing; using BrickPile.Core.Routing; namespace BrickPile.Core.Extensions { public static class RouteDataExtensions { public static T GetCurrentPage<T>(this RouteData data) { return (T)data.Values[PageRoute.CurrentPageKey]; } ...