Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Fix operation on wrong node | namespace SearchingBinaryTree
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class BinarySearchTree
{
public Node Root { get; private set; }
public void Add(Node node) {
if(Root!=null) {
... | namespace SearchingBinaryTree
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class BinarySearchTree
{
public Node Root { get; private set; }
public void Add(Node node) {
if(Root!=null) {
... |
Add override to test migration, so it happens every time | using System;
using IonFar.SharePoint.Migration;
using Microsoft.SharePoint.Client;
namespace TestApplication.Migrations
{
[Migration(10001)]
public class ShowTitle : IMigration
{
public void Up(ClientContext clientContext, ILogger logger)
{
clientContext.Load(clientContext.Web... | using System;
using IonFar.SharePoint.Migration;
using Microsoft.SharePoint.Client;
namespace TestApplication.Migrations
{
[Migration(10001, true)]
public class ShowTitle : IMigration
{
public void Up(ClientContext clientContext, ILogger logger)
{
clientContext.Load(clientConte... |
Remove RegexOptions.Compiled for code paths executed during cold start | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Text.RegularExpressions;
namespace Microsoft.Azure.WebJobs
{
/// <summary>
/// Attribute used to indicate the name to use for a job... | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Text.RegularExpressions;
namespace Microsoft.Azure.WebJobs
{
/// <summary>
/// Attribute used to indicate the name to use for a job... |
Add Articles rep into DI scope | using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace AustinSite
{
public class Startup
{
public Startup(IHostingEnvironment env)
... | using AustinSite.Repositories;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace AustinSite
{
public class Startup
{
public Startup(IH... |
Add retry logic for test clean up | using System;
namespace TestUtility
{
public partial class TestAssets
{
private class TestProject : ITestProject
{
private bool _disposed;
public string Name { get; }
public string BaseDirectory { get; }
public string Directory { get; }
... | using System;
using System.Threading;
namespace TestUtility
{
public partial class TestAssets
{
private class TestProject : ITestProject
{
private bool _disposed;
public string Name { get; }
public string BaseDirectory { get; }
public string Dir... |
Move EditorBrowsable to class level | /*
JustMock Lite
Copyright © 2019 Progress Software 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 of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ap... | /*
JustMock Lite
Copyright © 2019 Progress Software 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 of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ap... |
Use a lower maxTreeLevel precision | using System.Linq;
using Raven.Client.Indexes;
namespace Raven.TimeZones
{
public class ZoneShapesIndex : AbstractIndexCreationTask<ZoneShape>
{
public ZoneShapesIndex()
{
Map = shapes => from shape in shapes
select new
... | using System.Linq;
using Raven.Abstractions.Indexing;
using Raven.Client.Indexes;
namespace Raven.TimeZones
{
public class ZoneShapesIndex : AbstractIndexCreationTask<ZoneShape>
{
public ZoneShapesIndex()
{
Map = shapes => from shape in shapes
... |
Clean up reading templates from embedded resources. | using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using EnumsNET;
using Microsoft.Extensions.FileProviders;
namespace SJP.Schematic.Reporting.Html
{
internal class TemplateProvider : ITemplateProvider
{
public string GetTemplate(ReportTemplate template)
... | using System;
using System.IO;
using System.Linq;
using System.Reflection;
using EnumsNET;
using Microsoft.Extensions.FileProviders;
namespace SJP.Schematic.Reporting.Html
{
internal class TemplateProvider : ITemplateProvider
{
public string GetTemplate(ReportTemplate template)
{
i... |
Fix import status succeeded spelling error | using System;
using System.Collections.Generic;
using System.Text;
namespace Alexa.NET.Management.Package
{
public enum ImportStatus
{
FAILED,
IN_PROGRESS,
SUCCEEEDED
}
}
| using System;
using System.Collections.Generic;
using System.Text;
namespace Alexa.NET.Management.Package
{
public enum ImportStatus
{
FAILED,
IN_PROGRESS,
SUCCEEDED
}
}
|
Make cursor redundancy more redundant | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UnlockCursorOnStart : MonoBehaviour
{
void Start()
{
Invoke("unlockCursor", .1f);
}
void unlockCursor()
{
Cursor.lockState = GameController.DefaultCursorMode;
}
}
| using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UnlockCursorOnStart : MonoBehaviour
{
[SerializeField]
bool forceOnUpdate = true;
void Start()
{
Invoke("unlockCursor", .1f);
}
void unlockCursor()
{
Cursor.lockState = GameControl... |
Use {0:c} rather than ToString("c") where possible. | @if (Model.DiscountedPrice != Model.Price)
{
<b class="inactive-price" style="text-decoration:line-through" title="@T("Was {0}", Model.Price.ToString("c"))">@Model.Price.ToString("c")</b>
<b class="discounted-price" title="@T("Now {0}", Model.DiscountedPrice.ToString("c"))">@Model.DiscountedPrice.ToString("... | @if (Model.DiscountedPrice != Model.Price)
{
<b class="inactive-price" style="text-decoration:line-through" title="@T("Was {0:c}", Model.Price)">@Model.Price.ToString("c")</b>
<b class="discounted-price" title="@T("Now {0:c}", Model.DiscountedPrice)">@Model.DiscountedPrice.ToString("c")</b>
<span class... |
Use Persist value from config. | using System;
using System.Collections.Generic;
using RabbitMQ.Client;
using RabbitMQ.Client.Framing;
namespace RawRabbit.Common
{
public interface IBasicPropertiesProvider
{
IBasicProperties GetProperties<TMessage>(Action<IBasicProperties> custom = null);
}
public class BasicPropertiesProvider : IBasicPropert... | using System;
using System.Collections.Generic;
using RabbitMQ.Client;
using RabbitMQ.Client.Framing;
using RawRabbit.Configuration;
namespace RawRabbit.Common
{
public interface IBasicPropertiesProvider
{
IBasicProperties GetProperties<TMessage>(Action<IBasicProperties> custom = null);
}
public class BasicPro... |
Add util extention for rendering GUI. | #region Using
using System;
using System.Numerics;
using Emotion.Graphics.Objects;
using Emotion.Primitives;
#endregion
namespace Emotion.Plugins.ImGuiNet
{
public static class ImGuiExtensions
{
public static Tuple<Vector2, Vector2> GetImGuiUV(this Texture t, Rectangle? uv = null)
{
... | #region Using
using System;
using System.Numerics;
using Emotion.Graphics;
using Emotion.Graphics.Objects;
using Emotion.Primitives;
using ImGuiNET;
#endregion
namespace Emotion.Plugins.ImGuiNet
{
public static class ImGuiExtensions
{
public static Tuple<Vector2, Vector2> GetImGuiUV(this Texture t, ... |
Test for loading import from data url | namespace AngleSharp.Core.Tests.Library
{
using AngleSharp.Core.Tests.Mocks;
using AngleSharp.Dom.Html;
using AngleSharp.Extensions;
using NUnit.Framework;
using System;
using System.Threading.Tasks;
[TestFixture]
public class PageImportTests
{
[Test]
public async T... | namespace AngleSharp.Core.Tests.Library
{
using AngleSharp.Core.Tests.Mocks;
using AngleSharp.Dom.Html;
using AngleSharp.Extensions;
using NUnit.Framework;
using System;
using System.Threading.Tasks;
[TestFixture]
public class PageImportTests
{
[Test]
public async T... |
Add Device & Thing Titles to Endpoint GridList | @model PagedList.IPagedList<DynThings.Data.Models.Endpoint>
<table class="table striped hovered border bordered">
<thead>
<tr>
<th>Title</th>
<th>Type</th>
<th>GUID</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
... | @model PagedList.IPagedList<DynThings.Data.Models.Endpoint>
<table class="table striped hovered border bordered">
<thead>
<tr>
<th>Title</th>
<th>Type</th>
<th>Device</th>
<th>Thing</th>
<th></th>
</tr>
</thead>
<tbody>
@for... |
Use IConfiguration instead of IConfigurationRoot | using LiteDB;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.FileProviders;
namespace TIKSN.Data.LiteDB
{
/// <summary>
/// Create LiteDB database
/// </summary>
public class LiteDbDatabaseProvider : ILiteDbDatabaseProvider
{
private readonly IConfigurationRoot _co... | using LiteDB;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.FileProviders;
namespace TIKSN.Data.LiteDB
{
/// <summary>
/// Create LiteDB database
/// </summary>
public class LiteDbDatabaseProvider : ILiteDbDatabaseProvider
{
private readonly IConfiguration _config... |
Remove the silly `stop` alias for `kill`. | /*
* SDB - Mono Soft Debugger Client
* Copyright 2013 Alex Rønne Petersen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any late... | /*
* SDB - Mono Soft Debugger Client
* Copyright 2013 Alex Rønne Petersen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any late... |
Drop audio in summary videos | using System.Diagnostics;
namespace Cams
{
public static class VideoConverter
{
public static bool CodecCopy(string inputFile, string outputFile)
{
return Run($"-y -i {inputFile} -codec copy {outputFile}");
}
public static bool Concat(string listFilePath, string outputFile)
{
return Run($"-y -safe ... | using System.Diagnostics;
namespace Cams
{
public static class VideoConverter
{
public static bool CodecCopy(string inputFile, string outputFile)
{
return Run($"-y -i {inputFile} -codec copy {outputFile}");
}
public static bool Concat(string listFilePath, string outputFile)
{
return Run($"-y -safe ... |
Update application template with working code to prevent the main thread from exiting | using System;
namespace $safeprojectname$
{
public class Program
{
public static void Main()
{
}
}
}
| using System;
namespace $safeprojectname$
{
public class Program
{
public static void Main()
{
// Insert your code below this line
// The main() method has to end with this infinite loop.
// Do not use the NETMF style : Thread.Sleep(Timeout.Infinite)
while (true)
... |
Add properties and methods about connection. Implement `IDisposable` interface. | namespace PcscDotNet
{
public class PcscConnection
{
public PcscContext Context { get; private set; }
public IPcscProvider Provider { get; private set; }
public string ReaderName { get; private set; }
public PcscConnection(PcscContext context, string readerName)
{
... | using System;
namespace PcscDotNet
{
public class PcscConnection : IDisposable
{
public PcscContext Context { get; private set; }
public SCardHandle Handle { get; private set; }
public bool IsConnect => Handle.HasValue;
public bool IsDisposed { get; private set; } = false;
... |
Print to STDOUT - 2> is broken on Mono/OS X | using System;
using System.Linq;
namespace Gherkin.AstGenerator
{
class Program
{
static int Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Usage: Gherkin.AstGenerator.exe test-feature-file.feature");
return 1... | using System;
using System.Linq;
namespace Gherkin.AstGenerator
{
class Program
{
static int Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Usage: Gherkin.AstGenerator.exe test-feature-file.feature");
return 1... |
Make Status Effects UI better positioned. | using Content.Client.Utility;
using Robust.Client.Graphics;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.IoC;
namespace Content.Client.UserInterface
{
/// <summary>
/// The status effects display on the... | using Content.Client.Utility;
using Robust.Client.Graphics;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.IoC;
namespace Content.Client.UserInterface
{
/// <summary>
/// The status effects display on the... |
Add IsActive and ThrowIfNotActiveWithGivenName to AppLock interface | using System;
namespace RapidCore.Locking
{
/// <summary>
/// When implemented in a downstream locker provider, this instance contains a handle to the underlying lock instance
/// </summary>
public interface IDistributedAppLock : IDisposable
{
/// <summary>
/// The name of the lock ... | using System;
namespace RapidCore.Locking
{
/// <summary>
/// When implemented in a downstream locker provider, this instance contains a handle to the underlying lock instance
/// </summary>
public interface IDistributedAppLock : IDisposable
{
/// <summary>
/// The name of the lock ... |
Use JsonProperty attribute and remove unused types | /* Empiria Extensions ****************************************************************************************
* *
* Module : Cognitive Services Component : Service provider ... | /* Empiria Extensions ****************************************************************************************
* *
* Module : Cognitive Services Component : Service provider ... |
Add comments to vision quickstart. | // Copyright(c) 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... | // Copyright(c) 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
Print source and destination addresses on ICMPv6 packets |
using TAP;
using System;
using System.Net;
public class TAPCfgTest {
private static void Main(string[] args) {
EthernetDevice dev = new EthernetDevice();
dev.Start("Device name");
Console.WriteLine("Got device name: {0}", dev.DeviceName);
dev.MTU = 1280;
dev.SetAddress(IPAddress.Parse("192.168.1.1"), 16);
... |
using TAP;
using System;
using System.Net;
public class TAPCfgTest {
private static void Main(string[] args) {
EthernetDevice dev = new EthernetDevice();
dev.Start("Device name");
Console.WriteLine("Got device name: {0}", dev.DeviceName);
dev.MTU = 1280;
dev.SetAddress(IPAddress.Parse("192.168.1.1"), 16);
... |
Switch to .Dispose() from .Close(). | using System;
using System.Threading.Tasks;
using System.IO;
using System.Net;
using Newtonsoft.Json;
namespace apod_api
{
public sealed class APOD_API
{
public APOD_API()
{
date = DateTime.Today;
}
public void sendRequest()
{
generateURL();
... | using System;
using System.Threading.Tasks;
using System.IO;
using System.Net;
using Newtonsoft.Json;
namespace apod_api
{
public sealed class APOD_API
{
public APOD_API()
{
date = DateTime.Today;
}
public void sendRequest()
{
generateURL();
... |
Fix UpdateManager NRE for soundspawn | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SoundSpawn : MonoBehaviour
{
public AudioSource audioSource;
//We need to handle this manually to prevent multiple requests grabbing sound pool items in the same frame
public bool isPlaying = false;
private float waitLead ... | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SoundSpawn : MonoBehaviour
{
public AudioSource audioSource;
//We need to handle this manually to prevent multiple requests grabbing sound pool items in the same frame
public bool isPlaying = false;
private f... |
Add exit code to console app; return HostFactory.Run result | // Copyright 2014 Ron Griffin, ...
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... | // Copyright 2014 Ron Griffin, ...
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
Fix windows key blocking applying when window is inactive / when watching a replay | // 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.Platform;
using osu.Game.Configuration;
namespace osu.D... | // 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.Platform;
using osu.Game;
using osu.Game.Configuration;
... |
Make PublicIp variable lazy again. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Eco.Variables
{
public class PublicIpVariable : IVariableProvider
{
string _lastIp;
DateTime _lastUpdate;
public Dictionary<string, Func<stri... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Eco.Variables
{
public class PublicIpVariable : IVariableProvider
{
string _lastIp;
DateTime _lastUpdate;
public Dictionary<string, Func<stri... |
Fix grammar in test name | using System.IO;
using Xunit;
namespace TfsHipChat.Tests
{
public class TfsIdentityTests
{
[Fact]
public void Url_ShouldReturnTheServerUrl_WhenDeserializedByValidXml()
{
const string serverUrl = "http://some-tfs-server.com";
const string tfsIdentityXm... | using System.IO;
using Xunit;
namespace TfsHipChat.Tests
{
public class TfsIdentityTests
{
[Fact]
public void Url_ShouldReturnTheServerUrl_WhenDeserializedUsingValidXml()
{
const string serverUrl = "http://some-tfs-server.com";
const string tfsIdentit... |
Add option to enable prefetch or not. | namespace LoadTests
{
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using EasyConsole;
using SqlStreamStore.Streams;
public class ReadAll : LoadTest
{
protected override async Task RunAsync(CancellationToken ct)
{
... | namespace LoadTests
{
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using EasyConsole;
using SqlStreamStore.Streams;
public class ReadAll : LoadTest
{
protected override async Task RunAsync(CancellationToken ct)
{
... |
Comment code according to presentation's flow | using System;
using System.Threading.Tasks;
using static System.Console;
namespace AsyncLambda
{
class Program
{
static async Task Main()
{
WriteLine("Started");
try
{
Process(async () =>
{
await Task.Delay... | using System;
using System.Threading.Tasks;
using static System.Console;
namespace AsyncLambda
{
class Program
{
static async Task Main()
{
WriteLine("Started");
try
{
Process(async () =>
{
await Task.Delay... |
Set default render quality to medium | // Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Visuals.Media.Imaging;
namespace Avalonia.Media
{
public class RenderOptions
{
/// <summary>
/// Defines the <se... | // Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Visuals.Media.Imaging;
namespace Avalonia.Media
{
public class RenderOptions
{
/// <summary>
/// Defines the <se... |
Remove unnecessary event callback in WPF demo | using System.Drawing;
using System.Windows;
namespace NetSparkle.TestAppWPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private Sparkle _sparkle;
public MainWindow()
{
... | using System.Drawing;
using System.Windows;
namespace NetSparkle.TestAppWPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private Sparkle _sparkle;
public MainWindow()
{
... |
Remove Include from clause types. | using System;
namespace AutoQueryable.Models.Enums
{
[Flags]
public enum ClauseType : short
{
Select = 1 << 1,
Top = 1 << 2,
Take = 1 << 3,
Skip = 1 << 4,
OrderBy = 1 << 5,
OrderByDesc = 1 << 6,
Include = 1 << 7,
GroupBy = 1 << 8,
Fir... | using System;
namespace AutoQueryable.Models.Enums
{
[Flags]
public enum ClauseType : short
{
Select = 1 << 1,
Top = 1 << 2,
Take = 1 << 3,
Skip = 1 << 4,
OrderBy = 1 << 5,
OrderByDesc = 1 << 6,
GroupBy = 1 << 8,
First = 1 << 9,
Last ... |
Fix "Widget Mouse Down" event property friendly names | using System.Windows.Input;
namespace DesktopWidgets.Events
{
internal class WidgetMouseDownEvent : WidgetEventBase
{
public MouseButton MouseButton { get; set; }
}
} | using System.ComponentModel;
using System.Windows.Input;
namespace DesktopWidgets.Events
{
internal class WidgetMouseDownEvent : WidgetEventBase
{
[DisplayName("Mouse Button")]
public MouseButton MouseButton { get; set; }
}
} |
Fix version and update copyright | using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Xamarin.Social")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[asse... | using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("Xamarin.Social")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[asse... |
Set navigation bar translucent to false to fix views overlapping. Fix bug | using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
namespace Example_Drawing
{
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
#region -= declarations and properties =-
protected UIWindow window;
protected UINavigationController mainNavController;
protected Exam... | using System;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
namespace Example_Drawing
{
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
#region -= declarations and properties =-
protected UIWindow window;
protected UINavigationController mainNavController;
protected Exam... |
Fix incorrectly implemented async test. | using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SGEnviro;
namespace SGEnviroTest
{
[TestClass]
public class ApiTest
{
private string apiKey;
... | using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SGEnviro;
namespace SGEnviroTest
{
[TestClass]
public class ApiTest
{
private string apiKey;
... |
Increment minor version - breaking changes. | using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("RestKit")]
[assembly: AssemblyDescription("SIMPLE http client wrapper that eliminates the boilerplate code you don't want to write.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly:... | using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("RestKit")]
[assembly: AssemblyDescription("SIMPLE http client wrapper that eliminates the boilerplate code you don't want to write.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly:... |
Fix crashing in the case of empty args | using CommandLine;
namespace ProcessGremlinApp
{
public class ArgumentParser
{
public bool TryParse(string[] args, out Arguments arguments)
{
string invokedVerb = null;
object invokedVerbInstance = null;
var options = new Options();
if (Parser.De... | using CommandLine;
namespace ProcessGremlinApp
{
public class ArgumentParser
{
public bool TryParse(string[] args, out Arguments arguments)
{
if (args != null && args.Length != 0)
{
string invokedVerb = null;
object invokedVerbInstance = n... |
Write usage information if no parameters are specified | 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... |
Increment the version to 1.1. | 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("Lu... | 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("Lu... |
Remove superfluous StringComparison.Ordinal argument from ReadOnlySpan<char>.StarstWith(...) call, since the overload without a StringComparison in fact performs ordinal comparison semantics and the original call ultimately calls into the overload with no StringComparison argument anyway. In other words, you only have ... | namespace Parsley;
partial class Grammar
{
public static Parser<string> Keyword(string word)
{
if (word.Any(ch => !char.IsLetter(ch)))
throw new ArgumentException("Keywords may only contain letters.", nameof(word));
return input =>
{
var peek = input.Peek(word.L... | namespace Parsley;
partial class Grammar
{
public static Parser<string> Keyword(string word)
{
if (word.Any(ch => !char.IsLetter(ch)))
throw new ArgumentException("Keywords may only contain letters.", nameof(word));
return input =>
{
var peek = input.Peek(word.L... |
Refresh IP address not often than 1 time per minute. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Eco.Variables
{
public class PublicIpVariable : IVariableProvider
{
public Dictionary<string, Func<string>> GetVariables()
{
return new Di... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Eco.Variables
{
public class PublicIpVariable : IVariableProvider
{
string _lastIp;
DateTime _lastUpdate;
public Dictionary<string, Func<stri... |
Change InitModel from public to protected | using Andromeda2D.Entities;
using Andromeda2D.Entities.Components;
using Andromeda2D.Entities.Components.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Andromeda.Entities.Components
{
/// <summary>
/// A controller for a... | using Andromeda2D.Entities;
using Andromeda2D.Entities.Components;
using Andromeda2D.Entities.Components.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Andromeda.Entities.Components
{
/// <summary>
/// A controller for a... |
Make program maximized on start | using System;
using Gtk;
namespace VideoAggregator
{
class MainClass
{
public static void Main (string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
win.Show ();
Application.Run ();
}
}
}
| using System;
using Gtk;
namespace VideoAggregator
{
class MainClass
{
public static void Main (string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
win.Maximize ();
win.Show ();
Application.Run ();
}
}
}
|
Create output directory if needed for jpg slicing. | using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CuberLib
{
public class ImageTile
{
private Image image;
private Size size;
public ImageTi... | using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CuberLib
{
public class ImageTile
{
private Image image;
private Size size;
public ImageTi... |
Add note about things to add for vehicles | using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BatteryCommander.Web.Models
{
public class Vehicle
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[Required]
publi... | using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BatteryCommander.Web.Models
{
public class Vehicle
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[Required]
publi... |
Add a second contact to initial sample data | using System;
using SocialToolBox.Core.Database;
using SocialToolBox.Core.Database.Serialization;
using SocialToolBox.Crm.Contact.Event;
namespace SocialToolBox.Sample.Web
{
/// <summary>
/// Data initially available in the system.
/// </summary>
public static class InitialData
{
public st... | using System;
using SocialToolBox.Core.Database;
using SocialToolBox.Crm.Contact.Event;
namespace SocialToolBox.Sample.Web
{
/// <summary>
/// Data initially available in the system.
/// </summary>
public static class InitialData
{
public static readonly Id UserVictorNicollet = Id.Parse("a... |
Fix tests by creating a score processor | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using System.Collections.Generic;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
using osu.... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using System.Collections.Generic;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
using osu.... |
Fix for slow high score loading | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CodeBreaker.Core;
using CodeBreaker.Core.Storage;
using Microsoft.EntityFrameworkCore;
namespace CodeBreaker.WebApp.Storage
{
public class ScoreStore : IScoreStore
{
private readonly CodeBreakerDbCont... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CodeBreaker.Core;
using CodeBreaker.Core.Storage;
using Microsoft.EntityFrameworkCore;
namespace CodeBreaker.WebApp.Storage
{
public class ScoreStore : IScoreStore
{
private readonly CodeBreakerDbCont... |
Add default RequestRuntime to service registration | using System;
using System.Collections.Generic;
using Glimpse.Web;
using Microsoft.Framework.DependencyInjection;
namespace Glimpse
{
public class GlimpseWebServices
{
public static IServiceCollection GetDefaultServices()
{
var services = new ServiceCollection();
... | using System;
using System.Collections.Generic;
using Glimpse.Web;
using Microsoft.Framework.DependencyInjection;
namespace Glimpse
{
public class GlimpseWebServices
{
public static IServiceCollection GetDefaultServices()
{
var services = new ServiceCollection();
... |
Add AssemblyDescription to SIM.Telemetry project | 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("SIM... | 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("SIM... |
Use deep equality rather than string comparison. | using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Nest.Tests.Unit
{
public static class JsonExtensions
{
internal static bool JsonEquals(this string json, string otherjson)
{
var nJson = JObject.Parse(json).ToString();
var nOtherJson = JObject.Parse(o... | using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Nest.Tests.Unit
{
public static class JsonExtensions
{
internal static bool JsonEquals(this string json, string otherjson)
{
var nJson = JObject.Parse(json);
var nOtherJson = JObject.Parse(otherjson);
... |
Replace integer error code with enum | using Newtonsoft.Json;
namespace MessageBird.Objects
{
public class Error
{
[JsonProperty("code")]
public int Code { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("parameter")]
public string Parameter { get; se... | using System.Runtime.Serialization;
using Newtonsoft.Json;
namespace MessageBird.Objects
{
public enum ErrorCode
{
RequestNotAllowed = 2,
MissingParameters = 9,
InvalidParameters = 10,
NotFound = 20,
NotEnoughBalance = 25,
ApiNotFound = 98,
InternalError... |
Remove "hide during breaks" option | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.ComponentModel;
namespace osu.Game.Configuration
{
public enum HUDVisibilityMode
{
Never,
[Description("Hide during gameplay")]
... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.ComponentModel;
namespace osu.Game.Configuration
{
public enum HUDVisibilityMode
{
Never,
[Description("Hide during gameplay")]
... |
Rename variable to make it read better | using System;
using System.Collections.Generic;
using System.Linq;
using Fitbit.Models;
using Newtonsoft.Json.Linq;
namespace Fitbit.Api.Portable
{
internal static class JsonDotNetSerializerExtensions
{
/// <summary>
/// GetFriends has to do some custom manipulation with the returned represent... | using System;
using System.Collections.Generic;
using System.Linq;
using Fitbit.Models;
using Newtonsoft.Json.Linq;
namespace Fitbit.Api.Portable
{
internal static class JsonDotNetSerializerExtensions
{
/// <summary>
/// GetFriends has to do some custom manipulation with the returned represent... |
Undo version number bump from personal build | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CloudSearch")]
[assembly: Assemb... | using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CloudSearch")]
[assembly: Assemb... |
Fix use of obsolete API | using System;
using TagLib;
public class SetPictures
{
public static void Main(string [] args)
{
if(args.Length < 2) {
Console.Error.WriteLine("USAGE: mono SetPictures.exe AUDIO_PATH IMAGE_PATH_1[...IMAGE_PATH_N]");
return;
}
TagLib.File file = TagLib.File.C... | using System;
using TagLib;
public class SetPictures
{
public static void Main(string [] args)
{
if(args.Length < 2) {
Console.Error.WriteLine("USAGE: mono SetPictures.exe AUDIO_PATH IMAGE_PATH_1[...IMAGE_PATH_N]");
return;
}
TagLib.File file = TagLib.File.C... |
Support full API available for worklogs | using AxosoftAPI.NET.Core.Interfaces;
using AxosoftAPI.NET.Models;
namespace AxosoftAPI.NET.Interfaces
{
public interface IWorkLogs : IGetAllResource<WorkLog>, ICreateResource<WorkLog>, IDeleteResource<WorkLog>
{
}
}
| using AxosoftAPI.NET.Core.Interfaces;
using AxosoftAPI.NET.Models;
namespace AxosoftAPI.NET.Interfaces
{
public interface IWorkLogs : IResource<WorkLog>
{
}
}
|
Use a PrivateAdditionalLibrary for czmq.lib instead of a public one | // Copyright 2015 Palm Stone Games, Inc. All Rights Reserved.
using System.IO;
namespace UnrealBuildTool.Rules
{
public class ue4czmq : ModuleRules
{
public ue4czmq(TargetInfo Target)
{
// Include paths
//PublicIncludePaths.AddRange(new string[] {});
//PrivateIncludePat... | // Copyright 2015 Palm Stone Games, Inc. All Rights Reserved.
using System.IO;
namespace UnrealBuildTool.Rules
{
public class ue4czmq : ModuleRules
{
public ue4czmq(TargetInfo Target)
{
// Include paths
//PublicIncludePaths.AddRange(new string[] {});
//PrivateIncludePat... |
Fix failing test for TestContent in test redaction | using System;
using NBi.Xml;
using NUnit.Framework;
namespace NBi.Testing.Unit.Xml
{
[TestFixture]
public class XmlManagerTest
{
[Test]
public void Load_ValidFile_Success()
{
var filename = DiskOnFile.CreatePhysicalFile("TestSuite.xml", "NBi.Testing.Unit.Xml... | using System;
using NBi.Xml;
using NUnit.Framework;
namespace NBi.Testing.Unit.Xml
{
[TestFixture]
public class XmlManagerTest
{
[Test]
public void Load_ValidFile_Success()
{
var filename = DiskOnFile.CreatePhysicalFile("TestSuite.xml", "NBi.Testing.Unit.Xml... |
Allow File to not Exist in FileBrowse | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace poshsecframework.PShell
{
class psfilenameeditor : System.Drawing.Design.UITypeEditor
{
public override System.Dr... | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace poshsecframework.PShell
{
class psfilenameeditor : System.Drawing.Design.UITypeEditor
{
public override System.Dr... |
Add some readonly 's to tests | using System;
using Villermen.RuneScapeCacheTools.Cache;
using Villermen.RuneScapeCacheTools.Cache.RuneTek5;
using Xunit;
using Xunit.Abstractions;
namespace RuneScapeCacheToolsTests
{
public class RuneTek5CacheTests : IDisposable
{
private ITestOutputHelper _output;
private RuneTek5Cache _ca... | using System;
using Villermen.RuneScapeCacheTools.Cache;
using Villermen.RuneScapeCacheTools.Cache.RuneTek5;
using Xunit;
using Xunit.Abstractions;
namespace RuneScapeCacheToolsTests
{
public class RuneTek5CacheTests : IDisposable
{
private readonly ITestOutputHelper _output;
private readonly... |
Delete break from the test | // Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
using System;
using System.Linq;
using PInvoke;
using Xunit;
using Xunit.Abstractions;
using s... | // Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
using System;
using System.Linq;
using PInvoke;
using Xunit;
using Xunit.Abstractions;
using s... |
Use IntervalReachedEventArgs instead of EventArgs. | using System;
using Microsoft.SPOT;
namespace IntervalTimer
{
public delegate void IntervalEventHandler(object sender, EventArgs e);
public class IntervalTimer
{
public TimeSpan ShortDuration { get; set; }
public TimeSpan LongDuration { get; set; }
public IntervalTime... | using System;
using Microsoft.SPOT;
namespace IntervalTimer
{
public delegate void IntervalEventHandler(object sender, IntervalReachedEventArgs e);
public class IntervalTimer
{
public TimeSpan ShortDuration { get; set; }
public TimeSpan LongDuration { get; set; }
publ... |
Fix a bug that causes the application to not start. This happen because the Start method was not begin called. | using System;
using System.Web;
using System.Web.Configuration;
using ZMQ;
namespace Nohros.Toolkit.RestQL
{
public class Global : HttpApplication
{
static readonly Context zmq_context_;
#region .ctor
static Global() {
zmq_context_ = new Context(ZMQ.Context.DefaultIOThreads);
... | using System;
using System.Web;
using System.Web.Configuration;
using ZMQ;
namespace Nohros.Toolkit.RestQL
{
public class Global : HttpApplication
{
static readonly Context zmq_context_;
#region .ctor
static Global() {
zmq_context_ = new Context(ZMQ.Context.DefaultIOThreads);
... |
Add RandomAI() method for fast generation of simple random players | using UnityEngine;
public class Settings {
public static Player
p1 = new RandomAI(null, 1, Color.red, Resources.Load<Sprite>("Sprites/x"), "X"),
p2 = new RandomAI(null, 2, Color.blue, Resources.Load<Sprite>("Sprites/o"), "O");
}
| using UnityEngine;
public class Settings {
public static Player p1 = RandomAI(true), p2 = RandomAI(false);
public static RandomAI RandomAI(bool firstPlayer)
{
int turn = firstPlayer ? 1 : 2;
Color color = firstPlayer ? Color.red : Color.blue;
Sprite sprite =
Resources... |
Add two (currently failing) tests. Hopefully the new wikiextractor will deal with these corner cases (unissued, unilluminating). | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AvsAnLib;
using ExpressionToCodeLib;
using NUnit.Framework;
namespace AvsAn_Test {
public class StandardCasesWork {
[TestCase("an", "unanticipated result")]
[TestCa... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AvsAnLib;
using ExpressionToCodeLib;
using NUnit.Framework;
namespace AvsAn_Test {
public class StandardCasesWork {
[TestCase("an", "unanticipated result")]
[TestCa... |
Add AggressiveInlining for Rotate and Get functions | namespace NHasher
{
internal static class HashExtensions
{
public static ulong RotateLeft(this ulong original, int bits)
{
return (original << bits) | (original >> (64 - bits));
}
public static uint RotateLeft(this uint original, int bits)
{
retu... | using System.Runtime.CompilerServices;
namespace NHasher
{
internal static class HashExtensions
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong RotateLeft(this ulong original, int bits)
{
return (original << bits) | (original >> (64 - bits));
... |
Change constants file. Fixed path to MonkeyHelper. | using Telerik.TestingFramework.Controls.KendoUI;
using Telerik.WebAii.Controls.Html;
using Telerik.WebAii.Controls.Xaml;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
u... | using Telerik.TestingFramework.Controls.KendoUI;
using Telerik.WebAii.Controls.Html;
using Telerik.WebAii.Controls.Xaml;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using ArtOfTest.Common.UnitTesting;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Controls.HtmlControls;
u... |
Make lights not appear in menu | using UnityEngine;
using System.Collections;
public class LightManager {
Material LightOnMaterial;
Material LightOffMaterial;
public bool IsOn = true;
// Use this for initialization
public void UpdateLights() {
GameObject[] allLights = GameObject.FindGameObjectsWithTag ("Light");
foreach (GameObject i in al... | using UnityEngine;
using System.Collections;
public class LightManager {
Material LightOnMaterial;
Material LightOffMaterial;
public bool IsOn = true;
// Use this for initialization
public void UpdateLights() {
bool lightOn = IsOn;
if (!Application.loadedLevelName.StartsWith ("Level"))
lightOn = false;
... |
Use property instead of field for CompositeDisposable | using Avalonia.Controls;
using System.Reactive.Disposables;
namespace WalletWasabi.Gui.Behaviors
{
public class CommandOnDoubleClickBehavior : CommandBasedBehavior<Control>
{
private CompositeDisposable _disposables;
protected override void OnAttached()
{
_disposables = ne... | using Avalonia.Controls;
using System.Reactive.Disposables;
namespace WalletWasabi.Gui.Behaviors
{
public class CommandOnDoubleClickBehavior : CommandBasedBehavior<Control>
{
private CompositeDisposable Disposables { get; set; }
protected override void OnAttached()
{
Disposables = new CompositeDisposable(... |
Change printLn to print all values followed by a newline | using Mond.Binding;
namespace Mond.Libraries.Console
{
[MondClass("")]
internal class ConsoleOutputClass
{
private ConsoleOutputLibrary _consoleOutput;
public static MondValue Create(ConsoleOutputLibrary consoleOutput)
{
MondValue prototype;
MondClassBinder... | using Mond.Binding;
namespace Mond.Libraries.Console
{
[MondClass("")]
internal class ConsoleOutputClass
{
private ConsoleOutputLibrary _consoleOutput;
public static MondValue Create(ConsoleOutputLibrary consoleOutput)
{
MondValue prototype;
MondClassBinder... |
Set the version to a trepidatious 0.5 | 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("HA... | 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("HA... |
Use UserVisibilityHint to detect ViewPager change instead of MenuVisibility, this fixes an Exception. | using System;
using System.Collections.Generic;
using System.Linq;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Database;
using Android.Graphics;
using Android.OS;
using Android.Runtime;
using Android.Support.Design.Widget;
using Android.Support.V4.Widget;
using Android.Support.V4... | using System;
using System.Collections.Generic;
using System.Linq;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Database;
using Android.Graphics;
using Android.OS;
using Android.Runtime;
using Android.Support.Design.Widget;
using Android.Support.V4.Widget;
using Android.Support.V4... |
Use null propagation when invoking ValueWrittenToOutputRegister to prevent possible race condition. | namespace SimpSim.NET
{
public class Registers
{
public delegate void ValueWrittenToOutputRegisterHandler(char output);
public event ValueWrittenToOutputRegisterHandler ValueWrittenToOutputRegister;
private readonly byte[] _array;
public Registers()
{
_arra... | namespace SimpSim.NET
{
public class Registers
{
public delegate void ValueWrittenToOutputRegisterHandler(char output);
public event ValueWrittenToOutputRegisterHandler ValueWrittenToOutputRegister;
private readonly byte[] _array;
public Registers()
{
_arra... |
Add test showing problem with "continue with". | using NUnit.Framework;
namespace ZimmerBot.Core.Tests.BotTests
{
[TestFixture]
public class ContinueTests : TestHelper
{
[Test]
public void CanContinueWithEmptyTarget()
{
BuildBot(@"
> Hello
: Hi
! continue
> *
! weight 0.5
: What can I help you with?
");
AssertDialog... | using NUnit.Framework;
namespace ZimmerBot.Core.Tests.BotTests
{
[TestFixture]
public class ContinueTests : TestHelper
{
[Test]
public void CanContinueWithEmptyTarget()
{
BuildBot(@"
> Hello
: Hi
! continue
> *
! weight 0.5
: What can I help you with?
");
AssertDialog... |
Set suitable default settings, in accordance with the prophecy | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LaunchNumbering
{
public class LNSettings : GameParameters.CustomParameterNode
{
public override GameParameters.GameMode GameMode => GameParameters.GameMode.ANY;
public override bool HasPresets => false;
public o... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LaunchNumbering
{
public class LNSettings : GameParameters.CustomParameterNode
{
public override GameParameters.GameMode GameMode => GameParameters.GameMode.ANY;
public override bool HasPresets => false;
public o... |
Use Regex in namespace pattern | using System;
using dnlib.DotNet;
namespace Confuser.Core.Project.Patterns {
/// <summary>
/// A function that compare the namespace of definition.
/// </summary>
public class NamespaceFunction : PatternFunction {
internal const string FnName = "namespace";
/// <inheritdoc />
public override string Nam... | using System;
using System.Text.RegularExpressions;
using dnlib.DotNet;
namespace Confuser.Core.Project.Patterns {
/// <summary>
/// A function that compare the namespace of definition.
/// </summary>
public class NamespaceFunction : PatternFunction {
internal const string FnName = "namespace";
/// <inhe... |
Access dos not support such join syntax. | using System;
using System.Linq;
using LinqToDB;
using NUnit.Framework;
namespace Tests.UserTests
{
[TestFixture]
public class Issue1556Tests : TestBase
{
[Test]
public void Issue1556Test([DataSources(ProviderName.Sybase, ProviderName.OracleNative)] string context)
{
using (var db = GetDataContext(conte... | using System;
using System.Linq;
using LinqToDB;
using NUnit.Framework;
namespace Tests.UserTests
{
[TestFixture]
public class Issue1556Tests : TestBase
{
[Test]
public void Issue1556Test(
[DataSources(ProviderName.Sybase, ProviderName.OracleNative, ProviderName.Access)] string context)
{
using (var ... |
Clean up stream after use. | using System.IO;
using System.Text;
using Antlr4.Runtime;
using GraphQL.Language;
using GraphQL.Parsing;
namespace GraphQL.Execution
{
public class AntlrDocumentBuilder : IDocumentBuilder
{
public Document Build(string data)
{
var stream = new MemoryStream(Encoding.UTF8.GetBytes(dat... | using System.IO;
using System.Text;
using Antlr4.Runtime;
using GraphQL.Language;
using GraphQL.Parsing;
namespace GraphQL.Execution
{
public class AntlrDocumentBuilder : IDocumentBuilder
{
public Document Build(string data)
{
using (var stream = new MemoryStream(Encoding.UTF8.GetBy... |
Set failure rate to max 5% | using System;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Logging;
class ChaosHandler : IHandleMessages<object>
{
readonly ILog Log = LogManager.GetLogger<ChaosHandler>();
readonly double Thresshold = ThreadLocalRandom.NextDouble() * 0.50;
public Task Handle(object message, IMessage... | using System;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Logging;
class ChaosHandler : IHandleMessages<object>
{
readonly ILog Log = LogManager.GetLogger<ChaosHandler>();
readonly double Thresshold = ThreadLocalRandom.NextDouble() * 0.05;
public Task Handle(object message... |
Change throw exception due to appharbor build | using System;
using System.Collections.Generic;
using System.Linq;
using PhotoLife.Data.Contracts;
using PhotoLife.Models;
using PhotoLife.Models.Enums;
using PhotoLife.Services.Contracts;
namespace PhotoLife.Services
{
public class CategoryService : ICategoryService
{
private readonly IRepository<Cat... | using System;
using System.Collections.Generic;
using System.Linq;
using PhotoLife.Data.Contracts;
using PhotoLife.Models;
using PhotoLife.Models.Enums;
using PhotoLife.Services.Contracts;
namespace PhotoLife.Services
{
public class CategoryService : ICategoryService
{
private readonly IRepository<Cat... |
Print 'data' fields for generic events | namespace SyncTrayzor.SyncThing.ApiClient
{
public class GenericEvent : Event
{
public override void Visit(IEventVisitor visitor)
{
visitor.Accept(this);
}
public override string ToString()
{
return $"<GenericEvent ID={this.Id} Type={this.Type} T... | using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace SyncTrayzor.SyncThing.ApiClient
{
public class GenericEvent : Event
{
public override void Visit(IEventVisitor visitor)
{
visitor.Accept(this);
}
... |
Use EmptyLineBotLogger in unit tests. | // Copyright 2017-2018 Dirk Lemstra (https://github.com/dlemstra/line-bot-sdk-dotnet)
//
// Dirk Lemstra licenses this file to you under the Apache License,
// version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at:
//
// https://www.a... | // Copyright 2017-2018 Dirk Lemstra (https://github.com/dlemstra/line-bot-sdk-dotnet)
//
// Dirk Lemstra licenses this file to you under the Apache License,
// version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at:
//
// https://www.a... |
Add Find method to expression map | using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace NRules.RuleModel
{
/// <summary>
/// Sorted readonly map of named expressions.
/// </summary>
public class ExpressionMap : IEnumerable<NamedExpressionElement>
{
private readonly SortedDict... | using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace NRules.RuleModel
{
/// <summary>
/// Sorted readonly map of named expressions.
/// </summary>
public class ExpressionMap : IEnumerable<NamedExpressionElement>
{
private readonly SortedDict... |
Support debugging of modified assemblies | using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Mono.Cecil;
using System;
using System.IO;
namespace AspectInjector.BuildTask
{
public class AspectInjectorBuildTask : Task
{
[Required]
public string Assembly { get; set; }
[Required]
public... | using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Mono.Cecil;
using System;
using System.IO;
namespace AspectInjector.BuildTask
{
public class AspectInjectorBuildTask : Task
{
[Required]
public string Assembly { get; set; }
[Required]
public... |
Use propert initializers instead of constructor | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AllReady.Models
{
public class Activity
{
public Activity()
{
Tasks = new List<AllReadyTask>();
UsersSignedUp = new... | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AllReady.Models
{
public class Activity
{
public int Id { get; set; }
[Display(Name = "Tenant")]
public int TenantId { get; set; }... |
Allow non-default Command Settings to be passed to GetSqlCommand() | /*
* SqlServerHelpers
* SqlConnectionExtensions - Extension methods for SqlConnection
* Authors:
* Josh Keegan 26/05/2015
*/
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SqlServerHelpers.ExtensionMeth... | /*
* SqlServerHelpers
* SqlConnectionExtensions - Extension methods for SqlConnection
* Authors:
* Josh Keegan 26/05/2015
*/
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SqlServerHelpers.ExtensionMeth... |
Add whitespace on test file | using NUnit.Framework;
using UnityEngine.Formats.Alembic.Sdk;
namespace UnityEditor.Formats.Alembic.Exporter.UnitTests
{
class EditorTests
{
[Test]
public void MarshalTests()
{
Assert.AreEqual(72,System.Runtime.InteropServices.Marshal.SizeOf(typeof(aePolyMeshData)));
... | using NUnit.Framework;
using UnityEngine.Formats.Alembic.Sdk;
namespace UnityEditor.Formats.Alembic.Exporter.UnitTests
{
class EditorTests
{
[Test]
public void MarshalTests()
{
Assert.AreEqual(72,System.Runtime.InteropServices.Marshal.SizeOf(typeof(aePolyMeshData)));
... |
Set notification for sintrom control days | using System;
using System.Collections.Generic;
using System.Text;
using TFG.Model;
namespace TFG.Logic {
public class SintromLogic {
private static SintromLogic _instance;
public static SintromLogic Instance() {
if (_instance == null) {
_instance = new SintromLogic(... | using System;
using System.Collections.Generic;
using System.Text;
using TFG.Model;
namespace TFG.Logic {
public class SintromLogic {
private static SintromLogic _instance;
public static SintromLogic Instance() {
if (_instance == null) {
_instance = new SintromLogic(... |
Remove version attributes from assembly info | 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("Laz... | 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("Laz... |
Change version number to 1.2.1 | /*
* ******************************************************************************
* Copyright 2014 Spectra Logic Corporation. 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. A copy of the License is loc... | /*
* ******************************************************************************
* Copyright 2014 Spectra Logic Corporation. 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. A copy of the License is loc... |
Test filenames are case insensitive too. | using SRPCommon.Interfaces;
using SRPCommon.Util;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SRPTests.TestRenderer
{
// Implementation of IWorkspace that finds test files.
class TestWorkspace : IWorkspace
{
privat... | using SRPCommon.Interfaces;
using SRPCommon.Util;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SRPTests.TestRenderer
{
// Implementation of IWorkspace that finds test files.
class TestWorkspace : IWorkspace
{
privat... |
Fix bug in file selection | using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib.Tar;
namespace AppHarbor
{
public static class CompressionExtensions
{
public static void ToTar(this DirectoryInfo sourceDirectory, Stream output, string[] excludedDirectoryNames)
{
var archive = TarArchive.Cr... | using System.Collections.Generic;
using System.IO;
using System.Linq;
using ICSharpCode.SharpZipLib.Tar;
namespace AppHarbor
{
public static class CompressionExtensions
{
public static void ToTar(this DirectoryInfo sourceDirectory, Stream output, string[] excludedDirectoryNames)
{
var archive = TarArchive.Cr... |
Use RuntimeInformation class to check environment. | // dnlib: See LICENSE.txt for more info
using System;
using System.IO;
namespace dnlib.IO {
static class DataReaderFactoryFactory {
static readonly bool isUnix;
static DataReaderFactoryFactory() {
// See http://mono-project.com/FAQ:_Technical#Mono_Platforms for platform detection.
int p = (int)Environment... | // dnlib: See LICENSE.txt for more info
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace dnlib.IO {
static class DataReaderFactoryFactory {
static readonly bool isUnix;
static DataReaderFactoryFactory() {
// See http://mono-project.com/FAQ:_Technical#Mono_Platforms for platform ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.