doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
b2d41c01-8787-414b-a0a0-ea3dfcaa2bc1
{ "language": "C#" }
```c# ``` Add a Player test scene that uses a legacy 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 NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.IO.Stores; using osu.Game.Skinning; using osu.Game.Tests.Visua...
5954c5f0-5c0a-4eb4-a74b-7cdb3742bb14
{ "language": "C#" }
```c# ``` Add snippets for Offset type
```c# // Copyright 2018 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 NUnit.Framework; using System; namespace NodaTime.Demo { public class OffsetDemo { [Test] public void ConstructionFr...
af11e5e6-ff0a-42f0-8312-159ebcf8d0bc
{ "language": "C#" }
```c# ``` Add Maverick Sevmont 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 MaverickSevmont : IAmACommunityMember { public string FirstName => "Maverick"; ...
544f6e83-8c1a-41dd-beda-94e5b923b979
{ "language": "C#" }
```c# ``` Add RFC 7693 test vectors
```c# using System; using NSec.Cryptography; using Xunit; namespace NSec.Tests.Rfc { public static class Blake2Tests { public static readonly TheoryData<string, string> Rfc7693TestVectors = new TheoryData<string, string> { { "616263", "ba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b...
5dd85626-ada9-4b7d-8010-07fd00280e54
{ "language": "C#" }
```c# ``` Test to verify type name handling on newtonsoft using additional converter
```c# namespace MassTransit.Tests.Serialization { using System; using System.Linq; using System.Threading.Tasks; using MassTransit.Testing; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; using NUnit.Framework; [TestFixture] public class When_using_type_name_...
c43d5d76-310a-498a-8478-b8c700c1c098
{ "language": "C#" }
```c# ``` Remove dupes, keep lexicographic order, take 1 - wrong
```c# // http://careercup.com/question?id=5758790009880576 // // Given a string with lowercase chars, delete the repeated // letters and only leave one but with the optimal // lexicographic order using System; using System.Collections.Generic; using System.Linq; using System.Text; static class Program { static St...
6b3132f2-5397-4686-abec-927572f73ac6
{ "language": "C#" }
```c# ``` Define the contract to specify a range
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NBi.Core.Members.Ranges { public interface IRange { } } ```
de80488a-0c0b-4890-9277-dadb326c7367
{ "language": "C#" }
```c# ``` Use this script to test the physics
```c# using UnityEngine; public class NudgeMe : MonoBehaviour { public float xDir = 1000; public float yDir = 1000; // Update is called once per frame void Update () { if(Input.GetKey (KeyCode.Space)){ this.gameObject.GetComponent<Rigidbody2D>().AddForce(new Vector2(xDir,yDir)); } } } ```
2d4050ae-47b1-483f-b06f-1754698deb95
{ "language": "C#" }
```c# // mcs -pkg:gtkhtml-sharp -pkg:gtk-sharp gtk-html-sample.cs using Gtk; using System; using System.IO; class HTMLSample { static int Main (string [] args) { HTML html; Window win; Application.Init (); html = new HTML (); win = new Window ("Test"); win.Add (html); HTMLStream s = html.Begin ("text/h...
```c# // mcs -pkg:gtkhtml-sharp -pkg:gtk-sharp gtk-html-sample.cs using Gtk; using System; using System.IO; class HTMLSample { static int Main (string [] args) { HTML html; Window win; Application.Init (); html = new HTML (); win = new Window ("Test"); win.Add (html); HTMLStream s = html.Begin ("text/h...
bf059022-5253-4820-ab7a-4fb0a2d06f8c
{ "language": "C#" }
```c# ``` Call Dispose on the messageConsumer and add a Guid to the message payload.
```c# using System; using FluentAssertions; using Paramore.Brighter.MessagingGateway.Kafka; using Xunit; namespace Paramore.Brighter.Tests.MessagingGateway.Kafka { [Trait("Category", "KAFKA")] public class KafkaMessageProducerSendTests : IDisposable { private const string QueueName = "test"; ...
0420cec6-1fc3-4816-ad02-e81bb2215a9b
{ "language": "C#" }
```c# ``` Add util classes to deal with specific claims.
```c# using A2BBCommon; using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; namespace A2BBAPI.Utils { public static class ClaimsUtils { #region Nested classes /// <summary> /// Holder for authorized user claims....
227e3dd5-4886-4b15-8b90-768eda9819f3
{ "language": "C#" }
```c# ``` Add missing tests for write lock
```c# using Xunit; namespace RdbmsEventStore.Tests { public class WriteLockTests { [Fact] public void SameIdCannotEnterLockSimultaneously() { var mutex = new WriteLock<int>(); var lock1 = mutex.Aquire(1); var lock2 = mutex.Aquire(1); As...
9b9e1444-b811-47a5-8a3e-e1b2dc1ed376
{ "language": "C#" }
```c# ``` Move directions and orientations into global enums
```c# public enum Side : byte { Right, Left, Top, Bottom }; public enum Position : byte { TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, BottomCenter, BottomRight }```
e3f3d654-1ae2-4d59-bb46-f17a52a33736
{ "language": "C#" }
```c# ``` Add placeholder test to avoid build warnings
```c# // Copyright 2021 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...
845f7f21-d62c-4a2d-b3bc-a9e861f2e25d
{ "language": "C#" }
```c# using MediaBrowser.Model.Plugins; namespace MediaBrowser.Plugins.Trailers.Configuration { /// <summary> /// Class PluginConfiguration /// </summary> public class PluginConfiguration : BasePluginConfiguration { public bool EnableMovieArchive { get; set; } public bool EnableNet...
```c# using MediaBrowser.Model.Plugins; namespace MediaBrowser.Plugins.Trailers.Configuration { /// <summary> /// Class PluginConfiguration /// </summary> public class PluginConfiguration : BasePluginConfiguration { public bool EnableMovieArchive { get; set; } public bool...
46ce4d0f-7771-4dfa-8486-1c8af984a5b4
{ "language": "C#" }
```c# ``` Add Servant Controller with retrieval and creation endpoints
```c# using Microsoft.AspNetCore.Mvc; using StoryGenerator.Domain; using StoryGenerator.Persistance; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace StoryGenerator.Controllers { [Route("api/servants")] public class ServantController : Controller {...
7aecf35d-60ba-4b86-a316-82413a1f8acd
{ "language": "C#" }
```c# ``` Add a test for fruit randomness
```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.Bindables; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawables; using osu.Game.Tests.V...
9fa890b6-2c2f-43ab-917d-6ea11b90ae84
{ "language": "C#" }
```c# ``` Add tests for enumerable formatting ComplexObjectToPseudoCode
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ExpressionToCodeLib; using Xunit; namespace ExpressionToCodeTest { public class EnumerableFormattingTest { [Fact] public void ShortArraysRenderedComplete...
b5a92477-6e16-46f0-b71d-30e7abc3535e
{ "language": "C#" }
```c# ``` Add extension search method for game object collection.
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Infusion.LegacyApi { public static class GameObjectCollectionExtensions { public static IEnumerable<GameObject> OfType(this IEnumerable<GameObject> objects, ModelId type) => objects.Where(...
e8cee8de-9977-411b-8c99-dcc707a607e4
{ "language": "C#" }
```c# ``` Add new attribute for authorization.
```c# using System; using Bibliotheca.Server.Mvc.Middleware.Authorization.SecureTokenAuthentication; using Bibliotheca.Server.Mvc.Middleware.Authorization.UserTokenAuthentication; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authorization; namespace Bibliotheca.Server.Mvc.Middleware....
3a8328d5-bd54-4a56-a67b-ad7fd8780b4c
{ "language": "C#" }
```c# ``` Add custom listbox item class
```c# using System.Windows.Controls; using System.Windows.Forms; namespace food_tracker { public class FoodBoxItem : ListBoxItem { public int calories { get; set; } public int fats { get; set; } public int saturatedFat { get; set; } public int carbohydrates { get; set; } public int sugar { get; set; } p...
7dc0bb55-a1a1-43e2-8121-55980012fa00
{ "language": "C#" }
```c# ``` Define the log levels supported by the abstract logging API.
```c# using System; using System.Collections.Generic; using System.Text; namespace Nohros.Logging { /// <summary> /// The supported logging levels. Not all loggin libraries support all the levels and when is /// the case the related <see cref="ILogger"/> object will always return false for the ...
d1d43e10-21f3-4a9b-9cfd-095eee46fb7e
{ "language": "C#" }
```c# ``` Add dedicated class for listing application credits
```c# using System.Collections.Generic; namespace ShopifySharp.Filters { public class ApplicationCreditListFilter : ListFilter { public string Fields { get; set; } public override IEnumerable<KeyValuePair<string, object>> ToQueryParameters() { return base.ToQueryParameters(...
4c7ffdbe-67b4-4fa1-98b2-c6625fe5fa33
{ "language": "C#" }
```c# ``` Add basic structure for HSV colour picker part
```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.Bindables; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; namespace osu.Framework.Graphics.UserInterface { /...
1bf50daa-b049-46a5-ad1e-27e98a9f0d8c
{ "language": "C#" }
```c# ``` Add car move event arguments
```c# // CarMovedEventArgs.cs // <copyright file="CarMovedEventArgs.cs"> This code is protected under the MIT License. </copyright> namespace Tron.EventArgs { /// <summary> /// The event arguments for when the timer changes. /// </summary> public class CarMovedEventArgs : System.EventArgs { ...
ed8790a0-9c3d-4089-bcc7-4dfc2f8ec187
{ "language": "C#" }
```c# ``` Add Html extension method for Kendo grid.
```c# namespace SupportMe.Web.Infrastructure.HtmlHelpers { using System; using System.Linq.Expressions; using System.Web.Mvc; using Kendo.Mvc.UI; using Kendo.Mvc.UI.Fluent; public static class KendoHelpers { public static GridBuilder<T> FullFeaturedGrid<T>( this HtmlHe...
9027d06d-c534-44b9-91b4-c8db10ac9b71
{ "language": "C#" }
```c# ``` Add an interface for scrubbing rollbar data.
```c# using Valetude.Rollbar; namespace Nancy.Rollbar.Api { public interface IRollbarDataScrubber{ RollbarData ScrubRollbarData(RollbarData data); } } ```
419806b3-7af8-4213-b67a-624b04ed4830
{ "language": "C#" }
```c# ``` Convert a MusicBrainz date into a DateTime object
```c# /* -*- Mode: csharp; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: t -*- */ /*************************************************************************** * Utilities.cs * * Copyright (C) 2005 Novell * Written by Aaron Bockover (aaron@aaronbock.net) *****************************************************...
f24939ac-f033-406c-ad2c-cec0091763b3
{ "language": "C#" }
```c# ``` Add initial page permission enums.
```c# using System; namespace MitternachtWeb.Models { [Flags] public enum BotPagePermissions { None = 0b00, ReadBotConfig = 0b01, WriteBotConfig = 0b11, } [Flags] public enum GuildPagePermissions { None = 0b_0000_0000, ReadGuildConfig = 0b_0000_0001, WriteGuildConfig = 0b_000...
24772bd4-983d-4dc2-9e40-aad091392f2a
{ "language": "C#" }
```c# ``` Add unit test for strongly connected components.
```c#  namespace CSparse.Tests.Ordering { using CSparse.Double; using CSparse.Ordering; using NUnit.Framework; using System; public class TestStronglyConnectedComponents { [Test] public void TestScc() { // https://en.wikipedia.org/wiki/Strongly_connected_com...
c6d44e57-1f16-45a6-b3b6-f2d4a27fda23
{ "language": "C#" }
```c# ``` Add more SDL2 native functions
```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.Numerics; using System.Runtime.InteropServices; using osu.Framework.Graphics; using Veldrid.Sdl2; // ReSharper disable InconsistentNaming namespace o...
0f24b95c-a66a-4cab-a824-0c79617350d8
{ "language": "C#" }
```c# using System; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using Confuser.Core.Project; using ConfuserEx.ViewModel; namespace ConfuserEx { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); ...
```c# using System; using System.ComponentModel; using System.IO; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Xml; using Confuser.Core.Project; using ConfuserEx.ViewModel; namespace ConfuserEx { public partial class MainWindow : Window { public MainWi...
687fd994-6f14-4d72-bb76-5f7971883e75
{ "language": "C#" }
```c# ``` Embed assembly info and version
```c# using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("https://github.com/thekid/inotify-win")] [assembly: AssemblyDescription("A port of the inotifywait tool for Windows")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany(...
5dfa43b6-f03e-4df7-961a-1283e0928a7c
{ "language": "C#" }
```c# ``` Add notes on the alert model
```c# namespace BatteryCommander.Web.Models { public class Alert { // Id // SentAt // Recipients - IDs? - Pull Phone, Email from Soldier entity // Format - SMS? Email? Phone? // Message / Content // Status - Open, Closed -- Only one open at a time, all respo...
6cc80a84-f37c-4118-b44b-bea91b473355
{ "language": "C#" }
```c# ``` Add tests for Project Resources.
```c# using System.Collections.Generic; using DigitalOcean.API.Clients; using DigitalOcean.API.Http; using DigitalOcean.API.Models.Requests; using DigitalOcean.API.Models.Responses; using NSubstitute; using RestSharp; using Xunit; namespace DigitalOcean.API.Tests.Clients { public class ProjectResourcesClientTest ...
36a4cb0f-421e-4f04-a680-e7886a8e5221
{ "language": "C#" }
```c# ``` Add EventStore implementation of IEventStore.
```c# using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Xml.Serialization; using EventStore.ClientAPI; namespace Edument.CQRS { // An implementation of IEventStore in terms of EventStore, available from ...
260ecf32-5bcb-4be4-bb73-1f514ea2e6b6
{ "language": "C#" }
```c# ``` Add a unit test for the new reserve-whitespace behavior
```c# //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. // All rights reserved. // // This code is licensed under the MIT License. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated docu...
4de38f34-7962-43a8-88cd-c7ff9d342c23
{ "language": "C#" }
```c# using System; using System.Collections.Generic; using Caliburn.Micro; using CM.HelloUniversal.Views; using CM.HelloUniversal.ViewModels; using Windows.ApplicationModel.Activation; using Windows.UI.Xaml.Controls; namespace CM.HelloUniversal { public sealed partial class App { private WinRTContain...
```c# using System; using System.Collections.Generic; using System.Diagnostics; using Caliburn.Micro; using CM.HelloUniversal.Views; using CM.HelloUniversal.ViewModels; using Windows.ApplicationModel.Activation; using Windows.UI.Xaml.Controls; namespace CM.HelloUniversal { public sealed partial class App { ...
de20263d-2384-46d6-b829-5fa96a6a5edc
{ "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. namespace System.Runtime.InteropServices { // Stand-in type for low-level assemblies to obtain Win32 error...
```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 System.Runtime.InteropServices { // Stand-in type for low-level assemblies to obtain Win32 error...
f435856f-0347-4747-adf0-9d452c258a33
{ "language": "C#" }
```c# ``` Add basic support for outputing on the fly updates
```c# using System; using NUnit.Framework.Api; using System.Xml.Linq; using System.IO; namespace GuiUnit { public class XmlTestListener : ITestListener { TextWriter Writer { get; set; } public XmlTestListener (TextWriter writer) { Writer = writer; } public void TestStarted (ITest test) { if ...
4371e733-59df-49dc-9c90-9793f1376c80
{ "language": "C#" }
```c# ``` Make metadata accessible without reflection
```c# #region Apache License // // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2....
88d59251-695f-4ba1-827c-16237acfc1ab
{ "language": "C#" }
```c# ``` Add simple step which allow using delegates for defining steps
```c# using System; using System.Threading.Tasks; using NCrawler.Interfaces; namespace NCrawler { /// <summary> /// Implementation of pipeline steps which allow steps definition using simple functions /// </summary> public class SimpleStep : IPipelineStep { private Func<ICrawler, PropertyB...
144128fd-0d70-40c7-8cdd-3c190b0c628f
{ "language": "C#" }
```c# ``` Add zone marker to fix exceptions in inspectcode
```c# using JetBrains.Application.BuildScript.Application.Zones; using JetBrains.ReSharper.Feature.Services.ExternalSources; namespace JetBrains.ReSharper.Plugins.Unity.Feature.Services.ExternalSources { [ZoneMarker] public class ZoneMarker : IRequire<ExternalSourcesZone> { } }```
7541d935-1fae-40d8-9b2e-6820d30e0838
{ "language": "C#" }
```c# ``` Add Command to Edit Profiles
```c# using CLImber; using SetIPLib; using System; using System.Linq; using System.Net; namespace SetIPCLI { [CommandClass("edit", ShortDescription = "Updates a profile with the specified information. Updated info is specified using options: --ip=xxx.xxx.xxx.xxx")] class EditProfile { private Prof...
47ba3643-e5e4-495f-bc23-1c0ab6f03b28
{ "language": "C#" }
```c# ``` Add class for David OBrien
```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 DavidOBrien : IFilterMyBlogPosts, IAmAMicrosoftMVP { public string FirstName => "David"; ...
2a481d05-4219-49a1-8ab1-89e010a7e281
{ "language": "C#" }
```c# ``` Add the builder for an Integer range
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NBi.Core.Members.Ranges { internal class IntegerRangeBuilder : BaseBuilder { protected new IntegerRange Range { get { return (IntegerRange)...
c86adbd8-429e-430f-96ce-370864c22ba2
{ "language": "C#" }
```c# using System.Collections.Generic; using System.Linq; using CppSharp.Passes; namespace CppSharp { /// <summary> /// This class is used to build passes that will be run against the AST /// that comes from C++. /// </summary> public class PassBuilder<T> { public List<T> Passes { get...
```c# using System.Collections.Generic; using System.Linq; using CppSharp.Passes; namespace CppSharp { /// <summary> /// This class is used to build passes that will be run against the AST /// that comes from C++. /// </summary> public class PassBuilder<T> { public List<T> Passes { get...
4a7c1eaa-d3b1-443b-87d4-9fad4b808dc6
{ "language": "C#" }
```c# ``` Test was added for ExceptionDescription
```c# namespace Skeleton.Web.Tests.Conventions.Responses { using System; using Web.Conventions.Responses; using Xunit; public class ExceptionDescriptionTests { [Fact] public void ShouldCollectInformation() { // Given const string message = "<Message>...
8a315a98-d957-422e-b349-a7f3344a1246
{ "language": "C#" }
```c# using System; using CoreGraphics; using UIKit; using Foundation; namespace TableEditing { [Register ("AppDelegate")] public class AppDelegate : UIApplicationDelegate { #region -= main =- public static void Main (string[] args) { try { UIApplication.Main (args, null, "AppDelegate"); } catch (E...
```c# using System; using CoreGraphics; using UIKit; using Foundation; namespace TableEditing { [Register ("AppDelegate")] public class AppDelegate : UIApplicationDelegate { #region -= main =- public static void Main (string[] args) { try { UIApplication.Main (args, null, "AppDelegate"); } catch (E...
f7e004bf-07c2-43fd-ac02-d70958f45d06
{ "language": "C#" }
```c# using Certify.Locales; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; namespace Certify.UI.Utils { public class UpdateCheckUtils { public async Task<Models.UpdateCheck> UpdateWithDownload() { Mouse.OverrideCursor = Cursors.Wait; va...
```c# using Certify.Locales; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; namespace Certify.UI.Utils { public class UpdateCheckUtils { public async Task<Models.UpdateCheck> UpdateWithDownload() { Mouse.OverrideCursor = Cursors.Wait; va...
07ce4266-34c1-4dbb-b50b-b30624926c4a
{ "language": "C#" }
```c# ``` Add partial class for retry settings (compatibility)
```c# // Copyright 2019 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...
5b8075fd-fcab-42d9-9312-badd89f8bd7b
{ "language": "C#" }
```c# ``` Fix issue with persisting DateTime
```c# using System; namespace Tellurium.VisualAssertions.Screenshots.Utils { static class DateTimeExtensions { public static DateTime TrimToMiliseconds(this DateTime dateTime) { return Trim(dateTime, TimeSpan.TicksPerMillisecond); } static DateTime Trim(DateTime da...
5af246f1-eb63-44a6-996e-e82b4a9aef35
{ "language": "C#" }
```c# ``` Add test to verify library class visability
```c# using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Stranne.BooliLib.Models; using Xunit; namespace Stranne.BooliLib.Tests { public class LibraryVisabilityTest { private readonly IEnumerable<Type> _publicClasses = new List<Type> { ...
b38acae8-718c-4ba4-9ff2-937d4aec30f9
{ "language": "C#" }
```c# ``` Update server side API for single multiple answer question
```c# using Microsoft.AspNetCore.Mvc; using Promact.Trappist.DomainModel.Models.Question; using Promact.Trappist.Repository.Questions; using System; namespace Promact.Trappist.Core.Controllers { [Route("api/question")] public class QuestionsController : Controller { private readonly IQuestionRepos...
6925ced9-3873-4ba7-9126-e77d3b290598
{ "language": "C#" }
```c# ``` Add accelerometer reader example script
```c# using UnityEngine; using System.Collections; public class AccelerometerReader : MonoBehaviour { public float Filter = 5.0f; public GUIText Label; private Vector3 accel; void Start() { accel = Input.acceleration; } void Update() { // filter the jerky acceleration in the ...
694e02fd-8bb1-4aaf-b785-3d0bc68a6099
{ "language": "C#" }
```c# ``` Convert int to string column
```c# // http://careercup.com/question?id=5690323227377664 // // Write a function which takes an integer and convert to string as: // 1 - A 0001 // 2 - B 0010 // 3 - AA 0011 // 4 - AB 0100 // 5 - BA 0101 // 6 - BB 0110 // 7 - AAA 0111 // 8 - AAB 1000 // 9 - ABA ...
5ba531e2-f453-4f4d-b648-a6a4b2770d34
{ "language": "C#" }
```c# ``` Add Eric Lippert's backport of Zip() to .NET 3.5.
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace open3mod { // Zip() was added in .NET 4.0. // http://blogs.msdn.com/b/ericlippert/archive/2009/05/07/zip-me-up.aspx public static class LinqZipNet4Backport { public static IEnumerable<TResult>...
228b33ac-2057-4eb3-a207-b5a2e9606273
{ "language": "C#" }
```c# ``` Add test coverage of accuracy formatting function
```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.Game.Utils; namespace osu.Game.Tests.NonVisual { [TestFixture] public class FormatUtilsTest { [TestCase(0, "0....
39a64b64-4c2d-4a2c-b8cf-d585251548d4
{ "language": "C#" }
```c# ``` Add too few players exception
```c# // TooFewPlayersException.cs // <copyright file="TooFewPlayersException.cs"> This code is protected under the MIT License. </copyright> using System; namespace CardGames { /// <summary> /// An exception raised when TooFewPlayers are added to a game. /// </summary> [Serializable] pu...
d9818557-5f1d-409a-aaba-8a67d23e101d
{ "language": "C#" }
```c# ``` Set up results output interface
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TimeNetSync.Services { public interface IResultsOutput { } } ```
91804201-b782-4a4c-bc10-25251d1a37fd
{ "language": "C#" }
```c# ``` Fix autosave and refresh on shared projects
```c# using JetBrains.Annotations; using JetBrains.Application.changes; using JetBrains.Application.FileSystemTracker; using JetBrains.Application.Threading; using JetBrains.DocumentManagers; using JetBrains.DocumentModel; using JetBrains.Lifetimes; using JetBrains.ProjectModel; using JetBrains.ReSharper.Host.Features....
80df9968-99a9-4fb1-9fd0-dab6f8b93fd9
{ "language": "C#" }
```c# ``` Add missing file for named tabs
```c# // Copyright 2013 J.C. Moyer // // 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...
30b3c125-f72b-4fef-b6bf-21e6d9d79364
{ "language": "C#" }
```c# ``` Verify NotifyFault called will properly fail a filter execution
```c# namespace MassTransit.Tests { using System; using System.Threading.Tasks; using MassTransit.Testing; using Microsoft.Extensions.DependencyInjection; using Middleware; using NUnit.Framework; using TestFramework.Messages; [TestFixture] public class Using_a_request_filter_with_r...
8c7fde8e-95f5-42d2-abf9-8839df92525c
{ "language": "C#" }
```c# ``` Add models for notification emails.
```c# using System; namespace CompetitionPlatform.Models { public class Initiative { public string FirstName { get; set; } public string ProjectId { get; set; } public DateTime ProjectCreatedDate { get; set; } public string ProjectAuthorName { get; set; } public string ...
b3b0ae1a-ddeb-4f13-b79d-6724af012a3d
{ "language": "C#" }
```c# ``` Add a function to compute hit object position in catch editor
```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.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.UI.Scrolling; using osuTK; namespace osu.Game.Rulesets.Catch.Edit {...
2a017aa6-980b-4082-af72-adc71823eb5b
{ "language": "C#" }
```c# ``` Add a new datatype for skeletons
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ServiceModel; using System.Runtime.Serialization; using System.Runtime.Serialization.Json; using Microsoft.Kinect; using System.IO; namespace MultipleKinectsPlatform.MultipleKinectsPl...
1139d0ee-478b-476e-bcd0-c33af353a94f
{ "language": "C#" }
```c# ``` Add some simple test cases for SetProperty.
```c# using System; using GamesWithGravitas.Extensions; using Xunit; namespace GamesWithGravitas { public class NotifyPropertyChangedBaseTests { [Theory] [InlineData("Foo")] [InlineData("Bar")] public void SettingAPropertyWorks(string propertyValue) { var no...
a1936161-3b84-45ae-a5c9-b06fc6ed1fff
{ "language": "C#" }
```c# ``` Add new interface that allows restarts
```c# // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Mods { /// <summary> /// Represents a mod which can override (and block) a fail. /// </summary> public interface IAppli...
ae87c619-5ab4-4ae1-84cd-1fadc6f3d1f1
{ "language": "C#" }
```c# ``` Add tests for losing audio devices
```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.Threading; using NUnit.Framework; using osu.Framework.IO.Stores; using osu.Framework.Threading; namespace osu.Framework.Tests.Audio { ...
d16a7ca6-2981-4906-ad7f-f08e47669631
{ "language": "C#" }
```c# ``` Add test that asserts records don't have RecordAttribute in reflection
```c# using Amadevus.RecordGenerator.TestsBase; using Xunit; namespace Amadevus.RecordGenerator.Test { public class RecordClassTests : RecordTestsBase { [Fact] public void ReflectedClass_HasNo_RecordAttribute() { var recordType = typeof(Item); var recordAttribu...
d3d4f54b-1122-47b4-9a86-a720e29739cc
{ "language": "C#" }
```c# ``` Update to use EventKit messaging
```c# public class DifficultyHandler : BaseBehaviour { private int difficultyLevel; void OnSetDifficulty(int difficulty) { switch (difficulty) { case NORMAL: EventKit.Broadcast("set difficulty damage modifier", 1); break; case HARD: EventKit.Broadcast("set difficulty damage modifier", 2); ...
aa5b199b-4951-48e0-97c4-b3f6ba283d24
{ "language": "C#" }
```c# ``` Move connection strings to separate file
```c# using Windows.UI.Xaml.Controls; namespace WeatherDataReporter { public sealed partial class MainPage : Page { static string iotHubUri = "{replace}"; static string deviceKey = "{replace}"; static string deviceId = "{replace}"; } } ```
94c644b4-7566-44db-aeee-68688afce37c
{ "language": "C#" }
```c# ``` Add partial implementation to PPCompletionCallback
```c# using System; using System.Runtime.InteropServices; namespace PepperSharp { public partial struct PPCompletionCallback { public PPCompletionCallback(PPCompletionCallbackFunc func) { this.func = func; this.user_data = IntPtr.Zero; this.flags = (int)PPC...
ba42aa33-25b8-4950-af87-a3289c4e93e1
{ "language": "C#" }
```c# ``` Add extension methods to export the Data Center's content.
```c# using System.IO; using System.Linq; using System.Xml.Linq; namespace Tera.Analytics { public static class DataCenterExtensions { private static XStreamingElement ToXStreamingElement(DataCenterElement element) { var xElement = new XStreamingElement(element.Name); x...
18bc3a01-025a-4485-b17e-ae36da24b51b
{ "language": "C#" }
```c# ``` Add top level test coverage of editor shortcuts
```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.Game.Rulesets; using osu.Game.Rulesets.Osu; using osuTK.Input; namespace osu.Game.Tests.Visual.Editing { /// <summary> ///...
24a7ed16-8beb-427a-9689-17b09d0b523f
{ "language": "C#" }
```c# ``` Add a basic application test
```c# using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using System; namespace Tgstation.Server.Host.Core.Tests { [TestClass] public sealed class TestAp...
7c1fff4f-c8ff-4983-aacc-a99c42212cb7
{ "language": "C#" }
```c# ``` Rearrange chars - prep work
```c# // http://careercup.com/question?id=5693863291256832 // // Rearrange chars in a String so that no adjacent chars repeat // using System; using System.Collections.Generic; using System.Linq; using System.Text; static class Program { static Random random = new Random(); static String Rearrange(this Strin...
81eeb5d1-b52e-438d-bdfb-c34b804e6950
{ "language": "C#" }
```c# ``` Add two extensions for RegionInfo.
```c# // Copyright (c) Narvalo.Org. All rights reserved. See LICENSE.txt in the project root for license information. namespace Narvalo.Finance { using System.Globalization; public static class RegionInfoExtensions { public static bool IsUsing(this RegionInfo @this, Currency currency) { ...
ff9e2e17-bfe1-4d73-b442-0a692cded90b
{ "language": "C#" }
```c# ``` Add a helper class to compose broadcasted messages.
```c# using Newtonsoft.Json; namespace CompetitionPlatform.Helpers { public static class NotificationMessageHelper { public static string ProjectCreatedMessage(string userEmail, string userName, string projectName) { var messageData = new MessageData { S...
7afb6c12-33cf-4a85-8a5e-aae67f41b59f
{ "language": "C#" }
```c# ``` Add test coverage for common mime types
```c# namespace AngleSharp.Core.Tests.Io { using AngleSharp.Io; using NUnit.Framework; [TestFixture] public class MimeTypeNameTests { [Test] public void CommonMimeTypesAreCorrectlyDefined() { Assert.AreEqual("image/avif", MimeTypeNames.FromExtension(".avif")); ...
2aa873f1-2b8a-4ba4-aac1-462188cfff0d
{ "language": "C#" }
```c# ``` Add unit tests for MetaModel
```c# // Copyright (c) Martin Costello, 2017. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.LondonTravel.Site.Models { using MartinCostello.LondonTravel.Site.Options; using Shouldly; using Xunit...
2fb3fcf0-175b-4da6-957a-72a9d2dac6f4
{ "language": "C#" }
```c# ``` Add mapping profile for departments
```c# using AutoMapper; using Diploms.Core; using Diploms.Dto.Departments; namespace Diploms.Services.Departments { public class DepartmentsMappings : Profile { public DepartmentsMappings() { CreateMap<DepartmentEditDto, Department>(); } } }```
9672799c-24a9-4da1-933e-ea2ed62be34b
{ "language": "C#" }
```c# ``` Add separate facility for bit commitment
```c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BitCommitment { /// <summary> /// A class to perform bit commitment. It does not care what the input is; it's just a /// facility for exchanging bit commitment messages. ...
65cf1527-da63-43e3-b2fe-d28414d77d9b
{ "language": "C#" }
```c# ``` Add a basic kafka serilaizer
```c# using System; using System.Text; using System.Threading.Tasks; using Confluent.Kafka; using Confluent.Kafka.SyncOverAsync; using Newtonsoft.Json; namespace Jasper.ConfluentKafka.Serialization { internal class DefaultJsonSerializer<T> : IAsyncSerializer<T> { public Task<byte[]> SerializeAsync(T da...
e20c7726-069b-415e-b53b-e87c130f9ecb
{ "language": "C#" }
```c# ``` Add default web socket client unit tests
```c# using System; using System.Threading; using System.Threading.Tasks; using Binance.WebSocket; using Xunit; namespace Binance.Tests.WebSocket { public class DefaultWebSocketClientTest { [Fact] public async Task Throws() { var uri = new Uri("wss://stream.binance.com:9443...
bb724b0b-92e0-4baf-a2bb-7707c1db4b1c
{ "language": "C#" }
```c# ``` Add the producer wrap to donet
```c# using System; using System.Runtime.InteropServices; namespace RocketMQ.Interop { public static class ProducerWrap { // init [DllImport(ConstValues.RocketMQDriverDllName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr CreateProducer(string groupId); ...
78396aec-f77d-4c72-a6a4-de55c3c55f7b
{ "language": "C#" }
```c# ``` Add the NBench visual studio test adapter project.
```c# namespace NBench.VisualStudio.TestAdapter { using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using System; using System.Collections.Generic; public class NBenchTestDiscoverer : ITestDiscoverer { public v...
7b23c98d-b50c-4926-bbbf-f5a43e1ab3b5
{ "language": "C#" }
```c# ``` Add script for fixing tecture scaling
```c# using UnityEngine; using System.Collections; [ExecuteInEditMode] public class TextureTilingController : MonoBehaviour { // Give us the texture so that we can scale proportianally the width according to the height variable below // We will grab it from the meshRenderer //public Texture texture; //public fl...
db6fc975-ebd9-4446-a39d-67901683eeb8
{ "language": "C#" }
```c# using System; namespace Toggl.Phoebe.Data.DataObjects { public abstract class CommonData { protected CommonData () { ModifiedAt = Time.UtcNow; } /// <summary> /// Initializes a new instance of the <see cref="Toggl.Phoebe.Data.DataObjects.CommonData"/>...
```c# using System; using SQLite; namespace Toggl.Phoebe.Data.DataObjects { public abstract class CommonData { protected CommonData () { ModifiedAt = Time.UtcNow; } /// <summary> /// Initializes a new instance of the <see cref="Toggl.Phoebe.Data.DataObjects...
b38e4d39-fd1c-4e7c-aef0-42f590507f8d
{ "language": "C#" }
```c# ``` Add test coverage for ignoring null mods returned by rulesets
```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 enable using System.Collections.Generic; using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Testing; using osu...
0b3a5488-7caf-4e0c-a282-6e6a5bb78f0f
{ "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.Linq; using Xunit; namespace System.Diagnostics.Tests { public class ProcessModuleTests : Pr...
```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.Linq; using Xunit; namespace System.Diagnostics.Tests { public class ProcessModuleTests : Pr...
279dea88-1534-431a-b8fb-3d9be8df13c7
{ "language": "C#" }
```c# using UIKit; using Foundation; namespace OpenGLESSampleGameView { // The name AppDelegate is referenced in the MainWindow.xib file. public partial class OpenGLESSampleAppDelegate : UIApplicationDelegate { // This method is invoked when the application has loaded its UI and its ready to run public overrid...
```c# using UIKit; using Foundation; namespace OpenGLESSampleGameView { // The name AppDelegate is referenced in the MainWindow.xib file. public partial class OpenGLESSampleAppDelegate : UIApplicationDelegate { // This method is invoked when the application has loaded its UI and its ready to run public overrid...
3f6d0877-8350-4866-8370-e2057aec386d
{ "language": "C#" }
```c# ``` Add unit tests for the P2pkhIssuanceImplicitLayout 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...
b4df2183-3818-4d61-b27b-5603112e6e5a
{ "language": "C#" }
```c# ``` Enable scanning at the assembly level for components for the dotnet CLI
```c# using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Reflection; using Microsoft.TemplateEngine.Abstractions; namespace Microsoft.TemplateEngine.Edge { public class AssemblyComponentCatalog : IReadOnlyList<KeyValuePair<Guid, Func<Type>>> { pri...
1dc9979a-4b89-44db-b95a-98f72c0dc27e
{ "language": "C#" }
```c# ``` Add tests for the ConsoleWriter
```c# using System; using Xunit; using OutputColorizer; using System.IO; namespace UnitTests { public partial class ConsoleWriterTests { [Fact] public void TestGetForegroundColor() { ConsoleWriter cw = new ConsoleWriter(); Assert.Equal(Console.ForegroundColor, c...
49ef5465-539c-4b32-b786-ce688ced730d
{ "language": "C#" }
```c# ``` Add test that validates all reflected methods are non-null.
```c# #region License // // Dasher // // Copyright 2015-2016 Drew Noakes // // 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 /...
57028ccc-dbb6-473d-bce2-c2a66311ee2d
{ "language": "C#" }
```c# ``` Add work-in-progress ObjectOverrides pass that adds GetHashCode and Equals overrides.
```c# using System; using System.Collections.Generic; using CppSharp.AST; using CppSharp.Generators; using CppSharp.Generators.CLI; using CppSharp.Passes; namespace CppSharp { public class ObjectOverridesPass : TranslationUnitPass { void OnUnitGenerated(GeneratorOutput output) { fo...
35c4943f-f79a-40b1-9877-3b4b8587dbd6
{ "language": "C#" }
```c# ``` Use PropertyInfo control in mobile apps
```c# using System; using System.Collections.Generic; using System.Globalization; using System.Text; using Xamarin.Forms; namespace ProjectTracker.Ui.Xamarin.Xaml { public class BoolColorConverter : IValueConverter { public Color TrueColor { get; set; } public Color FalseColor { get; set; } public boo...
904dede0-c475-49db-95c5-3f6e683b49f6
{ "language": "C#" }
```c# ``` Add a model for transitions
```c# using System; using slang.Lexing.Tokens; namespace slang.Lexing.Trees.Nodes { public class Transition { public Transition (Node target, Func<Token> tokenProducer = null) { Target = target; TokenProducer = tokenProducer; } public Token GetToken() ...
e4c37fcb-130a-41e4-8106-c945c2a5eb03
{ "language": "C#" }
```c# ``` Add helper class to handle firing async multiplayer methods
```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 enable using System; using System.Diagnostics; using System.Threading.Tasks; using Microsoft.AspNetCore.SignalR; using osu.Framework.Logging; namespace o...