Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Change static content to dynamic | @{
ViewData["Title"] = "List of Articles I've Written";
}
<h1 id="page_title">Articles I've written</h1>
<div class="centered_wrapper">
<input type="text" class="search" placeholder="Filter by title/tag">
<article>
<p class="date">Monday Aug 28</p>
<h2><a href="#">Change Kestrel default ur... | @model IEnumerable<ArticleModel>
@{
ViewData["Title"] = "List of Articles I've Written";
}
<h1 id="page_title">Articles I've written</h1>
<div class="centered_wrapper">
<input type="text" class="search" placeholder="Filter by title/tag">
@foreach (var article in Model)
{
<article>
<p clas... |
Add simple interpolated motion driver | using System;
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public class BasicQuadrupedGaitEngine : QuadrupedGaitEngine
{
private const int Speed = 10;
private const int MaxForward = 5;
private const int MinForward = -5;
private const int LegDistance = 15;
... | using System;
using System.Numerics;
namespace DynamixelServo.Quadruped
{
public class BasicQuadrupedGaitEngine : QuadrupedGaitEngine
{
private const int Speed = 12;
private int _currentIndex;
private readonly Vector3[] _positions =
{
new Vector3(-5, 5, 3),
... |
Handle correctly the special HTML characters and tags | namespace AnimalHope.Web
{
using System.Web;
using System.Web.Mvc;
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
| namespace AnimalHope.Web
{
using System.Web;
using System.Web.Mvc;
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
filters.Add(new ValidateInputAttribute(false));
... |
Make Hot the default reddit post category | using System.Diagnostics;
using CommonBotLibrary.Interfaces.Models;
using RedditSharp.Things;
namespace CommonBotLibrary.Services.Models
{
[DebuggerDisplay("{Url, nq}")]
public class RedditResult : IWebpage
{
public RedditResult(Post post)
{
Title = post.Title;
Url ... | using System.Diagnostics;
using CommonBotLibrary.Interfaces.Models;
using RedditSharp.Things;
namespace CommonBotLibrary.Services.Models
{
[DebuggerDisplay("{Url, nq}")]
public class RedditResult : IWebpage
{
public RedditResult(Post post)
{
Title = post.Title;
Url ... |
Revert change to pump in the wrong spot. | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
namesp... | // Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
namesp... |
Use red color when outputting error message | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Windsor;
namespace AppHarbor
{
class Program
{
static void Main(string[] args)
{
var container = new WindsorContainer()
.Install(new AppHarborInstaller());
var commandDispatcher = container.Resolve<Comm... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Windsor;
namespace AppHarbor
{
class Program
{
static void Main(string[] args)
{
var container = new WindsorContainer()
.Install(new AppHarborInstaller());
var commandDispatcher = container.Resolve<Comm... |
Fix issue that the changes to the connection strings were not registered before you're changing the focus to another connection string. | using System;
using System.Linq;
using System.Windows.Forms;
using NBi.UI.Genbi.Presenter;
namespace NBi.UI.Genbi.View.TestSuiteGenerator
{
public partial class SettingsControl : UserControl
{
public SettingsControl()
{
InitializeComponent();
}
intern... | using System;
using System.Linq;
using System.Windows.Forms;
using NBi.UI.Genbi.Presenter;
namespace NBi.UI.Genbi.View.TestSuiteGenerator
{
public partial class SettingsControl : UserControl
{
public SettingsControl()
{
InitializeComponent();
}
intern... |
Fix the broken NuGet build. | using System;
using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
// Simple example script that subscribes to primary pointer changes and applies a cursor highlight to the current one.
public class PrimaryPointerHandlerExample : MonoBehaviour
{
public GameObject Cu... | using Microsoft.MixedReality.Toolkit;
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Examples.Demos
{
// Simple example script that subscribes to primary pointer changes and applies a cursor highlight to the current one.
public class PrimaryPointerHandl... |
Add Refund as paymentmethod so we can use it in SettlementPeriodRevenue. | using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Mollie.Api.Models.Payment {
[JsonConverter(typeof(StringEnumConverter))]
public enum PaymentMethod {
[EnumMember(Value = "ideal")] Ideal,
[EnumMember(Value = "creditcard")] CreditCard,
... | using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace Mollie.Api.Models.Payment {
[JsonConverter(typeof(StringEnumConverter))]
public enum PaymentMethod {
[EnumMember(Value = "ideal")] Ideal,
[EnumMember(Value = "creditcard")] CreditCard,
... |
Add basics to load compiled client app | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Dependenc... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Dependenc... |
Fix detectors link to the slot | @{
var ownerName = Environment.GetEnvironmentVariable("WEBSITE_OWNER_NAME") ?? "";
var subscriptionId = ownerName;
var resourceGroup = Environment.GetEnvironmentVariable("WEBSITE_RESOURCE_GROUP") ?? "";
var siteName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME") ?? "";
var index = ow... | @{
var ownerName = Environment.GetEnvironmentVariable("WEBSITE_OWNER_NAME") ?? "";
var subscriptionId = ownerName;
var resourceGroup = Environment.GetEnvironmentVariable("WEBSITE_RESOURCE_GROUP") ?? "";
var siteName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME") ?? "";
var hostName = Envi... |
Add move towards method for vectors | using System.Numerics;
namespace DynamixelServo.Quadruped
{
public static class Vector3Extensions
{
public static Vector3 Normal(this Vector3 vector)
{
return Vector3.Normalize(vector);
}
public static bool Similar(this Vector3 a, Vector3 b, float marginOfError = f... | using System.Numerics;
namespace DynamixelServo.Quadruped
{
public static class Vector3Extensions
{
public static Vector3 Normal(this Vector3 vector)
{
return Vector3.Normalize(vector);
}
public static bool Similar(this Vector3 a, Vector3 b, float marginOfError = f... |
Update default logging behaviors to use functions that correspond to log level | using System;
using System.Diagnostics;
namespace Spiffy.Monitoring
{
public static class Behavior
{
static Action<Level, string> _loggingAction;
/// <summary>
/// Whether or not to remove newline characters from logged values.
/// </summary>
/// <returns>
/// <... | using System;
using System.Diagnostics;
namespace Spiffy.Monitoring
{
public static class Behavior
{
static Action<Level, string> _loggingAction;
/// <summary>
/// Whether or not to remove newline characters from logged values.
/// </summary>
/// <returns>
/// <... |
Fix build issues with 4.12 | //Copyright (c) 2016 Artem A. Mavrin and other contributors
using UnrealBuildTool;
public class DialogueSystem : ModuleRules
{
public DialogueSystem(TargetInfo Target)
{
PrivateIncludePaths.AddRange(
new string[] {"DialogueSystem/Private"});
PublicDependencyModuleNames.AddRange(
new s... | //Copyright (c) 2016 Artem A. Mavrin and other contributors
using UnrealBuildTool;
public class DialogueSystem : ModuleRules
{
public DialogueSystem(TargetInfo Target)
{
PrivateIncludePaths.AddRange(
new string[] {"DialogueSystem/Private"});
PublicDependencyModuleNames.AddRange(
new s... |
Update expression to match dots following dots | using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.ValueForms
{
public class DefaultSafeNamespaceValueFormModel : IValueForm
{
public DefaultSafeNamespaceValueFormModel()
... | using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
namespace Microsoft.TemplateEngine.Orchestrator.RunnableProjects.ValueForms
{
public class DefaultSafeNamespaceValueFormModel : IValueForm
{
public DefaultSafeNamespaceValueFormModel()
... |
Make sure timerdecoratortest always succeeds | namespace TestMoya.Runner.Runners
{
using System;
using System.Reflection;
using Moq;
using Moya.Attributes;
using Moya.Models;
using Moya.Runner.Runners;
using Xunit;
public class TimerDecoratorTests
{
private readonly Mock<ITestRunner> testRunnerMock;
private Time... | using System.Threading;
namespace TestMoya.Runner.Runners
{
using System;
using System.Reflection;
using Moq;
using Moya.Attributes;
using Moya.Models;
using Moya.Runner.Runners;
using Xunit;
public class TimerDecoratorTests
{
private readonly Mock<ITestRunner> testRunnerM... |
Tidy up the display of the side bar. | @using CGO.Web.Models
@model IEnumerable<SideBarSection>
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
@foreach (var sideBarSection in Model)
{
<li class="nav-header">@sideBarSection.Title</li>
foreach (var link in side... | @using CGO.Web.Models
@model IEnumerable<SideBarSection>
<div class="col-lg-3">
<div class="well">
<ul class="nav nav-stacked">
@foreach (var sideBarSection in Model)
{
<li class="navbar-header">@sideBarSection.Title</li>
foreach (var link in sideBar... |
Allow Leeroy to run until canceled in test mode. | using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
namespace Leeroy
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
if (args.Firs... | using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.ServiceProcess;
using System.Threading;
using System.Threading.Tasks;
namespace Leeroy
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
... |
Revert change to .NET desktop default directory logic | //
// DefaultDirectoryResolver.cs
//
// Copyright (c) 2017 Couchbase, 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/... | //
// DefaultDirectoryResolver.cs
//
// Copyright (c) 2017 Couchbase, 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/... |
Make sure to End StaticContent. |
using System;
using System.IO;
using Manos;
//
// This the default StaticContentModule that comes with all Manos apps
// if you do not wish to serve any static content with Manos you can
// remove its route handler from <YourApp>.cs's constructor and delete
// this file.
//
// All Content placed on the Conten... |
using System;
using System.IO;
using Manos;
//
// This the default StaticContentModule that comes with all Manos apps
// if you do not wish to serve any static content with Manos you can
// remove its route handler from <YourApp>.cs's constructor and delete
// this file.
//
// All Content placed on the Conten... |
Set an exception message for ReturnStatusMessage | using Grpc.Core;
using System;
namespace MagicOnion
{
public class ReturnStatusException : Exception
{
public StatusCode StatusCode { get; private set; }
public string Detail { get; private set; }
public ReturnStatusException(StatusCode statusCode, string detail)
{
... | using Grpc.Core;
using System;
namespace MagicOnion
{
public class ReturnStatusException : Exception
{
public StatusCode StatusCode { get; private set; }
public string Detail { get; private set; }
public ReturnStatusException(StatusCode statusCode, string detail)
: base($"T... |
Enlarge the scope of SA1600 supression to whole test project | // 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("StyleCop.CSha... | // 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("StyleCop.CSha... |
Allow noop on text fields | namespace Bumblebee.Interfaces
{
public interface ITextField : IElement, IHasText
{
TCustomResult EnterText<TCustomResult>(string text) where TCustomResult : IBlock;
TCustomResult AppendText<TCustomResult>(string text) where TCustomResult : IBlock;
}
public interface ITextField<out TRe... | namespace Bumblebee.Interfaces
{
public interface ITextField : IElement, IHasText
{
TCustomResult EnterText<TCustomResult>(string text) where TCustomResult : IBlock;
TCustomResult AppendText<TCustomResult>(string text) where TCustomResult : IBlock;
}
public interface ITextField<out TRe... |
Change version number to 2.2.1 | //-----------------------------------------------------------------------
// <copyright file="AssemblyInfo.Shared.cs" company="SonarSource SA and Microsoft Corporation">
// Copyright (c) SonarSource SA and Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the projec... | //-----------------------------------------------------------------------
// <copyright file="AssemblyInfo.Shared.cs" company="SonarSource SA and Microsoft Corporation">
// Copyright (c) SonarSource SA and Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the projec... |
Check folders by its tag | using System.Collections;
using System.Windows.Forms;
namespace GUI.Controls
{
internal class TreeViewFileSorter : IComparer
{
public int Compare(object x, object y)
{
var tx = x as TreeNode;
var ty = y as TreeNode;
var folderx = tx.ImageKey == @"_folder";
... | using System.Collections;
using System.Windows.Forms;
namespace GUI.Controls
{
internal class TreeViewFileSorter : IComparer
{
public int Compare(object x, object y)
{
var tx = x as TreeNode;
var ty = y as TreeNode;
var folderx = tx.Tag is TreeViewFolder;
... |
Add support for basic auth | using System;
using System.Net.Http;
using System.Threading.Tasks;
using Ecom.Hal.JSON;
using Newtonsoft.Json;
namespace Ecom.Hal
{
public class HalClient
{
public HalClient(Uri endpoint)
{
Client = new HttpClient {BaseAddress = endpoint};
}
public T Parse<T>(string content)
{
retu... | using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Ecom.Hal.JSON;
using Newtonsoft.Json;
namespace Ecom.Hal
{
public class HalClient
{
public HalClient(Uri endpoint)
{
Client = new HttpClient {BaseAddress = endpoint};
}
... |
Fix bug with zoom when it didnt limit | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Micro;
namespace SharpGraphEditor.Models
{
public class ZoomManager : PropertyChangedBase
{
public int MaxZoom { get; } = 2;
public double CurrentZoom { get; private set; }
public ... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Micro;
namespace SharpGraphEditor.Models
{
public class ZoomManager : PropertyChangedBase
{
public double MaxZoom { get; } = 2;
public double CurrentZoom { get; private set; }
publi... |
Fix RestClient BaseUrl change to Uri | using RestSharp;
namespace PivotalTrackerDotNet
{
public abstract class AAuthenticatedService
{
protected readonly string m_token;
protected RestClient RestClient;
protected AAuthenticatedService(string token)
{
m_token = token;
RestClient = n... | using RestSharp;
namespace PivotalTrackerDotNet
{
using System;
public abstract class AAuthenticatedService
{
protected readonly string m_token;
protected RestClient RestClient;
protected AAuthenticatedService(string token)
{
m_token = token;
... |
Exclude Shouldly from code coverage | #load nuget:?package=Cake.Recipe&version=1.0.0
Environment.SetVariableNames();
BuildParameters.SetParameters(
context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "TfsUrlParser",
repositoryOwner: "bbtsoftware",
repositoryName: "TfsUrlParser",
appVeyorAccountNam... | #load nuget:?package=Cake.Recipe&version=1.0.0
Environment.SetVariableNames();
BuildParameters.SetParameters(
context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "TfsUrlParser",
repositoryOwner: "bbtsoftware",
repositoryName: "TfsUrlParser",
appVeyorAccountNam... |
Define a const for read buffer size | /*
* Programmed by Umut Celenli umut@celenli.com
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace MimeBank
{
/// <summary>
/// This is the main class to check the file mime type
/// Header list is loaded once
/// </summary>
public cla... | /*
* Programmed by Umut Celenli umut@celenli.com
*/
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace MimeBank
{
/// <summary>
/// This is the main class to check the file mime type
/// Header list is loaded once
/// </summary>
public class MimeChecker
... |
Use static class for static methods. | #if !(LESSTHAN_NET40 || NETSTANDARD1_0)
using System.Runtime.CompilerServices;
#endif
namespace System.Threading
{
public class MonitorEx
{
#if !(LESSTHAN_NET40 || NETSTANDARD1_0)
[MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
#endif
public static void Enter(object obj, ref bool lockTake... | #if !(LESSTHAN_NET40 || NETSTANDARD1_0)
using System.Runtime.CompilerServices;
#endif
namespace System.Threading
{
public static class MonitorEx
{
#if !(LESSTHAN_NET40 || NETSTANDARD1_0)
[MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
#endif
public static void Enter(object obj, ref bool l... |
Revert "Swapping Silly UK English ;)" | namespace Nancy
{
using System.Collections.Generic;
using System.IO;
public interface ISerializer
{
/// <summary>
/// Whether the serializer can serialize the content type
/// </summary>
/// <param name="contentType">Content type to serialize</param>
... | namespace Nancy
{
using System.Collections.Generic;
using System.IO;
public interface ISerializer
{
/// <summary>
/// Whether the serializer can serialize the content type
/// </summary>
/// <param name="contentType">Content type to serialise</param>
... |
Add OrderingDomainException when the order doesn't exist with id orderId | using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
using System;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Reposi... | using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
using Ordering.Domain.Exceptions;
using System;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Servi... |
Handle oddity in watchdog naming convention | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace XiboClient.Control
{
class WatchDogManager
{
public static void Start()
{
// Check to see if the WatchDog EXE exist... | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace XiboClient.Control
{
class WatchDogManager
{
public static void Start()
{
// Check to see if the WatchDog EXE exist... |
Fix BL-3614 Crash while checking for keyman | using System.Linq;
using System.Windows.Forms;
using Bloom.Api;
namespace Bloom.web.controllers
{
class KeybordingConfigApi
{
public void RegisterWithServer(EnhancedImageServer server)
{
server.RegisterEndpointHandler("keyboarding/useLongPress", (ApiRequest request) =>
{
//detect if some keyboarding ... | using System;
using System.Linq;
using System.Windows.Forms;
using Bloom.Api;
namespace Bloom.web.controllers
{
class KeybordingConfigApi
{
public void RegisterWithServer(EnhancedImageServer server)
{
server.RegisterEndpointHandler("keyboarding/useLongPress", (ApiRequest request) =>
{
try
{
/... |
Allow config.json path to work on non-Windows OS | using System;
using System.IO;
using System.Reflection;
using Newtonsoft.Json.Linq;
namespace Noobot.Core.Configuration
{
public class ConfigReader : IConfigReader
{
private JObject _currentJObject;
private readonly string _configLocation;
private readonly object _lock = new object();
... | using System;
using System.IO;
using System.Reflection;
using Newtonsoft.Json.Linq;
namespace Noobot.Core.Configuration
{
public class ConfigReader : IConfigReader
{
private JObject _currentJObject;
private readonly string _configLocation;
private readonly object _lock = new object();
... |
Add support for local folder | using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Phone.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using Windows.Storage;
using System.Diagnostics;
using System.IO;
namespace WPCordovaClassLib.Cordova.Commands
{
pub... | using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Phone.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
using Windows.Storage;
using System.Diagnostics;
using System.IO;
namespace WPCordovaClassLib.Cordova.Commands
{
pub... |
Rewrite test to cover failure case | // 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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Overlays;
using osu.G... | // 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.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Gam... |
Add http.host and http.path annotations | using System;
using Microsoft.AspNetCore.Builder;
using Criteo.Profiling.Tracing;
using Criteo.Profiling.Tracing.Utils;
namespace Criteo.Profiling.Tracing.Middleware
{
public static class TracingMiddleware
{
public static void UseTracing(this IApplicationBuilder app, string serviceName)
{
... | using System;
using Microsoft.AspNetCore.Builder;
using Criteo.Profiling.Tracing;
using Criteo.Profiling.Tracing.Utils;
using Microsoft.AspNetCore.Http.Extensions;
namespace Criteo.Profiling.Tracing.Middleware
{
public static class TracingMiddleware
{
public static void UseTracing(this IApplicationBuil... |
Make translation work with inheritance | namespace Translatable.TranslationTest
{
public class MainWindowTranslation : ITranslatable
{
private IPluralBuilder PluralBuilder { get; set; } = new DefaultPluralBuilder();
public string Title { get; private set; } = "Main window title";
public string SampleText { get; private set; ... | namespace Translatable.TranslationTest
{
public class MainWindowTranslation : ITranslatable
{
protected IPluralBuilder PluralBuilder { get; set; } = new DefaultPluralBuilder();
public string Title { get; protected set; } = "Main window title";
public string SampleText { get; protected... |
Make tests actually test the string output | // 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.Input.Bindings;
using osu.Framework.Input.States;
using osuTK.Input;
using KeyboardState = osu.Framework.Input.States.KeyboardS... | // 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.Input.Bindings;
namespace osu.Framework.Tests.Input
{
[TestFixture]
public class KeyCombinationTest
{
priv... |
Add basic Get for a post | using System;
using System.Collections.Generic;
using DapperTesting.Core.Model;
namespace DapperTesting.Core.Data
{
public class DapperPostRepository : DapperRepositoryBase, IPostRepository
{
public DapperPostRepository(IConnectionFactory connectionFactory, string connectionStringName) : base(connecti... | using System;
using System.Collections.Generic;
using System.Linq;
using Dapper;
using DapperTesting.Core.Model;
namespace DapperTesting.Core.Data
{
public class DapperPostRepository : DapperRepositoryBase, IPostRepository
{
public DapperPostRepository(IConnectionFactory connectionFactory, string co... |
Create temp directories in temp folder | using System.IO;
namespace NuGet.Extensions.Tests.TestData
{
public class Isolation
{
public static DirectoryInfo GetIsolatedTestSolutionDir()
{
var solutionDir = new DirectoryInfo(Path.GetRandomFileName());
CopyFilesRecursively(new DirectoryInfo(Paths.TestSolutionForA... | using System.IO;
namespace NuGet.Extensions.Tests.TestData
{
public class Isolation
{
public static DirectoryInfo GetIsolatedTestSolutionDir()
{
var solutionDir = new DirectoryInfo(GetRandomTempDirectoryPath());
CopyFilesRecursively(new DirectoryInfo(Paths.TestSolution... |
Add RemainingTime and env vars to dotnetcore2.0 example | // Compile with:
// docker run --rm -v "$PWD":/var/task lambci/lambda:build-dotnetcore2.0 dotnet publish -c Release -o pub
// Run with:
// docker run --rm -v "$PWD"/pub:/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler "some"
using Amazon.Lambda.Core;
[assembly: LambdaSerializer(typeof(Amazo... | // Compile with:
// docker run --rm -v "$PWD":/var/task lambci/lambda:build-dotnetcore2.0 dotnet publish -c Release -o pub
// Run with:
// docker run --rm -v "$PWD"/pub:/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler "some"
using System;
using System.Collections;
using Amazon.Lambda.Core;
... |
Add comments to constructors, use constructor chaining. | using System;
namespace WundergroundClient.Autocomplete
{
enum ResultFilter
{
CitiesOnly,
HurricanesOnly,
CitiesAndHurricanes
}
class AutocompleteRequest
{
private String _searchString;
private ResultFilter _filter = ResultFilter.CitiesOnly;
private... | using System;
namespace WundergroundClient.Autocomplete
{
enum ResultFilter
{
CitiesOnly,
HurricanesOnly,
CitiesAndHurricanes
}
class AutocompleteRequest
{
private const String BaseUrl = "http://autocomplete.wunderground.com/";
private readonly String _sea... |
Initialize the server with a report-state command | using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using OpenStardriveServer.Domain.Database;
using OpenStardriveServer.Domain.Systems;
namespace OpenStardriveServer.HostedServices;
public class ServerInitializationService : BackgroundService
... | using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using OpenStardriveServer.Domain;
using OpenStardriveServer.Domain.Database;
using OpenStardriveServer.Domain.Systems;
namespace OpenStardriveServer.HostedServices;
public class ServerInitiali... |
Clean up Translation code health test | // Copyright 2017 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... | // Copyright 2017 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... |
Remove second build step from TC, thanks to Sean | @{ViewBag.Title = "Home";}
<div class="jumbotron">
<h1>CasperJS Testing!</h1>
<p>CasperJS is a navigation scripting & testing utility for PhantomJS written in Javascript</p>
<p><a target="_blank" href="http://casperjs.org/" class="btn btn-primary btn-lg" role="button">Learn more</a></p>
</div>
<div clas... | @{ViewBag.Title = "Home";}
<div class="jumbotron">
<h1>CasperJS Testing!!!</h1>
<p>CasperJS is a navigation scripting & testing utility for PhantomJS written in Javascript</p>
<p><a target="_blank" href="http://casperjs.org/" class="btn btn-primary btn-lg" role="button">Learn more</a></p>
</div>
<div cl... |
Remove some spurious Console.WriteLine() calls from a test. | // Copyright 2013 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 System;
using System.Linq;
using NodaTime.Annotations;
using NUnit.Framework;
namespace NodaTime.Test.Annotations
{
[TestFixture]
public c... | // Copyright 2013 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 System;
using System.Linq;
using NodaTime.Annotations;
using NUnit.Framework;
namespace NodaTime.Test.Annotations
{
[TestFixture]
public c... |
Rewrite of the Time Parsing code | using System;
using System.Globalization;
namespace LiveSplit.Model
{
public static class TimeSpanParser
{
public static TimeSpan? ParseNullable(String timeString)
{
if (String.IsNullOrEmpty(timeString))
return null;
return Parse(timeString);
}
... | using System;
using System.Linq;
using System.Globalization;
namespace LiveSplit.Model
{
public static class TimeSpanParser
{
public static TimeSpan? ParseNullable(String timeString)
{
if (String.IsNullOrEmpty(timeString))
return null;
return Parse(timeS... |
Increase editor verify settings width to give more breathing space | // 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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.G... | // 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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.G... |
Set compatibility version to 2.2 in hello world sample project | using ExplicitlyImpl.AspNetCore.Mvc.FluentActions;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace HelloWorld
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddFluentActions();
... | using ExplicitlyImpl.AspNetCore.Mvc.FluentActions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
namespace HelloWorld
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services... |
Fix ReturnsDefaultRepresenationCurrentCulture test for all cultures | using System.Globalization;
using Xunit;
namespace ByteSizeLib.Tests.BinaryByteSizeTests
{
public class ToBinaryStringMethod
{
[Fact]
public void ReturnsDefaultRepresenation()
{
// Arrange
var b = ByteSize.FromKiloBytes(10);
// Act
var r... | using System.Globalization;
using Xunit;
namespace ByteSizeLib.Tests.BinaryByteSizeTests
{
public class ToBinaryStringMethod
{
[Fact]
public void ReturnsDefaultRepresenation()
{
// Arrange
var b = ByteSize.FromKiloBytes(10);
// Act
var r... |
Use CssParser front-end as intended | namespace AngleSharp.Performance.Css
{
using AngleSharp;
using AngleSharp.Parser.Css;
using System;
class AngleSharpParser : ITestee
{
static readonly IConfiguration configuration = new Configuration().WithCss();
public String Name
{
get { return "AngleSharp"; ... | namespace AngleSharp.Performance.Css
{
using AngleSharp;
using AngleSharp.Parser.Css;
using System;
class AngleSharpParser : ITestee
{
static readonly IConfiguration configuration = new Configuration().WithCss();
static readonly CssParserOptions options = new CssParserOptions
... |
Add some more properties to hover info. | using System.Threading.Tasks;
namespace DanTup.DartAnalysis
{
class AnalysisGetHoverRequest : Request<AnalysisGetHoverParams, Response<AnalysisGetHoverResponse>>
{
public string method = "analysis.getHover";
public AnalysisGetHoverRequest(string file, int offset)
{
this.@params = new AnalysisGetHoverParam... | using System.Threading.Tasks;
namespace DanTup.DartAnalysis
{
class AnalysisGetHoverRequest : Request<AnalysisGetHoverParams, Response<AnalysisGetHoverResponse>>
{
public string method = "analysis.getHover";
public AnalysisGetHoverRequest(string file, int offset)
{
this.@params = new AnalysisGetHoverParam... |
Implement the second overload of Select | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodePlayground
{
public static class MyLinqMethods
{
public static IEnumerable<T> Where<T>(
this IEnumerable<T> inputSequence,
Func<T, bool> predicate)... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodePlayground
{
public static class MyLinqMethods
{
public static IEnumerable<T> Where<T>(
this IEnumerable<T> inputSequence,
Func<T, bool> predicate)... |
Update sql commands and use the new method | using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
p... | using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
p... |
Fix tests - all green | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Moq;
using Engine;
namespace EngineTest
{
[TestFixture()]
public class ActorShould
{
Mock<IScene> scene;
Actor actor;
Mock<IStrategy> strategy;
[SetUp()]
public void SetUp()
{
strat... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Moq;
using Engine;
namespace EngineTest
{
[TestFixture()]
public class ActorShould
{
Mock<IScene> scene;
Actor actor;
Mock<IStrategy> strategy;
private Mock<IAct> act;
[SetUp()]
pu... |
Revert "Added edit method into UserRepository" | using BikeMates.DataAccess.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BikeMates.Contracts
{
//TODO: Create folder Repositories and move this interface into it
//TODO: Create a base IRepository interface
public inter... | using BikeMates.DataAccess.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BikeMates.Contracts
{
//TODO: Create folder Repositories and move this interface into it
//TODO: Create a base IRepository interface
public inter... |
Remove heartbeat server property index name | // Copyright (c) 2017 Sergey Zhigunov.
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Hangfire.EntityFramework
{
internal class HangfireS... | // Copyright (c) 2017 Sergey Zhigunov.
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Hangfire.EntityFramework
{
internal class HangfireS... |
Handle null id for Cars/Details action | using CarFuel.DataAccess;
using CarFuel.Models;
using CarFuel.Services;
using Microsoft.AspNet.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace CarFuel.Controllers
{
public class CarsController : Controller
{
private ICarDb ... | using CarFuel.DataAccess;
using CarFuel.Models;
using CarFuel.Services;
using Microsoft.AspNet.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
namespace CarFuel.Controllers
{
public class CarsController : Controller
{
... |
Use background thread, otherwise process is not terminated after closing application window. | using System;
using System.IO;
using System.IO.MemoryMappedFiles;
using System.Threading;
using UltimaRX.Proxy.InjectionApi;
namespace Infusion.Desktop
{
internal static class InterProcessCommunication
{
private static readonly EventWaitHandle MessageSentEvent = new EventWaitHandle(false, EventResetMo... | using System;
using System.IO;
using System.IO.MemoryMappedFiles;
using System.Threading;
using UltimaRX.Proxy.InjectionApi;
namespace Infusion.Desktop
{
internal static class InterProcessCommunication
{
private static readonly EventWaitHandle MessageSentEvent = new EventWaitHandle(false, EventResetMo... |
Add test for reading files with UTF-8 BOM | using Xunit;
using System.IO;
namespace Mammoth.Tests {
public class DocumentConverterTests {
[Fact]
public void DocxContainingOneParagraphIsConvertedToSingleParagraphElement() {
assertSuccessfulConversion(
convertToHtml("single-paragraph.docx"),
"<p>Walking on imported air</p>");
}
private void ... | using Xunit;
using System.IO;
namespace Mammoth.Tests {
public class DocumentConverterTests {
[Fact]
public void DocxContainingOneParagraphIsConvertedToSingleParagraphElement() {
assertSuccessfulConversion(
ConvertToHtml("single-paragraph.docx"),
"<p>Walking on imported air</p>");
}
[Fact]
publ... |
Make initial task easier given the number of refactorings needed. | using System;
using System.Linq;
using MyApplication.dependencies;
using System.Collections.Generic;
namespace MyApplication
{
public class PersonService
{
/// <summary>
/// Initializes a new instance of the <see cref="PersonService"/> class.
/// </summary>
public Perso... | using System;
using System.Linq;
using MyApplication.dependencies;
using System.Collections.Generic;
namespace MyApplication
{
public class PersonService
{
/// <summary>
/// Initializes a new instance of the <see cref="PersonService"/> class.
/// </summary>
public Perso... |
Add release action to journal transaction | using ONIT.VismaNetApi.Models;
using System.Threading.Tasks;
namespace ONIT.VismaNetApi.Lib.Data
{
public class JournalTransactionData : BaseCrudDataClass<JournalTransaction>
{
public JournalTransactionData(VismaNetAuthorization auth) : base(auth)
{
ApiControllerUri = VismaNetContr... | using ONIT.VismaNetApi.Models;
using System.Threading.Tasks;
namespace ONIT.VismaNetApi.Lib.Data
{
public class JournalTransactionData : BaseCrudDataClass<JournalTransaction>
{
public JournalTransactionData(VismaNetAuthorization auth) : base(auth)
{
ApiControllerUri = VismaNetContr... |
Add test cases for wall avoidance settings | using Alensia.Core.Actor;
using Alensia.Core.Camera;
using Alensia.Tests.Actor;
using NUnit.Framework;
namespace Alensia.Tests.Camera
{
[TestFixture, Description("Test suite for ThirdPersonCamera class.")]
public class ThirdPersonCameraTest : BaseOrbitingCameraTest<ThirdPersonCamera, IHumanoid>
{
... | using Alensia.Core.Actor;
using Alensia.Core.Camera;
using Alensia.Tests.Actor;
using NUnit.Framework;
using UnityEngine;
namespace Alensia.Tests.Camera
{
[TestFixture, Description("Test suite for ThirdPersonCamera class.")]
public class ThirdPersonCameraTest : BaseOrbitingCameraTest<ThirdPersonCamera, IHuman... |
Save work items after starting. | using TicketTimer.Core.Infrastructure;
namespace TicketTimer.Core.Services
{
// TODO this should have a better name
public class WorkItemServiceImpl : WorkItemService
{
private readonly WorkItemStore _workItemStore;
private readonly DateProvider _dateProvider;
public WorkItemServic... | using TicketTimer.Core.Infrastructure;
namespace TicketTimer.Core.Services
{
// TODO this should have a better name
public class WorkItemServiceImpl : WorkItemService
{
private readonly WorkItemStore _workItemStore;
private readonly DateProvider _dateProvider;
public WorkItemServic... |
Allow standalone program to process multiple files at once | // Copyright (c) 2014 Eberhard Beilharz
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using Undisposed;
namespace UndisposedExe
{
class MainClass
{
private static void Usage()
{
Console.WriteLine("Usage");
Console.WriteLine("Undisposed.exe [-o output... | // Copyright (c) 2014 Eberhard Beilharz
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using Undisposed;
namespace UndisposedExe
{
class MainClass
{
private static void Usage()
{
Console.WriteLine("Usage");
Console.WriteLine("Undisposed.exe [-o output... |
Change comment to doc comment | using System.Web.Http.Controllers;
namespace System.Web.Http.ModelBinding
{
// Interface for model binding
public interface IModelBinder
{
bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext);
}
}
| using System.Web.Http.Controllers;
namespace System.Web.Http.ModelBinding
{
/// <summary>
/// Interface for model binding.
/// </summary>
public interface IModelBinder
{
bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext);
}
}
|
Fix private keys config parsing | using System.Collections.Generic;
using System.Linq;
using RestImageResize.Security;
using RestImageResize.Utils;
namespace RestImageResize
{
/// <summary>
/// Provides configuration options.
/// </summary>
internal static class Config
{
private static class AppSettingKeys
{
... | using System.Collections.Generic;
using System.Linq;
using RestImageResize.Security;
using RestImageResize.Utils;
namespace RestImageResize
{
/// <summary>
/// Provides configuration options.
/// </summary>
internal static class Config
{
private static class AppSettingKeys
{
... |
Add link to Guava implementation of Cache. | using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
namespace Tamarind.Cache
{
// TODO: NEEDS DOCUMENTATION.
public interface ICache<K, V>
{
V GetIfPresent(K key);
V Get(K key, Func<V> valueLoader);
Im... | using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
namespace Tamarind.Cache
{
// Guava Reference: https://code.google.com/p/guava-libraries/source/browse/guava/src/com/google/common/cache/Cache.java
// TODO: NEEDS DOCUMENTATION.
... |
Remove account and api key | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;
namespace VendingMachineNew
{
public class TwilioAPI
{
static void Main(string[] args)
{
SendSms... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;
namespace VendingMachineNew
{
public class TwilioAPI
{
static void Main(string[] args)
{
SendSms... |
Set Configuration.DefaultNameOrConnectionString for unit tests by default. | using System.Reflection;
using Abp.Modules;
namespace Abp.TestBase
{
[DependsOn(typeof(AbpKernelModule))]
public class AbpTestBaseModule : AbpModule
{
public override void PreInitialize()
{
Configuration.EventBus.UseDefaultEventBus = false;
}
public override vo... | using System.Reflection;
using Abp.Modules;
namespace Abp.TestBase
{
[DependsOn(typeof(AbpKernelModule))]
public class AbpTestBaseModule : AbpModule
{
public override void PreInitialize()
{
Configuration.EventBus.UseDefaultEventBus = false;
Configuration.DefaultName... |
Fix DelayableAction delays persisting DAH serialization | using System;
using System.Xml;
using Hacknet;
using Pathfinder.Util;
using Pathfinder.Util.XML;
namespace Pathfinder.Action
{
public abstract class DelayablePathfinderAction : PathfinderAction
{
[XMLStorage]
public string DelayHost;
[XMLStorage]
public string Delay;
... | using System;
using System.Xml;
using Hacknet;
using Pathfinder.Util;
using Pathfinder.Util.XML;
namespace Pathfinder.Action
{
public abstract class DelayablePathfinderAction : PathfinderAction
{
[XMLStorage]
public string DelayHost;
[XMLStorage]
public string Delay;
... |
Fix for shader preview window in material tool appearing and then just disappearing | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ControlsLibrary.BasicControls
{
public partial class TextWindow : Form
{
public TextWindow()
{
... | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ControlsLibrary.BasicControls
{
public partial class TextWindow : Form
{
public TextWindow()
{
... |
Remove test intead of fixing it 👍 | using System;
using Xunit;
using Branch.Clients.Json;
using System.Threading.Tasks;
using Branch.Clients.Http.Models;
using System.Collections.Generic;
namespace Branch.Tests.Clients.JsonTests
{
public class OptionTests
{
[Fact]
public void RespectOptions()
{
var options = new Options
{
... | using System;
using Xunit;
using Branch.Clients.Json;
using System.Threading.Tasks;
using Branch.Clients.Http.Models;
using System.Collections.Generic;
namespace Branch.Tests.Clients.JsonTests
{
public class OptionTests
{
[Fact]
public void RespectOptions()
{
var options = new Options
{
... |
Handle elements without elevation data | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace KmlToGpxConverter
{
internal static class KmlReader
{
public const string FileExtension = "kml";
public static IList<GpsTimePoint> ReadFile(string fi... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace KmlToGpxConverter
{
internal static class KmlReader
{
public const string FileExtension = "kml";
public static IList<GpsTimePoint> ReadFile(string fi... |
Increase usable width slightly further | // 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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.G... | // 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.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.G... |
Use the shortest path if assemblies have the same file name | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Pennyworth {
public static class DropHelper {
public static IEnumerable<String> GetAssembliesFromDropData(IEnumerable<FileInfo> data) {
Func<FileInfo, Boolean> isDir = fi => ((fi.Attributes & FileAttr... | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Pennyworth {
public static class DropHelper {
public static IEnumerable<String> GetAssembliesFromDropData(IEnumerable<FileInfo> data) {
Func<FileInfo, Boolean> isDir = fi => ((fi.Attributes & FileAtt... |
Make XHud MaskType cast-able to AndHud MaskType | using System;
using Android.App;
using AndroidHUD;
namespace XHUD
{
public enum MaskType
{
// None = 1,
Clear,
Black,
// Gradient
}
public static class HUD
{
public static Activity MyActivity;
public static void Show(string message, int progress = -1, MaskType maskType = MaskType.Black)
{
AndHU... | using System;
using Android.App;
using AndroidHUD;
namespace XHUD
{
public enum MaskType
{
// None = 1,
Clear = 2,
Black = 3,
// Gradient
}
public static class HUD
{
public static Activity MyActivity;
public static void Show(string message, int progress = -1, MaskType maskType = MaskType.Black)
{
... |
Make the code in the entrypoint even shorter. | using System;
using Autofac;
using WordList.Composition;
namespace WordList {
public class Program {
public static void Main(string[] args) {
var compositionRoot = CompositionRoot.Compose();
var wordListProgram = compositionRoot.Resolve<IWordListProgram>();
wordListProgram.Run();
Consol... | using System;
using Autofac;
using WordList.Composition;
namespace WordList {
public class Program {
public static void Main(string[] args) {
CompositionRoot.Compose().Resolve<IWordListProgram>().Run();
Console.WriteLine("Press any key to quit...");
Console.ReadKey();
}
}
} |
Add FirstLetterToLower() to each exception message | using System;
namespace Evolve
{
public class EvolveConfigurationException : EvolveException
{
private const string EvolveConfigurationError = "Evolve configuration error: ";
public EvolveConfigurationException(string message) : base(EvolveConfigurationError + message) { }
public Evo... | using System;
namespace Evolve
{
public class EvolveConfigurationException : EvolveException
{
private const string EvolveConfigurationError = "Evolve configuration error: ";
public EvolveConfigurationException(string message) : base(EvolveConfigurationError + FirstLetterToLower(message)) { }... |
Add assertion to check for cycles in ExecutionTree | using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Symbooglix
{
public class ExecutionTreeNode
{
public readonly ExecutionTreeNode Parent;
public readonly ProgramLocation CreatedAt;
public readonly ExecutionState State; // Should this be a weak referenc... | using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Symbooglix
{
public class ExecutionTreeNode
{
public readonly ExecutionTreeNode Parent;
public readonly ProgramLocation CreatedAt;
public readonly ExecutionState State; // Should this be a weak referenc... |
Use dictionary instead of lists | namespace BracesValidator
{
using System.Collections.Generic;
public class BracesValidator
{
public bool Validate(string code)
{
char[] codeArray = code.ToCharArray();
List<char> openers = new List<char> { '{', '[', '(' };
List<char> closers = new List<c... | namespace BracesValidator
{
using System.Collections.Generic;
public class BracesValidator
{
public bool Validate(string code)
{
char[] codeArray = code.ToCharArray();
Dictionary<char, char> openersClosersMap = new Dictionary<char, char>();
openersClose... |
Remove warnings from Ably log to reduce noise. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using DotNetApis.Common.Internals;
using Microsoft.Extensions.Logging;
namespace DotNetApis.Common
{
/// <summary>
/// A logger that attempts to write to an implicit Ably channel. This type can be safely created before ... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using DotNetApis.Common.Internals;
using Microsoft.Extensions.Logging;
namespace DotNetApis.Common
{
/// <summary>
/// A logger that attempts to write to an implicit Ably channel. This type can be safely created before ... |
Make sure we only ever initialize once | // Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
//using GLib;
//using Gtk;
using NDesk.DBus;
using NDesk.GLib;
using org.freedesktop.DBus;
namespace NDesk.DBus
{
//FIXME: this API needs review and de-unixification. It is h... | // Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
//using GLib;
//using Gtk;
using NDesk.DBus;
using NDesk.GLib;
using org.freedesktop.DBus;
namespace NDesk.DBus
{
//FIXME: this API needs review and de-unixification. It is h... |
Add parallelism to Tests project | using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Atata.Tests")]
[assembly: Guid("9d0aa4f2-4987-4395-be95-76abc329b7a0")] | using NUnit.Framework;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Atata.Tests")]
[assembly: Guid("9d0aa4f2-4987-4395-be95-76abc329b7a0")]
[assembly: LevelOfParallelism(4)]
[assembly: Parallelizable(ParallelScope.Fixtures)]
[assembly: Atata.Culture("en-us")] |
Fix crew to reference by BroeCrewId | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using HeadRaceTimingSite.Models;
using Microsoft.EntityFrameworkCore;
namespace HeadRaceTimingSite.Controllers
{
public class CrewController : BaseController
{
public CrewCon... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using HeadRaceTimingSite.Models;
using Microsoft.EntityFrameworkCore;
namespace HeadRaceTimingSite.Controllers
{
public class CrewController : BaseController
{
public CrewCon... |
Mark the empty method detour test as NoInlining | #pragma warning disable CS1720 // Expression will always cause a System.NullReferenceException because the type's default value is null
#pragma warning disable xUnit1013 // Public method should be marked as test
using Xunit;
using MonoMod.RuntimeDetour;
using System;
using System.Reflection;
using System.Runtime.Comp... | #pragma warning disable CS1720 // Expression will always cause a System.NullReferenceException because the type's default value is null
#pragma warning disable xUnit1013 // Public method should be marked as test
using Xunit;
using MonoMod.RuntimeDetour;
using System;
using System.Reflection;
using System.Runtime.Comp... |
Make user voice content provider work with https. | using System;
using System.Threading.Tasks;
using JabbR.ContentProviders.Core;
using JabbR.Infrastructure;
namespace JabbR.ContentProviders
{
public class UserVoiceContentProvider : CollapsibleContentProvider
{
private static readonly string _uservoiceAPIURL = "http://{0}/api/v1/oembed.json?url={1}";
... | using System;
using System.Threading.Tasks;
using JabbR.ContentProviders.Core;
using JabbR.Infrastructure;
namespace JabbR.ContentProviders
{
public class UserVoiceContentProvider : CollapsibleContentProvider
{
private static readonly string _uservoiceAPIURL = "https://{0}/api/v1/oembed.json?url={1}";... |
Make X509 work with ManagedHandler | using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
namespace Docker.DotNet.X509
{
public class CertificateCredentials : Credentials
{
private readonly WebRequestHandler _handler;
public CertificateCredentials(X509Certificate2 clientCertificate)
{
_... | using System.Net;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Net.Http.Client;
namespace Docker.DotNet.X509
{
public class CertificateCredentials : Credentials
{
private X509Certificate2 _certificate;
public CertificateCredentials(X509Certificat... |
Rename listened table in migration |
using FluentMigrator;
namespace Azimuth.Migrations
{
[Migration(201409101200)]
public class Migration_201409101200_RemoveListenedTableAndAddCounterToPlaylistTable: Migration
{
public override void Up()
{
Delete.Table("Listened");
Alter.Table("Playlists").AddColumn(... |
using FluentMigrator;
namespace Azimuth.Migrations
{
[Migration(201409101200)]
public class Migration_201409101200_RemoveListenedTableAndAddCounterToPlaylistTable: Migration
{
public override void Up()
{
Delete.Table("Listened");
Alter.Table("Playlists").AddColumn(... |
Include Fact attribute on test method | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MathParser.Tests
{
public class InfixLexicalAnalyzerTest
{
public void Expressao_binaria_simples_com_espacos()
{
//var analyzer = new InfixLexic... | using Xunit;
namespace MathParser.Tests
{
public class InfixLexicalAnalyzerTest
{
[Fact]
public void Expressao_binaria_simples_com_espacos()
{
//var analyzer = new InfixLexicalAnalyzer();
//analyzer.Analyze("2 + 2");
}
}
}
|
Update servicepointmanager to use newer TLS | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Synapse.RestClient.Transaction;
namespace Synapse.RestClient
{
using User;
using Node;
public class SynapseRestClientFactory
{
private SynapseApiCredentials _creds;
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Synapse.RestClient.Transaction;
namespace Synapse.RestClient
{
using User;
using Node;
using System.Net;
public class SynapseRestClientFactory
{
private SynapseApiCred... |
Add missing "using geckofx" for mono build | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Bloom;
using Bloom.MiscUI;
using NUnit.Framework;
namespace BloomTests
{
[TestFixture]
#if __MonoCS__
[RequiresSTA]
#endif
public class ProblemReporterDialogTests
{
[TestFixtureSetUp]
public... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Bloom;
using Bloom.MiscUI;
using NUnit.Framework;
#if __MonoCS__
using Gecko;
#endif
namespace BloomTests
{
[TestFixture]
#if __MonoCS__
[RequiresSTA]
#endif
public class ProblemReporterDialogTe... |
Add client for simple call | using System;
namespace HelloClient
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
| using System;
using Grpc.Core;
using Hello;
namespace HelloClient
{
class Program
{
public static void Main(string[] args)
{
Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure);
var client = new HelloService.HelloServiceClient(channel);
String user = "Euler";
var reply = ... |
Throw 404 when you can't find the node | using System;
using System.Collections.Generic;
namespace WebNoodle
{
public static class NodeHelper
{
public static IEnumerable<object> YieldChildren(this object node, string path, bool breakOnNull = false)
{
path = string.IsNullOrWhiteSpace(path) ? "/" : path;
yield re... | using System;
using System.Collections.Generic;
using System.Web;
namespace WebNoodle
{
public static class NodeHelper
{
public static IEnumerable<object> YieldChildren(this object node, string path, bool breakOnNull = false)
{
path = string.IsNullOrWhiteSpace(path) ? "/" : path;
... |
Make FPS counter to a GameComponent | using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
namespace MonoGame.Extended
{
public class FramesPerSecondCounter : IUpdate
{
public FramesPerSecondCounter(int maximumSamples = 100)
{
MaximumSamples = maximumSamples;
}
private re... | using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
namespace MonoGame.Extended
{
public class FramesPerSecondCounter : DrawableGameComponent
{
public FramesPerSecondCounter(Game game, int maximumSamples = 100)
:base(game)
{
MaximumSample... |
Fix tests failing due to not being updated with new behaviour | // 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.Globalization;
using NUnit.Framework;
using osu.Framework.Localisation;
namespace osu.Framework.Tests.Localisation
{
[TestFixture]
public class Cult... | // 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.Globalization;
using NUnit.Framework;
using osu.Framework.Localisation;
namespace osu.Framework.Tests.Localisation
{
[TestFixture]
public class Cult... |
Handle Mongo ObjectId references better | // Copyright (c) 2015 SIL International
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
namespace LfMerge.LanguageForge.Model
{
public class LfAuthorInfo : LfFieldBase
{
public string CreatedByUserRef { get; set; }
public DateTime CreatedDate { get; set; }
... | // Copyright (c) 2015 SIL International
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using MongoDB.Bson;
namespace LfMerge.LanguageForge.Model
{
public class LfAuthorInfo : LfFieldBase
{
public ObjectId? CreatedByUserRef { get; set; }
public DateTime Crea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.