Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Fix showing username when logged in. | @{
var DiscordUser = UserHelper.GetDiscordUser(User);
}
@if(DiscordUser == null) {
<a class="nav-link text-dark" asp-area="" asp-controller="Login" asp-action="Index">Login</a>
} else {
@DiscordUser
}
| @{
var DiscordUser = UserHelper.GetDiscordUser(User);
}
@if(DiscordUser == null) {
<a class="nav-link text-dark" asp-area="" asp-controller="Login" asp-action="Index">Login</a>
} else {
@DiscordUser.User
}
|
Fix hash code to use a tuple. | using System;
namespace StructuredLogViewer
{
public struct ProjectImport : IEquatable<ProjectImport>
{
public ProjectImport(string importedProject, int line, int column)
{
ProjectPath = importedProject;
Line = line;
Column = column;
}
... | using System;
namespace StructuredLogViewer
{
public struct ProjectImport : IEquatable<ProjectImport>
{
public ProjectImport(string importedProject, int line, int column)
{
ProjectPath = importedProject;
Line = line;
Column = column;
}
... |
Improve test name and assertion | using slang.Compiler.Clr.Compilation.Core.Builders;
using slang.Compiler.Clr.Compilation.CSharp;
using Xunit;
namespace Clr.Tests.Compilation.CSharp
{
public class CSharpAssemblyGeneratorTests
{
[Fact]
public void Given_a_defined_module_When_compiled_Then_a_CLR_class_is_created()
{
... | using System.Reflection;
using FluentAssertions;
using slang.Compiler.Clr.Compilation.Core.Builders;
using slang.Compiler.Clr.Compilation.CSharp;
using Xunit;
namespace Clr.Tests.Compilation.CSharp
{
public class CSharpAssemblyGeneratorTests
{
[Fact]
public void Given_a_defined_module_When_com... |
Fix incorrect end date usage in timeshift ready button | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Graphics;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Comp... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Graphics;
using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Comp... |
Fix lifestyles of job to dispose after each execution | using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
namespace FineBot.Workers.DI
{
public class WorkerInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.... | using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
namespace FineBot.Workers.DI
{
public class WorkerInstaller : IWindsorInstaller
{
public void Install(IWindsorContainer container, IConfigurationStore store)
{
container.... |
Use BigInteger.Zero instead of implicit conversion | // Copyright (c) Martin Costello, 2015. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
namespace MartinCostello.ProjectEuler.Puzzles
{
using System;
using System.Globalization;
using System.Linq;
using System.Numeri... | // Copyright (c) Martin Costello, 2015. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
namespace MartinCostello.ProjectEuler.Puzzles
{
using System;
using System.Globalization;
using System.Linq;
using System.Numeri... |
Change icon for audio settings | // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Settings.Sections.Audio;
namespace osu.Game.Overlays.Settings.Sections
{
pu... | // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Settings.Sections.Audio;
namespace osu.Game.Overlays.Settings.Sections
{
pu... |
Fix mismatched use of MEF 1 and 2 | // 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.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.Editor.Wpf;
using Microsoft.VisualStudio.Imaging;
using Microsoft.... | // 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.Collections.Immutable;
using Microsoft.CodeAnalysis.Editor.Wpf;
using Microsoft.VisualStudio.Imaging;
using Microsoft.VisualStudio.Imaging.Inter... |
Add closing message to sample console runner | using NSpec;
using NSpec.Domain;
using NSpec.Domain.Formatters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace AdHocConsoleRunner
{
class Program
{
static void Main(string[] args)
{
var assemblies = new Assembly[]
... | using NSpec;
using NSpec.Domain;
using NSpec.Domain.Formatters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace AdHocConsoleRunner
{
class Program
{
static void Main(string[] args)
{
var assemblies = new Assembly[]
... |
Add wrapper for environment variables. | // Copyright Matthias Koch 2017.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Linq;
#if NETCORE
using System.IO;
#endif
namespace Nuke.Core
{
public static partial class EnvironmentInfo
{
public static string NewLine => En... | // Copyright Matthias Koch 2017.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
#if NETCORE
using System.IO;
#endif
namespace Nuke.Core
{
public static partial class Envi... |
Add ConsoleWhriteLine on Area and Perimeter Methods | using System;
using Shapes.Class;
namespace Shapes
{
using Interfaces;
class Program
{
static void Main()
{
IShape circle = new Circle(4);
Console.WriteLine(circle.CalculateArea());
circle.CalculatePerimeter();
IShape triangle = new Triangle(... | using System;
using Shapes.Class;
namespace Shapes
{
using Interfaces;
class Program
{
static void Main()
{
IShape circle = new Circle(4);
Console.WriteLine("circle area: " + circle.CalculateArea());
Console.WriteLine("circle perimeter: " + circle.Calcul... |
Tweak so it'll send for any non-ignored units | using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using FluentEmail.Core;
using FluentEmail.Core.Models;
using FluentScheduler;
using System.Collections.Generic;
using System.IO;
namespace BatteryCommander.Web.Jobs
{
public class PERSTATReportJob : IJob
{
private static IList<Add... | using BatteryCommander.Web.Models;
using BatteryCommander.Web.Services;
using FluentEmail.Core;
using FluentEmail.Core.Models;
using FluentScheduler;
using System.Collections.Generic;
using System.IO;
namespace BatteryCommander.Web.Jobs
{
public class PERSTATReportJob : IJob
{
private static IList<Add... |
Make as an obsolete class. | #region License
//
// Copyright (c) 2013, Kooboo team
//
// Licensed under the BSD License
// See the file LICENSE.txt for details.
//
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
namespace Kooboo
{
/// <summary>
///
/// </summary>
public static class ApplicationIn... | #region License
//
// Copyright (c) 2013, Kooboo team
//
// Licensed under the BSD License
// See the file LICENSE.txt for details.
//
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
namespace Kooboo
{
/// <summary>
///
/// </summary>
[Obsolete]
public static clas... |
Make the text areas bigger on suta edit | @model BatteryCommander.Web.Commands.UpdateSUTARequest
@using (Html.BeginForm("Edit", "SUTA", new { Model.Id }, FormMethod.Post, true, new { @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary()
<div class="form-group form-group-lg">
@Html.Disp... | @model BatteryCommander.Web.Commands.UpdateSUTARequest
@using (Html.BeginForm("Edit", "SUTA", new { Model.Id }, FormMethod.Post, true, new { @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary()
<div class="form-group form-group-lg">
@Html.Disp... |
Fix a different error on unit create | using System;
using System.ComponentModel.DataAnnotations;
using static BatteryCommander.Web.Models.Soldier;
namespace BatteryCommander.Web.Models.Reports
{
public class Stat
{
public int Assigned { get; set; }
public int Passed { get; set; }
public int Failed { get; set; }
... | using System;
using System.ComponentModel.DataAnnotations;
using static BatteryCommander.Web.Models.Soldier;
namespace BatteryCommander.Web.Models.Reports
{
public class Stat
{
public int Assigned { get; set; }
public int Passed { get; set; }
public int Failed { get; set; }
... |
Fix the server list update | using UnityEngine;
public class OnActivateRefresh : MonoBehaviour
{
private ServerUI _serverUi;
private void Start()
{
_serverUi = FindObjectOfType<ServerUI>();
}
private void OnEnable()
{
_serverUi.GetServerList();
}
} | using UnityEngine;
public class OnActivateRefresh : MonoBehaviour
{
private ServerUI _serverUi;
private void Start()
{
_serverUi = FindObjectOfType<ServerUI>();
_serverUi.GetServerList();
}
private void OnEnable()
{
if(_serverUi)_serverUi.GetServerList();
}
} |
Add context menu to select the script of a scriptable object | using UnityEditor;
namespace BitStrap
{
public class ScriptableObjectContextMenu
{
[MenuItem("CONTEXT/ScriptableObject/Select in Project View")]
public static void SelectScriptabelObject(MenuCommand menuCommand)
{
EditorGUIUtility.PingObject(menuCommand.context);
}
}
} | using UnityEditor;
using UnityEngine;
namespace BitStrap
{
public class ScriptableObjectContextMenu
{
[MenuItem("CONTEXT/ScriptableObject/Select Script", false, 10)]
public static void SelectScriptabelObjectScript(MenuCommand menuCommand)
{
var serializedObject = new SerializedObject(menuCommand.context);
... |
Add None enum member to flags | using System;
using JsonApiDotNetCore.Resources;
namespace JsonApiDotNetCoreTests.IntegrationTests
{
/// <summary>
/// Lists the various extensibility points on <see cref="IResourceDefinition{TResource,TId}" />.
/// </summary>
[Flags]
public enum ResourceDefinitionExtensibilityPoints
{
... | using System;
using JsonApiDotNetCore.Resources;
namespace JsonApiDotNetCoreTests.IntegrationTests
{
/// <summary>
/// Lists the various extensibility points on <see cref="IResourceDefinition{TResource,TId}" />.
/// </summary>
[Flags]
public enum ResourceDefinitionExtensibilityPoints
{
... |
Allow 'data-folder' and 'data-directory' config options | /*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* 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 ... | /*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* 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 ... |
Make querying successors and predeccors fail explicitly | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
namespace Bearded.Utilities.Graphs
{
class AdjacencyListDirectedGraph<T> : IDirectedGraph<T> where T : IEquatable<T>
{
private readonly ImmutableList<T> elements;
private readonly ImmutableDictionary<T, Immutab... | using System;
using System.Collections.Generic;
using System.Collections.Immutable;
namespace Bearded.Utilities.Graphs
{
class AdjacencyListDirectedGraph<T> : IDirectedGraph<T> where T : IEquatable<T>
{
private readonly ImmutableList<T> elements;
private readonly ImmutableDictionary<T, Immutab... |
Fix type name in exception message for HasUniqueDomainSignature | namespace SharpArch.NHibernate.NHibernateValidator
{
using System.ComponentModel.DataAnnotations;
using SharpArch.Domain;
using SharpArch.Domain.DomainModel;
using SharpArch.Domain.PersistenceSupport;
/// <summary>
/// Provides a class level validator for determining if the entity has a u... | namespace SharpArch.NHibernate.NHibernateValidator
{
using System.ComponentModel.DataAnnotations;
using SharpArch.Domain;
using SharpArch.Domain.DomainModel;
using SharpArch.Domain.PersistenceSupport;
/// <summary>
/// Provides a class level validator for determining if the entity has a u... |
Increase the precision of speed multiplier to match osu-stable | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Game.Graphics;
using osuTK.Graphics;
namespace osu.Game.Beatmaps.ControlPoints
{
public class DifficultyControlPoint : Contr... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Game.Graphics;
using osuTK.Graphics;
namespace osu.Game.Beatmaps.ControlPoints
{
public class DifficultyControlPoint : Contr... |
Add the accumulator addressing mode. | namespace Mos6510.Instructions
{
public enum AddressingMode
{
Implied,
Immediate,
Absolute,
AbsoluteX,
AbsoluteY,
Zeropage,
ZeropageX,
ZeropageY,
IndirectX,
IndirectY
}
}
| namespace Mos6510.Instructions
{
public enum AddressingMode
{
Absolute,
AbsoluteX,
AbsoluteY,
Accumulator,
Immediate,
Implied,
IndirectX,
IndirectY,
Zeropage,
ZeropageX,
ZeropageY,
}
}
|
Fix failing when passing null | using System.Collections.Generic;
namespace RetailStore
{
public class RetailStore
{
private readonly Screen m_Screen;
private readonly Dictionary<string, string> m_Products;
public RetailStore(Screen screen, Dictionary<string, string> products)
{
m_Screen = screen... | using System.Collections.Generic;
namespace RetailStore
{
public class RetailStore
{
private readonly Screen m_Screen;
private readonly Dictionary<string, string> m_Products;
public RetailStore(Screen screen, Dictionary<string, string> products)
{
m_Screen = screen... |
Move back to list link | @model alert_roster.web.Models.Message
@{
ViewBag.Title = "Create New Message";
}
<h2>@ViewBag.Title</h2>
@using (Html.BeginForm("New", "Home", FormMethod.Post))
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>Message</h4>
<hr />
@Html.ValidationSummary(true)
... | @model alert_roster.web.Models.Message
@{
ViewBag.Title = "Create New Message";
}
<h2>@ViewBag.Title</h2>
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@using (Html.BeginForm("New", "Home", FormMethod.Post))
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>Message</h4... |
Change OrderDetails table name from 'OrderDetails' to 'Order Details' in the mapping. | using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
namespace Northwind.Model.Mapping
{
public class OrderDetailMap : EntityTypeConfiguration<OrderDetail>
{
public OrderDetailMap()
{
// Primary Key
HasKey(t => new { t.OrderId,... | using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
namespace Northwind.Model.Mapping
{
public class OrderDetailMap : EntityTypeConfiguration<OrderDetail>
{
public OrderDetailMap()
{
// Primary Key
HasKey(t => new { t.OrderId,... |
Remove this test as the API is broken | using Machine.Specifications;
namespace Stripe.Tests
{
[Behaviors]
public class account_behaviors
{
protected static StripeAccountSharedOptions CreateOrUpdateOptions;
protected static StripeAccount StripeAccount;
//It should_have_the_correct_email_address = () =>
// Str... | using Machine.Specifications;
namespace Stripe.Tests
{
[Behaviors]
public class account_behaviors
{
protected static StripeAccountSharedOptions CreateOrUpdateOptions;
protected static StripeAccount StripeAccount;
//It should_have_the_correct_email_address = () =>
// Str... |
Revert "Revert "Force fix for new databases"" | using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Newtonsoft.Json;
using VotingApplication.Data.Context;
using VotingApplicati... | using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Newtonsoft.Json;
using VotingApplication.Data.Context;
using VotingApplicati... |
Fix NPE where saveData was accessed before being initialized | namespace RedBlueGames.ToolsExamples
{
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class PrimitiveCreatorSaveData : ScriptableObject
{
public List<PrimitiveCreator.Config> ConfigPresets;
public bool HasConfigForIndex(int index)
{
... | namespace RedBlueGames.ToolsExamples
{
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class PrimitiveCreatorSaveData : ScriptableObject
{
public List<PrimitiveCreator.Config> ConfigPresets;
private void OnEnable()
{
if (th... |
Allow Eye Dropper to be used as macro parameter editor | using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Serialization;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;
namespace Umbraco.Cms.Core.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.ColorPickerEyeDropper,
"Eye Dropper Colo... | using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Serialization;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;
namespace Umbraco.Cms.Core.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.ColorPickerEyeDropper,
EditorType.Proper... |
Fix test datacard path case | using System;
using System.IO;
using System.IO.Compression;
using System.Reflection;
namespace TestUtilities
{
public static class DatacardUtility
{
public static string WriteDatacard(string name)
{
var directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
... | using System;
using System.IO;
using System.IO.Compression;
using System.Reflection;
namespace TestUtilities
{
public static class DatacardUtility
{
public static string WriteDatacard(string name)
{
var directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
... |
Use correct claims in case UserPrincipal has more than one identity | using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Security.Claims;
using System.Security.Principal;
using System.Web;
namespace Bonobo.Git.Server
{
public static class UserExtensions
{
public static string GetClaim(this IPrincipal user, string claim... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Security.Claims;
using System.Security.Principal;
using System.Web;
namespace Bonobo.Git.Server
{
public static class UserExtensions
{
public static string GetClaim(this IPrincipal user, string claim... |
Optimize element and text rendering for modern Windows versions | namespace Inspiring.Mvvm.Views {
using System.Windows;
using System.Windows.Media;
using Inspiring.Mvvm.Common;
using Inspiring.Mvvm.Screens;
public class WindowService : IWindowService {
public static readonly Event<InitializeWindowEventArgs> InitializeWindowEvent = new Event<InitializeWi... | namespace Inspiring.Mvvm.Views {
using System.Windows;
using System.Windows.Media;
using Inspiring.Mvvm.Common;
using Inspiring.Mvvm.Screens;
public class WindowService : IWindowService {
public static readonly Event<InitializeWindowEventArgs> InitializeWindowEvent = new Event<InitializeWi... |
Replace any API endpoint [::] for localhost when configuring HttpClient base address | using System;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.Extensions.Hosting;
namespace Duracellko.PlanningPoker.Web
{
public class HttpClientSetupServ... | using System;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.Extensions.Hosting;
namespace Duracellko.PlanningPoker.Web
{
public class HttpClientSetupServ... |
Add Uri Path Extension - constraints: new { ext = @"|json|xml|csv" } | using System;
using System.Web.Http;
using DataBooster.DbWebApi;
namespace MyDbWebApi
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DbWebApi",
routeTemplate: "{sp}",
defaults: new { controller = "DbWebA... | using System;
using System.Web.Http;
using DataBooster.DbWebApi;
namespace MyDbWebApi
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DbWebApi",
routeTemplate: "{sp}/{ext}",
defaults: new { controller = "... |
Remove OpCode and Task from mapping | using System.Collections.Generic;
using System.Linq;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using MongoDB.Bson;
namespace TIMEmSYSTEM.SemanticLogging.Mongo
{
internal static class EventEntryExtensions
{
internal static BsonDocument AsBsonDocument(this EventEntry eventEntry)
... | using System.Collections.Generic;
using System.Linq;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using MongoDB.Bson;
namespace TIMEmSYSTEM.SemanticLogging.Mongo
{
internal static class EventEntryExtensions
{
internal static BsonDocument AsBsonDocument(this EventEntry eventEntry)
... |
Add new option to redirect to output from command line | using CommandLine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IdunnSql.Console
{
[Verb("execute", HelpText = "Execute the permission checks defined in a file")]
public class ExecuteOptions
{
[Option('s', "source", R... | using CommandLine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IdunnSql.Console
{
[Verb("execute", HelpText = "Execute the permission checks defined in a file")]
public class ExecuteOptions
{
[Option('s', "source", R... |
Deploy as well as trim | using System;
using System.IO;
using NuGet;
namespace NugetPackageTrimmer
{
class Program
{
static void Main(string[] args)
{
var repoUrl = args.Length > 2 ? args[1] : "https://packages.nuget.org/api/v2";
Console.WriteLine($"Checking if packages in [{args[0]}] exist in {repoUrl} and deleting any that don... | using System;
using System.Globalization;
using System.IO;
using NuGet;
namespace NugetPackageTrimmer
{
class Program
{
static void Main(string[] args)
{
var repoUrl = args.Length > 3 ? args[2] : "https://packages.nuget.org/api/v2";
Console.WriteLine($"Checking if packages in [{args[0]}] exist in {repoUr... |
Use deprecated method for older Unity support | using Oxide.Core;
using UnityEngine;
namespace Oxide.Unity
{
/// <summary>
/// The main MonoBehaviour which calls OxideMod.OnFrame
/// </summary>
public class UnityScript : MonoBehaviour
{
public static GameObject Instance { get; private set; }
public static void Create()
... | using Oxide.Core;
using UnityEngine;
namespace Oxide.Unity
{
/// <summary>
/// The main MonoBehaviour which calls OxideMod.OnFrame
/// </summary>
public class UnityScript : MonoBehaviour
{
public static GameObject Instance { get; private set; }
public static void Create()
... |
Tweak raw sql data update | using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace BatteryCommander.Web.Migrations
{
public partial class CanLogin : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
... | using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace BatteryCommander.Web.Migrations
{
public partial class CanLogin : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
... |
Set assembly version to 5.0.0.0 | using System.Reflection;
[assembly: AssemblyVersion("3.1.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
//// [assembly: AssemblyInformationalVersion("3.1.0.0 Release")] | using System.Reflection;
[assembly: AssemblyVersion("5.0.0.0")]
[assembly: AssemblyFileVersion("5.0.0.0")]
//// [assembly: AssemblyInformationalVersion("3.1.0.0 Release")] |
Add way to get HTTP error code | using System;
namespace IvionWebSoft
{
public abstract class WebResource
{
public Uri Location { get; private set; }
public bool Success { get; private set; }
public Exception Exception { get; private set; }
public WebResource(Uri uri)
{
if (uri == null)
... | using System;
using System.Net;
namespace IvionWebSoft
{
public abstract class WebResource
{
public Uri Location { get; private set; }
public bool Success { get; private set; }
public Exception Exception { get; private set; }
public WebResource(Uri uri)
{
... |
Use linq to simplify enumeration | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web;
namespace SettingsAPISample.Models
{
public class ARMListEntry<T> where T : INamedObject
{
public static ARMListEntry<T> Create(IEnumerable<T> objects, HttpRequestMessage request)
{
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Web;
namespace SettingsAPISample.Models
{
public class ARMListEntry<T> where T : INamedObject
{
public static ARMListEntry<T> Create(IEnumerable<T> objects, HttpRequestMessage request)
{
... |
Align with Nuget Package Version 1.0.7 | 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("El... | 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("El... |
Use regular test steps rather than one-time set up and scheduling | // 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.Utils;
using osu.Game.Beatmaps;
using osu.Game.Screens.R... | // 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.Utils;
using osu.Game.Beatmaps;
using osu.Game.Screens.R... |
Correct names for http verbs | //-----------------------------------------------------------------------
// <copyright file="HttpVerb.cs" company="Bremus Solutions">
// Copyright (c) Bremus Solutions. All rights reserved.
// </copyright>
// <author>Timm Bremus</author>
// <license>
// Licensed to the Apache Software Foundation(ASF) under o... | //-----------------------------------------------------------------------
// <copyright file="HttpVerb.cs" company="Bremus Solutions">
// Copyright (c) Bremus Solutions. All rights reserved.
// </copyright>
// <author>Timm Bremus</author>
// <license>
// Licensed to the Apache Software Foundation(ASF) under o... |
Mark the "Auto" variable scope as not expensive | //
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
public class Scope
{
/// <summary>
/// Gets or sets the name of the ... | //
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
public class Scope
{
/// <summary>
/// Gets or sets the name of the ... |
Add property to identity a Channel Notice | using System.Collections.Generic;
namespace NetIRC.Messages
{
public class NoticeMessage : IRCMessage, IServerMessage, IClientMessage
{
public string From { get; }
public string Target { get; }
public string Message { get; }
public NoticeMessage(ParsedIRCMessage parsedMessage)... | using System.Collections.Generic;
namespace NetIRC.Messages
{
public class NoticeMessage : IRCMessage, IServerMessage, IClientMessage
{
public string From { get; }
public string Target { get; }
public string Message { get; }
public NoticeMessage(ParsedIRCMessage parsedMessage)... |
Add animation path curves to the debug component | using UnityEngine;
using System.Collections;
using ATP.AnimationPathTools;
[ExecuteInEditMode]
public class AnimationPathCurvesDebug : MonoBehaviour {
private AnimationPathAnimator animator;
[Header("Rotation curves")]
public AnimationCurve curveX;
public AnimationCurve curveY;
public AnimationCu... | using UnityEngine;
using System.Collections;
using ATP.AnimationPathTools;
[ExecuteInEditMode]
public class AnimationPathCurvesDebug : MonoBehaviour {
private AnimationPathAnimator animator;
private AnimationPath animationPath;
[Header("Animation Path")]
public AnimationCurve pathCurveX;
public ... |
Make the monitor tool build again | // Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System.Reflection;
using System.Runtime.CompilerServices;
//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC ... | // Copyright 2006 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System.Reflection;
using System.Runtime.CompilerServices;
//[assembly: AssemblyVersion("0.0.0.*")]
[assembly: AssemblyTitle ("NDesk.DBus")]
[assembly: AssemblyDescription ("D-Bus IPC ... |
Move Settings tab just after OfflinePayment settings | using Orchard.Localization;
using Orchard.UI.Navigation;
using OShop.Permissions;
namespace OShop.PayPal.Navigation {
public class AdminMenu : INavigationProvider {
public Localizer T { get; set; }
public AdminMenu() {
T = NullLocalizer.Instance;
}
public string MenuN... | using Orchard.Localization;
using Orchard.UI.Navigation;
using OShop.Permissions;
namespace OShop.PayPal.Navigation {
public class AdminMenu : INavigationProvider {
public Localizer T { get; set; }
public AdminMenu() {
T = NullLocalizer.Instance;
}
public string MenuN... |
Check if image is supported before uploading in the validation tag | using ImageSharp;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
namespace CollAction.ValidationAttributes
{
public class MaxImageDimensionsAttribute : ValidationAttribute
{
private reado... | using ImageSharp;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
namespace CollAction.ValidationAttributes
{
public class MaxImageDimensionsAttribute : ValidationAttribute
{
private reado... |
Implement random walk for 3D | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace RandomWalkConsole
{
class Program
{
static void Main(string[] args)
{
var unfinished = Enumerable.Range(0, 1000)
.Select(_ => Walk2())
... | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using static System.Console;
using static System.Math;
namespace RandomWalkConsole
{
class Program
{
const int Trials = 1 * 1000;
const int MaxSteps = 100 * 1000 * 1000;
const int ... |
Fix incorrect hit object type. | // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
namespace osu.Game.Modes.Objects.Types
{
[Flags]
public enum HitObjectType
{
Circle = 1 << 0,
Slider = 1 << 1,
... | // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
namespace osu.Game.Modes.Objects.Types
{
[Flags]
public enum HitObjectType
{
Circle = 1 << 0,
Slider = 1 << 1,
... |
Add a test to confirm down migrations are run in reverse order of up migrations | using NUnit.Framework;
using FluentMigrator.Infrastructure;
namespace FluentMigrator.Tests.Unit
{
using System.Collections.ObjectModel;
using System.Linq;
using FluentMigrator.Expressions;
using Moq;
[TestFixture]
public class AutoReversingMigrationTests
{
private Mock<IMigrationCo... | using NUnit.Framework;
using FluentMigrator.Infrastructure;
namespace FluentMigrator.Tests.Unit
{
using System.Collections.ObjectModel;
using System.Linq;
using FluentMigrator.Expressions;
using Moq;
[TestFixture]
public class AutoReversingMigrationTests
{
private Mock<IMigrationCo... |
Change Pad-Palettes behavior to be more like the old version. | using LibPixelPet;
using System;
namespace PixelPet.CLI.Commands {
internal class PadPalettesCmd : CliCommand {
public PadPalettesCmd()
: base("Pad-Palettes",
new Parameter(true, new ParameterValue("width", "0"))
) { }
public override void Run(Workbench workbench, ILogger logger) {
int width = Find... | using LibPixelPet;
using System;
namespace PixelPet.CLI.Commands {
internal class PadPalettesCmd : CliCommand {
public PadPalettesCmd()
: base("Pad-Palettes",
new Parameter(true, new ParameterValue("width", "0"))
) { }
public override void Run(Workbench workbench, ILogger logger) {
int width = Find... |
Add LocationViewTypes repo to unit of work | /////////////////////////////////////////////////////////////////
// Created by : Caesar Moussalli //
// TimeStamp : 31-1-2016 //
// Content : Associate Repositories to the Unit of Work //
// Notes : Send DB context to repositories to redu... | /////////////////////////////////////////////////////////////////
// Created by : Caesar Moussalli //
// TimeStamp : 31-1-2016 //
// Content : Associate Repositories to the Unit of Work //
// Notes : Send DB context to repositories to redu... |
Make sure daemon password console works on Windows 7 | using System;
using System.Collections.Generic;
using System.Text;
namespace WalletWasabi.Helpers
{
public static class PasswordConsole
{
/// <summary>
/// Gets the console password.
/// </summary>
public static string ReadPassword()
{
var sb = new StringBuilder();
while (true)
{
ConsoleKeyInf... | using System;
using System.Collections.Generic;
using System.Text;
namespace WalletWasabi.Helpers
{
public static class PasswordConsole
{
/// <summary>
/// Gets the console password.
/// </summary>
public static string ReadPassword()
{
try
{
var sb = new StringBuilder();
while (true)
{
... |
Remove never-run code in WriteHost. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using Extensions.String;
namespace Microsoft.PowerShell.Commands.Utility
{
[Cmdlet("Write", "Host")]
public sealed class WriteHostCommand : ConsoleColorCmdlet
{
[Parameter(Posi... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
using Extensions.String;
using System.Collections;
namespace Microsoft.PowerShell.Commands.Utility
{
[Cmdlet("Write", "Host")]
public sealed class WriteHostCommand : ConsoleColorCmdlet
... |
Add filter property to most collected movies request. | namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common
{
using Base.Get;
using Enums;
using Objects.Basic;
using Objects.Get.Movies.Common;
using System.Collections.Generic;
internal class TraktMoviesMostCollectedRequest : TraktGetRequest<TraktPaginationListResult<TraktMostCollectedMovie>... | namespace TraktApiSharp.Requests.WithoutOAuth.Movies.Common
{
using Base;
using Base.Get;
using Enums;
using Objects.Basic;
using Objects.Get.Movies.Common;
using System.Collections.Generic;
internal class TraktMoviesMostCollectedRequest : TraktGetRequest<TraktPaginationListResult<TraktMos... |
Update wear command to work with the new appearance maanger. | using System;
using OpenMetaverse;
namespace OpenMetaverse.TestClient
{
public class WearCommand : Command
{
public WearCommand(TestClient testClient)
{
Client = testClient;
Name = "wear";
Description = "Wear an outfit folder from inventory. Usage: wear [outf... | using System;
using System.Collections.Generic;
using OpenMetaverse;
namespace OpenMetaverse.TestClient
{
public class WearCommand : Command
{
public WearCommand(TestClient testClient)
{
Client = testClient;
Name = "wear";
Description = "Wear an outfit folder... |
Add correct guid/date generation for messages | using System;
namespace Glimpse
{
public class BaseMessage : IMessage
{
public BaseMessage()
{
Id = new Guid();
Time = new DateTime();
}
public Guid Id { get; }
public DateTime Time { get; }
}
} | using System;
namespace Glimpse
{
public class BaseMessage : IMessage
{
public BaseMessage()
{
Id = Guid.NewGuid();
Time = DateTime.Now;
}
public Guid Id { get; }
public DateTime Time { get; }
}
} |
Remove unused code & add comment | using System;
using System.Net.Http;
namespace Glimpse.Agent
{
public class RemoteHttpMessagePublisher : IMessagePublisher, IDisposable
{
private readonly HttpClient _httpClient;
private readonly HttpClientHandler _httpHandler;
public RemoteHttpMessagePublisher()
{
... | using System;
using System.Net.Http;
namespace Glimpse.Agent
{
public class RemoteHttpMessagePublisher : IMessagePublisher, IDisposable
{
private readonly HttpClient _httpClient;
private readonly HttpClientHandler _httpHandler;
public RemoteHttpMessagePublisher()
{
... |
Set Geolocator to accuracy of 500m, 5min age and 10 second timeout | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Windows.Devices.Geolocation;
using AirQualityInfo.DataClient.Models;
using AirQualityInfo.DataClient.Services;
namespace AirQualityInfo.WP.Services
{
// http://msdn.micro... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Windows.Devices.Geolocation;
using AirQualityInfo.DataClient.Models;
using AirQualityInfo.DataClient.Services;
namespace AirQualityInfo.WP.Services
{
// http://msdn.micro... |
Fix crash with legacy import from incomplete installs | // 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 osu.Framework.IO.Stores;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Ga... | // 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 osu.Framework.IO.Stores;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Ga... |
Remove "Default" from Destination VNet for migration | //
// Copyright (c) Microsoft and contributors. 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 requi... | //
// Copyright (c) Microsoft and contributors. 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 requi... |
Use AssemblyName to portably obtain version number | using System.Reflection;
namespace EvilDICOM.Core.Helpers
{
public static class Constants
{
public static string EVIL_DICOM_IMP_UID = "1.2.598.0.1.2851334.2.1865.1";
public static string EVIL_DICOM_IMP_VERSION = Assembly.GetCallingAssembly().GetName().Version.ToString();
//APPLICATION ... | using System.Reflection;
namespace EvilDICOM.Core.Helpers
{
public static class Constants
{
public static string EVIL_DICOM_IMP_UID = "1.2.598.0.1.2851334.2.1865.1";
public static string EVIL_DICOM_IMP_VERSION = new AssemblyName(Assembly.GetCallingAssembly().FullName).Version.ToString();
... |
Remove 0.75 scale from osu! playfield in the editor | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Cursor;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Osu.Edit
... | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Cursor;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using OpenTK;
namespace osu.Game.Rule... |
Implement a simple executor that just reads the file directly | using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace DanTup.TestAdapters.Xml
{
public class XmlExternalTestExecutor : ExternalTestExecutor
{
static readonly string extensionFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
public override string ExtensionFolder {... | using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace DanTup.TestAdapters.Xml
{
public class XmlExternalTestExecutor : ExternalTestExecutor
{
static readonly string extensionFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
public override st... |
Add typing state to inspiro command | using Discord;
using Discord.Commands;
using NadekoBot.Extensions;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
namespace NadekoBot.Modules.Searches
{
public partial class Searches
{
[Group]
public class ... | using Discord;
using Discord.Commands;
using NadekoBot.Extensions;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
using NadekoBot.Common;
using NadekoBot.Common.Attributes;
namespace NadekoBot.Modules.Searches
{
public partial class Searches
{
[Group]
public class ... |
Remove extraneous info in assembly info | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 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.
[asse... | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("Eto.Platform.Wpf")]
[assembly: AssemblyDescription("")]
[assembly: ThemeInfo (
ResourceDictionaryLocation.SourceAssembly,
ResourceDictionaryLocation.SourceAssembl... |
Hide the Manage Content admin menu item | using System.Linq;
using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData;
using Orchard.Localization;
using Orchard.UI.Navigation;
namespace Orchard.Core.Contents {
public class AdminMenu : INavigationProvider {
private readonly IContentDefinitionManager _contentDefinitionManag... | using System.Linq;
using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData;
using Orchard.Localization;
using Orchard.UI.Navigation;
namespace Orchard.Core.Contents {
public class AdminMenu : INavigationProvider {
private readonly IContentDefinitionManager _contentDefinitionManag... |
Remove old red 1 reference | using BatteryCommander.Web.Models;
using BatteryCommander.Web.Models.Reports;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
namespace BatteryCommander.Web.Controllers
{
[Authorize, ApiExplorerSettings(IgnoreApi = true)]... | using BatteryCommander.Web.Models;
using BatteryCommander.Web.Models.Reports;
using BatteryCommander.Web.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
namespace BatteryCommander.Web.Controllers
{
[Authorize, ApiExplorerSettings(IgnoreApi = true)]... |
Copy file to temp folder as long as document is not saved | using MyDocs.Common.Contract.Service;
using MyDocs.Common.Model.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.Storage;
using Windows.Storage.Pickers;
namespace MyDocs.WindowsStore.Service
{
public class FileOpenPickerService : IFile... | using MyDocs.Common.Contract.Service;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Windows.Storage;
using Windows.Storage.Pickers;
namespace MyDocs.WindowsStore.Service
{
public class FileOpenPickerService : IFileOpenPickerServi... |
Edit comment. Token is not required. | using System;
using System.Linq;
namespace Elasticsearch.Net.Aws
{
/// <summary>
/// Encapsulates
/// </summary>
public class AwsSettings
{
/// <summary>
/// Gets or sets the region. e.g. us-east-1. Required.
/// </summary>
public string Region { get; set; }
... | using System;
using System.Linq;
namespace Elasticsearch.Net.Aws
{
/// <summary>
/// Encapsulates
/// </summary>
public class AwsSettings
{
/// <summary>
/// Gets or sets the region. e.g. us-east-1. Required.
/// </summary>
public string Region { get; set; }
... |
Raise Ping timeout for tests slightly | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace System.Net.Utilities.Tests
{
internal static class TestSettings
{
... | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace System.Net.Utilities.Tests
{
internal static class TestSettings
{
... |
Add comment and make constructor protected internal | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Input.Handlers;
using osu.Framework.Input.StateChanges.Events;
using osu.Framework.Platform;
using osuTK;
namespac... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Input.Handlers;
using osu.Framework.Input.StateChanges.Events;
using osu.Framework.Platform;
using osuTK;
namespac... |
Add missing file offset registration. | using System;
namespace AsmResolver.PE.Debug
{
/// <summary>
/// Provides an implementation of a debug data entry that was stored in a PE file.
/// </summary>
public class SerializedDebugDataEntry : DebugDataEntry
{
private readonly IDebugDataReader _dataReader;
private readonly Deb... | using System;
namespace AsmResolver.PE.Debug
{
/// <summary>
/// Provides an implementation of a debug data entry that was stored in a PE file.
/// </summary>
public class SerializedDebugDataEntry : DebugDataEntry
{
private readonly IDebugDataReader _dataReader;
private readonly Deb... |
Use default build & revision numbers | 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("Sq... | 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("Sq... |
Add the product name and the assembly title custom attributes | using System;
using System.Reflection;
// TODO: Automate this
[assembly: AssemblyInformationalVersion ("1.1.0")]
namespace Tomboy {
public class Defines {
public const string VERSION = "1.1.0";
public static readonly string DATADIR = System.IO.Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location);
... | using System;
using System.Reflection;
// TODO: Automate this
[assembly: AssemblyInformationalVersion ("1.1.0")]
[assembly: AssemblyProduct("Tomboy")]
[assembly: AssemblyTitle("Tomboy Notes")]
namespace Tomboy {
public class Defines {
public const string VERSION = "1.1.0";
public static readonly string DATADIR ... |
Align side-by-side comments in SampleSpecs.Bug test | using System.Collections.Generic;
using NSpec;
namespace SampleSpecs.Bug
{
class grandparents_run_first : nspec
{
List<int> ints = null;
void describe_NSpec() //describe RSpec do
{
before = () => ints = new List<int>(); ... | using System.Collections.Generic;
using NSpec;
namespace SampleSpecs.Bug
{
class grandparents_run_first : nspec
{
List<int> ints = null;
void describe_NSpec() //describe RSpec do
{
before = () => ints = new List<int>... |
Fix for a compile error in the QuickStart. | using System.Xml;
using FluentNHibernate;
using FluentNHibernate.Mapping;
namespace FluentNHibernate.QuickStart.Domain.Mapping
{
public class CatMap : ClassMap<Cat>, IMapGenerator
{
public CatMap()
{
//set up our generator as UUID.HEX
Id(x => x.Id)
... | using System.Xml;
using FluentNHibernate;
using FluentNHibernate.Mapping;
namespace FluentNHibernate.QuickStart.Domain.Mapping
{
public class CatMap : ClassMap<Cat>, IMapGenerator
{
public CatMap()
{
//set up our generator as UUID.HEX
Id(x => x.Id)
... |
Revert "Fix of previous commit" | using System.IO;
using System;
namespace Bari.Core.Generic
{
public class LocalFileSystemDirectoryWatcher: IFileSystemDirectoryWatcher
{
private readonly FileSystemWatcher watcher;
private readonly string path;
public event EventHandler<FileSystemChangedEventArgs> Changed;
... | using System.IO;
using System;
namespace Bari.Core.Generic
{
public class LocalFileSystemDirectoryWatcher: IFileSystemDirectoryWatcher
{
private readonly FileSystemWatcher watcher;
private readonly string path;
public event EventHandler<FileSystemChangedEventArgs> Changed;
... |
Add test for incrementing with negative number | using System.Linq;
using FluentAssertions;
using Xunit;
namespace Okanshi.Test
{
public class CounterTest
{
private readonly Counter counter;
public CounterTest()
{
counter = new Counter(MonitorConfig.Build("Test"));
}
[Fact]
public void Initial_pea... | using System.Linq;
using FluentAssertions;
using Xunit;
namespace Okanshi.Test
{
public class CounterTest
{
private readonly Counter counter;
public CounterTest()
{
counter = new Counter(MonitorConfig.Build("Test"));
}
[Fact]
public void Initial_pea... |
Add a namespace reference for System | using System.IO;
using System.Security.Cryptography;
using Mono.Security;
using Mono.Security.Cryptography;
namespace Xpdm.PurpleOnion
{
class Program
{
private static void Main()
{
long count = 0;
while (true)
{
RSA pki = RSA.Create();
ASN1 asn = RSAExtensions.ToAsn1Key(pki);
byte[] hash = ... | using System;
using System.IO;
using System.Security.Cryptography;
using Mono.Security;
using Mono.Security.Cryptography;
namespace Xpdm.PurpleOnion
{
class Program
{
private static void Main()
{
long count = 0;
while (true)
{
RSA pki = RSA.Create();
ASN1 asn = RSAExtensions.ToAsn1Key(pki);
... |
Revert "Remove ignore attribute from now fixed test scene" | // 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.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
usin... | // 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.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
usin... |
Fix NRE if null array. | using System.Data.SqlClient;
using System.Management.Automation;
namespace PSql
{
[Cmdlet(VerbsCommunications.Disconnect, "Sql")]
public class DisconnectSqlCommand : Cmdlet
{
// -Connection
[Alias("c", "cn")]
[Parameter(Position = 0, ValueFromPipeline = true, ValueFromRemainingArgu... | using System.Data.SqlClient;
using System.Management.Automation;
namespace PSql
{
[Cmdlet(VerbsCommunications.Disconnect, "Sql")]
public class DisconnectSqlCommand : Cmdlet
{
// -Connection
[Alias("c", "cn")]
[Parameter(Position = 0, ValueFromPipeline = true, ValueFromRemainingArgu... |
Add extension method for using version header middleware. | using System;
using Microsoft.AspNetCore.Hosting;
using TwentyTwenty.Mvc;
using TwentyTwenty.Mvc.ErrorHandling;
using TwentyTwenty.Mvc.HealthCheck;
using TwentyTwenty.Mvc.ReadOnlyMode;
namespace Microsoft.AspNetCore.Builder
{
public static class ErrorHandling
{
public static void UseErrorHandling(this ... | using System;
using Microsoft.AspNetCore.Hosting;
using TwentyTwenty.Mvc;
using TwentyTwenty.Mvc.ErrorHandling;
using TwentyTwenty.Mvc.HealthCheck;
using TwentyTwenty.Mvc.ReadOnlyMode;
using TwentyTwenty.Mvc.Version;
namespace Microsoft.AspNetCore.Builder
{
public static class ErrorHandling
{
public st... |
Change SMA assembly info for DNX xUnit runner | using System.Runtime.CompilerServices;
using System.Reflection;
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Management")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Utility")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Security")]
[assembly:InternalsVisibleTo("Microsoft.PowerSh... | using System.Runtime.CompilerServices;
using System.Reflection;
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Management")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Commands.Utility")]
[assembly:InternalsVisibleTo("Microsoft.PowerShell.Security")]
[assembly:InternalsVisibleTo("Microsoft.PowerSh... |
Fix time zone name on non windows platforms | using System;
namespace Stranne.VasttrafikNET.Extensions
{
internal static class DateTimeOffsetExtension
{
private const string TimeZoneName = "W. Europe Standard Time";
public static TimeSpan GetVasttrafikTimeOffset(this DateTimeOffset dateTimeOffset)
{
return T... | using System;
using System.Runtime.InteropServices;
namespace Stranne.VasttrafikNET.Extensions
{
internal static class DateTimeOffsetExtension
{
public static TimeSpan GetVasttrafikTimeOffset(this DateTimeOffset dateTimeOffset)
{
return TimeZoneInfo.FindSystemTimeZoneById(... |
Check if a phone call is possible on Andriod | using System;
using Android.Content;
using Android.Telephony;
using Uri = Android.Net.Uri;
namespace Plugin.Messaging
{
internal class PhoneCallTask : IPhoneCallTask
{
public PhoneCallTask()
{
}
#region IPhoneCallTask Members
public bool CanMakePhoneCall
{
... | using System;
using Android.Content;
using Android.Telephony;
using Uri = Android.Net.Uri;
namespace Plugin.Messaging
{
internal class PhoneCallTask : IPhoneCallTask
{
public PhoneCallTask()
{
}
#region IPhoneCallTask Members
public bool CanMakePhoneCall
{
... |
Fix bad key in Context.Items. | using CK.AspNet.Auth;
using CK.Auth;
using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.AspNetCore.Http
{
/// <summary>
/// Exposes <see cref="WebFrontAuthenticate"/> extension method on <see cref="HttpContext"/>.
/// </summary>
static public class CKAspNetAuthHttpCo... | using CK.AspNet.Auth;
using CK.Auth;
using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.AspNetCore.Http
{
/// <summary>
/// Exposes <see cref="WebFrontAuthenticate"/> extension method on <see cref="HttpContext"/>.
/// </summary>
static public class CKAspNetAuthHttpCo... |
Fix for entity not loading from db. | using System.ComponentModel.DataAnnotations;
namespace BoozeHoundCloud.Models.Core
{
public class Account
{
//-------------------------------------------------------------------------
public const int NameMaxLength = 64;
//-------------------------------------------------------------------------
... | using System.ComponentModel.DataAnnotations;
namespace BoozeHoundCloud.Models.Core
{
public class Account
{
//-------------------------------------------------------------------------
public const int NameMaxLength = 64;
//-------------------------------------------------------------------------
... |
Create a new claims principal everytime if jabbr authenticated. | using System;
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using JabbR.Infrastructure;
using JabbR.Services;
namespace JabbR.Middleware
{
using AppFunc = Func<IDictionary<string, object>, Task>;
public class AuthorizationHandler
{
private readonly ... | using System;
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using JabbR.Infrastructure;
using JabbR.Services;
namespace JabbR.Middleware
{
using AppFunc = Func<IDictionary<string, object>, Task>;
public class AuthorizationHandler
{
private readonly ... |
Remove forcefield from fist movement | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FistForceApply : MonoBehaviour {
public static float forceAmount = 10000000f;
public forceField forceField;
public GameObject movingParentObj;
public Vector3 oldPosition;
void Start(){
oldPosition = (movingParentObj.tr... | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FistForceApply : MonoBehaviour {
public static float forceAmount = 10000000f;
void OnCollisionEnter(Collision col)
{
if (col.gameObject.tag == "Fish") {
Debug.Log ("COLLIDED - "+col.gameObject.name);
col.rigidbody.... |
Adjust default entity rendering layer. | using BearLib;
using Roguelike.Entities;
using Roguelike.World;
using System.Collections.Generic;
namespace Roguelike.Render
{
public abstract class Renderer : IRenderer
{
public const int MapLayer = 0;
public const int EntityLayer = 5;
public abstract void RenderEntities(IEnumerable<... | using BearLib;
using Roguelike.Entities;
using Roguelike.World;
using System.Collections.Generic;
namespace Roguelike.Render
{
public abstract class Renderer : IRenderer
{
public const int MapLayer = 0;
public const int EntityLayer = 10;
public abstract void RenderEntities(IEnumerable... |
Return IServiceCollection from AddDirectoryBrowser extension methods | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.Extensions.DependencyInjection
{
/// <summary>
/// Extension methods for adding directory browser services.
... | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.Extensions.DependencyInjection
{
/// <summary>
/// Extension methods for adding directory browser services.
... |
Add Identity namespace to view imports | @using System.Globalization
@using Microsoft.Extensions.Configuration
@using MartinCostello.LondonTravel.Site
@using MartinCostello.LondonTravel.Site.Extensions
@using MartinCostello.LondonTravel.Site.Models
@using MartinCostello.LondonTravel.Site.Options
@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers"
@addTagH... | @using System.Globalization
@using Microsoft.Extensions.Configuration
@using MartinCostello.LondonTravel.Site
@using MartinCostello.LondonTravel.Site.Extensions
@using MartinCostello.LondonTravel.Site.Identity
@using MartinCostello.LondonTravel.Site.Models
@using MartinCostello.LondonTravel.Site.Options
@addTagHelper ... |
Add tests for constructors of MuffinClient | using System;
using System.ComponentModel.Composition.Hosting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MuffinFramework.Tests
{
[TestClass]
public class MuffinClientTests
{
[TestMethod]
public void DoubleStartTest()
{
// arrange
InvalidO... | using System;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MuffinFramework.Tests
{
[TestClass]
public class MuffinClientTests
{
[TestMethod]
public void ... |
Update vehicle data set mime type version to 2.2 | using System.Collections.Generic;
namespace NFleet.Data
{
public class VehicleDataSet : IResponseData, IVersioned
{
public static string MIMEType = "application/vnd.jyu.nfleet.vehicleset";
public static string MIMEVersion = "2.0";
int IVersioned.VersionNumber { get; set; }
pub... | using System.Collections.Generic;
namespace NFleet.Data
{
public class VehicleDataSet : IResponseData, IVersioned
{
public static string MIMEType = "application/vnd.jyu.nfleet.vehicleset";
public static string MIMEVersion = "2.2";
int IVersioned.VersionNumber { get; set; }
pub... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.