Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add missing project context handler for ts | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Composition;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Languag... | |
Add factory for analytics migrations | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Nether.Data.Sql.Common;
using S... | |
Add order controller for authentified users | using System;
using System.Collections.Generic;
using System.Web.Http;
namespace TokenAuthentification.Controllers
{
[RoutePrefix("api/orders")]
public class OrdersController : ApiController
{
[Authorize]
[Route("")]
public IHttpActionResult Get()
{
return Ok(Or... | |
Increment release number to 2.0.14 | 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: AssemblyTitle("... | 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: AssemblyTitle("... |
Add a failing test to check catch replay accuracy | // 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.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
namespace... | |
Add user controller on API to check in/outs. | using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using A2BBCommon.Models;
using A2BBCommon;
using A2BBAPI.Data;
using IdentityModel.Client;
using A2BBAPI.DTO;
using Microsoft.Extensions.Logging;
using A2BBAPI.Models;
using System.C... | |
Add unit tests to verify that the amount parameters are added to the query string when they are added as parameter | using Mollie.Api.Client;
using Mollie.Api.Models;
using NUnit.Framework;
using System.Net.Http;
using System.Threading.Tasks;
namespace Mollie.Tests.Unit.Client {
[TestFixture]
public class PaymentMethodClientTests : BaseClientTests {
private const string defaultPaymentMethodJsonResponse = @"{
... | |
Add a new datatype for joints | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.IO;
namespace MultipleKinectsPlatform.MultipleKinectsPlatform.Data
{
[DataContract(Name="Joint")]
public class Joint
{
[DataMember]
... | |
Add shared helper to flatten response headers | using System.Collections.Generic;
using System.Net.Http;
namespace Amazon.S3
{
internal static class HttpResponseMessageExtensions
{
public static Dictionary<string, string> GetProperties(this HttpResponseMessage response)
{
#if NET5_0
var result = new Dictionary<string, string>(16... | |
Add method to return Edge from IRefAxis | using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using SolidworksAddinFramework.Geometry;
using SolidWorks.Interop.sldworks;
namespace SolidworksAddinFramework
{
public static class RefAxisExtensions
{
public sta... | |
Define the factory to handle the build of list | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace NBi.Core.Members
{
public class PredefinedMembersFactory
{
private readonly ICollection<BuilderRegistration> registrations;
public PredefinedMembersFactory()
{
... | |
Add a very basic class to allow placing buttons on-screen. | using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace MonoGameUtils.UI
{
/// <summary>
/// Represents a rectangular button that can be clicked in a game.
/// </summary>
public class Button : DrawableGameComponent
{
public SpriteFont Font { get; set; }
pub... | |
Reset the Application Entry Point | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using RapID.ClassLibrary;
namespace RapID.Auth
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
st... | |
Add tool to update all dependencies | // 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 to in... | |
Add empty report for web part performance analysis | using KenticoInspector.Core;
using KenticoInspector.Core.Constants;
using KenticoInspector.Core.Models;
using System;
using System.Collections.Generic;
namespace KenticoInspector.Reports.WebPartPerformanceAnalysis
{
class Report : IReport
{
public string Codename => nameof(WebPartPerformanceAnalysis);... | |
Add unit test for SYSTEM_LANGUAGE SCPI command | using SCPI.System;
using System.Text;
using Xunit;
namespace SCPI.Tests.System
{
public class SYSTEM_LANGUAGE_Tests
{
[Theory]
[InlineData("ENGL")]
[InlineData("GERM")]
public void LanguageIsSetToProperty(string expected)
{
// Arrange
var cmd = n... | |
Add player test for osu! ruleset | // 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;
namespace osu.Game.Rulesets.Osu.Tests
{
[TestFixture]
public class TestCaseOsuPlayer : Game.Tests.Visual.TestCasePlayer
{
publ... | |
Add tests covering score preparation flow | // 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.Screens;
using osu.Framework.Testing;
using osu.Game.Rulesets;
using osu.Game.Scoring;
using osu.... | |
Hide 'vsgd' graphic devie function from Environment window | using System;
using System.Threading.Tasks;
using Microsoft.R.Host.Client;
namespace Microsoft.VisualStudio.R.Package.Repl.Session {
public static class RSessionEvaluationCommands {
public static Task OptionsSetWidth(this IRSessionEvaluation evaluation, int width) {
return evaluation.EvaluateNo... | using System;
using System.Threading.Tasks;
using Microsoft.R.Host.Client;
namespace Microsoft.VisualStudio.R.Package.Repl.Session {
public static class RSessionEvaluationCommands {
public static Task OptionsSetWidth(this IRSessionEvaluation evaluation, int width) {
return evaluation.EvaluateNo... |
Disable rename for Unity event handlers | using System.Collections.Generic;
using JetBrains.Application;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Feature.Services.Refactorings.Specific.Rename;
using JetBrains.ReSharper.Plugins.Unity.Yaml.Psi.Caches;
using JetBrains.ReSharper.Psi;
using JetBrains.Util;
namespace JetBrains.ReSharper.Plugins.Unit... | |
Add helper to check TCP port status. | using System.Net;
using System.Net.Sockets;
namespace PSql.Tests
{
internal static class TcpPort
{
public static bool IsListening(ushort port)
{
const int TimeoutMs = 1000;
try
{
using var client = new TcpClient();
return cli... | |
Add endpoints to view jobs | using BatteryCommander.Web.Models;
using FluentScheduler;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
namespace BatteryCommander.Web.Controllers.API
{
public class JobsController : ApiController
{
public JobsController(Database db) : base(db)
{
/... | |
Add unit test to check for duplicate log types | using System;
using System.Linq;
using Content.Shared.Administration.Logs;
using NUnit.Framework;
namespace Content.Tests.Shared.Administration.Logs;
[TestFixture]
public class LogTypeTests
{
[Test]
public void Unique()
{
var types = Enum.GetValues<LogType>();
var duplicates = types
... | |
Add content conveter to show DataGrid | using System;
using System.Globalization;
using System.Windows.Data;
namespace Mastoon.Conveters
{
public class DataGridContentConveter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var doc = new HtmlAgil... | |
Add class for exponential distribution | using System;
using System.Collections.Generic;
namespace Blaze.Randomization.Lab
{
public static class ExponentialDistribution
{
static readonly Random random = new Random();
public static double Next(double mean) =>
-mean * Math.Log(1 - random.NextDouble());
}
}
... | |
Add alternate empty entries remover | #!/usr/bin/csexec -r:System.Windows.Forms.dll
using System;
using System.IO;
using System.Resources;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.Design;
public static class Program
{
public static void Main (string [] args)
{
try {
var script = new EmptyEntriesRemove... | |
Add manual test to validate python cache | // ------------------------------------------------------------------------------
//
// 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 associate... | |
Add Acceptor for an Enumerable of objects. | using System;
using System.Collections.Generic;
namespace CBojar.Acceptors
{
public class EnumerableAcceptor<T> : IAcceptor<T>
{
protected IEnumerable<T> _value;
public EnumerableAcceptor(IEnumerable<T> value) {
_value = value;
}
public IAcceptor<T> Accept(Action<T> visitor) {
foreach(T... | |
Add helper methods for numeric | using System;
namespace DeclarativeSql.Internals
{
/// <summary>
/// Provides helper methods for numeric.
/// </summary>
internal static class NumericHelper
{
/// <summary>
/// Gets the number of digits of the specified value.
/// </summary>
/// <param name="value... | |
Add a behaviour to drop nodes if all the current connected nodes are behind. | using System;
using System.Linq;
using NBitcoin;
using NBitcoin.Protocol;
using NBitcoin.Protocol.Behaviors;
namespace Stratis.Bitcoin.Connection
{
/// <summary>
/// If the light wallet is only connected to nodes behind
/// it cannot progress progress to the tip to get the full balance
/// this behav... | |
Disable concurrency for storage integration tests | // 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 applic... | |
Add an instance provider for Colore | // ---------------------------------------------------------------------------------------
// <copyright file="ColoreProvider.cs" company="Corale">
// Copyright © 2015-2017 by Adam Hellberg and Brandon Scott.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this soft... | |
Add missing Contract helper function file | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;
namespace DotNetFrontEnd.Contracts
{
public static class ContractExtensions
{
[Pure]
public static bool Implies(this bool antecedent, bool consequent)
{
Contract... | |
Fix add signature and comment | using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using BatteryCommander.Web.Models;
using BatteryCommander.Web.Queries;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace BatteryCommander.Web.Commands
{
public class AddSUTAComment : IRequest
{... | |
Add tests for nullable keys | using System.Collections.Generic;
using AutoMapper.EquivalencyExpression;
using FluentAssertions;
using Xunit;
namespace AutoMapper.Collection
{
public class NullableIdTests
{
[Fact]
public void Should_Work_With_Null_Id()
{
Mapper.Reset();
Mapper.Initialize(x =>... | |
Update flusher to have defaults | using System.Data;
namespace ZocMonLib
{
public interface IRecordFlush
{
/// <summary>
/// Flush all data accumulated thus far.
/// </summary>
void FlushAll();
/// <summary>
/// Flush data for the lowest reduce resolution for the given configuration.
///... | using System.Data;
namespace ZocMonLib
{
public interface IRecordFlush
{
/// <summary>
/// Flush all data accumulated thus far.
/// </summary>
void FlushAll();
/// <summary>
/// Flush data for the lowest reduce resolution for the given configuration.
///... |
Add missing file to samples | @page Test
<div class="row">
<div class="col-md-3">
<h2>RazorPages Test</h2>
<ul>
<li>This file should give you a quick view of a Mvc Raor Page in action.</li>
</ul>
</div>
</div>
| |
Make a working copy of an PCB design | //-----------------------------------------------------------------------------------
// PCB-Investigator Automation Script
// Created on 2014-04-24
// Autor
//
// Make copy of job and open it in temporary path.
//-----------------------------------------------------------------------------------
using Syste... | |
Update to avoid an execption if there are no jobs and therefore no jobs folder. | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Linq;
using System.Reflection;
using System.Web;
using dashing.net.common;
namespace dashing.net.App_Start
{
public class JobConfig
{
publ... | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Linq;
using System.Reflection;
using System.Web;
using dashing.net.common;
namespace dashing.net.App_Start
{
using System.IO;
public class JobCon... |
Add tests class for NoteSubparser | using FluentAssertions;
using NFugue.Parser;
using NFugue.Theory;
using Staccato.Subparsers.NoteSubparser;
using Xunit;
namespace Staccato.Tests.Subparsers
{
public class NoteSubparserTests : SubparserTestBase<NoteSubparser>
{
[Fact]
public void Should_match_simple_notes()
{
... | |
Change file name to reflect new class name | using DotNetNuke.Security.Roles;
using System;
namespace Dnn.PersonaBar.Prompt.Models
{
public class RoleModel : RoleModelBase
{
public string Description;
public DateTime CreatedDate;
public int CreatedBy;
#region Constructors
public RoleModel()
{
}
... | |
Add labelled number box control | // 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.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterfaceV2
{
public class LabelledNumberBox : LabelledTextBox
{
protected overrid... | |
Add skeleton for Autocomplete Responses. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WundergroundClient.Autocomplete
{
class AutocompleteResponse
{
public Boolean IsSuccessful { get; private set; }
public IList<AutocompleteResponseObject> Results;
}
}
| |
Move initialization code into the original lock to avoid a race condition. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace Csla.Security
{
/// <summary>
/// Maintains a list of all object level
/// authorization roles.
/// </summary>
internal class ObjectAuthorizationRules
{
private static... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace Csla.Security
{
/// <summary>
/// Maintains a list of all object level
/// authorization roles.
/// </summary>
internal class ObjectAuthorizationRules
{
private static... |
Add the soft focus editor to the repository. | /*
* Editors/SoftFocus.cs
*
* Copyright 2007 Novell Inc.
*
* Author
* Larry Ewing <lewing@novell.com>
*
* See COPYING for license information.
*
*/
using Gtk;
using System;
namespace FSpot.Editors {
public class SoftFocus : EffectEditor {
Widgets.SoftFocus soft;
Scale scale;
bool double_buffer;
... | |
Enable limitation control for rendering |
namespace SharpexGL.Framework.Game.Timing
{
public enum RenderMode
{
/// <summary>
/// Limits the render call to a fixed fps amount.
/// </summary>
Limited,
/// <summary>
/// No limitations.
/// </summary>
Unlimited
}
}
| |
Add a few base backend tests | using Mofichan.Backend;
using Mofichan.Core.Interfaces;
using Moq;
using Serilog;
using Shouldly;
using Xunit;
namespace Mofichan.Tests
{
public class BackendSpec
{
private class MockBackend : BaseBackend
{
public bool OnStartCalled { get; private set; }
public string R... | |
Store and provide full original partition key | using System;
using System.Linq;
using Microsoft.WindowsAzure.Storage.Table;
namespace Streamstone
{
public class Partition
{
static readonly string[] separator = {"|"};
public readonly CloudTable Table;
public readonly string PartitionKey;
public readonly string RowKeyPrefix... | using System;
using System.Linq;
using Microsoft.WindowsAzure.Storage.Table;
namespace Streamstone
{
public class Partition
{
static readonly string[] separator = {"|"};
public readonly CloudTable Table;
public readonly string PartitionKey;
public readonly string RowKeyPrefix... |
Add some very basic tests for Link | using System;
using System.Collections.Generic;
using Seq.Api.Model;
using Xunit;
namespace Seq.Api.Tests
{
public class LinkTests
{
[Fact]
public void ALinkWithNoParametersIsLiteral()
{
const string uri = "https://example.com";
var link = new Link(uri);
... | |
Remove attributes of an ODB++ job | //-----------------------------------------------------------------------------------
// PCB-Investigator Automation Script
// Created on 27.05.2015
// Autor Gruber Fabio
//
// Clear Attributes of components.
//-----------------------------------------------------------------------------------
using System;
... | |
Add basic test coverage for solid border colour | // 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.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osuTK;
namespace osu.Framework.T... | |
Add a script to draw all spring joints connected to an object, for debugging. | // The MIT License (MIT)
//
// Copyright (c) 2015 Jabavu W. Adams.
//
// 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 restriction, including without limitation the rights
// to us... | |
Add LegacyGlobalOptionsWorkspaceService for OmniSharp EA | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Composition;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.CodeG... | |
Define interface for a command in setup or cleanup | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NBi.Core.Etl
{
public interface IEtlRunCommand: IEtl
{
}
}
| |
Fix on previous commit ... | using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Media;
using System.Windows.Shapes;
using System.Windows;
using System.Windows.Input;
namespace FreeSCADA.Schema.Manipulators
{
class GeometryHilightManipulator:BaseManipulator
{
Rectangle hilightRect =... | |
Add failing GL disposal stress test | // 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;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osuTK;
namesp... | |
Add unit test for getuserrole | using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using Microsoft.AspNetCore.Http;
using Moq;
using NUnit.Framework;
using NUnit.Framework.Internal;
using SFA.DAS.CommitmentsV2.Api.Authentication;
using SFA.DAS.CommitmentsV2.Authentication;
using SFA.DA... | |
Add test scene for arc bounding box computation | // 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.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Lines;
using os... | |
Add extension methods to determine whether an actor is an ancestor or descendant of another actor. | using Akka.Actor;
using System;
namespace AKDK.Utilities
{
/// <summary>
/// Extension methods for Akka types.
/// </summary>
public static class AkkaExtensions
{
/// <summary>
/// Determine whether another actor is a descendent of the actor.
/// </summary>
... | |
Add test coverage of PlayingUsers tracking | // 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 Humanizer;
using NUnit.Framework;
using osu.Framework.Testing;
using osu.Game.Online.Multiplayer;
using osu.Game.Tests.Visual.Multiplayer;
using ... | |
Move serialization end event firing into a pipeline processor | using System.Linq;
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.Data.Serialization;
using Sitecore.Diagnostics;
using Sitecore.Eventing;
using Unicorn.Predicates;
namespace Unicorn.Pipelines.UnicornSyncEnd
{
public class SendSerializationCompleteEvent : IUnicornSyncEndProcessor
{
public void ... | |
Add back obsoleted mapping to improve backwards compatibility | // 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;
namespace osu.Framework.Graphics
{
[Obsolete("Use BlendingParameters statics instead")] // can be removed 20200220
public static class BlendingMode... | |
Rename UpdateHUD lives to DisplayLives. | 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()
{
lives = g... | |
Add more tests for surface | 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.FillWithRa... | |
Set default db for existing raven instances | 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);
... | 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);
... |
Add sample to illustrate lack of ordering of type compilation, for a future branch. | 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 TestByte;
... | |
Add new bip 157 p2p message cfilter | 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;
pr... | |
Define enumeration for supported list of predefined members | 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
}
}
| |
Add support for 8 bit raw bitmap | 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;
... | |
Add needed generated file for Live Preview. | //------------------------------------------------------------------------------
// <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>
//----... | |
Add model class for realm skin | // 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.Game.Exte... | |
Use name that doesn't clash with unit-testing classes | 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 static... | 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 static... |
Add a controller for authorized user s.t. they can retrieve their info and update password. | 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.Tasks;
usi... | |
Add THE IDOLM@STER CINDERELLA GIRLS ANIMATION PROJECTシリーズCD発売記念イベント | @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 =>
{
... | |
Add custom project exception type. | // ---------------------------------------------------------------------------------------
// <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 software and ... | |
Add missing file for 0188bf6b. | 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; }
}
}
| |
Add ninject module for mvp | 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";
... | |
Revert "Revert "Privide equivalent to System.currentTimeMillis()"" | 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 TimeUtils(... | |
Add structure for path control points | 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 Bindable<P... | |
Add new Author: Victor Silva | 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";
p... | |
Add a realtime room manager | // 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;
usin... | |
Remove info that's now elsewhere. | /* 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 assemb... | /* 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 assemb... |
Allow test assembly to access internals | 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")]
[assembly... | 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: Assembly... |
Implement extension method get max array element | //
// 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>
/// Extensi... | //
// 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.EditorServices.Ut... |
Add integration test for relative path | 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 LocalFeed_... | |
Add basic VirtualTrack retrieval test | // 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.Framework.Tes... | |
Add JS zone requirement to asmdef namespace | using JetBrains.Application.BuildScript.Application.Zones;
using JetBrains.ReSharper.Psi.JavaScript;
namespace JetBrains.ReSharper.Plugins.Unity.Json
{
[ZoneMarker]
public class ZoneMarker : IRequire<ILanguageJavaScriptZone>
{
}
} | |
Add Beta to the version | 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 specified maj... | 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 specified maj... |
Add support for mediapicker3 in mappers. | 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
{
... | |
Use correct element name for admins | 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) : base... | 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 opSyst... |
Modify to work with new n-level undo behaviors. | 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();
... | 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();
... |
Add basic tests for pipeline | 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
... | |
Add test coverage ensuring unique acronyms | // 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
{
... | |
Remove third and fourth digits from version | 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 and Futu... | 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 and Futu... |
Add tablet information class to ferry information from OTD | // 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.
/... | |
Add path element factory for selection access | 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 IPathElemen... | |
Print pairs with difference k | // 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[] array, int... | |
Add tests for Base64 encoding/decoding | 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]
pu... | |
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) | using System;
using System.Collections.Generic;
using System.Text;
namespace SO115App.Models.Servizi.Infrastruttura.GestioneSoccorso
{
interface IGetRichiesteAssistenza
{
}
}
| |
Add a switch test to cover Jit codegen. | // 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++) {
switch(i) {... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.