Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major. | using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Integration.Mef")]
[assembly: AssemblyDescription("Autofac MEF Integration")]
[assembly: InternalsVisibleTo("Autofac.Tests.Integration.Mef, PublicKey=00240000048... | using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Integration.Mef")]
[assembly: InternalsVisibleTo("Autofac.Tests.Integration.Mef, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261... |
Store settings as plain strings, without SettingsHelper | using Template10.Mvvm;
using Template10.Services.SettingsService;
namespace Zermelo.App.UWP.Services
{
public class SettingsService : BindableBase, ISettingsService
{
ISettingsHelper _helper;
public SettingsService(ISettingsHelper settingsHelper)
{
_helper = settingsHelper... | using Template10.Mvvm;
using Template10.Services.SettingsService;
using Windows.Storage;
namespace Zermelo.App.UWP.Services
{
public class SettingsService : BindableBase, ISettingsService
{
ApplicationDataContainer _settings;
public SettingsService()
{
_settings = Applicat... |
Handle null/missing category and tags | // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
namespace ServiceStack.IntroSpec.Services
{
using System.Linq;
using DTO;
public class ApiSpecMetadata... | // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
namespace ServiceStack.IntroSpec.Services
{
using System.Linq;
using DTO;
public class ApiSpecMetadata... |
Fix evaluation of max values for random int and long | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StrangerData.Utils
{
internal static class RandomValues
{
public static object ForColumn(TableColumnInfo columnInfo)
{
switch (columnInfo.ColumnType)
... | using System;
namespace StrangerData.Utils
{
internal static class RandomValues
{
public static object ForColumn(TableColumnInfo columnInfo)
{
switch (columnInfo.ColumnType)
{
case ColumnType.String:
// generates a random string
... |
Fix shell-completion.yml to exclude unlisted targets for invocation | // Copyright 2019 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Collections.Generic;
using System.Linq;
using Nuke.Common.IO;
namespace Nuke.Common.Execution
{
[AttributeUsage(AttributeTargets.Class)]
internal cl... | // Copyright 2019 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Collections.Generic;
using System.Linq;
using Nuke.Common.IO;
using static Nuke.Common.Constants;
namespace Nuke.Common.Execution
{
[AttributeUsage(Attr... |
Update Tester class implementation due to the recent changes in Tester implementation | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tracer;
namespace Tester
{
class SingleThreadTest : ITest
{
private ITracer tracer = new Tracer.Tracer();
public void Run()
{
tracer.StartTrace();
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tracer;
using System.Threading;
namespace Tester
{
class SingleThreadTest : ITest
{
private ITracer tracer = new Tracer.Tracer();
public void Run()
{
tra... |
Update fixture path for specs | using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Taxjar.Tests
{
public class TaxjarFixture
{
public static string GetJSON(string fixturePath)
{
using (StreamReader file = File.OpenText(Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "../../..... | using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Taxjar.Tests
{
public class TaxjarFixture
{
public static string GetJSON(string fixturePath)
{
using (StreamReader file = File.OpenText(Path.Combine("../../../", "Fixtures", fixturePath)))
usi... |
Clean up unused lat/long coordinates in language tests. | using System.Threading.Tasks;
namespace ForecastPCL.Test
{
using System;
using System.Configuration;
using ForecastIOPortable;
using NUnit.Framework;
[TestFixture]
public class LanguageTests
{
// These coordinates came from the Forecast API documentation,
// and should r... | using System.Threading.Tasks;
namespace ForecastPCL.Test
{
using System;
using System.Configuration;
using ForecastIOPortable;
using NUnit.Framework;
[TestFixture]
public class LanguageTests
{
// These coordinates came from the Forecast API documentation,
// and should r... |
Fix stackoverflow error caused by navigation property in Session model | using Microsoft.Extensions.DependencyInjection;
using ISTS.Application.Rooms;
using ISTS.Application.Studios;
using ISTS.Domain.Rooms;
using ISTS.Domain.Studios;
using ISTS.Infrastructure.Repository;
namespace ISTS.Api
{
public static class DependencyInjectionConfiguration
{
public static void Configu... | using Microsoft.Extensions.DependencyInjection;
using ISTS.Application.Rooms;
using ISTS.Application.Schedules;
using ISTS.Application.Studios;
using ISTS.Domain.Rooms;
using ISTS.Domain.Schedules;
using ISTS.Domain.Studios;
using ISTS.Infrastructure.Repository;
namespace ISTS.Api
{
public static class Dependency... |
Simplify component factory with generics | using UnityEditor;
using UnityEngine;
namespace Alensia.Core.UI
{
public static class ComponentFactory
{
[MenuItem("GameObject/UI/Alensia/Button", false, 10)]
public static Button CreateButton(MenuCommand command)
{
var button = Button.CreateInstance();
GameObje... | using System;
using UnityEditor;
using UnityEngine;
namespace Alensia.Core.UI
{
public static class ComponentFactory
{
[MenuItem("GameObject/UI/Alensia/Button", false, 10)]
public static Button CreateButton(MenuCommand command) => CreateComponent(command, Button.CreateInstance);
[MenuI... |
Modify the enode project assembly.cs file | 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("EN... | 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("EN... |
Remove the non-active button from the jumbotron. | <section class="container">
<div id="our-jumbotron" class="jumbotron">
<h1>Welcome!</h1>
<p>We are Sweet Water Revolver. This is our website. Please look around and check out our...</p>
<p><a class="btn btn-primary btn-lg" role="button">... showtimes.</a></p>
</div>
</section>
| <section class="container">
<div id="our-jumbotron" class="jumbotron">
<h1>Welcome!</h1>
<p>We are Sweet Water Revolver. This is our website. Please look around.</p>
</div>
</section>
|
Revert "Newline at end of file missing, added." |
// Copyright 2016 Google Inc. All Rights Reserved.
// Licensed under the Apache License Version 2.0.
using Google.Apis.Dns.v1;
using Google.PowerShell.Common;
namespace Google.PowerShell.Dns
{
/// <summary>
/// Base class for Google DNS-based cmdlets.
/// </summary>
public abstract class GcdCmdlet ... |
// Copyright 2016 Google Inc. All Rights Reserved.
// Licensed under the Apache License Version 2.0.
using Google.Apis.Dns.v1;
using Google.PowerShell.Common;
namespace Google.PowerShell.Dns
{
/// <summary>
/// Base class for Google DNS-based cmdlets.
/// </summary>
public abstract class GcdCmdlet ... |
Fix build error in VS2015 | // Copyright 2015-2017 Directive Games Limited - All Rights Reserved
using UnrealBuildTool;
public class RapidJson : ModuleRules
{
public RapidJson(TargetInfo Target)
{
bFasterWithoutUnity = true;
PCHUsage = PCHUsageMode.NoSharedPCHs;
PublicIncludePaths.AddRange(
... | // Copyright 2015-2017 Directive Games Limited - All Rights Reserved
using UnrealBuildTool;
public class RapidJson : ModuleRules
{
public RapidJson(TargetInfo Target)
{
bFasterWithoutUnity = true;
PCHUsage = PCHUsageMode.NoSharedPCHs;
PublicIncludePaths.AddRange(
... |
Add extension method for working out if an entry is deleted or not. | using KeePassLib;
using System;
using System.Linq;
namespace HaveIBeenPwned
{
public static class PwEntryExtension
{
public static DateTime GetPasswordLastModified(this PwEntry entry)
{
if(entry.History != null && entry.History.Any())
{
var sortedEntries... | using KeePass.Plugins;
using KeePassLib;
using System;
using System.Linq;
namespace HaveIBeenPwned
{
public static class PwEntryExtension
{
public static DateTime GetPasswordLastModified(this PwEntry entry)
{
if(entry.History != null && entry.History.Any())
{
... |
Fix script location via AppDomain base dir for web applications | using System;
using System.IO;
using System.Reflection;
using NServiceBus;
using NServiceBus.Settings;
static class ScriptLocation
{
public static string FindScriptDirectory(ReadOnlySettings settings)
{
var currentDirectory = GetCurrentDirectory(settings);
return Path.Combine(currentDirectory,... | using System;
using System.IO;
using System.Reflection;
using NServiceBus;
using NServiceBus.Settings;
static class ScriptLocation
{
const string ScriptFolder = "NServiceBus.Persistence.Sql";
public static string FindScriptDirectory(ReadOnlySettings settings)
{
var currentDirectory = GetCurrentDi... |
Implement extracting the property name | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Rhaeo.Mvvm
{
public class ObservableObject
{
}
} | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="ObservableObject.cs" company="Rhaeo">
// Licenced under the MIT licence.
// </copyright>
// <summary>
// Defines the ObservableObject type.
// </summary>
// ------------------... |
Build and print the trie | // https://www.reddit.com/r/dailyprogrammer/comments/3n55f3/20150930_challenge_234_intermediate_red_squiggles/
//
// Your challenge today is to implement a real time spell checker and indicate where you would throw the red squiggle. For your dictionary use /usr/share/dict/words
//
using System;
using System.Collectio... | // https://www.reddit.com/r/dailyprogrammer/comments/3n55f3/20150930_challenge_234_intermediate_red_squiggles/
//
// Your challenge today is to implement a real time spell checker and indicate where you would throw the red squiggle. For your dictionary use /usr/share/dict/words
//
using System;
using System.Collectio... |
Allow rotating the screen without crashing by overriding the Configuration changes. | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using Android.App;
using Android.OS;
using Android.Content.PM;
using Android.Views;
namespace SampleGame.Android
{
[Activity(Label = "SampleGame", MainLa... | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using Android.App;
using Android.OS;
using Android.Content.PM;
using Android.Views;
using System;
using Android.Runtime;
using Android.Content.Res;
namespace... |
Increment version before creating release (0.2.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("Pi... | 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("Pi... |
Write the autolink's URL so we can see the autolink. | // Copyright (c) 2016-2017 Nicolas Musset. All rights reserved.
// This file is licensed under the MIT license.
// See the LICENSE.md file in the project root for more information.
using System;
using System.Windows.Documents;
using Markdig.Annotations;
using Markdig.Syntax.Inlines;
using Markdig.Wpf;
namespace Markd... | // Copyright (c) 2016-2017 Nicolas Musset. All rights reserved.
// This file is licensed under the MIT license.
// See the LICENSE.md file in the project root for more information.
using System;
using System.Windows.Documents;
using Markdig.Annotations;
using Markdig.Syntax.Inlines;
using Markdig.Wpf;
namespace Markd... |
Use MvcJsonOptions json serializer formatting when generating swagger.json | using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
namespace Swashbuckle.Swagger.Application
{
public class SwaggerSerializerFactory
{
internal static JsonSerializer Create(IOptions<MvcJsonOptions> mvcJsonOptions)
{
// TODO: Should this handl... | using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
namespace Swashbuckle.Swagger.Application
{
public class SwaggerSerializerFactory
{
internal static JsonSerializer Create(IOptions<MvcJsonOptions> mvcJsonOptions)
{
// TODO: Should this handl... |
Update View convention to recognize MainWindow | using Conventional.Conventions;
namespace Pirac.Conventions
{
internal class ViewConvention : Convention
{
public ViewConvention()
{
Must.HaveNameEndWith("View").BeAClass();
Should.BeAConcreteClass();
BaseName = t => t.Name.Substring(0, t.Name.Length - 4);... | using System;
using Conventional.Conventions;
namespace Pirac.Conventions
{
internal class ViewConvention : Convention
{
public ViewConvention()
{
Must.Pass(t => t.IsClass && (t.Name.EndsWith("View") || t.Name == "MainWindow"), "Name ends with View or is named MainWindow");
... |
Install NuGet as a tool | using System;
using System.Collections.Generic;
using System.IO;
using Cake.Core;
using Cake.Core.Configuration;
using Cake.Frosting;
using Cake.NuGet;
public class Program : IFrostingStartup
{
public static int Main(string[] args)
{
// Create the host.
var host = new CakeHostBuil... | using System;
using System.Collections.Generic;
using System.IO;
using Cake.Core;
using Cake.Core.Configuration;
using Cake.Frosting;
using Cake.NuGet;
public class Program : IFrostingStartup
{
public static int Main(string[] args)
{
// Create the host.
var host = new CakeHostBuil... |
Move DataFolder config get to static member initializer | /*
* 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 ... |
Use a path for storage that doesn't include version and company name | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Kyru.Core
{
class Config
{
internal readonly string storeDirectory;
internal Config() {
storeDirectory = Path.Combine(System.Windows.Forms.Application.User... | using System;
using System.IO;
namespace Kyru.Core
{
internal sealed class Config
{
internal string storeDirectory;
internal Config()
{
storeDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Kyru", "objects");
}
}
} |
Update the static content module to fit the new API. |
using System;
using System.IO;
using Mango;
//
// This the default StaticContentModule that comes with all Mango apps
// if you do not wish to serve any static content with Mango you can
// remove its route handler from <YourApp>.cs's constructor and delete
// this file.
//
// All Content placed on the Conten... |
using System;
using System.IO;
using Mango;
//
// This the default StaticContentModule that comes with all Mango apps
// if you do not wish to serve any static content with Mango you can
// remove its route handler from <YourApp>.cs's constructor and delete
// this file.
//
// All Content placed on the Conten... |
Add url to get unicorns | using Nancy;
using Owin;
namespace Bbl.KnockoutJs
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseNancy();
}
}
public class IndexModule : NancyModule
{
public IndexModule()
{
Get["/"] = parameters => View... | using System.IO;
using System.Linq;
using System.Web.Hosting;
using Nancy;
using Owin;
namespace Bbl.KnockoutJs
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseNancy();
}
}
public class IndexModule : NancyModule
{
private co... |
Fix case when project directory already exists | using System;
using System.Diagnostics;
using System.IO;
namespace dotnet_new2
{
public class ProjectCreator
{
public bool CreateProject(string name, string path, Template template)
{
Directory.CreateDirectory(path);
foreach (var file in template.Files)
{
... | using System;
using System.Diagnostics;
using System.IO;
namespace dotnet_new2
{
public class ProjectCreator
{
public bool CreateProject(string name, string path, Template template)
{
Directory.CreateDirectory(path);
if (Directory.GetFileSystemEntries(path).Length > 0)... |
Throw all dispatcher exceptions on the non-service build. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace SteamIrcBot
{
class ServiceDispatcher
{
static ServiceDispatcher _instance = new ServiceDispatcher();
public static ServiceDispatche... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace SteamIrcBot
{
class ServiceDispatcher
{
static ServiceDispatcher _instance = new ServiceDispatcher();
public static ServiceDispatche... |
Fix the XML docs generic class references | using System;
using System.Collections.Generic;
using System.Linq;
namespace Monacs.Core.Unit
{
///<summary>
/// Extensions for <see cref="Result<Unit>" /> type.
///</summary>
public static class Result
{
///<summary>
/// Creates successful <see cref="Result<Unit>" />.
///<... | using System;
using System.Collections.Generic;
using System.Linq;
namespace Monacs.Core.Unit
{
///<summary>
/// Extensions for <see cref="Result{Unit}" /> type.
///</summary>
public static class Result
{
///<summary>
/// Creates successful <see cref="Result{Unit}" />.
///<... |
Set assembly culture to neutral | using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ProviderModel")]
[assembly: AssemblyDescription("An improvment over the bundled .NET provider model")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Enrique Alejandro Allegretta")]
[assembly: AssemblyProduct("... | using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("ProviderModel")]
[assembly: AssemblyDescription("An improvment over the bundled .NET provider model")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Enrique Alejandro Allegretta")]
[assembly: AssemblyProduct("... |
Change port for new RabbitMQ-MQTT server | using SOVND.Lib;
using System.IO;
namespace SOVND.Server
{
public class ServerMqttSettings : IMQTTSettings
{
public string Broker { get { return "104.131.87.42"; } }
public int Port { get { return 8883; } }
public string Username
{
get { return File.ReadAllText("us... | using SOVND.Lib;
using System.IO;
namespace SOVND.Server
{
public class ServerMqttSettings : IMQTTSettings
{
public string Broker { get { return "104.131.87.42"; } }
public int Port { get { return 2883; } }
public string Username
{
get { return File.ReadAllText("us... |
Truncate stream when writing sidecar XMP files. | using System;
using System.IO;
using GLib;
using Hyena;
using TagLib.Image;
using TagLib.Xmp;
namespace FSpot.Utils
{
public static class SidecarXmpExtensions
{
/// <summary>
/// Parses the XMP file identified by resource and replaces the XMP
/// tag of file by the parsed data.
... | using System;
using System.IO;
using GLib;
using Hyena;
using TagLib.Image;
using TagLib.Xmp;
namespace FSpot.Utils
{
public static class SidecarXmpExtensions
{
/// <summary>
/// Parses the XMP file identified by resource and replaces the XMP
/// tag of file by the parsed data.
... |
Remove exit step (needs login to show properly) | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Screens;
using osu.Game.Screens.Multi;
using osu.Game.Screens.Multi.Lounge;
us... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Screens;
using osu.Game.Screens.Multi;
using osu.Game.Screens.Multi.Lounge;
us... |
Replace StackTrace with CallerMemberName attribute | // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
usi... | // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
usi... |
Stop double call of Directory.GetCurrentDirectory on startup, as 20% slower on linux | using System.IO;
using Microsoft.AspNetCore.Hosting;
using Orchard.Hosting;
using Orchard.Web;
namespace Orchard.Console
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseIISIntegration()
.UseKestre... | using System.IO;
using Microsoft.AspNetCore.Hosting;
using Orchard.Hosting;
using Orchard.Web;
namespace Orchard.Console
{
public class Program
{
public static void Main(string[] args)
{
var currentDirectory = Directory.GetCurrentDirectory();
var host = new WebHostBuil... |
Refactor Add Integers Operation to use GetValues and CloneWithValues | namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class AddIntegerIntegerOperation : IBinaryOperation<int, int, int>
{
public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2)
{... | namespace TensorSharp.Operations
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class AddIntegerIntegerOperation : IBinaryOperation<int, int, int>
{
public Tensor<int> Evaluate(Tensor<int> tensor1, Tensor<int> tensor2)
{... |
Fix normalizing a vector results in a zero vector | namespace SharpMath.Geometry
{
public static class VectorExtensions
{
public static T Negate<T>(this Vector vector) where T : Vector, new()
{
var resultVector = new T();
for (uint i = 0; i < vector.Dimension; ++i)
resultVector[i] = -vector[i];
... | using SharpMath.Geometry.Exceptions;
namespace SharpMath.Geometry
{
public static class VectorExtensions
{
public static T Negate<T>(this Vector vector) where T : Vector, new()
{
var resultVector = new T();
if (vector.Dimension != resultVector.Dimension)
... |
Add test for Signature equality | // Copyright 2009 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using NUnit.Framework;
using NDesk.DBus;
namespace NDesk.DBus.Tests
{
[TestFixture]
public class SignatureTest
{
[Test]
public void Parse ()
{
string sigText = "as... | // Copyright 2009 Alp Toker <alp@atoker.com>
// This software is made available under the MIT License
// See COPYING for details
using System;
using NUnit.Framework;
using NDesk.DBus;
namespace NDesk.DBus.Tests
{
[TestFixture]
public class SignatureTest
{
[Test]
public void Parse ()
{
string sigText = "as... |
Add layout to guidelines page. | <h2>What is dotnet signals?</h2>
.NET Signals is a community driven link aggregator for the sharing of knowledge in the .NET community. Our focus is to give the .NET community a place to post ideas and
knowledge as voted by the community while avoiding the clutter found in traditional sources.
<h2>Posts</h2>
<ul>
... | @{
ViewData["Title"] = "Guidelines";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<section>
<h2>What is dotnet signals?</h2>
.NET Signals is a community driven link aggregator for the sharing of knowledge in the .NET community. Our focus is to give the .NET community a place to post ideas and
knowle... |
Add a couple of friend assemblies | // 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 ... |
Add explicit usage via attribute | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Game.Online.Chat;
namespace osu.Game.Online.API.Requests
{
public class GetUpdatesResponse
{
public List<Ch... | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using Newtonsoft.Json;
using osu.Game.Online.Chat;
namespace osu.Game.Online.API.Requests
{
public class GetUpdatesResponse
{... |
Make mainObject an instance field | using System;
using ColossalFramework;
using ColossalFramework.Plugins;
using ICities;
using ModTools.Utils;
using UnityEngine;
namespace ModTools
{
public sealed class ModToolsMod : IUserMod
{
public const string ModToolsName = "ModTools";
public static GameObject MainWindowObject;
... | using System;
using ColossalFramework;
using ColossalFramework.Plugins;
using ICities;
using ModTools.Utils;
using UnityEngine;
namespace ModTools
{
public sealed class ModToolsMod : IUserMod
{
public const string ModToolsName = "ModTools";
public static GameObject MainWindowObject;
... |
Change to use ScriptLinkCore.Objects namespace | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NTST.ScriptLinkService.Objects;
namespace ScriptLinkCore
{
public partial class ScriptLink
{
/// <summary>
/// Used set required fields
/// </summary>
/// <p... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ScriptLinkCore.Objects;
namespace ScriptLinkCore
{
public partial class ScriptLink
{
/// <summary>
/// Used set required fields
/// </summary>
/// <param nam... |
Send single sample of processor performance counter to the InfluxDB.Net. | using System;
namespace InfluxDB.Net.Collector.Console
{
static class Program
{
private static InfluxDb _client;
static void Main(string[] args)
{
if (args.Length != 3)
{
//url: http://128.199.43.107:8086
//username: root
... | using System;
using System.Diagnostics;
using InfluxDB.Net.Models;
namespace InfluxDB.Net.Collector.Console
{
static class Program
{
private static InfluxDb _client;
static void Main(string[] args)
{
if (args.Length != 3)
{
//url: http://12... |
Fix quoting for Unity log file | // Copyright 2021 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Linq;
using Nuke.Common.Tooling;
namespace Nuke.Common.Tools.Unity
{
public partial class UnityBaseSettings
{
public override Action<Output... | // Copyright 2021 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Linq;
using Nuke.Common.Tooling;
using Nuke.Common.Utilities;
namespace Nuke.Common.Tools.Unity
{
public partial class UnityBaseSettings
{
... |
Handle exiting if bot is destroyed by consuming resources. | using UnityEngine;
using System.Collections;
public class Nanobot : MonoBehaviour, TimestepManager.TimestepListener {
BulletGridGenerator currentLevel;
public NanobotSchematic schematic;
public int price;
public string id;
// Use this for initialization
void Start() {
currentLevel = FindOb... | using UnityEngine;
using System.Collections;
public class Nanobot : MonoBehaviour, TimestepManager.TimestepListener {
BulletGridGenerator currentLevel;
public NanobotSchematic schematic;
public int price;
public string id;
// Use this for initialization
void Start() {
currentLevel = FindOb... |
Change format on default logger formatter. | namespace SimpleLogger.Logging.Formatters
{
internal class DefaultLoggerFormatter : ILoggerFormatter
{
public string ApplyFormat(LogMessage logMessage)
{
return string.Format("{0:dd.MM.yyyy HH:mm}: {1} ln: {2} [{3} -> {4}()]: {5}",
logMessage.DateTime, lo... | namespace SimpleLogger.Logging.Formatters
{
internal class DefaultLoggerFormatter : ILoggerFormatter
{
public string ApplyFormat(LogMessage logMessage)
{
return string.Format("{0:dd.MM.yyyy HH:mm}: {1} [line: {2} {3} -> {4}()]: {5}",
logMessage.DateTime, l... |
Revise expected resource name after fixing default namespace | using System.IO;
using System.Reflection;
using NServiceBus.Persistence.Sql.ScriptBuilder;
static class ResourceReader
{
static Assembly assembly = typeof(ResourceReader).GetTypeInfo().Assembly;
public static string ReadResource(BuildSqlDialect sqlDialect, string prefix)
{
var text = $"NServiceBu... | using System.IO;
using System.Reflection;
using NServiceBus.Persistence.Sql.ScriptBuilder;
static class ResourceReader
{
static Assembly assembly = typeof(ResourceReader).GetTypeInfo().Assembly;
public static string ReadResource(BuildSqlDialect sqlDialect, string prefix)
{
var text = $"NServiceBu... |
Add language declaration to layout | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"]–FAV Rocks</title>
<link rel="shortcut icon" href="~/favicon.ico" />
<environment names="Development">
<link rel="stylesheet" href="~/css... | <!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"]–FAV Rocks</title>
<link rel="shortcut icon" href="~/favicon.ico" />
<environment names="Development">
<link rel="stylesheet... |
Set port 7400 and use default WebHost builder | using System.IO;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
namespace Neo4jManager.Host
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.ConfigureS... | using System.IO;
using System.Net;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
namespace Neo4jManager.Host
{
public class Program
{
public static void Main(string[] args)
{
var host = WebHost.CreateDefaultBuilder(arg... |
Use a flag to indicate if the shader stage has been successfully compiled. | using System;
using OpenTK.Graphics.OpenGL;
using System.Diagnostics;
using ChamberLib.Content;
namespace ChamberLib.OpenTK
{
public class ShaderStage : IShaderStage
{
public ShaderStage(ShaderContent content)
: this(content.Source, content.Type, content.Name)
{
}
p... | using System;
using OpenTK.Graphics.OpenGL;
using System.Diagnostics;
using ChamberLib.Content;
using _OpenTK = global::OpenTK;
namespace ChamberLib.OpenTK
{
public class ShaderStage : IShaderStage
{
public ShaderStage(ShaderContent content)
: this(content.Source, content.Type, content.Nam... |
Add a wrong password status | namespace Espera.Network
{
public enum ResponseStatus
{
Success,
PlaylistEntryNotFound,
Unauthorized,
MalformedRequest,
NotFound,
NotSupported,
Rejected,
Fatal
}
} | namespace Espera.Network
{
public enum ResponseStatus
{
Success,
PlaylistEntryNotFound,
Unauthorized,
MalformedRequest,
NotFound,
NotSupported,
Rejected,
Fatal,
WrongPassword
}
} |
Fix Otimização desabilitada para teste | using System.Web;
using System.Web.Optimization;
namespace Quiz.Web
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBu... | using System.Web;
using System.Web.Optimization;
namespace Quiz.Web
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBu... |
Revert "Added "final door count" comment at return value." | using System.Linq;
namespace HundredDoors
{
public static class HundredDoors
{
/// <summary>
/// Solves the 100 Doors problem
/// </summary>
/// <returns>An array with 101 values, each representing a door (except 0). True = open</returns>
public static bool[] Solve()
{
// Create our array with 101 va... | using System.Linq;
namespace HundredDoors
{
public static class HundredDoors
{
/// <summary>
/// Solves the 100 Doors problem
/// </summary>
/// <returns>An array with 101 values, each representing a door (except 0). True = open</returns>
public static bool[] Solve()
{
// Create our array with 101 va... |
Rename that to avoid confusion | namespace Espera.Network
{
public enum NetworkSongSource
{
Local = 0,
Youtube = 1,
Remote = 2
}
} | namespace Espera.Network
{
public enum NetworkSongSource
{
Local = 0,
Youtube = 1,
Mobile = 2
}
} |
Remove page styling from Ajax search results. | @model IEnumerable<GiveCRM.Models.Member>
@foreach (var member in Model)
{
<a href="javascript:AddDonation(@member.Id);">@member.FirstName @member.LastName @member.PostalCode</a><br />
} | @model IEnumerable<GiveCRM.Models.Member>
@{
Layout = null;
}
@foreach (var member in Model)
{
<p style="margin:0; padding:0;"><a href="javascript:AddDonation(@member.Id);">@member.FirstName @member.LastName @member.PostalCode</a></p>
} |
Add missing namespace to the sample. | using Microsoft.AspNet.Abstractions;
namespace KWebStartup
{
public class Startup
{
public void Configuration(IBuilder app)
{
app.Run(async context =>
{
context.Response.ContentType = "text/plain";
await context.Response.WriteAsync("Hello ... | using Microsoft.AspNet;
using Microsoft.AspNet.Abstractions;
namespace KWebStartup
{
public class Startup
{
public void Configuration(IBuilder app)
{
app.Run(async context =>
{
context.Response.ContentType = "text/plain";
await context.Res... |
Fix issue with ms asp.net getting httproute paths with a wildcard | using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using Pablo.Gallery.Logic;
using Pablo.Gallery.Logic.Filters;
using System.Web.Http.Controllers;
using Pablo.Gallery.Logic.Selectors;
namespace Pablo.Gallery
{
public static class WebApiConfig
{
public static void Register(... | using System.Net.Http.Formatting;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using Pablo.Gallery.Logic;
using Pablo.Gallery.Logic.Filters;
using System.Web.Http.Controllers;
using Pablo.Gallery.Logic.Selectors;
namespace Pablo.Gallery
{
public static class WebApiConfig
{
public static void Register(... |
Allow coin flip to be heads. | using System;
using System.Collections.Generic;
using System.IO;
using TwitchLib;
using TwitchLib.TwitchClientClasses;
using System.Net;
namespace JefBot.Commands
{
internal class CoinPluginCommand : IPluginCommand
{
public string PluginName => "Coin";
public string Command => "coin";
... | using System;
using System.Collections.Generic;
using System.IO;
using TwitchLib;
using TwitchLib.TwitchClientClasses;
using System.Net;
namespace JefBot.Commands
{
internal class CoinPluginCommand : IPluginCommand
{
public string PluginName => "Coin";
public string Command => "coin";
... |
Allow visualtests to share config etc. with osu!. | //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Desktop;
using osu.Framework.Desktop.Platform;
using osu.Framework.Platform;
using osu.Game.Modes;
using osu.Game.Modes.Catch;
... | //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Desktop;
using osu.Framework.Desktop.Platform;
using osu.Framework.Platform;
using osu.Game.Modes;
using osu.Game.Modes.Catch;
... |
Add rich text to system field types | using System;
using System.Collections.Generic;
using System.Text;
namespace Contentful.Core.Models.Management
{
/// <summary>
/// Represents the different types available for a <see cref="Field"/>.
/// </summary>
public class SystemFieldTypes
{
/// <summary>
/// Short text.
... | using System;
using System.Collections.Generic;
using System.Text;
namespace Contentful.Core.Models.Management
{
/// <summary>
/// Represents the different types available for a <see cref="Field"/>.
/// </summary>
public class SystemFieldTypes
{
/// <summary>
/// Short text.
... |
Add stub for APFT list | @model IEnumerable<APFT>
<h2>Units @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
{... | @model IEnumerable<APFT>
<h2>Units @Html.ActionLink("Add New", "New", "APFT", null, new { @class = "btn btn-default" })</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var model in Model)
{
<tr>
... |
Fix incorrect profiler environment variable name for .NET framework support | using System;
using System.Runtime.CompilerServices;
namespace Mindscape.Raygun4Net
{
public static class APM
{
[ThreadStatic]
private static bool _enabled = false;
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void Enable()
{
_enabled = tru... | using System;
using System.Runtime.CompilerServices;
namespace Mindscape.Raygun4Net
{
public static class APM
{
[ThreadStatic]
private static bool _enabled = false;
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public static void Enable()
{
_enabled = tru... |
Fix ConfigurationsRights.List not being a power of 2 | using System;
namespace Tgstation.Server.Api.Rights
{
/// <summary>
/// Rights for <see cref="Models.ConfigurationFile"/>
/// </summary>
[Flags]
public enum ConfigurationRights : ulong
{
/// <summary>
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may read files
/// </summa... | using System;
namespace Tgstation.Server.Api.Rights
{
/// <summary>
/// Rights for <see cref="Models.ConfigurationFile"/>
/// </summary>
[Flags]
public enum ConfigurationRights : ulong
{
/// <summary>
/// User has no rights
/// </summary>
None = 0,
/// <summary>
/// User may read files
/// </summa... |
Add a check for argument existence to the Compiler | using System;
using System.IO;
using System.Linq;
namespace DotVVM.Compiler
{
public static class Program
{
private static readonly string[] HelpOptions = new string[] {
"--help", "-h", "-?", "/help", "/h", "/?"
};
public static bool TryRun(FileInfo assembly, DirectoryInfo?... | using System;
using System.IO;
using System.Linq;
namespace DotVVM.Compiler
{
public static class Program
{
private static readonly string[] HelpOptions = new string[] {
"--help", "-h", "-?", "/help", "/h", "/?"
};
public static bool TryRun(FileInfo assembly, DirectoryInfo?... |
Change icon color to be consistent with other section icon colors | namespace FALM.Housekeeping.Constants
{
/// <summary>
/// HkConstants
/// </summary>
public class HkConstants
{
/// <summary>
/// Application
/// </summary>
public class Application
{
/// <summary>Name of the Application</summary>
publ... | namespace FALM.Housekeeping.Constants
{
/// <summary>
/// HkConstants
/// </summary>
public class HkConstants
{
/// <summary>
/// Application
/// </summary>
public class Application
{
/// <summary>Name of the Application</summary>
publ... |
FIX CIT-785 Hide EDIT button for all users in hub | @using Cats.Models.Hubs
@using Cats.Web.Hub.Helpers
@using Telerik.Web.Mvc.UI
@{
var usr = @Html.GetCurrentUser();
var mdl = new CurrentUserModel(usr);
}
<div align="right">
@{
string title = "";
if(ViewBag.Title != null)
{
title = ViewBag.Title;
}
}
</di... | @using Cats.Models.Hubs
@using Cats.Web.Hub.Helpers
@using Telerik.Web.Mvc.UI
@{
var usr = @Html.GetCurrentUser();
var mdl = new CurrentUserModel(usr);
}
<div align="right">
@{
string title = "";
if(ViewBag.Title != null)
{
title = ViewBag.Title;
}
}
</di... |
Remove panel from index forum page for mobile devices | @{
Layout = null;
}
<div class="container" style="padding-top: 50px;">
<div class="container">
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-striped table-bordered table-hover">
<thead>
<... | @{
Layout = null;
}
<div class="container" style="padding-top: 50px;">
<div class="container">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th></th>
<th>Forum... |
Add case for waiting on an empty id | using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
public abstract class GameMessageBase : MessageBase
{
public GameObject NetworkObject;
public GameObject[] NetworkObjects;
protected IEnumerator WaitFor(NetworkInstanceId id)
{
int tries = 0;
while ((NetworkObject = ClientScene.FindLo... | using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
public abstract class GameMessageBase : MessageBase
{
public GameObject NetworkObject;
public GameObject[] NetworkObjects;
protected IEnumerator WaitFor(NetworkInstanceId id)
{
if (id.IsEmpty())
{
Debug.LogError($"{this} tried to ... |
Set TLS 1.2 as the default potocol | using Microsoft.Owin;
using Owin;
[assembly: OwinStartupAttribute(typeof(DancingGoat.Startup))]
namespace DancingGoat
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
}
}
} | using Microsoft.Owin;
using Owin;
using System.Net;
[assembly: OwinStartupAttribute(typeof(DancingGoat.Startup))]
namespace DancingGoat
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
// .NET Framework 4.6.1 and lower does not support TLS 1.2 as the d... |
Disable GDB + Bochs GUI | using System;
using System.Collections.Generic;
using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;
namespace Cosmos.TestRunner.Full
{
public class DefaultEngineConfiguration : IEngineConfiguration
{
public virtual int AllowedSecondsInKernel => 6000;
public virtual IEnumerable<RunTarget... | using System;
using System.Collections.Generic;
using Cosmos.Build.Common;
using Cosmos.TestRunner.Core;
namespace Cosmos.TestRunner.Full
{
public class DefaultEngineConfiguration : IEngineConfiguration
{
public virtual int AllowedSecondsInKernel => 6000;
public virtual IEnumerable<RunTarget... |
Move usings inside namespace in stringextensionstests | using Moya.Extensions;
using Xunit;
namespace TestMoya.Extensions
{
public class StringExtensionsTests
{
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithStrings()
{
const string Expected = "Hello world!";
var actual = "{0} {1}".FormatWith("Hello"... | namespace TestMoya.Extensions
{
using Moya.Extensions;
using Xunit;
public class StringExtensionsTests
{
[Fact]
public void StringExtensionsFormatWithWorksWithWorksWithStrings()
{
const string Expected = "Hello world!";
var actual = "{0} {1}".FormatWith... |
Fix crash caused by previous commit | using NBitcoin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NTumbleBit.BouncyCastle.Security
{
internal class SecureRandom : Random
{
public SecureRandom()
{
}
public override int Next()
{
return RandomUtils.GetInt32();
... | using NBitcoin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NTumbleBit.BouncyCastle.Security
{
internal class SecureRandom : Random
{
public SecureRandom()
{
}
public override int Next()
{
return RandomUtils.GetInt32();
... |
Remove wrong type for username and e-mail field | @model LoginOrRegisterViewModel
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post,
new { @class="form-signin", @role="form"}))
{
<div class="form-group">
@Html.ValidationSummary(true)
</div>
<h2 class="form-signin-heading dark">Meld u alstublie... | @model LoginOrRegisterViewModel
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post,
new { @class="form-signin", @role="form"}))
{
<div class="form-group">
@Html.ValidationSummary(true)
</div>
<h2 class="form-signin-heading dark">Meld u alstublie... |
Refactor benchmarks to only demonstrate what's needed | // 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 BenchmarkDotNet.Attributes;
using osu.Framework.Bindables;
namespace osu.Framework.Benchmarks
{
public class BenchmarkBindableInstantiation
{... | // 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 BenchmarkDotNet.Attributes;
using osu.Framework.Bindables;
namespace osu.Framework.Benchmarks
{
public class BenchmarkBindableInstantiation
{... |
Add a couple of apparently missing events | using Newtonsoft.Json;
namespace SyncTrayzor.Syncthing.ApiClient
{
[JsonConverter(typeof(DefaultingStringEnumConverter))]
public enum EventType
{
Unknown,
Starting,
StartupComplete,
Ping,
DeviceDiscovered,
DeviceConnected,
DeviceDisconnected,
... | using Newtonsoft.Json;
namespace SyncTrayzor.Syncthing.ApiClient
{
[JsonConverter(typeof(DefaultingStringEnumConverter))]
public enum EventType
{
Unknown,
Starting,
StartupComplete,
Ping,
DeviceDiscovered,
DeviceConnected,
DeviceDisconnected,
... |
Add MI debugger working directory to PATH | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Diagnostics;
using System.IO;
using System.Collections.Speciali... | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Diagnostics;
using System.IO;
using System.Collections.Speciali... |
Rename SELECT * test cases to match naming convention | using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace NQuery.UnitTests
{
[TestClass]
public class SelectStarTests
{
[TestMethod]
public void Binder_DisallowsSelectStarWithoutTables()
{
var syntaxTree = SyntaxTree.ParseQuery("SEL... | using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace NQuery.UnitTests
{
[TestClass]
public class SelectStarTests
{
[TestMethod]
public void SelectStar_Disallowed_WhenNoTablesSpecified()
{
var syntaxTree = SyntaxTree.ParseQuery(... |
Implement endpoint for remove instance | using System;
using System.Linq;
using Nancy;
namespace Okanshi.Dashboard
{
public class SettingsModule : NancyModule
{
public SettingsModule(IConfiguration configuration)
{
Get["/settings"] = p =>
{
var servers = configuration.GetAll().ToArray();
return View["settings.html", servers];
};
Po... | using System;
using System.Linq;
using Nancy;
namespace Okanshi.Dashboard
{
public class SettingsModule : NancyModule
{
public SettingsModule(IConfiguration configuration)
{
Get["/settings"] = p =>
{
var servers = configuration.GetAll().ToArray();
return View["settings.html", servers];
};
Po... |
Remove hard coded USD dollar symbol and use currency string formatting instead. | @if (Model.DiscountedPrice != Model.Price) {
<b class="inactive-price" style="text-decoration:line-through" title="@T("Was ${0}", Model.Price)">$@Model.Price</b>
<b class="discounted-price" title="@T("Now ${0}", Model.DiscountedPrice)">$@Model.DiscountedPrice</b>
<span class="discount-comment">@Model.Di... | @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("... |
Put passwords in startup args | using S22.Xmpp.Client;
using S22.Xmpp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using S22.Xmpp.Im;
namespace XmppConsole
{
class Program
{
static void Main(string[] args)
{
try
{
... | using S22.Xmpp.Client;
using S22.Xmpp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using S22.Xmpp.Im;
namespace XmppConsole
{
class Program
{
static void Main(string[] args)
{
try
{
... |
Remove the container class from the header, because it was redundant with its containing div. |
<div class="container">
<header class="container">
<h1>Sweet Water Revolver</h1>
</header>
</div> |
<div class="container">
<header>
<h1>Sweet Water Revolver</h1>
</header>
</div> |
Enable migrations on app start | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace PickemApp
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?L... | using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using PickemApp.Models;
using PickemApp.Migrations;
namespace PickemApp
{
// Note: For instructions o... |
Enable CF migrations on restart | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace Portfolio
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
... | using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace Portfolio
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(G... |
Fix demo by uncommenting line accidentally left commented | using System;
using DemoDistributor.Endpoints.FileSystem;
using DemoDistributor.Endpoints.Sharepoint;
using Delivered;
namespace DemoDistributor
{
internal class Program
{
private static void Main(string[] args)
{
//Configure the distributor
var distributor = new Distri... | using System;
using DemoDistributor.Endpoints.FileSystem;
using DemoDistributor.Endpoints.Sharepoint;
using Delivered;
namespace DemoDistributor
{
internal class Program
{
private static void Main(string[] args)
{
//Configure the distributor
var distributor = new Distri... |
Fix null players in player list. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Battlezeppelins.Models;
namespace Battlezeppelins.Controllers
{
public abstract class BaseController : Controller
{
private static List<Player> playerList = new List<Player>();
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Battlezeppelins.Models;
namespace Battlezeppelins.Controllers
{
public abstract class BaseController : Controller
{
private static List<Player> playerList = new List<Player>();
... |
Maintain focus on the text editor after saving. | using System.Windows.Controls;
namespace PlantUmlEditor.View
{
public partial class DiagramEditorView : UserControl
{
public DiagramEditorView()
{
InitializeComponent();
}
}
}
| using System;
using System.Windows.Controls;
namespace PlantUmlEditor.View
{
public partial class DiagramEditorView : UserControl
{
public DiagramEditorView()
{
InitializeComponent();
ContentEditor.IsEnabledChanged += ContentEditor_IsEnabledChanged;
}
void ContentEdi... |
Fix bug: "Copy" button don't show in TextView during saving | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Caliburn.Micro;
namespace SharpGraphEditor.ViewModels
{
public class TextViewerViewModel : PropertyChangedBase
{
private string _text;
private bool _canCopy;
private bool _... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Caliburn.Micro;
namespace SharpGraphEditor.ViewModels
{
public class TextViewerViewModel : PropertyChangedBase
{
private string _text;
private bool _canCopy;
private bool _... |
Fix iOS app entry for raw keyboard input | // 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 UIKit;
namespace osu.iOS
{
public class Application
{
public static void Main(string[] args)
{
UIApplication.Main(args, null, ... | // 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 UIKit;
namespace osu.iOS
{
public class Application
{
public static void Main(string[] args)
{
UIApplication.Main(args, "GameU... |
Fix ShrineRoom to always be current spawner | using RimWorld;
using Verse;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MTW_AncestorSpirits
{
class RoomRoleWorker_ShrineRoom : RoomRoleWorker
{
public override float GetScore(Room room)
{
// I don't know if there should be some... | using RimWorld;
using Verse;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MTW_AncestorSpirits
{
class RoomRoleWorker_ShrineRoom : RoomRoleWorker
{
public override float GetScore(Room room)
{
// I don't know if there should be some... |
Add IoC registration for login data translator | // Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file
using EOLib.Data.Protocol;
using Microsoft.Practices.Unity;
namespace EOLib.Net.Translators
{
public class PacketTranslatorContainer : IDependencyContainer
{
public ... | // Original Work Copyright (c) Ethan Moffat 2014-2016
// This file is subject to the GPL v2 License
// For additional details, see the LICENSE file
using EOLib.Data.Login;
using EOLib.Data.Protocol;
using Microsoft.Practices.Unity;
namespace EOLib.Net.Translators
{
public class PacketTranslatorContainer : IDependen... |
Fix port in arguments crashing app | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Yio.Utilities;
namespace Yio
{
public c... | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Yio.Utilities;
namespace Yio
{
public c... |
Fix integer overflow on large collection files | using System;
namespace MarcelloDB.Helpers
{
internal class DataHelper
{
internal static void CopyData(
Int64 sourceAddress,
byte[] sourceData,
Int64 targetAddress,
byte[] targetData)
{
var lengthToCopy = sourceData.Length;
... | using System;
namespace MarcelloDB.Helpers
{
internal class DataHelper
{
internal static void CopyData(
Int64 sourceAddress,
byte[] sourceData,
Int64 targetAddress,
byte[] targetData)
{
Int64 lengthToCopy = sourceData.Length;
... |
Fix navigator.getUserMedia webkit(TypeError: Illegal invocation) + moz(typo) | using System.Html.Media;
using System.Runtime.CompilerServices;
namespace System.Html {
public partial class Navigator {
[InlineCode("(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozUserMedia || navigator.msGetUserMedia)({params}, {onsuccess})")]
public static void GetUserMedia(MediaStream... | using System.Html.Media;
using System.Runtime.CompilerServices;
namespace System.Html {
public partial class Navigator {
[InlineCode("(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia).call(navigator, {params}, {onsuccess})")]
public static void GetUs... |
Use glob-recurse and fix the program when you pass it file names | using System;
using System.IO;
using System.Collections;
namespace DeviceMetadataInstallTool
{
/// <summary>
/// see https://support.microsoft.com/en-us/kb/303974
/// </summary>
class MetadataFinder
{
public System.Collections.Generic.List<String> Files = new System.Collections.Generic.Lis... | using System;
using System.IO;
using System.Collections;
namespace DeviceMetadataInstallTool
{
class Program
{
static void Main(string[] args)
{
var files = new System.Collections.Generic.List<String>();
//Console.WriteLine("Args size is {0}", args.Length);
... |
Fix map path for single player maps | using System.IO;
using OpenSage.Network;
namespace OpenSage.Data.Sav
{
internal static class GameStateMap
{
internal static void Load(SaveFileReader reader, Game game)
{
reader.ReadVersion(2);
var mapPath1 = reader.ReadAsciiString();
var mapPath2 = reader.R... | using System.IO;
using OpenSage.Network;
namespace OpenSage.Data.Sav
{
internal static class GameStateMap
{
internal static void Load(SaveFileReader reader, Game game)
{
reader.ReadVersion(2);
var mapPath1 = reader.ReadAsciiString();
var mapPath2 = reader.R... |
Add extension to verify mimetype. | namespace Papyrus
{
public static class EBookExtensions
{
}
}
| using System;
using System.Threading.Tasks;
using Windows.Storage;
namespace Papyrus
{
public static class EBookExtensions
{
public static async Task<bool> VerifyMimetypeAsync(this EBook ebook)
{
var mimetypeFile = await ebook._rootFolder.GetItemAsync("mimetype");
if (... |
Use azure hosted server for now | using System.Collections.Generic;
using System.Net;
using AppGet.Http;
using NLog;
namespace AppGet.PackageRepository
{
public class AppGetServerClient : IPackageRepository
{
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
private readonly HttpRequestBuilder ... | using System.Collections.Generic;
using System.Net;
using AppGet.Http;
using NLog;
namespace AppGet.PackageRepository
{
public class AppGetServerClient : IPackageRepository
{
private readonly IHttpClient _httpClient;
private readonly Logger _logger;
private readonly HttpRequestBuilder ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.